rawx
Version:
process daemon with utilities
52 lines (51 loc) • 1.63 kB
TypeScript
/// <reference types="node" />
import { ChildProcess } from "child_process";
import { Color_Targets } from "../ops/index";
import { str } from "../util";
import { Watch_Args, Watch_I } from "./watch";
import { P, H, _P } from "./proc_type_defs";
import { Require_Only_One } from "../util/validation/validator";
import { Proc_Util_I } from "./proc_util";
export declare type Server_Args = Require_Only_One<Server_Args_, "procs" | "proc">;
export interface Server_Args_ {
name?: str;
procs?: P.Proc_Args;
proc?: P.Proc_Args;
trigger_index?: number;
trigger_indices?: number[];
watch?: Watch_Args;
colors?: Color_Targets;
debug: number;
log_ignore_reg_repl?: {
reg: RegExp;
replace?: string;
}[];
kill_delay?: number;
output_dir?: str;
first_proc?: number;
sig?: "handled";
dry_run?: true;
}
export interface Server_Constructor_I {
name: str;
label: str;
debug: number;
kill_delay: number;
exit_delay: number;
procs: Array<_P._Proc | H._Hook_Fn>;
first_proc: number;
trigger_index?: number;
trigger_indices?: number[];
_step_procs: Array<_P._Proc | H._Hook_Fn>;
_range_cache: Array<_P._Proc | H._Hook_Fn>;
_last_range_at: number;
_proc_util: Proc_Util_I;
set_range: (n: number) => void;
_watch: Watch_I;
watch: Watch_Args;
colors: Color_Targets;
_tubed?: str;
_running?: Array<ChildProcess>;
_live_functions: Record<str, str>;
}
export declare type Server_Constructor_C = new (args: Server_Args) => Server_Constructor_I;