-
Notifications
You must be signed in to change notification settings - Fork 440
fix querySelector method #170
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
Conversation
sorry for the delay. can you refresh the PR? |
done. |
baselines/dom.generated.d.ts
Outdated
@@ -13736,8 +13736,10 @@ interface NavigatorUserMedia { | |||
|
|||
interface NodeSelector { | |||
querySelector<K extends keyof ElementTagNameMap>(selectors: K): ElementTagNameMap[K] | null; | |||
querySelector<E extends Element>(selectors: string): E | null; |
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 not combine both signatures as:
querySelector<E extends Element = Element>(selectors: string): E | null;
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 did not know generic default... I fix it 😃
baselines/dom.generated.d.ts
Outdated
querySelectorAll<K extends keyof ElementListTagNameMap>(selectors: K): ElementListTagNameMap[K]; | ||
querySelectorAll<E extends Element>(selectors: string): NodeListOf<E>; |
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.
Can we combine these, too?
querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
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.
Good point!
@mhegazy anything holding this PR up? This makes testing the DOM much nicer in Angular 2. |
fixes #12568