add typings for zone.js

This commit is contained in:
Victor Berchet
2015-11-09 14:46:11 -08:00
parent 421d6610bd
commit b923a5aaf0
2 changed files with 32 additions and 0 deletions
+11
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
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};
}