Create public API#40
Conversation
nx10
left a comment
There was a problem hiding this comment.
Not sure about using properties here, otherwise it looks good 👍
| get(propertyName: "vertices"): Float32Array; | ||
| get(propertyName: "faces"): Uint32Array; | ||
| get(propertyName: "vertices" | "faces") { | ||
| return this[propertyName]; |
There was a problem hiding this comment.
Why do these have to be properties? Why not either public or readonly?
There was a problem hiding this comment.
I chose this because I wanted it to be readonly, but readonly also prevents private writing. This was the workaround I found towards that end; would you just make them public?
There was a problem hiding this comment.
Oh yeah seems like it's a missing language feature microsoft/TypeScript#37487
I'm fine with whatever then. Probably I would prefer just obj.getIntensity() for auto complete convenience but do what you think is best.
| get(propertyName: "colorMapName"): ColorInterpolateName; | ||
| get(propertyName: "colors"): Float32Array; | ||
| get(propertyName: "intensity" | "colorLimits" | "colorMapName" | "colors") { | ||
| return this[propertyName]; |
There was a problem hiding this comment.
See same comment chain above
This draft PR is meant as a starting point to address #39. At present, it refactors the models to the set-up proposed by this issue. As there is no attribute type that allows public read-only but private writing, I've set the attributes to private but added a
getobject for read access.I consider everything in this PR to be an early draft, so feel free to modify anything.