32 lines
713 B
TypeScript
32 lines
713 B
TypeScript
import * as plugins from "./mod.plugins.js";
|
|
import { FormatStats } from "./classes.formatstats.js";
|
|
|
|
interface IFormatContextOptions {
|
|
interactive?: boolean;
|
|
jsonOutput?: boolean;
|
|
}
|
|
|
|
export class FormatContext {
|
|
private formatStats: FormatStats;
|
|
private interactive: boolean;
|
|
private jsonOutput: boolean;
|
|
|
|
constructor(options: IFormatContextOptions = {}) {
|
|
this.formatStats = new FormatStats();
|
|
this.interactive = options.interactive ?? true;
|
|
this.jsonOutput = options.jsonOutput ?? false;
|
|
}
|
|
|
|
getFormatStats(): FormatStats {
|
|
return this.formatStats;
|
|
}
|
|
|
|
isInteractive(): boolean {
|
|
return this.interactive;
|
|
}
|
|
|
|
isJsonOutput(): boolean {
|
|
return this.jsonOutput;
|
|
}
|
|
}
|