UNPKG

1.1 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};
8export declare type ImportSource<T = string> = {
9 /**
10 * Source path, relative to the `baseOutputDir`
11 */
12 path: string;
13 /**
14 * Namespace to import source as
15 */
16 namespace?: string;
17 /**
18 * Entity names to import
19 */
20 identifiers?: T[];
21};
22export declare type FragmentImport = {
23 name: string;
24 kind: 'type' | 'document';
25};
26export declare function generateFragmentImportStatement(statement: ImportDeclaration<FragmentImport>, kind: 'type' | 'document' | 'both'): string;
27export declare function generateImportStatement(statement: ImportDeclaration): string;
28export declare function resolveRelativeImport(from: string, to: string): string;
29export declare function resolveImportSource<T>(source: string | ImportSource<T>): ImportSource<T>;
30export declare function clearExtension(path: string): string;
31export declare function fixLocalFilePath(path: string): string;