@emailcheck/email-validator-js
Version:
Advanced email validation with MX records, SMTP verification, disposable email detection, batch processing, and caching. Production-ready with TypeScript support.
57 lines (56 loc) • 1.81 kB
TypeScript
import { type ValidationRequestBody } from '../_shared/validation';
/**
* Loose API-Gateway event/result/context shapes — `headers` and similar maps
* intentionally widen to `string | undefined` so they line up with the
* official `@types/aws-lambda` definitions used by callers/tests.
*/
export interface APIGatewayProxyEvent {
body: string | null;
headers: {
[key: string]: string | undefined;
};
httpMethod: string;
path: string;
queryStringParameters: {
[key: string]: string | undefined;
} | null;
pathParameters: {
[key: string]: string | undefined;
} | null;
isBase64Encoded?: boolean;
}
export interface APIGatewayProxyResult {
statusCode: number;
headers?: {
[key: string]: string;
};
body: string;
}
export interface LambdaContext {
functionName: string;
functionVersion: string;
awsRequestId: string;
remainingTimeInMillis: number;
}
interface ValidateResponse {
success: boolean;
data?: unknown;
error?: string;
}
export declare function apiGatewayHandler(event: APIGatewayProxyEvent, _context: LambdaContext): Promise<APIGatewayProxyResult>;
export declare function lambdaHandler(event: ValidationRequestBody, _context: LambdaContext): Promise<ValidateResponse>;
export declare function cacheHandler(event: {
action: 'clear' | 'stats';
}, _context: LambdaContext): Promise<{
success: boolean;
message?: string;
stats?: unknown;
}>;
export declare function handler(event: APIGatewayProxyEvent, _context?: unknown): Promise<APIGatewayProxyResult>;
declare const _default: {
apiGatewayHandler: typeof apiGatewayHandler;
lambdaHandler: typeof lambdaHandler;
cacheHandler: typeof cacheHandler;
handler: typeof handler;
};
export default _default;