/** * Parameter validators for Tinybird pipe queries * Similar to the column type validators but for query parameters */ declare const PARAM_BRAND: unique symbol; /** * Base interface for parameter validators */ export interface ParamValidator { readonly [PARAM_BRAND]: true; /** The inferred TypeScript type */ readonly _type: TType; /** The Tinybird type string for the parameter */ readonly _tinybirdType: TTinybirdType; /** Whether this parameter is required */ readonly _required: TRequired; /** Default value if optional */ readonly _default?: TType; /** Description for documentation */ readonly _description?: string; /** Whether required/optional was explicitly set by a modifier */ readonly _requiredModifier?: "required" | "optional"; /** Make this parameter optional with an optional default value */ optional(defaultValue?: TDefault): ParamValidator; /** Make this parameter required (default) */ required(): ParamValidator; /** Add a description for this parameter */ describe(description: string): ParamValidator; } /** * Parameter validators for Tinybird pipe queries * * @example * ```ts * import { p } from '@tinybirdco/sdk'; * * const params = { * user_id: p.string(), * limit: p.int32().optional(10), * start_date: p.dateTime().describe('Start of date range'), * }; * ``` */ export declare const p: { /** String parameter */ readonly string: () => ParamValidator; /** UUID parameter */ readonly uuid: () => ParamValidator; /** Int8 parameter */ readonly int8: () => ParamValidator; /** Int16 parameter */ readonly int16: () => ParamValidator; /** Int32 parameter */ readonly int32: () => ParamValidator; /** Int64 parameter */ readonly int64: () => ParamValidator; /** UInt8 parameter */ readonly uint8: () => ParamValidator; /** UInt16 parameter */ readonly uint16: () => ParamValidator; /** UInt32 parameter */ readonly uint32: () => ParamValidator; /** UInt64 parameter */ readonly uint64: () => ParamValidator; /** Float32 parameter */ readonly float32: () => ParamValidator; /** Float64 parameter */ readonly float64: () => ParamValidator; /** Boolean parameter */ readonly boolean: () => ParamValidator; /** Date parameter (YYYY-MM-DD format, e.g. 2024-01-15) */ readonly date: () => ParamValidator; /** DateTime parameter (YYYY-MM-DD HH:MM:SS format, e.g. 2024-01-15 10:30:00) */ readonly dateTime: () => ParamValidator; /** DateTime64 parameter (YYYY-MM-DD HH:MM:SS[.fraction] format, e.g. 2024-01-15 10:30:00.123) */ readonly dateTime64: () => ParamValidator; /** * Array parameter - values can be passed as comma-separated or repeated params * @param _element - The type of array elements (used for type inference) * @param _separator - Optional custom separator (default: comma) */ readonly array: >(_element: TElement, _separator?: string) => ParamValidator; /** * Column reference parameter - allows dynamic column selection * Use with caution as it can affect query safety */ readonly column: () => ParamValidator; /** * JSON parameter - for passing complex structured data */ readonly json: () => ParamValidator; }; /** Type alias for any parameter validator */ export type AnyParamValidator = ParamValidator; /** Extract the TypeScript type from a parameter validator */ export type InferParamType = T["_required"] extends true ? T["_type"] : T["_type"] | undefined; /** Check if a value is a parameter validator */ export declare function isParamValidator(value: unknown): value is AnyParamValidator; /** Get the Tinybird type string from a parameter validator */ export declare function getParamTinybirdType(validator: AnyParamValidator): string; /** Check if a parameter is required */ export declare function isParamRequired(validator: AnyParamValidator): boolean; /** Get the default value of a parameter */ export declare function getParamDefault(validator: ParamValidator): T | undefined; /** Get the description of a parameter */ export declare function getParamDescription(validator: AnyParamValidator): string | undefined; /** Check whether required/optional was explicitly set by a modifier */ export declare function getParamRequiredModifier(validator: AnyParamValidator): "required" | "optional" | undefined; export {}; //# sourceMappingURL=params.d.ts.map