/
declarationEmitPromise.types
131 lines (116 loc) · 5.32 KB
/
declarationEmitPromise.types
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
=== tests/cases/compiler/declarationEmitPromise.ts ===
export class bluebird<T> {
>bluebird : bluebird<T>
static all: Array<bluebird<any>>;
>all : bluebird<any>[]
}
export async function runSampleWorks<A, B, C, D, E>(
>runSampleWorks : <A, B, C, D, E>(a: bluebird<A>, b?: bluebird<B>, c?: bluebird<C>, d?: bluebird<D>, e?: bluebird<E>) => Promise<(<T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T) => T)>
a: bluebird<A>, b?: bluebird<B>, c?: bluebird<C>, d?: bluebird<D>, e?: bluebird<E>) {
>a : bluebird<A>
>b : bluebird<B>
>c : bluebird<C>
>d : bluebird<D>
>e : bluebird<E>
let result = await (bluebird.all as any)([a, b, c, d, e].filter(el => !!el));
>result : any
>await (bluebird.all as any)([a, b, c, d, e].filter(el => !!el)) : any
>(bluebird.all as any)([a, b, c, d, e].filter(el => !!el)) : any
>(bluebird.all as any) : any
>bluebird.all as any : any
>bluebird.all : bluebird<any>[]
>bluebird : typeof bluebird
>all : bluebird<any>[]
>[a, b, c, d, e].filter(el => !!el) : bluebird<A>[]
>[a, b, c, d, e].filter : { <S extends bluebird<A>>(callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => value is S, thisArg?: any): S[]; (callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => unknown, thisArg?: any): bluebird<A>[]; }
>[a, b, c, d, e] : bluebird<A>[]
>a : bluebird<A>
>b : bluebird<B>
>c : bluebird<C>
>d : bluebird<D>
>e : bluebird<E>
>filter : { <S extends bluebird<A>>(callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => value is S, thisArg?: any): S[]; (callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => unknown, thisArg?: any): bluebird<A>[]; }
>el => !!el : (el: bluebird<A>) => boolean
>el : bluebird<A>
>!!el : boolean
>!el : boolean
>el : bluebird<A>
let func = <T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T): T =>
>func : <T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T) => T
><T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T): T => f.apply(this, result) : <T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T) => T
>f : (a: A, b?: B, c?: C, d?: D, e?: E) => T
>a : A
>b : B
>c : C
>d : D
>e : E
f.apply(this, result);
>f.apply(this, result) : any
>f.apply : (this: Function, thisArg: any, argArray?: any) => any
>f : (a: A, b?: B, c?: C, d?: D, e?: E) => T
>apply : (this: Function, thisArg: any, argArray?: any) => any
>this : any
>result : any
let rfunc: typeof func & {} = func as any; // <- This is the only difference
>rfunc : <T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T) => T
>func : <T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T) => T
>func as any : any
>func : <T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T) => T
return rfunc
>rfunc : <T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T) => T
}
export async function runSampleBreaks<A, B, C, D, E>(
>runSampleBreaks : <A, B, C, D, E>(a: bluebird<A>, b?: bluebird<B>, c?: bluebird<C>, d?: bluebird<D>, e?: bluebird<E>) => Promise<(<T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T) => T)>
a: bluebird<A>, b?: bluebird<B>, c?: bluebird<C>, d?: bluebird<D>, e?: bluebird<E>) {
>a : bluebird<A>
>b : bluebird<B>
>c : bluebird<C>
>d : bluebird<D>
>e : bluebird<E>
let result = await (bluebird.all as any)([a, b, c, d, e].filter(el => !!el));
>result : any
>await (bluebird.all as any)([a, b, c, d, e].filter(el => !!el)) : any
>(bluebird.all as any)([a, b, c, d, e].filter(el => !!el)) : any
>(bluebird.all as any) : any
>bluebird.all as any : any
>bluebird.all : bluebird<any>[]
>bluebird : typeof bluebird
>all : bluebird<any>[]
>[a, b, c, d, e].filter(el => !!el) : bluebird<A>[]
>[a, b, c, d, e].filter : { <S extends bluebird<A>>(callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => value is S, thisArg?: any): S[]; (callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => unknown, thisArg?: any): bluebird<A>[]; }
>[a, b, c, d, e] : bluebird<A>[]
>a : bluebird<A>
>b : bluebird<B>
>c : bluebird<C>
>d : bluebird<D>
>e : bluebird<E>
>filter : { <S extends bluebird<A>>(callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => value is S, thisArg?: any): S[]; (callbackfn: (value: bluebird<A>, index: number, array: bluebird<A>[]) => unknown, thisArg?: any): bluebird<A>[]; }
>el => !!el : (el: bluebird<A>) => boolean
>el : bluebird<A>
>!!el : boolean
>!el : boolean
>el : bluebird<A>
let func = <T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T): T =>
>func : <T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T) => T
><T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T): T => f.apply(this, result) : <T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T) => T
>f : (a: A, b?: B, c?: C, d?: D, e?: E) => T
>a : A
>b : B
>c : C
>d : D
>e : E
f.apply(this, result);
>f.apply(this, result) : any
>f.apply : (this: Function, thisArg: any, argArray?: any) => any
>f : (a: A, b?: B, c?: C, d?: D, e?: E) => T
>apply : (this: Function, thisArg: any, argArray?: any) => any
>this : any
>result : any
let rfunc: typeof func = func as any; // <- This is the only difference
>rfunc : <T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T) => T
>func : <T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T) => T
>func as any : any
>func : <T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T) => T
return rfunc
>rfunc : <T>(f: (a: A, b?: B, c?: C, d?: D, e?: E) => T) => T
}