///
import { Hook, Loader, Mapper, Matcher, StrictLoader, StrictLoaderWithOption } from '../../types/TemplateConfig';
import { AwaitEventEmitter, Logger, Tree } from '../../types/core';
import VariablesImpl from './Variables';
import { Stats } from 'fs';
export declare type Asset = {
value: Buffer | string | any;
meta: {
ext?: string;
mime?: string;
lstat: Stats;
filename: string;
};
loaders?: Array;
};
export default class Compiler extends AwaitEventEmitter {
logger: Logger;
root: string;
hookCwd: string;
includes: Matcher;
excludes: Matcher;
removeHook(hookName: string, hook?: Function): this;
addHook(hookName: string, hook: Hook, options?: {
type?: 'on' | 'once';
silent?: boolean;
}): Function;
constructor({ loaders, mappers, hookCwd, root, includes, excludes, }?: {
excludes?: Matcher;
includes?: Matcher;
loaders?: any;
mappers?: any;
root?: string;
hookCwd?: string;
});
addLoader(loaderId: string, loader: Loader): Compiler;
removeLoader(loaderId: string): Compiler;
assets: {
[path: string]: Asset;
};
static defaultLoaders: {
[loaderId: string]: Array;
};
static defaultMappers: Array;
loaders: {
[x: string]: (StrictLoader | StrictLoaderWithOption)[];
};
mappers: Mapper[];
variables: VariablesImpl;
private _matchedLoaders;
transform(input: any, loaders: Loader, path: string, highOrderOptions: object): Promise;
run(): Promise;
}