shelving
Version:
Toolkit for using data in JavaScript.
16 lines (15 loc) • 796 B
TypeScript
import type { StringSchemaOptions } from "./StringSchema.js";
import { StringSchema } from "./StringSchema.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 StringSchema {
constructor({ one, title, ...options }: Omit<StringSchemaOptions, "input" | "min" | "max" | "match" | "multiline">);
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>;