source: trip-planner-front/node_modules/zone.js/dist/zone.configurations.api.ts@ bdd6491

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

initial commit

  • Property mode set to 100644
File size: 27.9 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 * Interface of `zone.js` configurations.
11 *
12 * You can define the following configurations on the `window/global` object before
13 * importing `zone.js` to change `zone.js` default behaviors.
14 */
15interface ZoneGlobalConfigurations {
16 /**
17 * Disable the monkey patch of the `Node.js` `EventEmitter` API.
18 *
19 * By default, `zone.js` monkey patches the `Node.js` `EventEmitter` APIs to make asynchronous
20 * callbacks of those APIs in the same zone when scheduled.
21 *
22 * Consider the following example:
23 *
24 * ```
25 * const EventEmitter = require('events');
26 * class MyEmitter extends EventEmitter {}
27 * const myEmitter = new MyEmitter();
28 *
29 * const zone = Zone.current.fork({name: 'myZone'});
30 * zone.run(() => {
31 * myEmitter.on('event', () => {
32 * console.log('an event occurs in the zone', Zone.current.name);
33 * // the callback runs in the zone when it is scheduled,
34 * // so the output is 'an event occurs in the zone myZone'.
35 * });
36 * });
37 * myEmitter.emit('event');
38 * ```
39 *
40 * If you set `__Zone_disable_EventEmitter = true` before importing `zone.js`,
41 * `zone.js` does not monkey patch the `EventEmitter` APIs and the above code
42 * outputs 'an event occurred <root>'.
43 */
44 __Zone_disable_EventEmitter?: boolean;
45
46 /**
47 * Disable the monkey patch of the `Node.js` `fs` API.
48 *
49 * By default, `zone.js` monkey patches `Node.js` `fs` APIs to make asynchronous callbacks of
50 * those APIs in the same zone when scheduled.
51 *
52 * Consider the following example:
53 *
54 * ```
55 * const fs = require('fs');
56 *
57 * const zone = Zone.current.fork({name: 'myZone'});
58 * zone.run(() => {
59 * fs.stat('/tmp/world', (err, stats) => {
60 * console.log('fs.stats() callback is invoked in the zone', Zone.current.name);
61 * // since the callback of the `fs.stat()` runs in the same zone
62 * // when it is called, so the output is 'fs.stats() callback is invoked in the zone myZone'.
63 * });
64 * });
65 * ```
66 *
67 * If you set `__Zone_disable_fs = true` before importing `zone.js`,
68 * `zone.js` does not monkey patch the `fs` API and the above code
69 * outputs 'get stats occurred <root>'.
70 */
71 __Zone_disable_fs?: boolean;
72
73 /**
74 * Disable the monkey patch of the `Node.js` `timer` API.
75 *
76 * By default, `zone.js` monkey patches the `Node.js` `timer` APIs to make asynchronous
77 * callbacks of those APIs in the same zone when scheduled.
78 *
79 * Consider the following example:
80 *
81 * ```
82 * const zone = Zone.current.fork({name: 'myZone'});
83 * zone.run(() => {
84 * setTimeout(() => {
85 * console.log('setTimeout() callback is invoked in the zone', Zone.current.name);
86 * // since the callback of `setTimeout()` runs in the same zone
87 * // when it is scheduled, so the output is 'setTimeout() callback is invoked in the zone
88 * // myZone'.
89 * });
90 * });
91 * ```
92 *
93 * If you set `__Zone_disable_timers = true` before importing `zone.js`,
94 * `zone.js` does not monkey patch the `timer` APIs and the above code
95 * outputs 'timeout <root>'.
96 */
97 __Zone_disable_node_timers?: boolean;
98
99 /**
100 * Disable the monkey patch of the `Node.js` `process.nextTick()` API.
101 *
102 * By default, `zone.js` monkey patches the `Node.js` `process.nextTick()` API to make the
103 * callback in the same zone when calling `process.nextTick()`.
104 *
105 * Consider the following example:
106 *
107 * ```
108 * const zone = Zone.current.fork({name: 'myZone'});
109 * zone.run(() => {
110 * process.nextTick(() => {
111 * console.log('process.nextTick() callback is invoked in the zone', Zone.current.name);
112 * // since the callback of `process.nextTick()` runs in the same zone
113 * // when it is scheduled, so the output is 'process.nextTick() callback is invoked in the
114 * // zone myZone'.
115 * });
116 * });
117 * ```
118 *
119 * If you set `__Zone_disable_nextTick = true` before importing `zone.js`,
120 * `zone.js` does not monkey patch the `process.nextTick()` API and the above code
121 * outputs 'nextTick <root>'.
122 */
123 __Zone_disable_nextTick?: boolean;
124
125 /**
126 * Disable the monkey patch of the `Node.js` `crypto` API.
127 *
128 * By default, `zone.js` monkey patches the `Node.js` `crypto` APIs to make asynchronous callbacks
129 * of those APIs in the same zone when called.
130 *
131 * Consider the following example:
132 *
133 * ```
134 * const crypto = require('crypto');
135 *
136 * const zone = Zone.current.fork({name: 'myZone'});
137 * zone.run(() => {
138 * crypto.randomBytes(() => {
139 * console.log('crypto.randomBytes() callback is invoked in the zone', Zone.current.name);
140 * // since the callback of `crypto.randomBytes()` runs in the same zone
141 * // when it is called, so the output is 'crypto.randomBytes() callback is invoked in the
142 * // zone myZone'.
143 * });
144 * });
145 * ```
146 *
147 * If you set `__Zone_disable_crypto = true` before importing `zone.js`,
148 * `zone.js` does not monkey patch the `crypto` API and the above code
149 * outputs 'crypto <root>'.
150 */
151 __Zone_disable_crypto?: boolean;
152
153 /**
154 * Disable the monkey patch of the `Object.defineProperty()` API.
155 *
156 * Note: This configuration is available only in the legacy bundle (dist/zone.js). This module is
157 * not available in the evergreen bundle (zone-evergreen.js).
158 *
159 * In the legacy browser, the default behavior of `zone.js` is to monkey patch
160 * `Object.defineProperty()` and `Object.create()` to try to ensure PropertyDescriptor parameter's
161 * configurable property to be true. This patch is only needed in some old mobile browsers.
162 *
163 * If you set `__Zone_disable_defineProperty = true` before importing `zone.js`,
164 * `zone.js` does not monkey patch the `Object.defineProperty()` API and does not
165 * modify desc.configurable to true.
166 *
167 */
168 __Zone_disable_defineProperty?: boolean;
169
170 /**
171 * Disable the monkey patch of the browser `registerElement()` API.
172 *
173 * NOTE: This configuration is only available in the legacy bundle (dist/zone.js), this
174 * module is not available in the evergreen bundle (zone-evergreen.js).
175 *
176 * In the legacy browser, the default behavior of `zone.js` is to monkey patch the
177 * `registerElement()` API to make asynchronous callbacks of the API in the same zone when
178 * `registerElement()` is called.
179 *
180 * Consider the following example:
181 *
182 * ```
183 * const proto = Object.create(HTMLElement.prototype);
184 * proto.createdCallback = function() {
185 * console.log('createdCallback is invoked in the zone', Zone.current.name);
186 * };
187 * proto.attachedCallback = function() {
188 * console.log('attachedCallback is invoked in the zone', Zone.current.name);
189 * };
190 * proto.detachedCallback = function() {
191 * console.log('detachedCallback is invoked in the zone', Zone.current.name);
192 * };
193 * proto.attributeChangedCallback = function() {
194 * console.log('attributeChangedCallback is invoked in the zone', Zone.current.name);
195 * };
196 *
197 * const zone = Zone.current.fork({name: 'myZone'});
198 * zone.run(() => {
199 * document.registerElement('x-elem', {prototype: proto});
200 * });
201 * ```
202 *
203 * When these callbacks are invoked, those callbacks will be in the zone when
204 * `registerElement()` is called.
205 *
206 * If you set `__Zone_disable_registerElement = true` before importing `zone.js`,
207 * `zone.js` does not monkey patch `registerElement()` API and the above code
208 * outputs '<root>'.
209 */
210 __Zone_disable_registerElement?: boolean;
211
212 /**
213 * Disable the monkey patch of the browser legacy `EventTarget` API.
214 *
215 * NOTE: This configuration is only available in the legacy bundle (dist/zone.js), this module
216 * is not available in the evergreen bundle (zone-evergreen.js).
217 *
218 * In some old browsers, the `EventTarget` is not available, so `zone.js` cannot directly monkey
219 * patch the `EventTarget`. Instead, `zone.js` patches all known HTML elements' prototypes (such
220 * as `HtmlDivElement`). The callback of the `addEventListener()` will be in the same zone when
221 * the `addEventListener()` is called.
222 *
223 * Consider the following example:
224 *
225 * ```
226 * const zone = Zone.current.fork({name: 'myZone'});
227 * zone.run(() => {
228 * div.addEventListener('click', () => {
229 * console.log('div click event listener is invoked in the zone', Zone.current.name);
230 * // the output is 'div click event listener is invoked in the zone myZone'.
231 * });
232 * });
233 * ```
234 *
235 * If you set `__Zone_disable_EventTargetLegacy = true` before importing `zone.js`
236 * In some old browsers, where `EventTarget` is not available, if you set
237 * `__Zone_disable_EventTargetLegacy = true` before importing `zone.js`, `zone.js` does not monkey
238 * patch all HTML element APIs and the above code outputs 'clicked <root>'.
239 */
240 __Zone_disable_EventTargetLegacy?: boolean;
241
242 /**
243 * Disable the monkey patch of the browser `timer` APIs.
244 *
245 * By default, `zone.js` monkey patches browser timer
246 * APIs (`setTimeout()`/`setInterval()`/`setImmediate()`) to make asynchronous callbacks of those
247 * APIs in the same zone when scheduled.
248 *
249 * Consider the following example:
250 *
251 * ```
252 * const zone = Zone.current.fork({name: 'myZone'});
253 * zone.run(() => {
254 * setTimeout(() => {
255 * console.log('setTimeout() callback is invoked in the zone', Zone.current.name);
256 * // since the callback of `setTimeout()` runs in the same zone
257 * // when it is scheduled, so the output is 'setTimeout() callback is invoked in the zone
258 * // myZone'.
259 * });
260 * });
261 * ```
262 *
263 * If you set `__Zone_disable_timers = true` before importing `zone.js`,
264 * `zone.js` does not monkey patch `timer` API and the above code
265 * outputs 'timeout <root>'.
266 *
267 */
268 __Zone_disable_timers?: boolean;
269
270 /**
271 * Disable the monkey patch of the browser `requestAnimationFrame()` API.
272 *
273 * By default, `zone.js` monkey patches the browser `requestAnimationFrame()` API
274 * to make the asynchronous callback of the `requestAnimationFrame()` in the same zone when
275 * scheduled.
276 *
277 * Consider the following example:
278 *
279 * ```
280 * const zone = Zone.current.fork({name: 'myZone'});
281 * zone.run(() => {
282 * requestAnimationFrame(() => {
283 * console.log('requestAnimationFrame() callback is invoked in the zone', Zone.current.name);
284 * // since the callback of `requestAnimationFrame()` will be in the same zone
285 * // when it is scheduled, so the output will be 'requestAnimationFrame() callback is invoked
286 * // in the zone myZone'
287 * });
288 * });
289 * ```
290 *
291 * If you set `__Zone_disable_requestAnimationFrame = true` before importing `zone.js`,
292 * `zone.js` does not monkey patch the `requestAnimationFrame()` API and the above code
293 * outputs 'raf <root>'.
294 */
295 __Zone_disable_requestAnimationFrame?: boolean;
296
297 /**
298 *
299 * Disable the monkey patching of the browser's `queueMicrotask()` API.
300 *
301 * By default, `zone.js` monkey patches the browser's `queueMicrotask()` API
302 * to ensure that `queueMicrotask()` callback is invoked in the same zone as zone used to invoke
303 * `queueMicrotask()`. And also the callback is running as `microTask` like
304 * `Promise.prototype.then()`.
305 *
306 * Consider the following example:
307 *
308 * ```
309 * const zone = Zone.current.fork({name: 'myZone'});
310 * zone.run(() => {
311 * queueMicrotask(() => {
312 * console.log('queueMicrotask() callback is invoked in the zone', Zone.current.name);
313 * // Since `queueMicrotask()` was invoked in `myZone`, same zone is restored
314 * // when 'queueMicrotask() callback is invoked, resulting in `myZone` being console logged.
315 * });
316 * });
317 * ```
318 *
319 * If you set `__Zone_disable_queueMicrotask = true` before importing `zone.js`,
320 * `zone.js` does not monkey patch the `queueMicrotask()` API and the above code
321 * output will change to: 'queueMicrotask() callback is invoked in the zone <root>'.
322 */
323 __Zone_disable_queueMicrotask?: boolean;
324
325 /**
326 *
327 * Disable the monkey patch of the browser blocking APIs(`alert()`/`prompt()`/`confirm()`).
328 */
329 __Zone_disable_blocking?: boolean;
330
331 /**
332 * Disable the monkey patch of the browser `EventTarget` APIs.
333 *
334 * By default, `zone.js` monkey patches EventTarget APIs. The callbacks of the
335 * `addEventListener()` run in the same zone when the `addEventListener()` is called.
336 *
337 * Consider the following example:
338 *
339 * ```
340 * const zone = Zone.current.fork({name: 'myZone'});
341 * zone.run(() => {
342 * div.addEventListener('click', () => {
343 * console.log('div event listener is invoked in the zone', Zone.current.name);
344 * // the output is 'div event listener is invoked in the zone myZone'.
345 * });
346 * });
347 * ```
348 *
349 * If you set `__Zone_disable_EventTarget = true` before importing `zone.js`,
350 * `zone.js` does not monkey patch EventTarget API and the above code
351 * outputs 'clicked <root>'.
352 *
353 */
354 __Zone_disable_EventTarget?: boolean;
355
356 /**
357 * Disable the monkey patch of the browser `FileReader` APIs.
358 */
359 __Zone_disable_FileReader?: boolean;
360
361 /**
362 * Disable the monkey patch of the browser `MutationObserver` APIs.
363 */
364 __Zone_disable_MutationObserver?: boolean;
365
366 /**
367 * Disable the monkey patch of the browser `IntersectionObserver` APIs.
368 */
369 __Zone_disable_IntersectionObserver?: boolean;
370
371 /**
372 * Disable the monkey patch of the browser onProperty APIs(such as onclick).
373 *
374 * By default, `zone.js` monkey patches onXXX properties (such as onclick). The callbacks of onXXX
375 * properties run in the same zone when the onXXX properties is set.
376 *
377 * Consider the following example:
378 *
379 * ```
380 * const zone = Zone.current.fork({name: 'myZone'});
381 * zone.run(() => {
382 * div.onclick = () => {
383 * console.log('div click event listener is invoked in the zone', Zone.current.name);
384 * // the output will be 'div click event listener is invoked in the zone myZone'
385 * }
386 * });
387 * ```
388 *
389 * If you set `__Zone_disable_on_property = true` before importing `zone.js`,
390 * `zone.js` does not monkey patch onXXX properties and the above code
391 * outputs 'clicked <root>'.
392 *
393 */
394 __Zone_disable_on_property?: boolean;
395
396 /**
397 * Disable the monkey patch of the browser `customElements` APIs.
398 *
399 * By default, `zone.js` monkey patches `customElements` APIs to make callbacks run in the
400 * same zone when the `customElements.define()` is called.
401 *
402 * Consider the following example:
403 *
404 * ```
405 * class TestCustomElement extends HTMLElement {
406 * constructor() { super(); }
407 * connectedCallback() {}
408 * disconnectedCallback() {}
409 * attributeChangedCallback(attrName, oldVal, newVal) {}
410 * adoptedCallback() {}
411 * }
412 *
413 * const zone = Zone.fork({name: 'myZone'});
414 * zone.run(() => {
415 * customElements.define('x-elem', TestCustomElement);
416 * });
417 * ```
418 *
419 * All those callbacks defined in TestCustomElement runs in the zone when
420 * the `customElements.define()` is called.
421 *
422 * If you set `__Zone_disable_customElements = true` before importing `zone.js`,
423 * `zone.js` does not monkey patch `customElements` APIs and the above code
424 * runs inside <root> zone.
425 */
426 __Zone_disable_customElements?: boolean;
427
428 /**
429 * Disable the monkey patch of the browser `XMLHttpRequest` APIs.
430 *
431 * By default, `zone.js` monkey patches `XMLHttpRequest` APIs to make XMLHttpRequest act
432 * as macroTask.
433 *
434 * Consider the following example:
435 *
436 * ```
437 * const zone = Zone.current.fork({
438 * name: 'myZone',
439 * onScheduleTask: (delegate, curr, target, task) => {
440 * console.log('task is scheduled', task.type, task.source, task.zone.name);
441 * return delegate.scheduleTask(target, task);
442 * }
443 * })
444 * const xhr = new XMLHttpRequest();
445 * zone.run(() => {
446 * xhr.onload = function() {};
447 * xhr.open('get', '/', true);
448 * xhr.send();
449 * });
450 * ```
451 *
452 * In this example, the instance of XMLHttpRequest runs in the zone and acts as a macroTask. The
453 * output is 'task is scheduled macroTask, XMLHttpRequest.send, zone'.
454 *
455 * If you set `__Zone_disable_XHR = true` before importing `zone.js`,
456 * `zone.js` does not monkey patch `XMLHttpRequest` APIs and the above onScheduleTask callback
457 * will not be called.
458 *
459 */
460 __Zone_disable_XHR?: boolean;
461
462 /**
463 * Disable the monkey patch of the browser geolocation APIs.
464 *
465 * By default, `zone.js` monkey patches geolocation APIs to make callbacks run in the same zone
466 * when those APIs are called.
467 *
468 * Consider the following examples:
469 *
470 * ```
471 * const zone = Zone.current.fork({
472 * name: 'myZone'
473 * });
474 *
475 * zone.run(() => {
476 * navigator.geolocation.getCurrentPosition(pos => {
477 * console.log('navigator.getCurrentPosition() callback is invoked in the zone',
478 * Zone.current.name);
479 * // output is 'navigator.getCurrentPosition() callback is invoked in the zone myZone'.
480 * }
481 * });
482 * ```
483 *
484 * If set you `__Zone_disable_geolocation = true` before importing `zone.js`,
485 * `zone.js` does not monkey patch geolocation APIs and the above code
486 * outputs 'getCurrentPosition <root>'.
487 *
488 */
489 __Zone_disable_geolocation?: boolean;
490
491 /**
492 * Disable the monkey patch of the browser `canvas` APIs.
493 *
494 * By default, `zone.js` monkey patches `canvas` APIs to make callbacks run in the same zone when
495 * those APIs are called.
496 *
497 * Consider the following example:
498 *
499 * ```
500 * const zone = Zone.current.fork({
501 * name: 'myZone'
502 * });
503 *
504 * zone.run(() => {
505 * canvas.toBlob(blog => {
506 * console.log('canvas.toBlob() callback is invoked in the zone', Zone.current.name);
507 * // output is 'canvas.toBlob() callback is invoked in the zone myZone'.
508 * }
509 * });
510 * ```
511 *
512 * If you set `__Zone_disable_canvas = true` before importing `zone.js`,
513 * `zone.js` does not monkey patch `canvas` APIs and the above code
514 * outputs 'canvas.toBlob <root>'.
515 */
516 __Zone_disable_canvas?: boolean;
517
518 /**
519 * Disable the `Promise` monkey patch.
520 *
521 * By default, `zone.js` monkey patches `Promise` APIs to make the `then()/catch()` callbacks in
522 * the same zone when those callbacks are called.
523 *
524 * Consider the following examples:
525 *
526 * ```
527 * const zone = Zone.current.fork({name: 'myZone'});
528 *
529 * const p = Promise.resolve(1);
530 *
531 * zone.run(() => {
532 * p.then(() => {
533 * console.log('then() callback is invoked in the zone', Zone.current.name);
534 * // output is 'then() callback is invoked in the zone myZone'.
535 * });
536 * });
537 * ```
538 *
539 * If you set `__Zone_disable_ZoneAwarePromise = true` before importing `zone.js`,
540 * `zone.js` does not monkey patch `Promise` APIs and the above code
541 * outputs 'promise then callback <root>'.
542 */
543 __Zone_disable_ZoneAwarePromise?: boolean;
544
545 /**
546 * Define event names that users don't want monkey patched by the `zone.js`.
547 *
548 * By default, `zone.js` monkey patches EventTarget.addEventListener(). The event listener
549 * callback runs in the same zone when the addEventListener() is called.
550 *
551 * Sometimes, you don't want all of the event names used in this patched version because it
552 * impacts performance. For example, you might want `scroll` or `mousemove` event listeners to run
553 * the native `addEventListener()` for better performance.
554 *
555 * Users can achieve this goal by defining `__zone_symbol__UNPATCHED_EVENTS = ['scroll',
556 * 'mousemove'];` before importing `zone.js`.
557 */
558 __zone_symbol__UNPATCHED_EVENTS?: string[];
559
560 /**
561 * Define the event names of the passive listeners.
562 *
563 * To add passive event listeners, you can use `elem.addEventListener('scroll', listener,
564 * {passive: true});` or implement your own `EventManagerPlugin`.
565 *
566 * You can also define a global variable as follows:
567 *
568 * ```
569 * __zone_symbol__PASSIVE_EVENTS = ['scroll'];
570 * ```
571 *
572 * The preceding code makes all scroll event listeners passive.
573 */
574 __zone_symbol__PASSIVE_EVENTS?: string[];
575
576 /**
577 * Disable wrapping uncaught promise rejection.
578 *
579 * By default, `zone.js` wraps the uncaught promise rejection in a new `Error` object
580 * which contains additional information such as a value of the rejection and a stack trace.
581 *
582 * If you set `__zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION = true;` before
583 * importing `zone.js`, `zone.js` will not wrap the uncaught promise rejection.
584 */
585 __zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION?: boolean;
586}
587
588/**
589 * Interface of `zone-testing.js` test configurations.
590 *
591 * You can define the following configurations on the `window` or `global` object before
592 * importing `zone-testing.js` to change `zone-testing.js` default behaviors in the test runner.
593 */
594interface ZoneTestConfigurations {
595 /**
596 * Disable the Jasmine integration.
597 *
598 * In the `zone-testing.js` bundle, by default, `zone-testing.js` monkey patches Jasmine APIs
599 * to make Jasmine APIs run in specified zone.
600 *
601 * 1. Make the `describe()`/`xdescribe()`/`fdescribe()` methods run in the syncTestZone.
602 * 2. Make the `it()`/`xit()`/`fit()`/`beforeEach()`/`afterEach()`/`beforeAll()`/`afterAll()`
603 * methods run in the ProxyZone.
604 *
605 * With this patch, `async()`/`fakeAsync()` can work with the Jasmine runner.
606 *
607 * If you set `__Zone_disable_jasmine = true` before importing `zone-testing.js`,
608 * `zone-testing.js` does not monkey patch the jasmine APIs and the `async()`/`fakeAsync()` cannot
609 * work with the Jasmine runner any longer.
610 */
611 __Zone_disable_jasmine?: boolean;
612
613 /**
614 * Disable the Mocha integration.
615 *
616 * In the `zone-testing.js` bundle, by default, `zone-testing.js` monkey patches the Mocha APIs
617 * to make Mocha APIs run in the specified zone.
618 *
619 * 1. Make the `describe()`/`xdescribe()`/`fdescribe()` methods run in the syncTestZone.
620 * 2. Make the `it()`/`xit()`/`fit()`/`beforeEach()`/`afterEach()`/`beforeAll()`/`afterAll()`
621 * methods run in the ProxyZone.
622 *
623 * With this patch, `async()`/`fakeAsync()` can work with the Mocha runner.
624 *
625 * If you set `__Zone_disable_mocha = true` before importing `zone-testing.js`,
626 * `zone-testing.js` does not monkey patch the Mocha APIs and the `async()/`fakeAsync()` can not
627 * work with the Mocha runner any longer.
628 */
629 __Zone_disable_mocha?: boolean;
630
631 /**
632 * Disable the Jest integration.
633 *
634 * In the `zone-testing.js` bundle, by default, `zone-testing.js` monkey patches Jest APIs
635 * to make Jest APIs run in the specified zone.
636 *
637 * 1. Make the `describe()`/`xdescribe()`/`fdescribe()` methods run in the syncTestZone.
638 * 2. Make the `it()`/`xit()`/`fit()`/`beforeEach()`/`afterEach()`/`before()`/`after()` methods
639 * run in the ProxyZone.
640 *
641 * With this patch, `async()`/`fakeAsync()` can work with the Jest runner.
642 *
643 * If you set `__Zone_disable_jest = true` before importing `zone-testing.js`,
644 * `zone-testing.js` does not monkey patch the jest APIs and `async()`/`fakeAsync()` cannot
645 * work with the Jest runner any longer.
646 */
647 __Zone_disable_jest?: boolean;
648
649 /**
650 * Disable monkey patch the jasmine clock APIs.
651 *
652 * By default, `zone-testing.js` monkey patches the `jasmine.clock()` API,
653 * so the `jasmine.clock()` can work with the `fakeAsync()/tick()` API.
654 *
655 * Consider the following example:
656 *
657 * ```
658 * describe('jasmine.clock integration', () => {
659 * beforeEach(() => {
660 * jasmine.clock().install();
661 * });
662 * afterEach(() => {
663 * jasmine.clock().uninstall();
664 * });
665 * it('fakeAsync test', fakeAsync(() => {
666 * setTimeout(spy, 100);
667 * expect(spy).not.toHaveBeenCalled();
668 * jasmine.clock().tick(100);
669 * expect(spy).toHaveBeenCalled();
670 * }));
671 * });
672 * ```
673 *
674 * In the `fakeAsync()` method, `jasmine.clock().tick()` works just like `tick()`.
675 *
676 * If you set `__zone_symbol__fakeAsyncDisablePatchingClock = true` before importing
677 * `zone-testing.js`,`zone-testing.js` does not monkey patch the `jasmine.clock()` APIs and the
678 * `jasmine.clock()` cannot work with `fakeAsync()` any longer.
679 */
680 __zone_symbol__fakeAsyncDisablePatchingClock?: boolean;
681
682 /**
683 * Enable auto running into `fakeAsync()` when installing the `jasmine.clock()`.
684 *
685 * By default, `zone-testing.js` does not automatically run into `fakeAsync()`
686 * if the `jasmine.clock().install()` is called.
687 *
688 * Consider the following example:
689 *
690 * ```
691 * describe('jasmine.clock integration', () => {
692 * beforeEach(() => {
693 * jasmine.clock().install();
694 * });
695 * afterEach(() => {
696 * jasmine.clock().uninstall();
697 * });
698 * it('fakeAsync test', fakeAsync(() => {
699 * setTimeout(spy, 100);
700 * expect(spy).not.toHaveBeenCalled();
701 * jasmine.clock().tick(100);
702 * expect(spy).toHaveBeenCalled();
703 * }));
704 * });
705 * ```
706 *
707 * You must run `fakeAsync()` to make test cases in the `FakeAsyncTestZone`.
708 *
709 * If you set `__zone_symbol__fakeAsyncAutoFakeAsyncWhenClockPatched = true` before importing
710 * `zone-testing.js`, `zone-testing.js` can run test case automatically in the
711 * `FakeAsyncTestZone` without calling the `fakeAsync()`.
712 *
713 * Consider the following example:
714 *
715 * ```
716 * describe('jasmine.clock integration', () => {
717 * beforeEach(() => {
718 * jasmine.clock().install();
719 * });
720 * afterEach(() => {
721 * jasmine.clock().uninstall();
722 * });
723 * it('fakeAsync test', () => { // here we don't need to call fakeAsync
724 * setTimeout(spy, 100);
725 * expect(spy).not.toHaveBeenCalled();
726 * jasmine.clock().tick(100);
727 * expect(spy).toHaveBeenCalled();
728 * });
729 * });
730 * ```
731 *
732 */
733 __zone_symbol__fakeAsyncAutoFakeAsyncWhenClockPatched?: boolean;
734
735 /**
736 * Enable waiting for the unresolved promise in the `async()` test.
737 *
738 * In the `async()` test, `AsyncTestZone` waits for all the asynchronous tasks to finish. By
739 * default, if some promises remain unresolved, `AsyncTestZone` does not wait and reports that it
740 * received an unexpected result.
741 *
742 * Consider the following example:
743 *
744 * ```
745 * describe('wait never resolved promise', () => {
746 * it('async with never resolved promise test', async(() => {
747 * const p = new Promise(() => {});
748 * p.then(() => {
749 * // do some expectation.
750 * });
751 * }))
752 * });
753 * ```
754 *
755 * By default, this case passes, because the callback of `p.then()` is never called. Because `p`
756 * is an unresolved promise, there is no pending asynchronous task, which means the `async()`
757 * method does not wait.
758 *
759 * If you set `__zone_symbol__supportWaitUnResolvedChainedPromise = true`, the above case
760 * times out, because `async()` will wait for the unresolved promise.
761 */
762 __zone_symbol__supportWaitUnResolvedChainedPromise?: boolean;
763}
764
765/**
766 * The interface of the `zone.js` runtime configurations.
767 *
768 * These configurations can be defined on the `Zone` object after
769 * importing zone.js to change behaviors. The differences between
770 * the `ZoneRuntimeConfigurations` and the `ZoneGlobalConfigurations` are,
771 *
772 * 1. `ZoneGlobalConfigurations` must be defined on the `global/window` object before importing
773 * `zone.js`. The value of the configuration cannot be changed at runtime.
774 *
775 * 2. `ZoneRuntimeConfigurations` must be defined on the `Zone` object after importing `zone.js`.
776 * You can change the value of this configuration at runtime.
777 *
778 */
779interface ZoneRuntimeConfigurations {
780 /**
781 * Ignore outputting errors to the console when uncaught Promise errors occur.
782 *
783 * By default, if an uncaught Promise error occurs, `zone.js` outputs the
784 * error to the console by calling `console.error()`.
785 *
786 * If you set `__zone_symbol__ignoreConsoleErrorUncaughtError = true`, `zone.js` does not output
787 * the uncaught error to `console.error()`.
788 */
789 __zone_symbol__ignoreConsoleErrorUncaughtError?: boolean;
790}
Note: See TracBrowser for help on using the repository browser.