-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundle-calculator.d.ts
45 lines (45 loc) · 1.42 KB
/
bundle-calculator.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
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import { Budget as BudgetEntry, Type as BudgetType } from '../builders/application/schema';
export { type BudgetEntry, BudgetType };
export declare const BYTES_IN_KILOBYTE = 1000;
export interface Threshold {
limit: number;
type: ThresholdType;
severity: ThresholdSeverity;
}
declare enum ThresholdType {
Max = "maximum",
Min = "minimum"
}
export declare enum ThresholdSeverity {
Warning = "warning",
Error = "error"
}
export interface BudgetCalculatorResult {
severity: ThresholdSeverity;
message: string;
label?: string;
}
export interface BudgetChunk {
files?: string[];
names?: string[];
initial?: boolean;
}
export interface BudgetAsset {
name: string;
size: number;
componentStyle?: boolean;
}
export interface BudgetStats {
chunks?: BudgetChunk[];
assets?: BudgetAsset[];
}
export declare function calculateThresholds(budget: BudgetEntry): IterableIterator<Threshold>;
export declare function checkBudgets(budgets: BudgetEntry[], stats: BudgetStats, checkComponentStyles?: boolean): IterableIterator<BudgetCalculatorResult>;
export declare function checkThresholds(thresholds: Iterable<Threshold>, size: number, label?: string): IterableIterator<BudgetCalculatorResult>;