import { APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2 } from "aws-lambda"; import { Adapter } from "./adapter/adapter.js"; import { SignerOptions } from "fast-jwt"; import { SessionBuilder } from "./session.js"; interface OnSuccessResponder { session(input: T & Partial): { type: "session"; properties: T; }; http(input: APIGatewayProxyStructuredResultV2): { type: "http"; properties: typeof input; }; } export declare class UnknownProviderError extends Error { provider?: string | undefined; constructor(provider?: string | undefined); } export declare class MissingParameterError extends Error { parameter: string; constructor(parameter: string); } export declare class UnknownStateError extends Error { constructor(); } export declare class UnauthorizedClientError extends Error { client: string; redirect_uri: string; constructor(client: string, redirect_uri: string); } export declare class InvalidSessionError extends Error { constructor(); } export declare function AuthHandler>, Sessions extends SessionBuilder, Result = { [key in keyof Providers]: { provider: key; } & Extract>, { type: "success"; }>["properties"]; }[keyof Providers]>(input: { providers: Providers; sessions?: Sessions; /** @deprecated use callbacks.auth.allowClient callback instead */ clients?: () => Promise>; /** @deprecated use callbacks.auth.allowClient callback instead */ allowClient?: (clientID: string, redirect: string) => Promise; /** @deprecated use callbacks.auth.start callback instead */ onAuthorize?: (event: APIGatewayProxyEventV2) => Promise; /** @deprecated use callbacks.auth.success callback instead */ onSuccess?: (input: Result, response: OnSuccessResponder) => Promise[keyof OnSuccessResponder]>>; /** @deprecated */ onIndex?: (event: APIGatewayProxyEventV2) => Promise; /** @deprecated use on.error callback instead */ onError?: (error: MissingParameterError | UnauthorizedClientError | UnknownProviderError) => Promise; callbacks: { index?(event: APIGatewayProxyEventV2): Promise; error?(error: UnknownStateError): Promise; auth: { error?(error: MissingParameterError | UnauthorizedClientError | UnknownProviderError): Promise; start?(event: APIGatewayProxyEventV2): Promise; allowClient(clientID: string, redirect: string): Promise; success(input: Result, response: OnSuccessResponder): Promise[keyof OnSuccessResponder]>>; }; connect?: { error?(error: InvalidSessionError | UnknownProviderError): Promise; start?(session: Sessions["$typeValues"], event: APIGatewayProxyEventV2): Promise; success?(session: Sessions["$typeValues"], input: Result): Promise; }; }; }): (event: APIGatewayProxyEventV2, context: import("aws-lambda").Context) => Promise; export {};