serverless-aws-lambda
Version:
AWS Application Load Balancer and API Gateway - Lambda dev tool for Serverless. Allows Express synthax in handlers. Supports packaging, local invoking and offline ALB, APG, S3, SNS, SQS, DynamoDB Stream server mocking.
40 lines (39 loc) • 1.32 kB
TypeScript
import type { MessagePort } from "worker_threads";
import type { AsyncHook } from "async_hooks";
interface LambdaErrorResponse {
errorType?: string;
errorMessage: string;
trace?: string[];
}
export declare const genResponsePayload: (err: any) => LambdaErrorResponse;
export declare const patchConsole: () => void;
export declare const formatStack: (_stack: string[]) => string;
interface IEventQueueContext {
[id: string]: {
timers: Map<number, any>;
promises: Map<number, any>;
timeout?: boolean;
};
}
export declare class EventQueue extends Map {
private static readonly EMPTY_ARGS;
static IGNORE: string[];
onEmpty?: () => void;
requestId: string;
callbackWaitsForEmptyEventLoop: boolean;
async: boolean;
hook?: AsyncHook;
static context: IEventQueueContext;
static parentPort: MessagePort | null;
static logTimeoutPossibleCause: (requestId: string) => void;
constructor(requestId: string);
static restoreContext: () => void;
storeContextTimers: () => void;
isEmpty: () => boolean;
add: (asyncId: number, type: string, triggerAsyncId: number, resource: any) => this;
destroy: (asyncId: number) => void;
resolve: (asyncId: number) => void;
enable: () => void;
disable: () => void;
}
export {};