/** * This client is used at runtime. Keep the dependencies to a minimal and analyze the lambda bundles on output. */ export interface PrewarmClientInitializer { key: T; init: (key: string, props?: PrewarmProps) => O; } export declare type ClientName = "EventBridge" | "Lambda" | "SecretsManager" | "StepFunctions"; /** * Known, shared clients to use. * * Any object can be used by using the {@link PrewarmClientInitializer} interface directly. * * ```ts * context.getOrInit({ * key: 'customClient', * init: () => new anyClient() * }) * ``` */ export declare const PrewarmClients: Record>; export declare const SQSClient: PrewarmClientInitializer<"SQS", AWS.SQS>; export interface PrewarmProps { clientConfigRetriever?: (clientName: ClientName | string) => Omit; } /** * A client/object cache which Native Functions can use to * initialize objects once and before the handler is invoked. * * The same instance will be passed to both the `.call` and `.prewarm` methods * of a {@link NativeIntegration}. `prewarm` is called once when the function starts, * before the handler. * * Register and initialize clients by using `getOrInit` with a key and a initializer. * * ```ts * context.getOrInit(PrewarmClients.LAMBDA) * ``` * * or register anything by doing * * ```ts * context.getOrInit({ * key: 'customClient', * init: () => new anyClient() * }) * ``` * * To get without potentially initializing the client, use `get`: * * ```ts * context.get("LAMBDA") * context.get("customClient") * ``` */ export declare class NativePreWarmContext { private props?; private readonly cache; constructor(props?: PrewarmProps | undefined); get(key: ClientName | string): T | undefined; getOrInit(client: PrewarmClientInitializer): T; } //# sourceMappingURL=function-prewarm.d.ts.map