narraleaf
Version:
Create your visual novel with Electron and React
44 lines (43 loc) • 1.19 kB
TypeScript
import { Command } from "commander";
import { Logger } from "./logger";
import { PlatformInfo } from "../utils/pure/os";
import { ChildProcess } from "child_process";
type AppConfig = {
name: string;
version: string;
actions: CLIRegistry;
cliRoot: string;
cliDist: string;
};
type AppOptions = {
debug: boolean;
};
export type CLIRegistry = {
name: string;
command: Command;
action: (this: Command, app: App, options: any) => void;
}[];
export declare class App {
config: AppConfig;
static LogLevel: {
info: boolean;
warn: boolean;
error: boolean;
debug: boolean;
};
static createLogger(app: App): Logger;
process: NodeJS.Process | undefined;
private childProcesses;
constructor(config: AppConfig);
run(process: NodeJS.Process): Promise<Command>;
opts(): AppOptions;
getPlatform(): PlatformInfo;
getProcess(): NodeJS.Process;
resolvePath(p: string): string;
createLogger(): Logger;
registerChildProcess(process: ChildProcess): this;
unregisterChildProcess(process: ChildProcess): this;
forceExit(code?: number): void;
private registerCommands;
}
export {};