1 | /**
|
2 | * @fileoverview Internal shared types for Polymer
|
3 | * @externs
|
4 | *
|
5 | * @license
|
6 | * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
7 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
8 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
9 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
10 | * Code distributed by Google as part of the polymer project is also
|
11 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
12 | */
|
13 |
|
14 | /* eslint-disable no-unused-vars, strict, valid-jsdoc */
|
15 |
|
16 | /**
|
17 | * @constructor
|
18 | * @extends {DocumentFragment}
|
19 | */
|
20 | function StampedTemplate() { }
|
21 | /** @type {boolean} */
|
22 | StampedTemplate.prototype.__noInsertionPoint;
|
23 | /** @type {!Array<!Node>} */
|
24 | StampedTemplate.prototype.nodeList;
|
25 | /** @type {!Object<string, !Element>} */
|
26 | StampedTemplate.prototype.$;
|
27 | /** @type {!TemplateInfo | undefined} */
|
28 | StampedTemplate.prototype.templateInfo;
|
29 |
|
30 | /** @interface */
|
31 | function NodeInfo() { }
|
32 | /** @type {string} */
|
33 | NodeInfo.prototype.id;
|
34 | /** @type {!Array<{name: string, value: string}>}*/
|
35 | NodeInfo.prototype.events;
|
36 | /** @type {boolean} */
|
37 | NodeInfo.prototype.hasInsertionPoint;
|
38 | /** @type {!TemplateInfo} */
|
39 | NodeInfo.prototype.templateInfo;
|
40 | /** @type {!NodeInfo} */
|
41 | NodeInfo.prototype.parentInfo;
|
42 | /** @type {number} */
|
43 | NodeInfo.prototype.parentIndex;
|
44 | /** @type {number} */
|
45 | NodeInfo.prototype.infoIndex;
|
46 | /** @type {!Array<!Binding>} */
|
47 | NodeInfo.prototype.bindings;
|
48 |
|
49 | /** @interface */
|
50 | function TemplateInfo() { }
|
51 | /** @type {!Array<!NodeInfo>} */
|
52 | TemplateInfo.prototype.nodeInfoList;
|
53 | /** @type {!Array<!Node>} */
|
54 | TemplateInfo.prototype.nodeList;
|
55 | /** @type {boolean} */
|
56 | TemplateInfo.prototype.stripWhitespace;
|
57 | /** @type {boolean | undefined} */
|
58 | TemplateInfo.prototype.hasInsertionPoint;
|
59 | /** @type {!Object} */
|
60 | TemplateInfo.prototype.hostProps;
|
61 | /** @type {!Object} */
|
62 | TemplateInfo.prototype.propertyEffects;
|
63 | /** @type {TemplateInfo | undefined} */
|
64 | TemplateInfo.prototype.nextSibling;
|
65 | /** @type {TemplateInfo | undefined} */
|
66 | TemplateInfo.prototype.previousSibling;
|
67 | /** @type {TemplateInfo | undefined} */
|
68 | TemplateInfo.prototype.firstChild;
|
69 | /** @type {TemplateInfo | undefined} */
|
70 | TemplateInfo.prototype.parent;
|
71 | /** @type {!Array<!Node>} */
|
72 | TemplateInfo.prototype.childNodes;
|
73 | /** @type {boolean} */
|
74 | TemplateInfo.prototype.wasPreBound;
|
75 |
|
76 | /**
|
77 | * type for HTMLTemplateElement with `_templateInfo`
|
78 | *
|
79 | * @constructor
|
80 | * @extends {HTMLTemplateElement}
|
81 | */
|
82 | function HTMLTemplateElementWithInfo() { }
|
83 | /** @type {TemplateInfo} */
|
84 | HTMLTemplateElementWithInfo.prototype._templateInfo;
|
85 |
|
86 | /**
|
87 | * @typedef {{
|
88 | * literal: string,
|
89 | * compoundIndex: (number | undefined)
|
90 | * }}
|
91 | */
|
92 | let LiteralBindingPart;
|
93 |
|
94 | /**
|
95 | * @typedef {{
|
96 | * literal: boolean,
|
97 | * name: string,
|
98 | * value: (string | number),
|
99 | * rootProperty: (string | undefined),
|
100 | * structured: (boolean | undefined),
|
101 | * wildcard: (boolean | undefined)
|
102 | * }}
|
103 | */
|
104 | let MethodArg;
|
105 |
|
106 | /**
|
107 | * @typedef {{
|
108 | * methodName: string,
|
109 | * static: boolean,
|
110 | * args: !Array<!MethodArg>,
|
111 | * dynamicFn: (boolean | undefined),
|
112 | * }}
|
113 | */
|
114 | let MethodSignature;
|
115 |
|
116 | /**
|
117 | * @typedef {{
|
118 | * mode: string,
|
119 | * negate: boolean,
|
120 | * source: string,
|
121 | * dependencies: !Array<(!MethodArg|string)>,
|
122 | * customEvent: boolean,
|
123 | * signature: Object,
|
124 | * event: string
|
125 | * }}
|
126 | */
|
127 | let ExpressionBindingPart;
|
128 |
|
129 | /**
|
130 | * @typedef {LiteralBindingPart | ExpressionBindingPart}
|
131 | */
|
132 | let BindingPart;
|
133 |
|
134 | /**
|
135 | * @typedef {{
|
136 | * kind: string,
|
137 | * target: string,
|
138 | * parts: Array<!BindingPart>,
|
139 | * literal: (string | undefined),
|
140 | * isCompound: boolean,
|
141 | * listenerEvent: (string | undefined),
|
142 | * listenerNegate: (boolean | undefined)
|
143 | * }}
|
144 | */
|
145 | let Binding;
|
146 |
|
147 | /**
|
148 | * @typedef {{
|
149 | * path: string
|
150 | * }}
|
151 | */
|
152 | let PathInfo;
|
153 |
|
154 | /**
|
155 | * @typedef {{
|
156 | * forwardHostProp: (function(string, *) | undefined),
|
157 | * instanceProps: (Object | undefined),
|
158 | * mutableData: (boolean | undefined),
|
159 | * notifyInstanceProp: (function(*, string, *) | undefined),
|
160 | * parentModel: (boolean | undefined)
|
161 | * }}
|
162 | */
|
163 | let TemplatizeOptions;
|
164 |
|
165 | /** @record */
|
166 | function AsyncInterface(){}
|
167 | /** @type {function(!Function, number=): number} */
|
168 | AsyncInterface.prototype.run;
|
169 | /** @type {function(number): void} */
|
170 | AsyncInterface.prototype.cancel;
|
171 |
|
172 | /** @record */
|
173 | let GestureInfo = function(){};
|
174 | /** @type {string|undefined} */
|
175 | GestureInfo.prototype.state;
|
176 | /** @type {boolean|undefined} */
|
177 | GestureInfo.prototype.started;
|
178 | /** @type {!Array<?>|undefined} */
|
179 | GestureInfo.prototype.moves;
|
180 | /** @type {number|undefined} */
|
181 | GestureInfo.prototype.x;
|
182 | /** @type {number|undefined} */
|
183 | GestureInfo.prototype.y;
|
184 | /** @type {boolean|undefined} */
|
185 | GestureInfo.prototype.prevent;
|
186 | /** @type {function(?): void|undefined} */
|
187 | GestureInfo.prototype.addMove;
|
188 | /** @type {null|undefined} */
|
189 | GestureInfo.prototype.movefn;
|
190 | /** @type {null|undefined} */
|
191 | GestureInfo.prototype.upFn;
|
192 |
|
193 | /** @record */
|
194 | let GestureRecognizer = function(){};
|
195 | /** @type {string} */
|
196 | GestureRecognizer.prototype.name;
|
197 | /** @type {!Array<string>} */
|
198 | GestureRecognizer.prototype.deps;
|
199 | /** @type {function(): void} */
|
200 | GestureRecognizer.prototype.reset;
|
201 | /** @type {function(MouseEvent): void | undefined} */
|
202 | GestureRecognizer.prototype.mousedown;
|
203 | /** @type {(function(MouseEvent): void | undefined)} */
|
204 | GestureRecognizer.prototype.mousemove;
|
205 | /** @type {(function(MouseEvent): void | undefined)} */
|
206 | GestureRecognizer.prototype.mouseup;
|
207 | /** @type {(function(TouchEvent): void | undefined)} */
|
208 | GestureRecognizer.prototype.touchstart;
|
209 | /** @type {(function(TouchEvent): void | undefined)} */
|
210 | GestureRecognizer.prototype.touchmove;
|
211 | /** @type {(function(TouchEvent): void | undefined)} */
|
212 | GestureRecognizer.prototype.touchend;
|
213 | /** @type {(function(MouseEvent): void | undefined)} */
|
214 | GestureRecognizer.prototype.click;
|
215 | /** @type {!GestureInfo} */
|
216 | GestureRecognizer.prototype.info;
|
217 | /** @type {!Array<string>} */
|
218 | GestureRecognizer.prototype.emits;
|