1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | /// <reference types="packages/angular_devkit/build_angular/src/babel-bazel" />
|
---|
9 | import { PluginObj } from '@babel/core';
|
---|
10 | export interface ProcessBundleOptions {
|
---|
11 | filename: string;
|
---|
12 | code: string;
|
---|
13 | map?: string;
|
---|
14 | name: string;
|
---|
15 | sourceMaps?: boolean;
|
---|
16 | hiddenSourceMaps?: boolean;
|
---|
17 | vendorSourceMaps?: boolean;
|
---|
18 | runtime?: boolean;
|
---|
19 | optimize?: boolean;
|
---|
20 | optimizeOnly?: boolean;
|
---|
21 | ignoreOriginal?: boolean;
|
---|
22 | cacheKeys?: (string | undefined)[];
|
---|
23 | integrityAlgorithm?: 'sha256' | 'sha384' | 'sha512';
|
---|
24 | runtimeData?: ProcessBundleResult[];
|
---|
25 | replacements?: [string, string][];
|
---|
26 | supportedBrowsers?: string[] | Record<string, string>;
|
---|
27 | memoryMode?: boolean;
|
---|
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 | content?: string;
|
---|
40 | map?: {
|
---|
41 | filename: string;
|
---|
42 | size: number;
|
---|
43 | content?: string;
|
---|
44 | };
|
---|
45 | }
|
---|
46 | export declare const enum CacheKey {
|
---|
47 | OriginalCode = 0,
|
---|
48 | OriginalMap = 1,
|
---|
49 | DownlevelCode = 2,
|
---|
50 | DownlevelMap = 3
|
---|
51 | }
|
---|
52 | export declare function process(options: ProcessBundleOptions): Promise<ProcessBundleResult>;
|
---|
53 | export declare function createI18nPlugins(locale: string, translation: unknown | undefined, missingTranslation: 'error' | 'warning' | 'ignore', shouldInline: boolean, localeDataContent?: string): Promise<{
|
---|
54 | diagnostics: import("@angular/localize/src/tools/src/diagnostics").Diagnostics;
|
---|
55 | plugins: PluginObj<import("@babel/core").PluginPass>[];
|
---|
56 | }>;
|
---|
57 | export interface InlineOptions {
|
---|
58 | filename: string;
|
---|
59 | code: string;
|
---|
60 | map?: string;
|
---|
61 | es5: boolean;
|
---|
62 | outputPath: string;
|
---|
63 | missingTranslation?: 'warning' | 'error' | 'ignore';
|
---|
64 | setLocale?: boolean;
|
---|
65 | }
|
---|
66 | export declare function inlineLocales(options: InlineOptions): Promise<{
|
---|
67 | file: string;
|
---|
68 | diagnostics: {
|
---|
69 | type: "error" | "warning";
|
---|
70 | message: string;
|
---|
71 | }[];
|
---|
72 | count: number;
|
---|
73 | } | {
|
---|
74 | file: string;
|
---|
75 | diagnostics: {
|
---|
76 | type: "error" | "warning";
|
---|
77 | message: string;
|
---|
78 | }[];
|
---|
79 | }>;
|
---|