import { aws_cognito } from "aws-cdk-lib";
import lambda from "aws-lambda";
import { Construct } from "constructs";
import { Function } from "./function";
export declare type Trigger<Request, Response = Request> = Function<Request, Response>;
/**
 * Triggers for a user pool
 * @see https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html
 */
export interface UserPoolTriggers {
    /**
     * Creates an authentication challenge.
     *
     * ```ts
     * new UserPool(scope, id, {
     *   createAuthChallenge: new Function(scope, id, async (event) => {
     *     // handle event, set response properties, etc.
     *     event.response... = ..
     *     return event;
     *   }
     * }
     * ```
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-create-auth-challenge.html
     * @default - no trigger configured
     */
    readonly createAuthChallenge?: Trigger<lambda.CreateAuthChallengeTriggerEvent>;
    /**
     * A custom Message AWS Lambda trigger.
     *
     * ```ts
     * new UserPool(scope, id, {
     *   customMessage: new Function(scope, id, async (event) => {
     *     // handle event, set response properties, etc.
     *     event.response... = ..
     *     return event;
     *   })
     * });
     * ```
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-message.html
     * @default - no trigger configured
     */
    readonly customMessage?: Trigger<lambda.CustomMessageTriggerEvent>;
    /**
     * Defines the authentication challenge.
     *
     * ```ts
     * new UserPool(scope, id, {
     *   defineAuthChallenge: new Function(scope, id, async (event) => {
     *     // handle event, set response properties, etc.
     *     event.response... = ..
     *     return event;
     *   })
     * });
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-define-auth-challenge.html
     * @default - no trigger configured
     */
    readonly defineAuthChallenge?: Trigger<lambda.DefineAuthChallengeTriggerEvent>;
    /**
     * A post-authentication AWS Lambda trigger.
     *
     * ```ts
     * new UserPool(scope, id, {
     *   postAuthentication: new Function(scope, id, async (event) => {
     *     // handle event, set response properties, etc.
     *     event.response... = ..
     *     return event;
     *   })
     * });
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-post-authentication.html
     * @default - no trigger configured
     */
    readonly postAuthentication?: Trigger<lambda.PostAuthenticationTriggerEvent>;
    /**
     * A post-confirmation AWS Lambda trigger.
     *
     * ```ts
     * new UserPool(scope, id, {
     *   postConfirmation: new Function(scope, id, async (event) => {
     *     // handle event, set response properties, etc.
     *     event.response... = ..
     *     return event;
     *   })
     * });
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-post-confirmation.html
     * @default - no trigger configured
     */
    readonly postConfirmation?: Trigger<lambda.PostConfirmationTriggerEvent>;
    /**
     * A pre-authentication AWS Lambda trigger.
     *
     * ```ts
     * new UserPool(scope, id, {
     *   preAuthentication: new Function(scope, id, async (event) => {
     *     // handle event, set response properties, etc.
     *     event.response... = ..
     *     return event;
     *   })
     * });
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-authentication.html
     * @default - no trigger configured
     */
    readonly preAuthentication?: Trigger<lambda.PreAuthenticationTriggerEvent>;
    /**
     * A pre-registration AWS Lambda trigger.
     *
     * ```ts
     * new UserPool(scope, id, {
     *   preSignUp: new Function(scope, id, async (event) => {
     *     // handle event, set response properties, etc.
     *     event.response... = ..
     *     return event;
     *   })
     * });
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html
     * @default - no trigger configured
     */
    readonly preSignUp?: Trigger<lambda.PreSignUpTriggerEvent>;
    /**
     * A pre-token-generation AWS Lambda trigger.
     *
     * ```ts
     * new UserPool(scope, id, {
     *   preTokenGeneration: new Function(scope, id, async (event) => {
     *     // handle event, set response properties, etc.
     *     event.response... = ..
     *     return event;
     *   })
     * });
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html
     * @default - no trigger configured
     */
    readonly preTokenGeneration?: Trigger<lambda.PreTokenGenerationTriggerEvent>;
    /**
     * A user-migration AWS Lambda trigger.
     *
     * ```ts
     * new UserPool(scope, id, {
     *   userMigration: new Function(scope, id, async (event) => {
     *     // handle event, set response properties, etc.
     *     event.response... = ..
     *     return event;
     *   })
     * });
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-migrate-user.html
     * @default - no trigger configured
     */
    readonly userMigration?: Trigger<lambda.UserMigrationTriggerEvent>;
    /**
     * Verifies the authentication challenge response.
     *
     * ```ts
     * new UserPool(scope, id, {
     *   verifyAuthChallengeResponse: new Function(scope, id, async (event) => {
     *     // handle event, set response properties, etc.
     *     event.response... = ..
     *     return event;
     *   })
     * });
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-verify-auth-challenge-response.html
     * @default - no trigger configured
     */
    readonly verifyAuthChallengeResponse?: Trigger<lambda.VerifyAuthChallengeResponseTriggerEvent>;
    /**
     * Amazon Cognito invokes this trigger to send email notifications to users.
     *
     * ```ts
     * new UserPool(scope, id, {
     *   customEmailSender: new Function(scope, id, async (event) => {
     *     // handle event, set response properties, etc.
     *     event.response... = ..
     *     return event;
     *   })
     * });
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-email-sender.html
     * @default - no trigger configured
     */
    readonly customEmailSender?: Trigger<lambda.CustomEmailSenderTriggerEvent>;
    /**
     * Amazon Cognito invokes this trigger to send SMS notifications to users.
     *
     * ```ts
     * new UserPool(scope, id, {
     *   customSmsSender: new Function(scope, id, async (event) => {
     *     // handle event, set response properties, etc.
     *     event.response... = ..
     *     return event;
     *   })
     * });
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-sms-sender.html
     * @default - no trigger configured
     */
    readonly customSmsSender?: Trigger<lambda.CustomSMSSenderTriggerEvent>;
}
export interface UserPoolProps extends Omit<aws_cognito.UserPoolProps, "lambdaTriggers"> {
    /**
     * Lambda functions to use for supported Cognito triggers.
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html
     * @default - No Lambda triggers.
     */
    readonly lambdaTriggers?: UserPoolTriggers;
}
declare class BaseUserPool {
    /**
     * The underlying {@link aws_cognito.UserPool} instance.
     */
    readonly resource: aws_cognito.UserPool;
    static readonly FunctionlessType = "UserPool";
    readonly FunctionlessType = "UserPool";
    /**
     * Create a new {@link UserPool} from an existing {@link aws_cognito.UserPool}.
     *
     *
     * @param resource an existing UserPool Construct.
     * @see {@link aws_cognito.UserPool}
     */
    constructor(
    /**
     * The underlying {@link aws_cognito.UserPool} instance.
     */
    resource: aws_cognito.UserPool);
    /**
     * Configure AWS Cognito to trigger a {@link Function}.
     *
     * Usage Pattern 1 - on("triggerName")
     * ```ts
     * userPool.on("createAuthChallenge", new Function(scope, id, async (event) => {
     *   // handle event, set response properties, etc.
     *   event.response... = ..
     *   return event;
     * }))
     * ```
     *
     * Usage Pattern 2 - {@link aws_cognito.UserPoolTriggers}.
     *
     * ```ts
     * userPool.on(
     *   aws_cognito.UserPoolOperation.CREATE_AUTH_CHALLENGE,
     *   new Function(scope, id, async (event: CreateAuthChallengeTriggerEvent) => {
     *                                          // ^ you must explicitly type the even in this case
     *     // handle event, set response properties, etc.
     *     event.response... = ..
     *     return event;
     *   }));
     * ```
     *
     * @param triggerName name of a trigger in {@link UserPoolTriggers}
     * @param handler the {@link Function} to send the trigger events to.
     */
    on<TriggerName extends keyof UserPoolTriggers | aws_cognito.UserPoolOperation>(triggerName: TriggerName, handler: TriggerName extends keyof UserPoolTriggers ? Exclude<UserPoolTriggers[TriggerName], undefined> : Exclude<UserPoolTriggers[keyof UserPoolTriggers], undefined>): void;
    /**
     * Creates an authentication challenge.
     *
     * ```ts
     * userPool.onCreateAuthChallenge(new Function(scope, id, async (event) => {
     *   // handle event, set response properties, etc.
     *   event.response... = ..
     *   return event;
     * }));
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-create-auth-challenge.html
     * @default - no trigger configured
     */
    onCreateAuthChallenge(handler: Trigger<lambda.CreateAuthChallengeTriggerEvent>): void;
    /**
     * Amazon Cognito invokes this trigger to send email notifications to users.
     *
     * ```ts
     * userPool.onCustomEmailSender(new Function(scope, id, async (event) => {
     *   // handle event, set response properties, etc.
     *   event.response... = ..
     *   return event;
     * }));
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-email-sender.html
     * @default - no trigger configured
     */
    onCustomEmailSender(handler: Trigger<lambda.CustomEmailSenderTriggerEvent>): void;
    /**
     * A custom Message AWS Lambda trigger.
     *
     * ```ts
     * userPool.onCustomMessage(new Function(scope, id, async (event) => {
     *   // handle event, set response properties, etc.
     *   event.response... = ..
     *   return event;
     * }));
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-message.html
     * @default - no trigger configured
     */
    onCustomMessage(handler: Trigger<lambda.CustomMessageTriggerEvent>): void;
    /**
     * Amazon Cognito invokes this trigger to send SMS notifications to users.
     *
     * ```ts
     * userPool.onCustomMessage(new Function(scope, id, async (event) => {
     *   // handle event, set response properties, etc.
     *   event.response... = ..
     *   return event;
     * }));
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-sms-sender.html
     * @default - no trigger configured
     */
    onCustomSmsSender(handler: Trigger<lambda.CustomSMSSenderTriggerEvent>): void;
    /**
     * Defines the authentication challenge.
     *
     * ```ts
     * userPool.onDefineAuthChallenge(new Function(scope, id, async (event) => {
     *   // handle event, set response properties, etc.
     *   event.response... = ..
     *   return event;
     * }));
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-define-auth-challenge.html
     * @default - no trigger configured
     */
    onDefineAuthChallenge(handler: Trigger<lambda.DefineAuthChallengeTriggerEvent>): void;
    /**
     * A post-authentication AWS Lambda trigger.
     *
     * ```ts
     * userPool.onPostAuthentication(new Function(scope, id, async (event) => {
     *   // handle event, set response properties, etc.
     *   event.response... = ..
     *   return event;
     * }));
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-post-authentication.html
     * @default - no trigger configured
     */
    onPostAuthentication(handler: Trigger<lambda.PostAuthenticationTriggerEvent>): void;
    /**
     * A post-confirmation AWS Lambda trigger.
     *
     * ```ts
     * userPool.onPostConfirmation(new Function(scope, id, async (event) => {
     *   // handle event, set response properties, etc.
     *   event.response... = ..
     *   return event;
     * }));
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-post-confirmation.html
     * @default - no trigger configured
     */
    onPostConfirmation(handler: Trigger<lambda.PostConfirmationTriggerEvent>): void;
    /**
     * A pre-authentication AWS Lambda trigger.
     *
     * ```ts
     * userPool.onPreAuthentication(new Function(scope, id, async (event) => {
     *   // handle event, set response properties, etc.
     *   event.response... = ..
     *   return event;
     * }));
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-authentication.html
     * @default - no trigger configured
     */
    onPreAuthentication(handler: Trigger<lambda.PreAuthenticationTriggerEvent>): void;
    /**
     * A pre-registration AWS Lambda trigger.
     *
     * ```ts
     * userPool.onPreSignUp(new Function(scope, id, async (event) => {
     *   // handle event, set response properties, etc.
     *   event.response... = ..
     *   return event;
     * }));
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html
     * @default - no trigger configured
     */
    onPreSignUp(handler: Trigger<lambda.PreSignUpTriggerEvent>): void;
    /**
     * A pre-token-generation AWS Lambda trigger.
     *
     * ```ts
     * userPool.onPreTokenGeneration(new Function(scope, id, async (event) => {
     *   // handle event, set response properties, etc.
     *   event.response... = ..
     *   return event;
     * }));
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-token-generation.html
     * @default - no trigger configured
     */
    onPreTokenGeneration(handler: Trigger<lambda.PreTokenGenerationTriggerEvent>): void;
    /**
     * A user-migration AWS Lambda trigger.
     *
     * ```ts
     * userPool.onUserMigration(new Function(scope, id, async (event) => {
     *   // handle event, set response properties, etc.
     *   event.response... = ..
     *   return event;
     * }));
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-migrate-user.html
     * @default - no trigger configured
     */
    onUserMigration(handler: Trigger<lambda.UserMigrationTriggerEvent>): void;
    /**
     * Verifies the authentication challenge response.
     *
     * ```ts
     * userPool.onVerifyAuthChallengeResponse(new Function(scope, id, async (event) => {
     *   // handle event, set response properties, etc.
     *   event.response... = ..
     *   return event;
     * }));
     * ```
     *
     * @see https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-verify-auth-challenge-response.html
     * @default - no trigger configured
     */
    onVerifyAuthChallengeResponse(handler: Trigger<lambda.VerifyAuthChallengeResponseTriggerEvent>): void;
}
/**
 * An AWS Cognito User Pool.
 */
