1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | import { PluginObj } from '@babel/core';
|
10 | import { I18nOptions } from './i18n-options';
|
11 | export interface ProcessBundleOptions {
|
12 | filename: string;
|
13 | code: string;
|
14 | map?: string;
|
15 | name: string;
|
16 | sourceMaps?: boolean;
|
17 | hiddenSourceMaps?: boolean;
|
18 | vendorSourceMaps?: boolean;
|
19 | runtime?: boolean;
|
20 | optimize?: boolean;
|
21 | optimizeOnly?: boolean;
|
22 | ignoreOriginal?: boolean;
|
23 | cacheKeys?: (string | undefined)[];
|
24 | integrityAlgorithm?: 'sha256' | 'sha384' | 'sha512';
|
25 | runtimeData?: ProcessBundleResult[];
|
26 | replacements?: [string, string][];
|
27 | supportedBrowsers?: string[] | Record<string, string>;
|
28 | }
|
29 | export interface ProcessBundleResult {
|
30 | name: string;
|
31 | integrity?: string;
|
32 | original?: ProcessBundleFile;
|
33 | downlevel?: ProcessBundleFile;
|
34 | }
|
35 | export interface ProcessBundleFile {
|
36 | filename: string;
|
37 | size: number;
|
38 | integrity?: string;
|
39 | map?: {
|
40 | filename: string;
|
41 | size: number;
|
42 | };
|
43 | }
|
44 | export declare const enum CacheKey {
|
45 | OriginalCode = 0,
|
46 | OriginalMap = 1,
|
47 | DownlevelCode = 2,
|
48 | DownlevelMap = 3
|
49 | }
|
50 | export declare function setup(data: number[] | {
|
51 | cachePath: string;
|
52 | i18n: I18nOptions;
|
53 | }): void;
|
54 | export declare function process(options: ProcessBundleOptions): Promise<ProcessBundleResult>;
|
55 | export declare function createI18nPlugins(locale: string, translation: unknown | undefined, missingTranslation: 'error' | 'warning' | 'ignore', shouldInline: boolean, localeDataContent?: string): Promise<{
|
56 | diagnostics: import("@angular/localize/src/tools/src/diagnostics").Diagnostics;
|
57 | plugins: PluginObj<import("@babel/core").PluginPass>[];
|
58 | }>;
|
59 | export interface InlineOptions {
|
60 | filename: string;
|
61 | code: string;
|
62 | map?: string;
|
63 | es5: boolean;
|
64 | outputPath: string;
|
65 | missingTranslation?: 'warning' | 'error' | 'ignore';
|
66 | setLocale?: boolean;
|
67 | }
|
68 | export declare function inlineLocales(options: InlineOptions): Promise<{
|
69 | file: string;
|
70 | diagnostics: {
|
71 | type: "error" | "warning";
|
72 | message: string;
|
73 | }[];
|
74 | count: number;
|
75 | } | {
|
76 | file: string;
|
77 | diagnostics: {
|
78 | type: "error" | "warning";
|
79 | message: string;
|
80 | }[];
|
81 | }>;
|