This repository was archived by the owner on May 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathclosure_externs.js
More file actions
118 lines (95 loc) · 2.64 KB
/
closure_externs.js
File metadata and controls
118 lines (95 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @fileoverview Extern definitions for types missing in the Closure externs,
* but used in TypeScript platform `.d.ts`.
* We suppress checkTypes to handle the scenario where a user doesn't use the
* Closure externs (e.g. in a service worker).
* @externs
* @suppress {checkTypes}
*/
/** @typedef {!IArrayLike} */
var ArrayLike;
/** @typedef {!IteratorIterable} */
var IterableIterator;
/** @typedef {!IIterableResult} */
var IteratorYieldResult;
/** @typedef {!IIterableResult} */
var IteratorReturnResult;
/** @typedef {!HTMLCollection} */
var HTMLCollectionOf;
/** @typedef {!HTMLTableCellElement} */
var HTMLTableDataCellElement;
/**
* Does not have an equivalent in Closure's externs.
* @typedef {!HTMLTableCellElement}
*/
var HTMLTableHeaderCellElement;
/**
* Closure's NodeList is parameterized itself, there is no NodeListOf.
* @constructor
* @template T
* @extends {NodeList<T>}
*/
var NodeListOf;
/**
* Closure models this as a plain Array.
* @typedef {!IArrayLike<string>|null}
*/
var RegExpExecArray;
/** @typedef {!Set} */
var ReadonlySet;
/**
* @record
* @template T
* @extends {IThenable<T>}
*/
function PromiseLike() {}
/** @typedef {function(new:Promise)} */
var PromiseConstructor;
/** @typedef {function(new:Promise, function(function(*=), function(*=)))} */
var PromiseConstructorLike;
/** @typedef {?} */
var SymbolConstructor;
/** @typedef {!Object} */
var GlobalFetch;
/**
* @interface
* @extends {WorkerGlobalScope}
* @extends {Window}
*/
var WindowOrWorkerGlobalScope;
/** @record */
function CanvasDrawImage() {}
/** @typedef {!{handleEvent: function(Event):void}} */
var EventListenerObject;
/** @typedef {!ITemplateArray} */
var TemplateStringsArray;
/** @typedef {!RegExpResult} */
var RegExpMatchArray;
/** @record */
function ImportMeta() {}
// Representations for TS' EventMap objects.
// These are types that contain a mapping from event names to event object
// types. User code can augment them, which produces externs.js files that then
// reference the EventMap types - even though they are not defined in Closure.
// Defining them here works around the problem.
/** @interface */
class HTMLElementEventMap {}
/** @interface */
class ElementEventMap {}
/** @interface */
class DocumentEventMap {}
/** @interface */
class WindowEventMap {}
/** @interface */
class GlobalEventHandlersEventMap {}
/** @interface */
class DocumentAndElementEventHandlersEventMap {}
/** @interface */
class EventSourceEventMap {}