1 | export declare enum Events {
|
2 | PostBuild = "post-build",
|
3 | BuildFile = "build-file",
|
4 | BrowserRefresh = "browser-refresh"
|
5 | }
|
6 | export declare type Callable = (...args: any[]) => void;
|
7 | export declare type HookPostBuildPayload = {
|
8 | output: string;
|
9 | staticOutput: string;
|
10 | functionsOutput: string;
|
11 | functionsManifest: Record<string, string>;
|
12 | };
|
13 | export declare type HookBuildFilePayload = {
|
14 | file: string;
|
15 | };
|
16 | export declare type DestroyHookCallback = () => void;
|
17 | export declare type Hooks = {
|
18 | emitPostBuild(props: HookPostBuildPayload): void;
|
19 | onPostBuild(cb: (props: HookPostBuildPayload) => void): DestroyHookCallback;
|
20 | emitBuildFile(props: HookBuildFilePayload): void;
|
21 | onBuildFile(cb: (props: HookBuildFilePayload) => void): DestroyHookCallback;
|
22 | emitBrowserRefresh(): void;
|
23 | onBrowserRefresh(cb: () => void): DestroyHookCallback;
|
24 | };
|
25 | export declare function createEmitter(): {
|
26 | emit: (ev: string, ...args: any[]) => void;
|
27 | on: (ev: string, fn: (...args: any[]) => void) => () => Callable[];
|
28 | clear: () => void;
|
29 | listeners: (ev: string) => Callable[];
|
30 | };
|
31 | export declare function createHooks(emitter: ReturnType<typeof createEmitter>): Hooks;
|