/** * A conditional type for a primitive value. * * @since v0.4.0 */ export type InputPrimitive = T extends string | number | boolean | null | undefined ? T | string | number | boolean | null | undefined : never; /** * An array of input values `T`. * * @since v0.4.0 */ export type InputArray = Input[]; /** * An input object type. * * @since v0.4.0 */ export type InputObject = { [P in keyof T]?: Input | null; }; /** * A recursive type that shows that a given value of type `T` has not yet been validated. * * @since v0.4.0 */ export type Input = (T extends (infer U)[] ? InputArray : T extends object ? InputObject : InputPrimitive) | null | undefined; /** * Marks a given `value` as an {@linkcode Input}. * * @since v0.4.0 */ export declare function input(value: unknown): Input; /** * If a given `value` is a string, returns the `value`. * Otherwise, returns `undefined`. * * @since v0.4.0 */ export declare function stringInput(input: unknown): string | undefined; /** * If a given `value` is a number, returns the `value`. * Otherwise, returns `undefined`. * * @since v0.4.0 */ export declare function numberInput(input: unknown): number | undefined; /** * If a given `value` is a boolean, returns the `value`. * Otherwise, returns `undefined`. * * @since v0.4.0 */ export declare function booleanInput(input: unknown): boolean | undefined; /** * If a given `value` is an array, returns the `value`. * Otherwise, returns `undefined`. * * @since v0.4.0 */ export declare function arrayInput(input: unknown): Input[] | undefined; /** * If a given `value` is a non-array object, returns the `value`. * Otherwise, returns `undefined`. * * @since v0.4.0 */ export declare function objectInput(input: unknown): InputObject | undefined; /** * If a given `value` is null, returns the `value`. * Otherwise, returns `undefined`. * * @since v0.4.0 */ export declare function nullInput(input: unknown): null | undefined;