UNPKG

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