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