UNPKG

2.95 kBTypeScriptView Raw
1// Type definitions for gulp-nodemon
2// Project: https://github.com/JacksonGariety/gulp-nodemon
3// Definitions by: Qubo <https://github.com/tkQubo>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
6/// <reference types="node" />
7import * as Gulp from "gulp";
8
9declare 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
88declare var nodemon: nodemon.Nodemon;
89
90export = nodemon;
91
\No newline at end of file