Update tests

This commit is contained in:
Mohamed Hegazy
2017-02-13 14:29:46 -08:00
parent 91ac4b29a1
commit 765e57b318
6 changed files with 10 additions and 13 deletions

View File

@@ -2,7 +2,7 @@
// and all the comments.
// Then it adds explicit `this` arguments to the static members.
// Tests by: Bart van der Schoor <https://github.com/Bartvds>
declare class Promise<R> implements Promise.Thenable<R> {
export declare class Promise<R> implements Promise.Thenable<R> {
constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable<R>) => void, reject: (error: any) => void) => void);
static try<R>(dit: typeof Promise, fn: () => Promise.Thenable<R>, args?: any[], ctx?: any): Promise<R>;
static try<R>(dit: typeof Promise, fn: () => R, args?: any[], ctx?: any): Promise<R>;
@@ -108,7 +108,7 @@ declare class Promise<R> implements Promise.Thenable<R> {
static filter<R>(dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise<R[]>;
}
declare module Promise {
export declare module Promise {
export interface Thenable<R> {
then<U>(onFulfilled: (value: R) => Thenable<U>, onRejected: (error: any) => Thenable<U>): Thenable<U>;
then<U>(onFulfilled: (value: R) => Thenable<U>, onRejected?: (error: any) => U): Thenable<U>;
@@ -118,9 +118,6 @@ declare module Promise {
}
declare module 'bluebird' {
export = Promise;
}
interface Foo {
a: number;
b: string;

View File

@@ -1,4 +1,4 @@
interface IPromise<T> {
export interface IPromise<T> {
then<U>(callback: (x: T) => IPromise<U>): IPromise<U>;
}
interface Promise<T> {

View File

@@ -1,7 +1,7 @@
interface IPromise<T, V> {
export interface IPromise<T, V> {
then<U, W>(callback: (x: T) => IPromise<U, W>): IPromise<U, W>;
}
interface Promise<T, V> {
export interface Promise<T, V> {
then<U, W>(callback: (x: T) => Promise<T, U>): Promise<T, W>;
}

View File

@@ -1,7 +1,7 @@
interface IPromise<T, V> {
export interface IPromise<T, V> {
then<U, W>(callback: (x: T) => IPromise<U, W>): IPromise<U, W>;
}
interface Promise<T, V> {
export interface Promise<T, V> {
then<U, W>(callback: (x: T) => Promise<any, any>): Promise<any, any>;
}

View File

@@ -1,4 +1,4 @@
interface IPromise<T, V> {
export interface IPromise<T, V> {
then<U, W>(callback: (x: T) => IPromise<U, W>): IPromise<U, W>;
}
interface Promise<T, V> {

View File

@@ -1,7 +1,7 @@
interface IPromise<T, V> {
export interface IPromise<T, V> {
then<U extends T, W extends V>(callback: (x: T) => IPromise<U, W>): IPromise<U, W>;
}
interface Promise<T, V> {
export interface Promise<T, V> {
then<U extends T, W extends V>(callback: (x: T) => Promise<U, W>): Promise<U, W>;
}