-
Notifications
You must be signed in to change notification settings - Fork 49
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
fix type definitions #284
fix type definitions #284
Conversation
@@ -166,7 +166,7 @@ declare namespace parser { | |||
replaceWith(...nodes: Node[]): Node; | |||
next(): Node; | |||
prev(): Node; | |||
clone(opts?: {[override: string]:any}): Node; | |||
clone(opts?: {[override: string]:any}): this; |
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.
After cloning the return the value is always an instance of this
.
With Node
as the return type you always need to do more type checks after cloning because the specific type was erased.
append(selector: Child): this; | ||
prepend(selector: Child): this; |
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 think this was a typo.
append
/prepend
have similar implementations as insertAfter
/insertBefore
and those have type Child
removeAll(): this; | ||
empty(): this; |
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 reason as the change in clone()
.
Returning this
preserves the specific type of the current instance.
@alexander-akait Could you take a look at this when you have time? |
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.
Do we need to make release? Sorry for delay
A release would be awesome! Don't worry about taking your time with this :) |
No description provided.