b05dde747c
* Change type-only semantics to allow type queries * Don’t error using type-only import in ambient context * Fix default import * Fix namespace import * Update more baselines * Prevent circular resolution * Track const enum expression usage * Update baselines * Perf tuning 1 * Test commit for perf impact * Weave type-only alias declaration finding into alias resolution * Fix namespace import of type-only exported symbols * type-only exports do not contribute to the module object type * Update APIs * Fix enum casing, remove type-only conversion suggestion * Short circuit type-only checks in resolveEntityName faster * Fix casing in API * Remove unused parameter * Fix error on qualified names in type queries * Allow type-only imports in computed property names * Fix computed property names of types and abstract members * Remove unused util * Commit missing baselines * Rename “check” functions so as not to overload the word “check”
53 lines
1.1 KiB
TypeScript
53 lines
1.1 KiB
TypeScript
//// [tests/cases/conformance/externalModules/typeOnly/enums.ts] ////
|
|
|
|
//// [a.ts]
|
|
enum SyntaxKind {
|
|
ImportClause,
|
|
ExportDeclaration
|
|
}
|
|
|
|
const enum SymbolFlags {
|
|
Type = "Type",
|
|
Value = "Value"
|
|
}
|
|
|
|
export type { SyntaxKind };
|
|
export { SymbolFlags };
|
|
|
|
//// [b.ts]
|
|
import type { SyntaxKind, SymbolFlags } from './a';
|
|
|
|
SyntaxKind.ImportClause;
|
|
SymbolFlags.Type;
|
|
let kind: SyntaxKind.ImportClause;
|
|
let flags: SymbolFlags;
|
|
|
|
type TypeFlag = SymbolFlags.Type;
|
|
export type { TypeFlag };
|
|
|
|
//// [c.ts]
|
|
import { SymbolFlags } from './a';
|
|
import type { TypeFlag } from './b';
|
|
const flags: TypeFlag = SymbolFlags.Type;
|
|
|
|
|
|
//// [a.js]
|
|
"use strict";
|
|
exports.__esModule = true;
|
|
var SyntaxKind;
|
|
(function (SyntaxKind) {
|
|
SyntaxKind[SyntaxKind["ImportClause"] = 0] = "ImportClause";
|
|
SyntaxKind[SyntaxKind["ExportDeclaration"] = 1] = "ExportDeclaration";
|
|
})(SyntaxKind || (SyntaxKind = {}));
|
|
//// [b.js]
|
|
"use strict";
|
|
exports.__esModule = true;
|
|
SyntaxKind.ImportClause;
|
|
"Type" /* Type */;
|
|
var kind;
|
|
var flags;
|
|
//// [c.js]
|
|
"use strict";
|
|
exports.__esModule = true;
|
|
var flags = "Type" /* Type */;
|