mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Merge pull request #1166 from johnsoft/patch-1
Add any types to everything in Q.d.ts so it works with --noImplicitAny
This commit is contained in:
72
q/Q.d.ts
vendored
72
q/Q.d.ts
vendored
@@ -8,10 +8,10 @@ declare function Q<T>(promise: Q.IPromise<T>): Q.Promise<T>;
|
||||
|
||||
declare module Q {
|
||||
interface IPromise<T> {
|
||||
then<U>(onFulfill: (value: T) => IPromise<U>, onReject?: (reason) => IPromise<U>): IPromise<U>;
|
||||
then<U>(onFulfill: (value: T) => IPromise<U>, onReject?: (reason) => U): IPromise<U>;
|
||||
then<U>(onFulfill: (value: T) => U, onReject?: (reason) => IPromise<U>): IPromise<U>;
|
||||
then<U>(onFulfill: (value: T) => U, onReject?: (reason) => U): IPromise<U>;
|
||||
then<U>(onFulfill: (value: T) => IPromise<U>, onReject?: (reason: any) => IPromise<U>): IPromise<U>;
|
||||
then<U>(onFulfill: (value: T) => IPromise<U>, onReject?: (reason: any) => U): IPromise<U>;
|
||||
then<U>(onFulfill: (value: T) => U, onReject?: (reason: any) => IPromise<U>): IPromise<U>;
|
||||
then<U>(onFulfill: (value: T) => U, onReject?: (reason: any) => U): IPromise<U>;
|
||||
}
|
||||
|
||||
interface Deferred<T> {
|
||||
@@ -19,28 +19,28 @@ declare module Q {
|
||||
resolve(value: T): void;
|
||||
reject(reason: any): void;
|
||||
notify(value: any): void;
|
||||
makeNodeResolver(): (reason, value: T) => void;
|
||||
makeNodeResolver(): (reason: any, value: T) => void;
|
||||
}
|
||||
|
||||
interface Promise<T> {
|
||||
fin(finallyCallback: () => any): Promise<T>;
|
||||
finally(finallyCallback: () => any): Promise<T>;
|
||||
|
||||
then<U>(onFulfill: (value: T) => IPromise<U>, onReject?: (reason) => IPromise<U>, onProgress?: Function): Promise<U>;
|
||||
then<U>(onFulfill: (value: T) => IPromise<U>, onReject?: (reason) => U, onProgress?: Function): Promise<U>;
|
||||
then<U>(onFulfill: (value: T) => U, onReject?: (reason) => IPromise<U>, onProgress?: Function): Promise<U>;
|
||||
then<U>(onFulfill: (value: T) => U, onReject?: (reason) => U, onProgress?: Function): Promise<U>;
|
||||
then<U>(onFulfill: (value: T) => IPromise<U>, onReject?: (reason: any) => IPromise<U>, onProgress?: Function): Promise<U>;
|
||||
then<U>(onFulfill: (value: T) => IPromise<U>, onReject?: (reason: any) => U, onProgress?: Function): Promise<U>;
|
||||
then<U>(onFulfill: (value: T) => U, onReject?: (reason: any) => IPromise<U>, onProgress?: Function): Promise<U>;
|
||||
then<U>(onFulfill: (value: T) => U, onReject?: (reason: any) => U, onProgress?: Function): Promise<U>;
|
||||
|
||||
spread<U>(onFulfilled: Function, onRejected?: Function): Promise<U>;
|
||||
|
||||
fail<U>(onRejected: (reason) => U): Promise<U>;
|
||||
fail<U>(onRejected: (reason) => IPromise<U>): Promise<U>;
|
||||
catch<U>(onRejected: (reason) => U): Promise<U>;
|
||||
catch<U>(onRejected: (reason) => IPromise<U>): Promise<U>;
|
||||
fail<U>(onRejected: (reason: any) => U): Promise<U>;
|
||||
fail<U>(onRejected: (reason: any) => IPromise<U>): Promise<U>;
|
||||
catch<U>(onRejected: (reason: any) => U): Promise<U>;
|
||||
catch<U>(onRejected: (reason: any) => IPromise<U>): Promise<U>;
|
||||
|
||||
progress(onProgress: (progress) => any): Promise<T>;
|
||||
progress(onProgress: (progress: any) => any): Promise<T>;
|
||||
|
||||
done(onFulfilled?: (value: T) => any, onRejected?: (reason) => any, onProgress?: (progress) => any): void;
|
||||
done(onFulfilled?: (value: T) => any, onRejected?: (reason: any) => any, onProgress?: (progress: any) => any): void;
|
||||
|
||||
get<U>(propertyName: String): Promise<U>;
|
||||
set<U>(propertyName: String, value: any): Promise<U>;
|
||||
@@ -78,17 +78,17 @@ declare module Q {
|
||||
export function when<T, U>(value: T, onFulfilled: (val: T) => IPromise<U>): Promise<U>;
|
||||
export function when<T, U>(value: T, onFulfilled: (val: T) => U): Promise<U>;
|
||||
|
||||
export function when<T, U>(value: IPromise<T>, onFulfilled: (val: T) => IPromise<U>, onRejected?: (reason) => IPromise<U>, onProgress?: (progress) => any): Promise<U>;
|
||||
export function when<T, U>(value: IPromise<T>, onFulfilled: (val: T) => IPromise<U>, onRejected?: (reason) => U, onProgress?: (progress) => any): Promise<U>;
|
||||
export function when<T, U>(value: IPromise<T>, onFulfilled: (val: T) => U, onRejected?: (reason) => IPromise<U>, onProgress?: (progress) => any): Promise<U>;
|
||||
export function when<T, U>(value: IPromise<T>, onFulfilled: (val: T) => U, onRejected?: (reason) => U, onProgress?: (progress) => any): Promise<U>;
|
||||
export function when<T, U>(value: IPromise<T>, onFulfilled: (val: T) => IPromise<U>, onRejected?: (reason: any) => IPromise<U>, onProgress?: (progress: any) => any): Promise<U>;
|
||||
export function when<T, U>(value: IPromise<T>, onFulfilled: (val: T) => IPromise<U>, onRejected?: (reason: any) => U, onProgress?: (progress: any) => any): Promise<U>;
|
||||
export function when<T, U>(value: IPromise<T>, onFulfilled: (val: T) => U, onRejected?: (reason: any) => IPromise<U>, onProgress?: (progress: any) => any): Promise<U>;
|
||||
export function when<T, U>(value: IPromise<T>, onFulfilled: (val: T) => U, onRejected?: (reason: any) => U, onProgress?: (progress: any) => any): Promise<U>;
|
||||
|
||||
//export function try(method: Function, ...args: any[]): Promise<any>; // <- This is broken currently - not sure how to fix.
|
||||
|
||||
export function fbind<T>(method: (...args: any[]) => IPromise<T>, ...args: any[]): (...args: any[]) => Promise<T>;
|
||||
export function fbind<T>(method: (...args: any[]) => T, ...args: any[]): (...args: any[]) => Promise<T>;
|
||||
|
||||
export function fcall<T>(method: (...args) => T, ...args: any[]): Promise<T>;
|
||||
export function fcall<T>(method: (...args: any[]) => T, ...args: any[]): Promise<T>;
|
||||
|
||||
export function send<T>(obj: any, functionName: string, ...args: any[]): Promise<T>;
|
||||
export function invoke<T>(obj: any, functionName: string, ...args: any[]): Promise<T>;
|
||||
@@ -110,15 +110,15 @@ declare module Q {
|
||||
export function allResolved<T>(promises: any[]): Promise<Promise<T>[]>;
|
||||
export function allResolved<T>(promises: IPromise<T>[]): Promise<Promise<T>[]>;
|
||||
|
||||
export function spread<U>(promises: any[], onFulfilled: (...args: any[]) => IPromise<U>, onRejected: (reason) => IPromise<U>): Promise<U>;
|
||||
export function spread<U>(promises: any[], onFulfilled: (...args: any[]) => IPromise<U>, onRejected: (reason) => U): Promise<U>;
|
||||
export function spread<U>(promises: any[], onFulfilled: (...args: any[]) => U, onRejected: (reason) => IPromise<U>): Promise<U>;
|
||||
export function spread<U>(promises: any[], onFulfilled: (...args: any[]) => U, onRejected: (reason) => U): Promise<U>;
|
||||
export function spread<U>(promises: any[], onFulfilled: (...args: any[]) => IPromise<U>, onRejected: (reason: any) => IPromise<U>): Promise<U>;
|
||||
export function spread<U>(promises: any[], onFulfilled: (...args: any[]) => IPromise<U>, onRejected: (reason: any) => U): Promise<U>;
|
||||
export function spread<U>(promises: any[], onFulfilled: (...args: any[]) => U, onRejected: (reason: any) => IPromise<U>): Promise<U>;
|
||||
export function spread<U>(promises: any[], onFulfilled: (...args: any[]) => U, onRejected: (reason: any) => U): Promise<U>;
|
||||
|
||||
export function spread<T, U>(promises: IPromise<T>[], onFulfilled: (...args: T[]) => IPromise<U>, onRejected: (reason) => IPromise<U>): Promise<U>;
|
||||
export function spread<T, U>(promises: IPromise<T>[], onFulfilled: (...args: T[]) => IPromise<U>, onRejected: (reason) => U): Promise<U>;
|
||||
export function spread<T, U>(promises: IPromise<T>[], onFulfilled: (...args: T[]) => U, onRejected: (reason) => IPromise<U>): Promise<U>;
|
||||
export function spread<T, U>(promises: IPromise<T>[], onFulfilled: (...args: T[]) => U, onRejected: (reason) => U): Promise<U>;
|
||||
export function spread<T, U>(promises: IPromise<T>[], onFulfilled: (...args: T[]) => IPromise<U>, onRejected: (reason: any) => IPromise<U>): Promise<U>;
|
||||
export function spread<T, U>(promises: IPromise<T>[], onFulfilled: (...args: T[]) => IPromise<U>, onRejected: (reason: any) => U): Promise<U>;
|
||||
export function spread<T, U>(promises: IPromise<T>[], onFulfilled: (...args: T[]) => U, onRejected: (reason: any) => IPromise<U>): Promise<U>;
|
||||
export function spread<T, U>(promises: IPromise<T>[], onFulfilled: (...args: T[]) => U, onRejected: (reason: any) => U): Promise<U>;
|
||||
|
||||
export function timeout<T>(promise: Promise<T>, ms: number, message?: string): Promise<T>;
|
||||
|
||||
@@ -131,18 +131,18 @@ declare module Q {
|
||||
|
||||
export function defer<T>(): Deferred<T>;
|
||||
|
||||
export function reject(reason?): Promise<any>;
|
||||
export function reject(reason?: any): Promise<any>;
|
||||
|
||||
export function promise<T>(resolver: (resolve: (val: IPromise<T>) => void , reject: (reason) => void , notify: (progress) => void ) => void ): Promise<T>;
|
||||
export function promise<T>(resolver: (resolve: (val: T) => void , reject: (reason) => void , notify: (progress) => void ) => void ): Promise<T>;
|
||||
export function promise<T>(resolver: (resolve: (val: IPromise<T>) => void , reject: (reason: any) => void , notify: (progress: any) => void ) => void ): Promise<T>;
|
||||
export function promise<T>(resolver: (resolve: (val: T) => void , reject: (reason: any) => void , notify: (progress: any) => void ) => void ): Promise<T>;
|
||||
|
||||
export function promised<T>(callback: (...any) => T): (...any) => Promise<T>;
|
||||
export function promised<T>(callback: (...args: any[]) => T): (...args: any[]) => Promise<T>;
|
||||
|
||||
export function isPromise(object): boolean;
|
||||
export function isPromiseAlike(object): boolean;
|
||||
export function isPending(object): boolean;
|
||||
export function isPromise(object: any): boolean;
|
||||
export function isPromiseAlike(object: any): boolean;
|
||||
export function isPending(object: any): boolean;
|
||||
|
||||
export function async<T>(generatorFunction: any): (...args) => Promise<T>;
|
||||
export function async<T>(generatorFunction: any): (...args: any[]) => Promise<T>;
|
||||
export function nextTick(callback: Function): void;
|
||||
|
||||
export var oneerror: () => void;
|
||||
|
||||
Reference in New Issue
Block a user