1 | // Type definitions for live-server 1.2
|
2 | // Project: https://github.com/tapio/live-server#readme
|
3 | // Definitions by: Josh Cummings <https://github.com/joshcummingsdesign>
|
4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
5 |
|
6 | /**
|
7 | * The live-server start params.
|
8 | */
|
9 | export interface LiveServerParams {
|
10 | /** Set the server port. Defaults to 8080. */
|
11 | port?: number | undefined;
|
12 | /** Set the address to bind to. Defaults to 0.0.0.0 or process.env.IP. */
|
13 | host?: string | undefined;
|
14 | /** Set root directory that's being served. Defaults to cwd. */
|
15 | root?: string | undefined;
|
16 | /** When false, it won't load your browser by default. */
|
17 | open?: boolean | undefined;
|
18 | /** Comma-separated string for paths to ignore. */
|
19 | ignore?: string | undefined;
|
20 | /** When set, serve this file (server root relative) for every 404 (useful for single-page applications). */
|
21 | file?: string | undefined;
|
22 | /** Waits for all changes, before reloading. Defaults to 0 sec. */
|
23 | wait?: number | undefined;
|
24 | /** Mount a directory to a route. */
|
25 | mount?: string[][] | undefined;
|
26 | /** 0 = errors only, 1 = some, 2 = lots */
|
27 | logLevel?: 0 | 1 | 2 | undefined;
|
28 | /** Takes an array of Connect-compatible middleware that are injected into the server middleware stack. */
|
29 | middleware?: Array<(req: any, res: any, next: any) => void> | undefined;
|
30 | }
|
31 |
|
32 | /**
|
33 | * Start live-server.
|
34 | */
|
35 | export function start(params: LiveServerParams): void;
|
36 |
|
37 | /**
|
38 | * Shutdown live-server.
|
39 | */
|
40 | export function shutdown(): void;
|