mirror of
https://github.com/swc-project/swc.git
synced 2024-12-01 01:13:56 +03:00
11 lines
192 B
TypeScript
11 lines
192 B
TypeScript
const enum TestType { foo, bar }
|
|
type TestTypeStr = keyof typeof TestType;
|
|
|
|
function f1(f: TestType) { }
|
|
function f2(f: TestTypeStr) { }
|
|
|
|
f1(TestType.foo)
|
|
f1(TestType.bar)
|
|
f2('foo')
|
|
f2('bar')
|