UNPKG

1.25 kBTypeScriptView Raw
1/// <reference types="node" />
2import { Files, Config } from './types';
3interface Environment {
4 [key: string]: string;
5}
6interface LambdaOptions {
7 zipBuffer: Buffer;
8 handler: string;
9 runtime: string;
10 memory?: number;
11 maxDuration?: number;
12 environment: Environment;
13}
14interface CreateLambdaOptions {
15 files: Files;
16 handler: string;
17 runtime: string;
18 memory?: number;
19 maxDuration?: number;
20 environment?: Environment;
21}
22interface GetLambdaOptionsFromFunctionOptions {
23 sourceFile: string;
24 config?: Config;
25}
26export declare class Lambda {
27 type: 'Lambda';
28 zipBuffer: Buffer;
29 handler: string;
30 runtime: string;
31 memory?: number;
32 maxDuration?: number;
33 environment: Environment;
34 constructor({ zipBuffer, handler, runtime, maxDuration, memory, environment, }: LambdaOptions);
35}
36export declare function createLambda({ files, handler, runtime, memory, maxDuration, environment, }: CreateLambdaOptions): Promise<Lambda>;
37export declare function createZip(files: Files): Promise<Buffer>;
38export declare function getLambdaOptionsFromFunction({ sourceFile, config, }: GetLambdaOptionsFromFunctionOptions): Promise<Pick<LambdaOptions, 'memory' | 'maxDuration'>>;
39export {};