rawx
Version:
process daemon with utilities
21 lines (20 loc) • 997 B
TypeScript
export declare class Validator {
constructor();
}
import { Server_Constructor_I } from "../../node-enabled/server_construct";
import { str } from "../../util";
declare type Invalid<T> = ["Needs to be all of", T];
declare type Resolution_Is_T_In_U<T, U extends T[]> = U & ([T] extends [U[number]] ? unknown : Invalid<T>[]);
export declare type Array_Of_All = <T>() => <U extends T[]>(...array: Resolution_Is_T_In_U<T, U>) => U;
export declare type Set_Validator = <R>(input_args?: R) => void;
export declare type Require_Only_One<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
[K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
}[Keys];
export interface Arg_Validator_I {
errors: str[];
warnings: str[];
validate: (args: any) => void;
set_validated: (_self: Server_Constructor_I) => void;
}
export declare type Arg_Validator_Class = new (name: str, arg_dict: any) => Arg_Validator_I;
export {};