2020-06-23 15:23:53 +00:00
|
|
|
/**
|
|
|
|
|
* https://intl.cloud.tencent.com/document/product/583/9210
|
|
|
|
|
*/
|
|
|
|
|
export type Handler<TEvent, TResult> = (
|
|
|
|
|
event: TEvent,
|
|
|
|
|
context: Context,
|
|
|
|
|
callback: Callback<TResult>,
|
|
|
|
|
) => void | Promise<TResult>;
|
|
|
|
|
|
|
|
|
|
export interface Context {
|
|
|
|
|
callbackWaitsForEmptyEventLoop: boolean;
|
2020-07-06 19:39:12 +00:00
|
|
|
getRemainingTimeInMillis: () => number;
|
2020-06-23 15:23:53 +00:00
|
|
|
memory_limit_in_mb: number;
|
|
|
|
|
time_limit_in_ms: number;
|
|
|
|
|
request_id: string;
|
2020-07-06 19:39:12 +00:00
|
|
|
environment: string;
|
|
|
|
|
environ: string;
|
2020-06-23 15:23:53 +00:00
|
|
|
function_version: string;
|
|
|
|
|
function_name: string;
|
|
|
|
|
namespace: string;
|
|
|
|
|
tencentcloud_region: string;
|
|
|
|
|
tencentcloud_appid: string;
|
|
|
|
|
tencentcloud_uin: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type Callback<TResult> = (error?: Error | string | null, result?: TResult) => void;
|