///
import { Chalk } from "chalk";
export interface CommonConfig {
readonly baselines?: string | Results;
readonly reporters?: readonly ReporterConfig[];
}
export interface ScanConfig extends CommonConfig {
readonly budgets: BudgetsConfig;
readonly cwd?: string;
}
export interface LoadConfig extends CommonConfig {
readonly results: string | Results;
}
export interface BudgetsConfig {
readonly [path: string]: string;
}
export declare type ReporterConfig = string | readonly [string, object];
export interface Results {
readonly [path: string]: Result;
}
declare type Writable = {
-readonly [K in keyof T]: T[K];
};
export declare type WritableResults = Writable;
export interface Result {
readonly path: string;
readonly size: number;
readonly maxSize: number;
}
export interface ReturnValues {
readonly results: Results;
readonly anyOverBudget: boolean;
readonly anyUnderBaseline: boolean;
readonly anyOverBaseline: boolean;
}
export declare type InputStream = NodeJS.ReadableStream;
export declare type OutputStream = NodeJS.WritableStream;
export interface ReporterConstructor {
new (options?: object): Reporter;
}
export interface Reporter {
onRunStart(): Promise | void;
onResult(result: Result, baseline?: Result): Promise | void;
onRunComplete(results: Results, baselines?: Results): Promise | void;
}
export interface OutputContext {
readonly colors: Chalk;
readonly colorOverride?: Chalk;
readonly maxPathLength: number;
readonly verbose: boolean;
}
export interface ResultsContext {
readonly results: Results;
readonly baselines?: Results;
readonly outputContext: OutputContext;
}
export declare type ResultsWithBaselinesContext = Required;
export interface ResultContext {
readonly result: Result;
readonly baseline?: Result;
readonly outputContext: OutputContext;
}
export declare type ResultWithBaselineContext = Required;
export {};