forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathamdDeclarationEmitNoExtraDeclare.types
More file actions
60 lines (50 loc) · 1.9 KB
/
amdDeclarationEmitNoExtraDeclare.types
File metadata and controls
60 lines (50 loc) · 1.9 KB
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
//// [tests/cases/compiler/amdDeclarationEmitNoExtraDeclare.ts] ////
=== Class.ts ===
import { Configurable } from "./Configurable"
>Configurable : <T extends import("Configurable").Constructor<{}>>(base: T) => T
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^^^^
export class HiddenClass {}
>HiddenClass : HiddenClass
> : ^^^^^^^^^^^
export class ActualClass extends Configurable(HiddenClass) {}
>ActualClass : ActualClass
> : ^^^^^^^^^^^
>Configurable(HiddenClass) : HiddenClass
> : ^^^^^^^^^^^
>Configurable : <T extends import("Configurable").Constructor<{}>>(base: T) => T
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^^^^
>HiddenClass : typeof HiddenClass
> : ^^^^^^^^^^^^^^^^^^
=== Configurable.ts ===
export type Constructor<T> = {
>Constructor : Constructor<T>
> : ^^^^^^^^^^^^^^
new(...args: any[]): T;
>args : any[]
> : ^^^^^
}
export function Configurable<T extends Constructor<{}>>(base: T): T {
>Configurable : <T extends Constructor<{}>>(base: T) => T
> : ^ ^^^^^^^^^ ^^ ^^ ^^^^^
>base : T
> : ^
return class extends base {
>class extends base { constructor(...args: any[]) { super(...args); } } : { new (...args: any[]): (Anonymous class); prototype: Configurable<any>.(Anonymous class); } & T
> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>base : {}
> : ^^
constructor(...args: any[]) {
>args : any[]
> : ^^^^^
super(...args);
>super(...args) : void
> : ^^^^
>super : T
> : ^
>...args : any
> : ^^^
>args : any[]
> : ^^^^^
}
};
}