import type { FormValue } from "./value.js"; /** * A string form value. */ export interface FormString extends FormValue { type: "string"; /** * Whether or not this string is multiline. * * Multiline strings are rendered as textarea fields. */ isMultiline: boolean; /** * Whether this string is optional, i.e. allows `""` or `undefined` values. */ isOptional: TOptional; /** * Whether this string is required to be a valid URL. */ isUrl: boolean; /** * Set the default value of this string. The default value will be returned if the user * doesn't provide a value. * * NOTE that this is not the same as an initial value! */ default(value: string): FormString; /** * Make this string optional, i.e. allow `""` or `undefined` values. */ optional(): FormString; /** * Make this string multiline, i.e. render as textarea field. */ multiline(): FormString; /** * Set the maximum length of this string. */ maxLength(length: number): FormString; /** * Set the minimum length of this string. */ minLength(length: number): FormString; /** * Ensure that this string is a valid URL. * * A URL without a protocol, e.g. "attio.com" will pass validation, but will be * given to `onSubmit` as "https://attio.com". * * @param options The options for URL validation. * @param options.protocol The protocol regex to use for URL validation. If not provided, * the default is `https?`. * @param options.message The message to use for URL validation errors. If not provided, * the default is `Must be a valid URL`. */ url(options?: { protocol: RegExp; message?: string; }): FormString; } /** * Create a new string form value. */ export declare function string(): FormString; //# sourceMappingURL=string.d.ts.map