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 | }
|
---|
28 | export interface ProcessBundleResult {
|
---|
29 | name: string;
|
---|
30 | integrity?: string;
|
---|
31 | original?: ProcessBundleFile;
|
---|
32 | downlevel?: ProcessBundleFile;
|
---|
33 | }
|
---|
34 | export interface ProcessBundleFile {
|
---|
35 | filename: string;
|
---|
36 | size: number;
|
---|
37 | integrity?: string;
|
---|
38 | map?: {
|
---|
39 | filename: string;
|
---|
40 | size: number;
|
---|
41 | };
|
---|
42 | }
|
---|
43 | export declare const enum CacheKey {
|
---|
44 | OriginalCode = 0,
|
---|
45 | OriginalMap = 1,
|
---|
46 | DownlevelCode = 2,
|
---|
47 | DownlevelMap = 3
|
---|
48 | }
|
---|
49 | export declare function process(options: ProcessBundleOptions): Promise<ProcessBundleResult>;
|
---|
50 | export declare function createI18nPlugins(locale: string, translation: unknown | undefined, missingTranslation: 'error' | 'warning' | 'ignore', shouldInline: boolean, localeDataContent?: string): Promise<{
|
---|
51 | diagnostics: import("@angular/localize/src/tools/src/diagnostics").Diagnostics;
|
---|
52 | plugins: PluginObj<import("@babel/core").PluginPass>[];
|
---|
53 | }>;
|
---|
54 | export interface InlineOptions {
|
---|
55 | filename: string;
|
---|
56 | code: string;
|
---|
57 | map?: string;
|
---|
58 | es5: boolean;
|
---|
59 | outputPath: string;
|
---|
60 | missingTranslation?: 'warning' | 'error' | 'ignore';
|
---|
61 | setLocale?: boolean;
|
---|
62 | }
|
---|
63 | export declare function inlineLocales(options: InlineOptions): Promise<{
|
---|
64 | file: string;
|
---|
65 | diagnostics: {
|
---|
66 | type: "error" | "warning";
|
---|
67 | message: string;
|
---|
68 | }[];
|
---|
69 | count: number;
|
---|
70 | } | {
|
---|
71 | file: string;
|
---|
72 | diagnostics: {
|
---|
73 | type: "error" | "warning";
|
---|
74 | message: string;
|
---|
75 | }[];
|
---|
76 | }>;
|
---|