mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Remove promise package (#16030)
This commit is contained in:
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
// Type definitions for promise v7.1.1
|
||||
// Project: https://www.promisejs.org/
|
||||
// Definitions by: Manuel Rueda <https://github.com/ManRueda>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export as namespace Promise;
|
||||
|
||||
export = Promise;
|
||||
declare var Promise: Promise.IPromise;
|
||||
|
||||
declare namespace Promise {
|
||||
export interface IPromise {
|
||||
new <T>(resolver: (resolve: (value: T) => void, reject: (reason: any) => void) => void): IThenable<T>;
|
||||
|
||||
resolve: <T>(value: T) => IThenable<T>;
|
||||
reject: <T>(value: T) => IThenable<T>;
|
||||
all: (array: Array<IThenable<any>>) => IThenable<Array<any>>;
|
||||
denodeify: (fn: Function) => (...args: any[]) => IThenable<any>;
|
||||
nodeify: (fn: Function) => Function;
|
||||
}
|
||||
|
||||
export interface IThenable<T> {
|
||||
then<R>(onFulfilled?: (value: T) => IThenable<R>|R, onRejected?: (error: any) => IThenable<R>|R): IThenable<R>;
|
||||
catch<R>(onRejected?: (error: any) => IThenable<R>|R): IThenable<R>;
|
||||
done<R>(onFulfilled?: (value: T) => IThenable<R>|R, onRejected?: (error: any) => IThenable<R>|R): IThenable<R>;
|
||||
nodeify<R>(callback: Function): IThenable<R>;
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
var prom = new Promise<boolean>((resolve, reject) => {
|
||||
resolve(true);
|
||||
});
|
||||
|
||||
var prom2 = new Promise<boolean>((resolve, reject) => {
|
||||
resolve(true);
|
||||
});
|
||||
|
||||
prom.then((val) => {
|
||||
const b: boolean = val;
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
|
||||
var prom3 = Promise.all([prom, prom2]);
|
||||
|
||||
prom3.then((resolve: Array<any>) => {
|
||||
|
||||
});
|
||||
|
||||
function withCallback(arg: any, cb: (e: Error, result: any) => void): void {
|
||||
cb(null, arg);
|
||||
}
|
||||
var prom4 = Promise.denodeify(withCallback);
|
||||
prom4('test').then(result => result);
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"promise-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user