1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import * as Gulp from "gulp";
|
8 |
|
9 | declare namespace nodemon {
|
10 |
|
11 | interface Nodemon {
|
12 | (option?: Option): EventEmitter;
|
13 | }
|
14 |
|
15 | interface Option extends _Option {
|
16 | tasks?: string[] | ((changedFiles: string[]) => string[]) | undefined;
|
17 | }
|
18 |
|
19 | // TODO: Properties may be insufficient
|
20 | // TODO: In future this interface should be moved to nodemon.d.ts
|
21 | interface _Option {
|
22 | env?: { [key: string]: string | boolean | number; } | undefined;
|
23 | script?: string | undefined;
|
24 | /**
|
25 | * Extensions to look for, ie. js,jade,hbs.
|
26 | */
|
27 | ext?: string | undefined;
|
28 | /**
|
29 | * Execute script with "app", ie. -x "python -v".
|
30 | */
|
31 | exec?: string | undefined;
|
32 | /**
|
33 | * Watch directory "dir" or files. use once for each directory or file to watch.
|
34 | */
|
35 | watch?: string[] | undefined;
|
36 | /**
|
37 | * Ignore specific files or directories.
|
38 | */
|
39 | ignore?: string[] | undefined;
|
40 | /**
|
41 | * Minimise nodemon messages to start/stop only.
|
42 | */
|
43 | quiet?: boolean | undefined;
|
44 | /**
|
45 | * Show detail on what is causing restarts.
|
46 | */
|
47 | verbose?: boolean | undefined;
|
48 | /**
|
49 | * Try to read from stdin.
|
50 | */
|
51 | stdin?: boolean | undefined;
|
52 | stdout?: boolean | undefined;
|
53 | /**
|
54 | * Execute script on change only, not startup
|
55 | */
|
56 | runOnChangeOnly?: boolean | undefined;
|
57 | /**
|
58 | * Debounce restart in seconds.
|
59 | */
|
60 | delay?: number | undefined;
|
61 | /**
|
62 | * Forces node to use the most compatible version for watching file changes.
|
63 | */
|
64 | legacyWatch?: boolean | undefined;
|
65 | /**
|
66 | * Exit on crash, allows use of nodemon with daemon tools like forever.js.
|
67 | */
|
68 | exitcrash?: boolean | undefined;
|
69 | execMap?: { [key: string]: string | boolean | number; } | undefined;
|
70 | events?: { [key: string]: string; } | undefined;
|
71 | restartable?: string | undefined;
|
72 | args?: string[] | undefined;
|
73 | nodeArgs?: string[] | undefined;
|
74 | scriptPosition?: number | undefined;
|
75 | done?: Gulp.TaskFunctionCallback | undefined;
|
76 | }
|
77 |
|
78 | interface EventEmitter extends NodeJS.EventEmitter {
|
79 | addListener(event: string, listener: Function): this;
|
80 | addListener(event: string, tasks: string[]): this;
|
81 | on(event: string, listener: Function): this;
|
82 | on(event: string, tasks: string[]): this;
|
83 | once(event: string, listener: Function): this;
|
84 | once(event: string, tasks: string[]): this;
|
85 | }
|
86 | }
|
87 |
|
88 | declare var nodemon: nodemon.Nodemon;
|
89 |
|
90 | export = nodemon;
|
91 |
|
\ | No newline at end of file |