UNPKG

928 BTypeScriptView Raw
1import type TokenProcessor from "../TokenProcessor";
2export interface DeclarationInfo {
3 typeDeclarations: Set<string>;
4 valueDeclarations: Set<string>;
5}
6export declare const EMPTY_DECLARATION_INFO: DeclarationInfo;
7/**
8 * Get all top-level identifiers that should be preserved when exported in TypeScript.
9 *
10 * Examples:
11 * - If an identifier is declared as `const x`, then `export {x}` should be preserved.
12 * - If it's declared as `type x`, then `export {x}` should be removed.
13 * - If it's declared as both `const x` and `type x`, then the export should be preserved.
14 * - Classes and enums should be preserved (even though they also introduce types).
15 * - Imported identifiers should be preserved since we don't have enough information to
16 * rule them out. --isolatedModules disallows re-exports, which catches errors here.
17 */
18export default function getDeclarationInfo(tokens: TokenProcessor): DeclarationInfo;