Something went wrong. Try again.
Starship Simulator Controls thoriumsim.com
Something went wrong. Try again.
1.1 kB · 40 lines
TypeScript
at develop
1234567891011121314151617181920212223242526272829303132333435363738394041export type ParserZodEsque<TInput, TParsedInput> = { _input: TInput; _output: TParsedInput;};
export type ParserMyZodEsque<TInput> = { parse: (input: any) => TInput;};
export type ParserSuperstructEsque<TInput> = { create: (input: unknown) => TInput;};
export type ParserCustomValidatorEsque<TInput> = (input: unknown) => TInput | Promise<TInput>;
export type ParserYupEsque<TInput> = { validateSync: (input: unknown) => TInput;};export type ParserWithoutInput<TInput> = | ParserYupEsque<TInput> | ParserSuperstructEsque<TInput> | ParserCustomValidatorEsque<TInput> | ParserMyZodEsque<TInput>;
export type ParserWithInputOutput<TInput, TParsedInput> = ParserZodEsque<TInput, TParsedInput>;
export type Parser = ParserWithoutInput<any> | ParserWithInputOutput<any, any>;
export type inferParser<TParser extends Parser> = TParser extends ParserWithInputOutput<infer $TIn, infer $TOut> ? { in: $TIn; out: $TOut; } : TParser extends ParserWithoutInput<infer $InOut> ? { in: $InOut; out: $InOut; } : never;