serverless-offline-edge-lambda
Version:
A plugin for the Serverless Framework that simulates the behavior of AWS CloudFront Edge Lambdas while developing offline.
15 lines (14 loc) • 834 B
TypeScript
/**
* The `CallbackPromise` provides a mechanism for creating a promise that can be resolved or rejected
* like a Node callback function.
*/
export declare class CallbackPromise<T = any> implements Promise<T> {
readonly callback: (...args: any[]) => void;
private readonly promise;
private hasBeenCalled;
[Symbol.toStringTag]: string;
constructor(strict?: boolean);
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
finally(onfinally?: (() => void) | undefined | null): Promise<T>;
}