export interface IUserPool extends BaseUserPool {
}
/**
 * Defines an AWS Cognito User Pool.
 *
 * ```ts
 * const userPool = new UserPool(stack, "UserPool", {
 *   lambdaTriggers: {
 *     createAuthChallenge: new Function(
 *       stack,
 *       "CreateAuthChallenge",
 *       async (event) => {
 *         // implement logic for the CreateAuthChallenge lifecycle event
 *         return event;
 *       }
 *     ),
 *   },
 * });
 * ```
 */
export declare class UserPool extends BaseUserPool implements IUserPool {
    /**
     * Create a {@link UserPool} from a pre-existing {@link aws_cognito.UserPool}.
     *
     * @param resource a pre-existing CDK User Pool L2 Construct.
     * @returns a Functionless {@link UserPool}.
     */
    static from(resource: aws_cognito.UserPool): IUserPool;
    /**
     * Create a new AWS Cognito {@link UserPool}.
     *
     * @param scope Construct scope to instantiate the UserPool in.
     * @param id id of this UserPool within
     * @param props the {@link UserPoolProps}.
     * @see {@link aws_cognito.UserPool}
     */
    constructor(scope: Construct, id: string, props?: UserPoolProps);
}
export {};
//# sourceMappingURL=user-pool.d.ts.map