@now/build-utils
Version:
40 lines (39 loc) • 1.25 kB
TypeScript
/// <reference types="node" />
import { Files, Config } from './types';
interface Environment {
[key: string]: string;
}
interface LambdaOptions {
zipBuffer: Buffer;
handler: string;
runtime: string;
memory?: number;
maxDuration?: number;
environment: Environment;
}
interface CreateLambdaOptions {
files: Files;
handler: string;
runtime: string;
memory?: number;
maxDuration?: number;
environment?: Environment;
}
interface GetLambdaOptionsFromFunctionOptions {
sourceFile: string;
config?: Config;
}
export declare class Lambda {
type: 'Lambda';
zipBuffer: Buffer;
handler: string;
runtime: string;
memory?: number;
maxDuration?: number;
environment: Environment;
constructor({ zipBuffer, handler, runtime, maxDuration, memory, environment, }: LambdaOptions);
}
export declare function createLambda({ files, handler, runtime, memory, maxDuration, environment, }: CreateLambdaOptions): Promise<Lambda>;
export declare function createZip(files: Files): Promise<Buffer>;
export declare function getLambdaOptionsFromFunction({ sourceFile, config, }: GetLambdaOptionsFromFunctionOptions): Promise<Pick<LambdaOptions, 'memory' | 'maxDuration'>>;
export {};