1 |
|
2 | import { Writable } from "stream";
|
3 | import { CostSnapshot } from "../cost";
|
4 | import { PackerResult } from "../packer";
|
5 | import { CommonOptions, FunctionStats, Message, ProviderImpl } from "../provider";
|
6 | import { AsyncQueue } from "../throttle";
|
7 | import { Wrapper, WrapperOptions } from "../wrapper";
|
8 | interface Executor {
|
9 | wrapper: Wrapper;
|
10 | logUrl: string;
|
11 | logStream?: Writable;
|
12 | }
|
13 |
|
14 |
|
15 |
|
16 | export interface LocalState {
|
17 |
|
18 | executors: Executor[];
|
19 |
|
20 | getExecutor: () => Executor;
|
21 |
|
22 | tempDir: string;
|
23 |
|
24 | logUrl: string;
|
25 |
|
26 | gcPromise?: Promise<void>;
|
27 |
|
28 | queue: AsyncQueue<Message>;
|
29 |
|
30 | options: Required<LocalOptions>;
|
31 | }
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 | export interface LocalOptions extends CommonOptions {
|
38 |
|
39 | _gcWorker?: (tempdir: string) => Promise<void>;
|
40 | }
|
41 | export declare function defaultGcWorker(dir: string): Promise<void>;
|
42 | export declare const defaults: Required<LocalOptions>;
|
43 | export declare const LocalImpl: ProviderImpl<LocalOptions, LocalState>;
|
44 | export declare function logUrl(state: LocalState): string;
|
45 | export declare function localPacker(functionModule: string, options: CommonOptions, wrapperOptions: WrapperOptions, FunctionName: string): Promise<PackerResult>;
|
46 | export declare function costSnapshot(state: LocalState, stats: FunctionStats): Promise<CostSnapshot>;
|
47 | export {};
|