mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-21 00:28:23 +08:00
Merge pull request #6692 from vicb/1109-zone.js
add typings for zone.js
This commit is contained in:
11
zone.js/zone.js-tests.ts
Normal file
11
zone.js/zone.js-tests.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
/// <reference path="zone.js.d.ts" />
|
||||
|
||||
declare var zone: Zone;
|
||||
|
||||
zone.fork().fork({
|
||||
beforeTask: function () {
|
||||
console.log('from beforeTask');
|
||||
}
|
||||
}).run(function () {
|
||||
console.log('from main');
|
||||
});
|
||||
21
zone.js/zone.js.d.ts
vendored
Normal file
21
zone.js/zone.js.d.ts
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
// Type definitions for Zone.js
|
||||
// Project: https://github.com/angular/zone.js
|
||||
// Definitions by: angular team <https://github.com/angular/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../es6-promise/es6-promise.d.ts"/>
|
||||
|
||||
declare class Zone {
|
||||
constructor(parentZone: Zone, data: any);
|
||||
|
||||
fork(locals?: {[key: string]: any}): Zone;
|
||||
bind(fn: Function, skipEnqueue?: boolean): void;
|
||||
bindOnce(fn: Function): any;
|
||||
run(fn: Function, applyTo?: any, applyWith?: any): void;
|
||||
isRootZone(): boolean;
|
||||
|
||||
static bindPromiseFn<T extends () => Promise<any>>(fn: T): T;
|
||||
|
||||
static longStackTraceZone: {[key: string]: any};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user