-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathenumNamespaceConstantsDeclaration.types
More file actions
70 lines (60 loc) · 1.29 KB
/
enumNamespaceConstantsDeclaration.types
File metadata and controls
70 lines (60 loc) · 1.29 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
61
62
63
64
65
66
67
68
69
70
//// [tests/cases/compiler/enumNamespaceConstantsDeclaration.ts] ////
=== enumNamespaceConstantsDeclaration.ts ===
// Test for constant declarations inside namespace merged with enum
enum Foo {
>Foo : Foo
> : ^^^
bar
>bar : Foo.bar
> : ^^^^^^^
}
namespace Foo {
>Foo : typeof Foo
> : ^^^^^^^^^^
export const baz = Foo.bar;
>baz : Foo.bar
> : ^^^^^^^
>Foo.bar : Foo
> : ^^^
>Foo : typeof Foo
> : ^^^^^^^^^^
>bar : Foo
> : ^^^
}
// Multiple enum members
enum MyEnum {
>MyEnum : MyEnum
> : ^^^^^^
First = 1,
>First : MyEnum.First
> : ^^^^^^^^^^^^
>1 : 1
> : ^
Second = 2
>Second : MyEnum.Second
> : ^^^^^^^^^^^^^
>2 : 2
> : ^
}
namespace MyEnum {
>MyEnum : typeof MyEnum
> : ^^^^^^^^^^^^^
export const value1 = MyEnum.First;
>value1 : MyEnum.First
> : ^^^^^^^^^^^^
>MyEnum.First : MyEnum.First
> : ^^^^^^^^^^^^
>MyEnum : typeof MyEnum
> : ^^^^^^^^^^^^^
>First : MyEnum.First
> : ^^^^^^^^^^^^
export const value2 = MyEnum.Second;
>value2 : MyEnum.Second
> : ^^^^^^^^^^^^^
>MyEnum.Second : MyEnum.Second
> : ^^^^^^^^^^^^^
>MyEnum : typeof MyEnum
> : ^^^^^^^^^^^^^
>Second : MyEnum.Second
> : ^^^^^^^^^^^^^
}