-
Notifications
You must be signed in to change notification settings - Fork 4
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
typescript convention questions #405
Comments
I wrote about this a bit in phetsims/chipper#1065. I haven't seen a need for public modifier.
Some notes in phetsims/chipper#1106
Please see gravity-and-orbits/js/gravityAndOrbitsStrings.d.ts, for example, which defines: // Copyright 2021, University of Colorado Boulder
type t = { [ key: string ]: string };
let gravityAndOrbitsStrings: t;
export default gravityAndOrbitsStrings; It just says the string values are accessed by string key, and doesn't check for legal keys, but it seems better than nothing for now. In the future we may want to type check on the keys. Some notes in phetsims/chipper#1053 |
I noted some of these parts in https://github.com/phetsims/phet-info/blob/master/doc/typescript-conventions.md |
I marked the remaining items here for dev meeting discussion thursday. |
Here is the discussion from the dev meeting agenda on March 3:
I updated the conventions doc in the above commit. I think all is done here. |
While working on #404, I would like to keep track of questions I have about how we want to codify things in this new language. Most will probably be dumb questions, since I don't know the language very well.
public
, isn't that redundant to the default?export { .... }
(like an associated*Type
or something, like TickMarkView.ts*.js
. I have to add them manually or suffer the lint rule.@public (read-only)
to describe how others should access this, but could still mutate it internally. Typescript does not allow that AFAIK. You can use IReadonlyProperty, but you can't set it internally in that case.NodeOptions
. This works in my cases, but would make refactoring harder if we want to pass up an option supported/defined in the "middle" type. The example I just found was markingNodeOptions
inBothHandsHelpSection
, but I really just want to support NodeOptions.step
function, is that all it has?The text was updated successfully, but these errors were encountered: