Merge pull request #17349 from Kovensky/patch-3

jquery: Make JQueryStatic's context optional
This commit is contained in:
Nathan Shively-Sanders
2017-06-22 16:12:08 -07:00
committed by GitHub
+1 -1
View File
@@ -2470,7 +2470,7 @@ interface JQueryStatic<TElement extends Node = HTMLElement> {
* @see {@link https://api.jquery.com/jQuery/}
* @since 1.0
*/
(selector: JQuery.Selector, context: Element | Document | JQuery): JQuery<TElement>;
(selector: JQuery.Selector, context: Element | Document | JQuery | undefined): JQuery<TElement>;
// HACK: This is the factory function returned when importing jQuery without a DOM. Declaring it separately breaks using the type parameter on JQueryStatic.
// HACK: The discriminator parameter handles the edge case of passing a Window object to JQueryStatic. It doesn't actually exist on the factory function.
<FElement extends Node = HTMLElement>(window: Window, discriminator: boolean): JQueryStatic<FElement>;