source: trip-planner-front/node_modules/zone.js/zone_externs.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 11.0 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8
9/**
10 * @fileoverview Externs for zone.js
11 * @see https://github.com/angular/zone.js
12 * @externs
13 */
14
15/**
16 * @interface
17 */
18var Zone = function() {};
19/**
20 * @type {!Zone} The parent Zone.
21 */
22Zone.prototype.parent;
23/**
24 * @type {!string} The Zone name (useful for debugging)
25 */
26Zone.prototype.name;
27
28Zone.assertZonePatched = function() {};
29
30Zone.__symbol__ = function(name) {};
31
32Zone.__load_patch = function(name, fn) {};
33
34/**
35 * @type {!Zone} Returns the current [Zone]. Returns the current zone. The only way to change
36 * the current zone is by invoking a run() method, which will update the current zone for the
37 * duration of the run method callback.
38 */
39Zone.current;
40
41/**
42 * @type {Task} The task associated with the current execution.
43 */
44Zone.currentTask;
45
46/**
47 * @type {!Zone} Return the root zone.
48 */
49Zone.root;
50
51/**
52 * Returns a value associated with the `key`.
53 *
54 * If the current zone does not have a key, the request is delegated to the parent zone. Use
55 * [ZoneSpec.properties] to configure the set of properties associated with the current zone.
56 *
57 * @param {!string} key The key to retrieve.
58 * @returns {?} The value for the key, or `undefined` if not found.
59 */
60Zone.prototype.get = function(key) {};
61
62/**
63 * Returns a Zone which defines a `key`.
64 *
65 * Recursively search the parent Zone until a Zone which has a property `key` is found.
66 *
67 * @param {!string} key The key to use for identification of the returned zone.
68 * @returns {?Zone} The Zone which defines the `key`, `null` if not found.
69 */
70Zone.prototype.getZoneWith = function(key) {};
71
72/**
73 * Used to create a child zone.
74 *
75 * @param {!ZoneSpec} zoneSpec A set of rules which the child zone should follow.
76 * @returns {!Zone} A new child zone.
77 */
78Zone.prototype.fork = function(zoneSpec) {};
79
80/**
81 * Wraps a callback function in a new function which will properly restore the current zone upon
82 * invocation.
83 *
84 * The wrapped function will properly forward `this` as well as `arguments` to the `callback`.
85 *
86 * Before the function is wrapped the zone can intercept the `callback` by declaring
87 * [ZoneSpec.onIntercept].
88 *
89 * @param {!Function} callback the function which will be wrapped in the zone.
90 * @param {!string=} source A unique debug location of the API being wrapped.
91 * @returns {!Function} A function which will invoke the `callback` through [Zone.runGuarded].
92 */
93Zone.prototype.wrap = function(callback, source) {};
94
95/**
96 * Invokes a function in a given zone.
97 *
98 * The invocation of `callback` can be intercepted be declaring [ZoneSpec.onInvoke].
99 *
100 * @param {!Function} callback The function to invoke.
101 * @param {?Object=} applyThis
102 * @param {?Array=} applyArgs
103 * @param {?string=} source A unique debug location of the API being invoked.
104 * @returns {*} Value from the `callback` function.
105 */
106Zone.prototype.run = function(callback, applyThis, applyArgs, source) {};
107
108/**
109 * Invokes a function in a given zone and catches any exceptions.
110 *
111 * Any exceptions thrown will be forwarded to [Zone.HandleError].
112 *
113 * The invocation of `callback` can be intercepted be declaring [ZoneSpec.onInvoke]. The
114 * handling of exceptions can intercepted by declaring [ZoneSpec.handleError].
115 *
116 * @param {!Function} callback The function to invoke.
117 * @param {?Object=} applyThis
118 * @param {?Array=} applyArgs
119 * @param {?string=} source A unique debug location of the API being invoked.
120 * @returns {*} Value from the `callback` function.
121 */
122Zone.prototype.runGuarded = function(callback, applyThis, applyArgs, source) {};
123
124/**
125 * Execute the Task by restoring the [Zone.currentTask] in the Task's zone.
126 *
127 * @param {!Task} task
128 * @param {?Object=} applyThis
129 * @param {?Array=} applyArgs
130 * @returns {*}
131 */
132Zone.prototype.runTask = function(task, applyThis, applyArgs) {};
133
134/**
135 * @param {string} source
136 * @param {!Function} callback
137 * @param {?TaskData=} data
138 * @param {?function(!Task)=} customSchedule
139 * @return {!MicroTask} microTask
140 */
141Zone.prototype.scheduleMicroTask = function(source, callback, data, customSchedule) {};
142
143/**
144 * @param {string} source
145 * @param {!Function} callback
146 * @param {?TaskData=} data
147 * @param {?function(!Task)=} customSchedule
148 * @param {?function(!Task)=} customCancel
149 * @return {!MacroTask} macroTask
150 */
151Zone.prototype.scheduleMacroTask = function(
152 source, callback, data, customSchedule, customCancel) {};
153
154/**
155 * @param {string} source
156 * @param {!Function} callback
157 * @param {?TaskData=} data
158 * @param {?function(!Task)=} customSchedule
159 * @param {?function(!Task)=} customCancel
160 * @return {!EventTask} eventTask
161 */
162Zone.prototype.scheduleEventTask = function(
163 source, callback, data, customSchedule, customCancel) {};
164
165/**
166 * @param {!Task} task
167 * @return {!Task} task
168 */
169Zone.prototype.scheduleTask = function(task) {};
170
171/**
172 * @param {!Task} task
173 * @return {!Task} task
174 */
175Zone.prototype.cancelTask = function(task) {};
176
177/**
178 * @record
179 */
180var ZoneSpec = function() {};
181/**
182 * @type {!string} The name of the zone. Usefull when debugging Zones.
183 */
184ZoneSpec.prototype.name;
185
186/**
187 * @type {Object<string, Object>|undefined} A set of properties to be associated with Zone. Use
188 * [Zone.get] to retrieve them.
189 */
190ZoneSpec.prototype.properties;
191
192/**
193 * Allows the interception of zone forking.
194 *
195 * When the zone is being forked, the request is forwarded to this method for interception.
196 *
197 * @type {
198 * undefined|?function(ZoneDelegate, Zone, Zone, ZoneSpec): Zone
199 * }
200 */
201ZoneSpec.prototype.onFork;
202
203/**
204 * Allows the interception of the wrapping of the callback.
205 *
206 * When the zone is being forked, the request is forwarded to this method for interception.
207 *
208 * @type {
209 * undefined|?function(ZoneDelegate, Zone, Zone, Function, string): Function
210 * }
211 */
212ZoneSpec.prototype.onIntercept;
213
214/**
215 * Allows interception of the callback invocation.
216 *
217 * @type {
218 * undefined|?function(ZoneDelegate, Zone, Zone, Function, Object, Array, string): *
219 * }
220 */
221ZoneSpec.prototype.onInvoke;
222
223/**
224 * Allows interception of the error handling.
225 *
226 * @type {
227 * undefined|?function(ZoneDelegate, Zone, Zone, Object): boolean
228 * }
229 */
230ZoneSpec.prototype.onHandleError;
231
232/**
233 * Allows interception of task scheduling.
234 *
235 * @type {
236 * undefined|?function(ZoneDelegate, Zone, Zone, Task): Task
237 * }
238 */
239ZoneSpec.prototype.onScheduleTask;
240
241/**
242 * Allows interception of task invoke.
243 *
244 * @type {
245 * undefined|?function(ZoneDelegate, Zone, Zone, Task, Object, Array): *
246 * }
247 */
248ZoneSpec.prototype.onInvokeTask;
249
250/**
251 * Allows interception of task cancelation.
252 *
253 * @type {
254 * undefined|?function(ZoneDelegate, Zone, Zone, Task): *
255 * }
256 */
257ZoneSpec.prototype.onCancelTask;
258/**
259 * Notifies of changes to the task queue empty status.
260 *
261 * @type {
262 * undefined|?function(ZoneDelegate, Zone, Zone, HasTaskState)
263 * }
264 */
265ZoneSpec.prototype.onHasTask;
266
267/**
268 * @interface
269 */
270var ZoneDelegate = function() {};
271/**
272 * @type {!Zone} zone
273 */
274ZoneDelegate.prototype.zone;
275/**
276 * @param {!Zone} targetZone the [Zone] which originally received the request.
277 * @param {!ZoneSpec} zoneSpec the argument passed into the `fork` method.
278 * @returns {!Zone} the new forked zone
279 */
280ZoneDelegate.prototype.fork = function(targetZone, zoneSpec) {};
281/**
282 * @param {!Zone} targetZone the [Zone] which originally received the request.
283 * @param {!Function} callback the callback function passed into `wrap` function
284 * @param {string=} source the argument passed into the `wrap` method.
285 * @returns {!Function}
286 */
287ZoneDelegate.prototype.intercept = function(targetZone, callback, source) {};
288
289/**
290 * @param {Zone} targetZone the [Zone] which originally received the request.
291 * @param {!Function} callback the callback which will be invoked.
292 * @param {?Object=} applyThis the argument passed into the `run` method.
293 * @param {?Array=} applyArgs the argument passed into the `run` method.
294 * @param {?string=} source the argument passed into the `run` method.
295 * @returns {*}
296 */
297ZoneDelegate.prototype.invoke = function(targetZone, callback, applyThis, applyArgs, source) {};
298/**
299 * @param {!Zone} targetZone the [Zone] which originally received the request.
300 * @param {!Object} error the argument passed into the `handleError` method.
301 * @returns {boolean}
302 */
303ZoneDelegate.prototype.handleError = function(targetZone, error) {};
304/**
305 * @param {!Zone} targetZone the [Zone] which originally received the request.
306 * @param {!Task} task the argument passed into the `scheduleTask` method.
307 * @returns {!Task} task
308 */
309ZoneDelegate.prototype.scheduleTask = function(targetZone, task) {};
310/**
311 * @param {!Zone} targetZone The [Zone] which originally received the request.
312 * @param {!Task} task The argument passed into the `scheduleTask` method.
313 * @param {?Object=} applyThis The argument passed into the `run` method.
314 * @param {?Array=} applyArgs The argument passed into the `run` method.
315 * @returns {*}
316 */
317ZoneDelegate.prototype.invokeTask = function(targetZone, task, applyThis, applyArgs) {};
318/**
319 * @param {!Zone} targetZone The [Zone] which originally received the request.
320 * @param {!Task} task The argument passed into the `cancelTask` method.
321 * @returns {*}
322 */
323ZoneDelegate.prototype.cancelTask = function(targetZone, task) {};
324/**
325 * @param {!Zone} targetZone The [Zone] which originally received the request.
326 * @param {!HasTaskState} hasTaskState
327 */
328ZoneDelegate.prototype.hasTask = function(targetZone, hasTaskState) {};
329
330/**
331 * @interface
332 */
333var HasTaskState = function() {};
334
335/**
336 * @type {boolean}
337 */
338HasTaskState.prototype.microTask;
339/**
340 * @type {boolean}
341 */
342HasTaskState.prototype.macroTask;
343/**
344 * @type {boolean}
345 */
346HasTaskState.prototype.eventTask;
347/**
348 * @type {TaskType}
349 */
350HasTaskState.prototype.change;
351
352/**
353 * @interface
354 */
355var TaskType = function() {};
356
357/**
358 * @interface
359 */
360var TaskState = function() {};
361
362/**
363 * @interface
364 */
365var TaskData = function() {};
366/**
367 * @type {boolean|undefined}
368 */
369TaskData.prototype.isPeriodic;
370/**
371 * @type {number|undefined}
372 */
373TaskData.prototype.delay;
374/**
375 * @type {number|undefined}
376 */
377TaskData.prototype.handleId;
378
379/**
380 * @interface
381 */
382var Task = function() {};
383/**
384 * @type {TaskType}
385 */
386Task.prototype.type;
387/**
388 * @type {TaskState}
389 */
390Task.prototype.state;
391/**
392 * @type {string}
393 */
394Task.prototype.source;
395/**
396 * @type {Function}
397 */
398Task.prototype.invoke;
399/**
400 * @type {Function}
401 */
402Task.prototype.callback;
403/**
404 * @type {TaskData}
405 */
406Task.prototype.data;
407/**
408 * @param {!Task} task
409 */
410Task.prototype.scheduleFn = function(task) {};
411/**
412 * @param {!Task} task
413 */
414Task.prototype.cancelFn = function(task) {};
415/**
416 * @type {Zone}
417 */
418Task.prototype.zone;
419/**
420 * @type {number}
421 */
422Task.prototype.runCount;
423Task.prototype.cancelScheduleRequest = function() {};
424
425/**
426 * @interface
427 * @extends {Task}
428 */
429var MicroTask = function() {};
430/**
431 * @interface
432 * @extends {Task}
433 */
434var MacroTask = function() {};
435/**
436 * @interface
437 * @extends {Task}
438 */
439var EventTask = function() {};
440
441/**
442 * @type {?string}
443 */
444Error.prototype.zoneAwareStack;
445
446/**
447 * @type {?string}
448 */
449Error.prototype.originalStack;
Note: See TracBrowser for help on using the repository browser.