File: declarationEmitNonExportedBindingPattern.types

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (55 lines) | stat: -rw-r--r-- 1,364 bytes parent folder | download | duplicates (3)
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
=== tests/cases/compiler/test.ts ===
function getFoo() {
>getFoo : () => { foo: { test: number; }; }

  return { foo: { test: 42 } }
>{ foo: { test: 42 } } : { foo: { test: number; }; }
>foo : { test: number; }
>{ test: 42 } : { test: number; }
>test : number
>42 : 42
}

const { foo } = getFoo()
>foo : { test: number; }
>getFoo() : { foo: { test: number; }; }
>getFoo : () => { foo: { test: number; }; }

export type AliasType = typeof foo
>AliasType : { test: number; }
>foo : { test: number; }

const { foo: renamed } = getFoo()
>foo : any
>renamed : { test: number; }
>getFoo() : { foo: { test: number; }; }
>getFoo : () => { foo: { test: number; }; }

export type AliasType2 = typeof renamed
>AliasType2 : { test: number; }
>renamed : { test: number; }

function getNested() {
>getNested : () => { a: { b: { c: string; }; }; }

  return { a: { b: { c: 'd' } } }
>{ a: { b: { c: 'd' } } } : { a: { b: { c: string; }; }; }
>a : { b: { c: string; }; }
>{ b: { c: 'd' } } : { b: { c: string; }; }
>b : { c: string; }
>{ c: 'd' } : { c: string; }
>c : string
>'d' : "d"
}

const { a: { b: { c } } } = getNested()
>a : any
>b : any
>c : string
>getNested() : { a: { b: { c: string; }; }; }
>getNested : () => { a: { b: { c: string; }; }; }

export type AliasType3 = typeof c
>AliasType3 : string
>c : string