UNPKG

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