@keymanapp/kmc
Version:
Keyman Developer compiler command line tools
51 lines • 2.08 kB
TypeScript
import { CompilerCallbacks, CompilerEvent, CompilerPathCallbacks, CompilerFileSystemCallbacks, CompilerCallbackOptions, CompilerNetAsyncCallbacks, CompilerFileSystemAsyncCallbacks } from '@keymanapp/developer-utils';
import chalk from 'chalk';
/**
* Concrete implementation for CLI use
*/
export declare class NodeCompilerCallbacks implements CompilerCallbacks {
private options;
private readonly _net;
private readonly _fsAsync;
messages: CompilerEvent[];
messageCount: number;
messageFilename: string;
maxLogMessages: number;
constructor(options: CompilerCallbackOptions);
clear(): void;
/**
* Returns true if any message in the log is a Fatal, Error, or if we are
* treating warnings as errors, a Warning. The warning option will be taken
* from the CompilerOptions passed to the constructor, or the parameter, to
* allow for per-file overrides (as seen with projects, for example).
* @param compilerWarningsAsErrors
* @returns
*/
hasFailureMessage(compilerWarningsAsErrors?: boolean): boolean;
hasMessage(code: number): boolean;
private verifyFilenameConsistency;
loadFile(filename: string): Uint8Array;
fileSize(filename: string): number;
isDirectory(filename: string): boolean;
get path(): CompilerPathCallbacks;
get fs(): CompilerFileSystemCallbacks;
get net(): CompilerNetAsyncCallbacks;
get fsAsync(): CompilerFileSystemAsyncCallbacks;
fileURLToPath(url: string | URL): string;
reportMessage(event: CompilerEvent): void;
private printMessage;
private printTsvMessage;
private printFormattedMessage;
/**
* We treat a few certain infrastructure messages with special colours
* @param event
* @returns
*/
messageSpecialColor(event: CompilerEvent): chalk.Chalk & {
supportsColor: chalk.ColorSupport;
};
debug(msg: string): void;
fileExists(filename: string): boolean;
resolveFilename(baseFilename: string, filename: string): string;
}
//# sourceMappingURL=NodeCompilerCallbacks.d.ts.map