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
|
=== tests/cases/compiler/declFileTypeAnnotationTypeLiteral.ts ===
class c {
>c : c
}
class g<T> {
>g : g<T>
}
module m {
>m : typeof m
export class c {
>c : c
}
}
// Object literal with everything
var x: {
>x : { (a: number): c; (a: string): g<string>; new (a: number): c; new (a: string): m.c; [n: string]: c; [n: number]: c; a: c; b: g<string>; m1(): g<number>; m2(a: string, b?: number, ...c: c[]): string; }
// Call signatures
(a: number): c;
>a : number
(a: string): g<string>;
>a : string
// Construct signatures
new (a: number): c;
>a : number
new (a: string): m.c;
>a : string
>m : any
// Indexers
[n: number]: c;
>n : number
[n: string]: c;
>n : string
// Properties
a: c;
>a : c
b: g<string>;
>b : g<string>
// methods
m1(): g<number>;
>m1 : () => g<number>
m2(a: string, b?: number, ...c: c[]): string;
>m2 : (a: string, b?: number, ...c: c[]) => string
>a : string
>b : number
>c : c[]
};
// Function type
var y: (a: string) => string;
>y : (a: string) => string
>a : string
// constructor type
var z: new (a: string) => m.c;
>z : new (a: string) => m.c
>a : string
>m : any
|