shelving
Version:
Toolkit for using data in JavaScript.
16 lines (15 loc) • 730 B
TypeScript
import type { StringSchemaOptions } from "./StringSchema.js";
import { TextSchema } from "./TextSchema.js";
/**
* 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 TextSchema {
constructor({ title, ...options }: StringSchemaOptions);
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 OPTIONAL_PHONE: import("./OptionalSchema.js").OptionalSchema<string>;