-
Notifications
You must be signed in to change notification settings - Fork 9
Typescript defs #165
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 defs #165
Conversation
Can someone give feedback or figure out why the |
} | ||
|
||
declare class JsonURL { | ||
//Source comments suggest this is deprecated: |
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.
It was deprecated very recently. I left tests in place because the next release will be a semver minor increment. I'll likely remove it for 2.0
//* It is necessary to parse() | ||
constructor(prop?: JsonURLParseOptions); | ||
|
||
//Source comments suggests static parse() is available, |
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.
Yeah, the static method was added with a recent commit but I haven't cut a release yet.
I've chosen to deprecate (and eventually remove) the constructor and added the static parse() method so that the library interface mirrors JSON. That is, with static parse()
and stringify()
methods.
emptyValue?: any; //default is {} | ||
nullValue?: any; //default is null | ||
|
||
//These feel like they are intended to be protected |
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 can verify the intention is for them to be public. They allow the caller to modify parse behavior. The comments on the parse()
method should provide a brief summary and many of them are outlined in section 2.9 of the specification.
Thanks for these comments, BTW! Knowing where the docs fall short will help me know where to improve them.
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.
NP.
With this start on the typescript definitions, I think you have a good feel of how to define them. Feel free to rework them to represent the intended interfaces. I don't mind if you close this and replace it with another pull request. I would just like to have some typescript definitions in the near future that represent the public interfaces accurately.
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.
@darcyparker let me know if you see any concerns with #177
Yeah, sonarcloud requires auth. It has a check for |
See #177. |
Addresses #97
In my tests, these definitions appear to be correct. However, when reading the 'src/*.js' files, it appears there is a 'static parse' method that I do not see in the built distribution. Perhaps the comments were not correct... or I am misunderstanding them.