-
Notifications
You must be signed in to change notification settings - Fork 440
Add overrides for interface types and add CustomEvent types for testing. #319
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
Changes from 1 commit
47dafdb
4c32dbd
67d4250
1ebbef4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,8 +82,8 @@ interface ConstrainVideoFacingModeParameters { | |
ideal?: VideoFacingModeEnum | VideoFacingModeEnum[]; | ||
} | ||
|
||
interface CustomEventInit extends EventInit { | ||
detail?: any; | ||
interface CustomEventInit<T = any> extends EventInit { | ||
detail: T; | ||
} | ||
|
||
interface DeviceAccelerationDict { | ||
|
@@ -2374,9 +2374,9 @@ declare var CSSSupportsRule: { | |
new(): CSSSupportsRule; | ||
}; | ||
|
||
interface CustomEvent extends Event { | ||
readonly detail: any; | ||
initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. name of the method is missing. |
||
interface CustomEvent<T = any> extends Event { | ||
readonly detail: T; | ||
(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: T): void; | ||
} | ||
|
||
declare var CustomEvent: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you need to change this one too, this is your entry point to an event.. it should be: declare var CustomEvent: {
prototype: CustomEvent;
new<T>(typeArg: string, eventInitDict?: CustomEventInit<T>): CustomEvent<T>;
}; |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,39 @@ | ||
[ | ||
{ | ||
"kind": "typedinterface", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i do not think you need a new kind here.. just add a property There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So would |
||
"interface": "CustomEventInit", | ||
"parameters": [ | ||
"T = any" | ||
] | ||
}, | ||
{ | ||
"kind": "property", | ||
"interface": "CustomEventInit", | ||
"name": "detail", | ||
"type": "T" | ||
}, | ||
{ | ||
"kind": "typedinterface", | ||
"interface": "CustomEvent", | ||
"parameters": [ | ||
"T = any" | ||
] | ||
}, | ||
{ | ||
"kind": "property", | ||
"interface": "CustomEvent", | ||
"readonly": true, | ||
"name": "detail", | ||
"type": "T" | ||
}, | ||
{ | ||
"kind": "method", | ||
"interface": "CustomEvent", | ||
"name": "initCustomEvent", | ||
"signatures": [ | ||
"(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: T): void" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you need to include the name here. i.e. |
||
] | ||
}, | ||
{ | ||
"kind": "constructor", | ||
"interface": "Response", | ||
|
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.
detail
should still be optional? or is this intentional?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.
looks good otherwise. thanks!