UNPKG

intl-tel-input

Version:

A JavaScript plugin for entering and validating international telephone numbers

47 lines (46 loc) 1.74 kB
import { type Country, type Iso2 } from "./intl-tel-input/data"; import type { UtilsLoader, ItiUtils, NumberType, AllOptions, SomeOptions, SelectedCountryData } from "./modules/types/public-api"; import type { ForEachInstanceArgsMap } from "./modules/types/forEachInstanceArgsMap"; declare global { interface HTMLInputElement { iti?: Iti; } } export declare class Iti { #private; readonly id: number; readonly promise: Promise<void>; constructor(input: HTMLInputElement, customOptions?: SomeOptions); destroy(): void; isActive(): boolean; getExtension(): string; getNumber(format?: number): string; getNumberType(): number; getSelectedCountryData(): SelectedCountryData; getValidationError(): number; isValidNumber(): boolean | null; isValidNumberPrecise(): boolean | null; setCountry(iso2: Iso2): void; setNumber(number: string): void; setPlaceholderNumberType(type: NumberType): void; setDisabled(disabled: boolean): void; static forEachInstance<M extends keyof ForEachInstanceArgsMap>(method: M, ...args: ForEachInstanceArgsMap[M]): void; } interface IntlTelInputInterface { (input: HTMLInputElement, options?: SomeOptions): Iti; autoCountry?: Iso2; defaults: AllOptions; documentReady: () => boolean; getCountryData: () => Country[]; getInstance: (input: HTMLInputElement) => Iti | null; instances: { [key: string]: Iti; }; attachUtils: (source: UtilsLoader) => Promise<unknown> | null; startedLoadingAutoCountry: boolean; startedLoadingUtilsScript: boolean; version: string | undefined; utils?: ItiUtils; } declare const intlTelInput: IntlTelInputInterface; export default intlTelInput;