Skip to content

Commit d7ae0df

Browse files
committed
Move interface Promise<T> declaration to es5.d.ts
1 parent bc1058e commit d7ae0df

File tree

2 files changed

+51
-50
lines changed

2 files changed

+51
-50
lines changed

src/lib/es2015.promise.d.ts

-50
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,3 @@
1-
/**
2-
* Represents the completion of an asynchronous operation
3-
*/
4-
interface Promise<T> {
5-
/**
6-
* Attaches callbacks for the resolution and/or rejection of the Promise.
7-
* @param onfulfilled The callback to execute when the Promise is resolved.
8-
* @param onrejected The callback to execute when the Promise is rejected.
9-
* @returns A Promise for the completion of which ever callback is executed.
10-
*/
11-
then(onfulfilled?: ((value: T) => T | PromiseLike<T>) | undefined | null, onrejected?: ((reason: any) => T | PromiseLike<T>) | undefined | null): Promise<T>;
12-
13-
/**
14-
* Attaches callbacks for the resolution and/or rejection of the Promise.
15-
* @param onfulfilled The callback to execute when the Promise is resolved.
16-
* @param onrejected The callback to execute when the Promise is rejected.
17-
* @returns A Promise for the completion of which ever callback is executed.
18-
*/
19-
then<TResult>(onfulfilled: ((value: T) => T | PromiseLike<T>) | undefined | null, onrejected: (reason: any) => TResult | PromiseLike<TResult>): Promise<T | TResult>;
20-
21-
/**
22-
* Attaches callbacks for the resolution and/or rejection of the Promise.
23-
* @param onfulfilled The callback to execute when the Promise is resolved.
24-
* @param onrejected The callback to execute when the Promise is rejected.
25-
* @returns A Promise for the completion of which ever callback is executed.
26-
*/
27-
then<TResult>(onfulfilled: (value: T) => TResult | PromiseLike<TResult>, onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<TResult>;
28-
29-
/**
30-
* Attaches callbacks for the resolution and/or rejection of the Promise.
31-
* @param onfulfilled The callback to execute when the Promise is resolved.
32-
* @param onrejected The callback to execute when the Promise is rejected.
33-
* @returns A Promise for the completion of which ever callback is executed.
34-
*/
35-
then<TResult1, TResult2>(onfulfilled: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>;
36-
37-
/**
38-
* Attaches a callback for only the rejection of the Promise.
39-
* @param onrejected The callback to execute when the Promise is rejected.
40-
* @returns A Promise for the completion of the callback.
41-
*/
42-
catch(onrejected?: ((reason: any) => T | PromiseLike<T>) | undefined | null): Promise<T>;
43-
44-
/**
45-
* Attaches a callback for only the rejection of the Promise.
46-
* @param onrejected The callback to execute when the Promise is rejected.
47-
* @returns A Promise for the completion of the callback.
48-
*/
49-
catch<TResult>(onrejected: (reason: any) => TResult | PromiseLike<TResult>): Promise<T | TResult>;
50-
}
511

522
interface PromiseConstructor {
533
/**

src/lib/es5.d.ts

+51
Original file line numberDiff line numberDiff line change
@@ -1351,6 +1351,57 @@ interface PromiseLike<T> {
13511351
onrejected: (reason: any) => TResult2 | PromiseLike<TResult2>): PromiseLike<TResult1 | TResult2>;
13521352
}
13531353

1354+
/**
1355+
* Represents the completion of an asynchronous operation
1356+
*/
1357+
interface Promise<T> {
1358+
/**
1359+
* Attaches callbacks for the resolution and/or rejection of the Promise.
1360+
* @param onfulfilled The callback to execute when the Promise is resolved.
1361+
* @param onrejected The callback to execute when the Promise is rejected.
1362+
* @returns A Promise for the completion of which ever callback is executed.
1363+
*/
1364+
then(onfulfilled?: ((value: T) => T | PromiseLike<T>) | undefined | null, onrejected?: ((reason: any) => T | PromiseLike<T>) | undefined | null): Promise<T>;
1365+
1366+
/**
1367+
* Attaches callbacks for the resolution and/or rejection of the Promise.
1368+
* @param onfulfilled The callback to execute when the Promise is resolved.
1369+
* @param onrejected The callback to execute when the Promise is rejected.
1370+
* @returns A Promise for the completion of which ever callback is executed.
1371+
*/
1372+
then<TResult>(onfulfilled: ((value: T) => T | PromiseLike<T>) | undefined | null, onrejected: (reason: any) => TResult | PromiseLike<TResult>): Promise<T | TResult>;
1373+
1374+
/**
1375+
* Attaches callbacks for the resolution and/or rejection of the Promise.
1376+
* @param onfulfilled The callback to execute when the Promise is resolved.
1377+
* @param onrejected The callback to execute when the Promise is rejected.
1378+
* @returns A Promise for the completion of which ever callback is executed.
1379+
*/
1380+
then<TResult>(onfulfilled: (value: T) => TResult | PromiseLike<TResult>, onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<TResult>;
1381+
1382+
/**
1383+
* Attaches callbacks for the resolution and/or rejection of the Promise.
1384+
* @param onfulfilled The callback to execute when the Promise is resolved.
1385+
* @param onrejected The callback to execute when the Promise is rejected.
1386+
* @returns A Promise for the completion of which ever callback is executed.
1387+
*/
1388+
then<TResult1, TResult2>(onfulfilled: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected: (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>;
1389+
1390+
/**
1391+
* Attaches a callback for only the rejection of the Promise.
1392+
* @param onrejected The callback to execute when the Promise is rejected.
1393+
* @returns A Promise for the completion of the callback.
1394+
*/
1395+
catch(onrejected?: ((reason: any) => T | PromiseLike<T>) | undefined | null): Promise<T>;
1396+
1397+
/**
1398+
* Attaches a callback for only the rejection of the Promise.
1399+
* @param onrejected The callback to execute when the Promise is rejected.
1400+
* @returns A Promise for the completion of the callback.
1401+
*/
1402+
catch<TResult>(onrejected: (reason: any) => TResult | PromiseLike<TResult>): Promise<T | TResult>;
1403+
}
1404+
13541405
interface ArrayLike<T> {
13551406
readonly length: number;
13561407
readonly [n: number]: T;

0 commit comments

Comments
 (0)