UNPKG

1.15 kBTypeScriptView Raw
1export declare type ImportDeclaration<T = string> = {
2 outputPath: string;
3 importSource: ImportSource<T>;
4 baseOutputDir: string;
5 baseDir: string;
6 typesImport: boolean;
7 emitLegacyCommonJSImports: boolean;
8};
9export declare type ImportSource<T = string> = {
10 /**
11 * Source path, relative to the `baseOutputDir`
12 */
13 path: string;
14 /**
15 * Namespace to import source as
16 */
17 namespace?: string;
18 /**
19 * Entity names to import
20 */
21 identifiers?: T[];
22};
23export declare type FragmentImport = {
24 name: string;
25 kind: 'type' | 'document';
26};
27export declare function generateFragmentImportStatement(statement: ImportDeclaration<FragmentImport>, kind: 'type' | 'document' | 'both'): string;
28export declare function generateImportStatement(statement: ImportDeclaration): string;
29export declare function resolveRelativeImport(from: string, to: string): string;
30export declare function resolveImportSource<T>(source: string | ImportSource<T>): ImportSource<T>;
31export declare function clearExtension(path: string): string;
32export declare function fixLocalFilePath(path: string): string;