1
- type NodemonEventHandler =
1
+ export type NodemonEventHandler =
2
2
| 'start'
3
3
| 'crash'
4
4
| 'exit'
@@ -10,7 +10,7 @@ type NodemonEventHandler =
10
10
| 'stdout'
11
11
| 'stderr' ;
12
12
13
- type NodemonEventListener = {
13
+ export type NodemonEventListener = {
14
14
on ( event : 'start' | 'crash' | 'readable' , listener : ( ) => void ) : Nodemon ;
15
15
on ( event : 'log' , listener : ( e : NodemonEventLog ) => void ) : Nodemon ;
16
16
on ( event : 'stdout' | 'stderr' , listener : ( e : string ) => void ) : Nodemon ;
@@ -23,7 +23,7 @@ type NodemonEventListener = {
23
23
) : Nodemon ;
24
24
} ;
25
25
26
- type Nodemon = {
26
+ export type Nodemon = {
27
27
( options ?: NodemonSettings ) : Nodemon ;
28
28
on ( event : 'start' | 'crash' , listener : ( ) => void ) : Nodemon ;
29
29
on ( event : 'log' , listener : ( e : NodemonEventLog ) => void ) : Nodemon ;
@@ -72,10 +72,11 @@ type Nodemon = {
72
72
emit ( type : NodemonEventHandler , event ?: any ) : Nodemon ;
73
73
reset ( callback : Function ) : Nodemon ;
74
74
restart ( ) : Nodemon ;
75
+ // TODO remy is that now only the config or does it also include the other stuff liek script?
75
76
config : NodemonSettings ;
76
77
} ;
77
78
78
- type NodemonEventLog = {
79
+ export type NodemonEventLog = {
79
80
/**
80
81
detail*: what you get with nodemon --verbose.
81
82
status: subprocess starting, restarting.
@@ -89,20 +90,20 @@ type NodemonEventLog = {
89
90
colour : String ;
90
91
} ;
91
92
92
- interface NodemonEventRestart {
93
+ export interface NodemonEventRestart {
93
94
matched ?: {
94
95
result : string [ ] ;
95
96
total : number ;
96
97
} ;
97
98
}
98
99
99
- type NodemonEventQuit = 143 | 130 ;
100
- type NodemonEventExit = number ;
100
+ export type NodemonEventQuit = 143 | 130 ;
101
+ export type NodemonEventExit = number ;
101
102
102
103
// TODO: Define the type of NodemonEventConfig
103
- type NodemonEventConfig = any ;
104
+ export type NodemonEventConfig = any ;
104
105
105
- interface NodemonSettings {
106
+ export interface NodemonConfig {
106
107
/* restartable defaults to "rs" as a string the user enters */
107
108
restartable ?: false | String ;
108
109
colours ?: Boolean ;
@@ -117,10 +118,25 @@ interface NodemonSettings {
117
118
watchOptions ?: WatchOptions ;
118
119
}
119
120
120
- interface WatchOptions {
121
+ export interface NodemonSettings extends NodemonConfig {
122
+ script : string ;
123
+ ext ?: string ; // "js,mjs" etc (should really support an array of strings, but I don't think it does right now)
124
+ events ?: { [ key : string ] : string } ;
125
+ env ?: { [ key : string ] : string } ;
126
+ exec ?: string ; // node, python, etc
127
+ execArgs ?: string [ ] ; // args passed to node, etc,
128
+
129
+ // TODO remy check if that is correct i have that in my code configured
130
+ nodeArgs ?: string [ ] ; // args passed to node, etc,
131
+ delay ?: number ;
132
+ }
133
+
134
+ export interface WatchOptions {
121
135
ignorePermissionErrors : boolean ;
122
136
ignored : string ;
123
137
persistent : boolean ;
124
138
usePolling : boolean ;
125
139
interval : number ;
126
140
}
141
+
142
+ export default function nodemon ( settings : NodemonSettings ) : Nodemon ;
0 commit comments