UNPKG

1.06 kBTypeScriptView Raw
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 */
8import { StatsCompilation } from 'webpack';
9import { Budget } from '../builders/browser/schema';
10interface Threshold {
11 limit: number;
12 type: ThresholdType;
13 severity: ThresholdSeverity;
14}
15declare enum ThresholdType {
16 Max = "maximum",
17 Min = "minimum"
18}
19export declare enum ThresholdSeverity {
20 Warning = "warning",
21 Error = "error"
22}
23export interface BudgetCalculatorResult {
24 severity: ThresholdSeverity;
25 message: string;
26 label?: string;
27}
28export declare function calculateThresholds(budget: Budget): IterableIterator<Threshold>;
29export declare function checkBudgets(budgets: Budget[], webpackStats: StatsCompilation): IterableIterator<BudgetCalculatorResult>;
30export declare function checkThresholds(thresholds: IterableIterator<Threshold>, size: number, label?: string): IterableIterator<BudgetCalculatorResult>;
31export {};