-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create public API #40
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do these have to be properties? Why not either public
or readonly
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
get
object for read access.I consider everything in this PR to be an early draft, so feel free to modify anything.