UNPKG

@sinclair/typebox

Version:

Json Schema Type Builder with Static Type Resolution for TypeScript

8 lines (7 loc) 573 B
import type { TSchema, SchemaOptions } from '../schema/index'; import type { TFunction } from '../function/index'; import { type TTuple } from '../tuple/index'; import { type TNever } from '../never/index'; export type TParameters<Type extends TSchema> = (Type extends TFunction<infer Parameters extends TSchema[], infer _ReturnType extends TSchema> ? TTuple<Parameters> : TNever); /** `[JavaScript]` Extracts the Parameters from the given Function type */ export declare function Parameters<Type extends TSchema>(schema: Type, options?: SchemaOptions): TParameters<Type>;