import { LiteralParam, Param, ParamGetSet, ParamGetter } from './paramTypes'; import { StandardSchemaV1 } from '@standard-schema/spec'; export declare const paramStart = "["; export type ParamStart = typeof paramStart; export declare const paramEnd = "]"; export type ParamEnd = typeof paramEnd; /** * Type guard to check if a value conforms to the ParamGetter type. * @param value - The value to check. * @returns True if the value is a function that is not a constructor. */ export declare function isParamGetter(value: Param): value is ParamGetter; /** * Type guard to check if a value conforms to the ParamGetSet type. * @param value - The value to check. * @returns True if the value is an object with both 'get' and 'set' functions defined. */ export declare function isParamGetSet(value: Param): value is ParamGetSet; /** * Type guard to check if a value conforms to the LiteralParam type. * @param value - The value to check. * @returns True if the value is a string, number, or boolean. */ export declare function isLiteralParam(value: Param): value is LiteralParam; /** * Extracts the parameter name from a string, handling optional parameters denoted by a leading '?'. * @template TParam - The string from which to extract the parameter name. * @returns The extracted parameter name, or never if the parameter string is empty. */ export type ExtractParamName = TParam extends string ? TParam extends `?${infer Param}` ? Param extends '' ? never : Param extends `${infer Name}*` ? Name : Param : TParam extends '' ? never : TParam extends `${infer Name}*` ? Name : TParam : never; /** * Extracts the actual type from a parameter type, handling getters and setters. * @template TParam - The parameter type. * @returns The extracted type, or 'string' as a fallback. */ export type ExtractParamType = Param extends TParam ? unknown : TParam extends ParamGetSet ? Type : TParam extends DateConstructor ? Date : TParam extends JSON ? unknown : TParam extends ParamGetter ? ReturnType : TParam extends StandardSchemaV1 ? StandardSchemaV1.InferOutput : TParam extends LiteralParam ? TParam : string; export type ParamIsOptional = TParam extends `?${string}` ? true : false; export type ParamIsGreedy = TParam extends `${string}*` ? true : false; export type ParamIsOptionalOrHasDefault = ParamIsOptional extends true ? true : TParam extends Required ? true : false;