diff --git a/mithril/mithril.d.ts b/mithril/mithril.d.ts index d106025ba..525ded3aa 100644 --- a/mithril/mithril.d.ts +++ b/mithril/mithril.d.ts @@ -20,9 +20,9 @@ interface MithrilStatic { route(path: string, params?: any, shouldReplaceHistory?: boolean): void; route(): string; route(element: Element, isInitialized: boolean): void; - request(options: MithrilXHROptions): MithrilPromise; - deferred(): MithrilDeferred; - sync(promises: MithrilPromise[]): MithrilPromise; + request(options: MithrilXHROptions): MithrilPromise; + deferred(): MithrilDeferred; + sync(promises: MithrilPromise[]): MithrilPromise; startComputation(): void; endComputation(): void; } @@ -43,15 +43,15 @@ interface MithrilModule { view: Function; } -interface MithrilDeferred { - resolve(value?: any): void; - reject(value?: any): void; - promise: MithrilPromise; +interface MithrilDeferred { + resolve(value?: T): void; + reject(value?: any): void; + promise: MithrilPromise; } -interface MithrilPromise { - (value?: any): any; - then(successCallback?: (value: any) => any, errorCallback?: (value: any) => any): MithrilPromise; +interface MithrilPromise { + (value?: T): T; + then(successCallback?: (value: T) => R, errorCallback?: (value: any) => any): MithrilPromise; } interface MithrilXHROptions {