Merge pull request #6692 from vicb/1109-zone.js

add typings for zone.js
This commit is contained in:
Alex Eagle
2015-11-09 16:05:13 -08:00
2 changed files with 32 additions and 0 deletions

11
zone.js/zone.js-tests.ts Normal file
View 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
View 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};
}