UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

19 lines (18 loc) 893 B
import type { StringSchemaOptions } from "./StringSchema.js"; import { StringSchema } from "./StringSchema.js"; /** Options for a `PhoneSchema` */ export interface PhoneSchemaOptions extends Omit<StringSchemaOptions, "input" | "min" | "max" | "match" | "rows"> { } /** * Type of `StringSchema` that defines a valid phone number. * - Multiple string formats are automatically converted to E.164 format (starting with `+` plus). * - Falsy values are converted to `""` empty string. */ export declare class PhoneSchema extends StringSchema { constructor({ one, title, ...options }: PhoneSchemaOptions); sanitize(insaneString: string): string; } /** Valid phone number, e.g. `+441234567890` */ export declare const PHONE: PhoneSchema; /** Valid phone number, e.g. `+441234567890`, or `null` */ export declare const NULLABLE_PHONE: import("./NullableSchema.js").NullableSchema<string>;