1 |
|
2 | import type { Range, RangeOptions } from '@umijs/utils/compiled/semver';
|
3 | import Cache from 'file-system-cache';
|
4 | import type { RunLoaderOption as InternalRunLoaderOption, RunLoaderResult } from '../compiled/loader-runner';
|
5 | export type * from '../compiled/loader-runner';
|
6 | export { getContext } from '../compiled/loader-runner';
|
7 |
|
8 |
|
9 |
|
10 | export declare function getFileIdFromFsPath(fsPath: string): string;
|
11 |
|
12 |
|
13 |
|
14 | export declare const getFileRangeLines: (content: string, range: string) => string;
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | export declare const getFileContentByRegExp: (content: string, regexp: string, filePath: string) => string;
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | export declare function parseCodeFrontmatter(raw: string): {
|
27 | code: string;
|
28 | frontmatter: Record<string, any> | null;
|
29 | };
|
30 | declare const caches: Record<string, ReturnType<typeof Cache>>;
|
31 | export declare function _setFSCacheDir(dir: string): void;
|
32 | export declare function getCache(ns: string): (typeof caches)['0'];
|
33 |
|
34 |
|
35 |
|
36 | export declare function tryFatherBuildConfigs(cwd: string): Promise<any[]>;
|
37 |
|
38 |
|
39 |
|
40 | export declare function getProjectRoot(cwd: string): string;
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 | export declare function componentToChunkName(component: string, cwdPath?: string): string;
|
50 | export declare function generateMetaChunkName(path: string, cwd: string, locales?: string[]): string;
|
51 |
|
52 |
|
53 |
|
54 | export declare function getContentHash(content: string, length?: number): string;
|
55 | export type RunLoaderOption = Partial<InternalRunLoaderOption>;
|
56 | export declare function runLoaders(options: RunLoaderOption): Promise<RunLoaderResult>;
|
57 | export declare function runLoaders(options: RunLoaderOption, callback: undefined): Promise<RunLoaderResult>;
|
58 | export declare function runLoaders(options: RunLoaderOption, callback: (err: NodeJS.ErrnoException | null, result: RunLoaderResult) => any): void;
|
59 |
|
60 |
|
61 |
|
62 | export declare function isVersionInRange(version: string, range: string | Range, options?: RangeOptions): boolean;
|