// Types for email-validation.cjs (for a TypeScript functions project). The blocking functions are typed `unknown`, so
// this file needs no imports from firebase-functions; export them as they are.

/** The 2nd gen blocking function. `options`: Firebase's BlockingOptions (region, minInstances, ...). */
export function beforeUserCreated(options?: Record<string, unknown>): unknown;

/** The 1st gen blocking function. `options`: Firebase's RuntimeOptions for runWith, plus `region`. */
export function beforeCreate(options?: Record<string, unknown> & { region?: unknown }): unknown;

export interface SignupCheck {
  /** True only when the sign-up is to be refused. */
  stop: boolean;
  /** The text for the person signing up when `stop` is true, otherwise null. */
  message: string | null;
  /** valid, invalid, catch_all, unknown or disposable; null when the address was not checked. */
  status: string | null;
  reason: string | null;
  requestId: string | null;
}

/** The check alone, for your own before-create function. Never throws; bind the EV_API_KEY secret to that function. */
export function checkSignupEmail(email: string | null | undefined): Promise<SignupCheck>;
