import { Metrics } from '@basemaps/metrics'; import { ALBEvent, ALBResult, CloudFrontRequestEvent, CloudFrontRequestResult } from 'aws-lambda'; import { LambdaHttpResponse } from '.'; import { LogType } from './log'; export interface ActionData { version: string; name: string; rest: string[]; } export declare type LambdaHttpRequestType = ALBEvent | CloudFrontRequestEvent; export declare type LambdaHttpReturnType = ALBResult | CloudFrontRequestResult; export declare class LambdaContext { static isAlbEvent(evt: any): evt is ALBEvent; static isCloudFrontEvent(evt: any): evt is CloudFrontRequestEvent; id: string; correlationId: string; logContext: Record; timer: Metrics; log: LogType; evt: LambdaHttpRequestType; apiKey: string | undefined; headers: Map; constructor(evt: LambdaHttpRequestType, logger: LogType); private loadHeaders; get method(): string; get path(): string; get query(): Record; /** * Read a header from the event object * @param key header to read */ header(key: string): string | undefined; private _action; get action(): ActionData; /** * Set a key to be logged out at the end of the function call * @param key key to log as * @param val value to log */ set(key: string, val: any): void; static toResponse(req: LambdaContext, res: LambdaHttpResponse): LambdaHttpReturnType; static toCloudFrontResponse(res: LambdaHttpResponse, req?: CloudFrontRequestEvent): CloudFrontRequestResult; static toAlbResponse(res: LambdaHttpResponse): ALBResult; } //# sourceMappingURL=lambda.context.d.ts.map