@phonecheck/phone-number-validator-js
Version:
Validate, parse, and enrich international phone numbers — geocoding, carrier lookup, and timezone resolution. Sync (Node) + async (serverless) APIs, platform adapters, and a CLI.
33 lines (32 loc) • 1.13 kB
TypeScript
export interface AzureHttpRequest {
method: string;
url: string;
headers: {
get(name: string): string | null;
} | Record<string, string | undefined>;
query: {
get(name: string): string | null;
} | Record<string, string | undefined>;
json(): Promise<unknown>;
text?: () => Promise<string>;
}
export interface AzureInvocationContext {
invocationId?: string;
functionName?: string;
log?: (...args: unknown[]) => void;
error?: (...args: unknown[]) => void;
}
export interface AzureHttpResponseInit {
status: number;
headers: Record<string, string>;
jsonBody?: unknown;
body?: string;
}
export declare function azureHandler(req: AzureHttpRequest, _context?: AzureInvocationContext): Promise<AzureHttpResponseInit>;
/** Single-route convenience — infers single vs. batch from the body. */
export declare function azureFunction(req: AzureHttpRequest, _context?: AzureInvocationContext): Promise<AzureHttpResponseInit>;
declare const _default: {
azureHandler: typeof azureHandler;
azureFunction: typeof azureFunction;
};
export default _default;