import type { StringConstraints } from '@skyleague/axioms'; import { NodeTrait } from '../../cst/mixin.js'; import type { SchemaOptions } from '../base.js'; export declare const supportedFormats: readonly ["date-time", "date", "time", "email", "hostname", "ipv4", "ipv6", "uri", "ulid", "uuid", "base64", "duration"]; export type StringFormat = (typeof supportedFormats)[number]; export interface StringOptions { /** * The minimum the length the string is allowed to have. */ minLength?: number | undefined; /** * The maximum the length the string is allowed to have. */ maxLength?: number | undefined; /** * The pattern the string has. */ regex?: RegExp | string | undefined; /** * The format the string should follow (is not used for validation). */ format?: StringFormat | undefined; arbitrary?: Partial | undefined; } export declare class StringType extends NodeTrait { _type: "string"; _options: StringOptions; infer: string; input: string; constructor(options: SchemaOptions); arbitrary(options: Partial): this; minLength(minLength: number): this; maxLength(maxLength: number): this; datetime(): this; date(): this; time(): this; email(): this; hostname(): this; ipv4(): this; ipv6(): this; uri(): this; uuid(): this; base64(): this; duration(): this; ulid(): this; regex(pattern: RegExp | string): this; } /** * Create a new `StringType` instance with the given options. * * ### Example * ```ts * $string * * $string() * * $string({maxLength: 3}) * ``` * * @param options - Additional options to pass to the string. * @returns A StringType. * * @group Primitives */ export declare function $string(options?: SchemaOptions): StringType;