-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathprocess-bundle.d.ts
68 lines (68 loc) · 1.73 KB
/
process-bundle.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { I18nOptions } from './i18n-options';
export interface ProcessBundleOptions {
filename: string;
code: string;
map?: string;
name: string;
sourceMaps?: boolean;
hiddenSourceMaps?: boolean;
vendorSourceMaps?: boolean;
runtime?: boolean;
optimize?: boolean;
optimizeOnly?: boolean;
ignoreOriginal?: boolean;
cacheKeys?: (string | undefined)[];
integrityAlgorithm?: 'sha256' | 'sha384' | 'sha512';
runtimeData?: ProcessBundleResult[];
replacements?: [string, string][];
supportedBrowsers?: string[] | Record<string, string>;
}
export interface ProcessBundleResult {
name: string;
integrity?: string;
original?: ProcessBundleFile;
downlevel?: ProcessBundleFile;
}
export interface ProcessBundleFile {
filename: string;
size: number;
integrity?: string;
map?: {
filename: string;
size: number;
};
}
export declare const enum CacheKey {
OriginalCode = 0,
OriginalMap = 1,
DownlevelCode = 2,
DownlevelMap = 3
}
export declare function setup(data: number[] | {
cachePath: string;
i18n: I18nOptions;
}): void;
export declare function process(options: ProcessBundleOptions): Promise<ProcessBundleResult>;
export interface InlineOptions {
filename: string;
code: string;
map?: string;
es5: boolean;
outputPath: string;
missingTranslation?: 'warning' | 'error' | 'ignore';
setLocale?: boolean;
}
export declare function inlineLocales(options: InlineOptions): Promise<{
file: string;
diagnostics: {
type: "error" | "warning";
message: string;
}[];
count: number;
} | {
file: string;
diagnostics: {
type: "error" | "warning";
message: string;
}[];
}>;