-
Notifications
You must be signed in to change notification settings - Fork 7
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
Rename types in preparation for TypeDoc #16
Conversation
121bfc3
to
1781d48
Compare
type: 'derived'; | ||
parent: Scenarios; | ||
variants: Record<string, ProjectMutator[]>; | ||
}; |
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.
As we discussed on the office hours, this type is entirely private and self-contained so it should go back to being not exported.
If we add documentation to it, the most useful documentation would be on its individual fields. The object itself is really just an help to typescript so we know which fields are available in which states.
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.
@ef4 Done!
1781d48
to
690329a
Compare
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.
This looks good to me, it feels like the change of keys in some of the objects here are all entirely internal so it's not a breaking change.
I'm approving but I'm not 100% sure I should merge without someone who likes knows typescript having a quick look 👍
* | ||
* @returns A {@link Project} instance, optionally wrapped into a promise. | ||
*/ | ||
|
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.
shouldn't this comment block be "connected" to the following code for it to be picked up? or is it smart enough to know that it refers to the next line of code that isn't whitespace?
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.
TS changes look good to me 💯
This PR is in preparation for TypeDoc documentation.
This PR contains two changes:
root
callbacks and properties tocallbackCreateProject
. This makes them much more obvious, and also removes the ambiguity withroot
fromProject
where it's a string.It also defines a type for the callback, as it's used in many places throughout the code.
And renames
ProjectMutator
type toCallbackMutateProject
for consistency.State
type intoScenariosStateRoot
andScenariosStateDerived
. This lets me document them separately. TheScenraios
prefix scopes the type to its relevant class.