1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | import { Express } from 'express';
|
13 | import { EventEmitter } from 'events';
|
14 | import { Server as HttpServer } from 'http';
|
15 |
|
16 | import * as editorAPI from '@node-red/editor-api';
|
17 | import * as editorClient from '@node-red/editor-client';
|
18 | import * as registry from '@node-red/registry';
|
19 | import * as runtime from '@node-red/runtime';
|
20 | import * as util from '@node-red/util';
|
21 |
|
22 | declare const nodeRed: nodeRed.NodeRedApp;
|
23 |
|
24 | export = nodeRed;
|
25 |
|
26 | declare namespace nodeRed {
|
27 | interface NodeRedApp {
|
28 | |
29 |
|
30 |
|
31 |
|
32 |
|
33 | init: (httpServer: HttpServer, userSettings: runtime.LocalSettings) => void;
|
34 |
|
35 | |
36 |
|
37 |
|
38 | start: () => Promise<void>;
|
39 |
|
40 | |
41 |
|
42 |
|
43 | stop: () => Promise<void>;
|
44 |
|
45 | |
46 |
|
47 |
|
48 | log: util.Log;
|
49 |
|
50 | |
51 |
|
52 |
|
53 | util: util.Util;
|
54 |
|
55 | |
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 | readonly nodes: runtime.InternalNodesModule;
|
64 |
|
65 | |
66 |
|
67 |
|
68 | events: EventEmitter;
|
69 |
|
70 | |
71 |
|
72 |
|
73 | hooks: util.Hooks;
|
74 |
|
75 | |
76 |
|
77 |
|
78 |
|
79 | readonly settings: runtime.PersistentSettings;
|
80 |
|
81 | |
82 |
|
83 |
|
84 | readonly version: string;
|
85 |
|
86 | |
87 |
|
88 |
|
89 | readonly httpAdmin: Express;
|
90 |
|
91 | |
92 |
|
93 |
|
94 | readonly httpNode: Express;
|
95 |
|
96 | |
97 |
|
98 |
|
99 | readonly server: HttpServer;
|
100 |
|
101 | |
102 |
|
103 |
|
104 | runtime: runtime.RuntimeModule;
|
105 |
|
106 | |
107 |
|
108 |
|
109 | auth: editorAPI.Auth;
|
110 | }
|
111 |
|
112 | |
113 |
|
114 |
|
115 |
|
116 | |
117 |
|
118 |
|
119 |
|
120 | interface NodeInitializer<TSets extends NodeAPISettingsWithData = NodeAPISettingsWithData>
|
121 | extends registry.NodeInitializer<TSets> {}
|
122 |
|
123 | interface NodeConstructor<TNode extends Node<TCreds>, TNodeDef extends NodeDef, TCreds extends {}>
|
124 | extends registry.NodeConstructor<TNode, TNodeDef, TCreds> {}
|
125 |
|
126 | interface NodeAPISettingsWithData extends registry.NodeAPISettingsWithData {}
|
127 |
|
128 | interface NodeSetting<T> extends registry.NodeSetting<T> {}
|
129 |
|
130 | type NodeSettings<TSets> = registry.NodeSettings<TSets>;
|
131 |
|
132 | interface NodeCredential extends registry.NodeCredential {}
|
133 |
|
134 | type NodeCredentials<TCreds> = registry.NodeCredentials<TCreds>;
|
135 |
|
136 | interface NodeMessage extends registry.NodeMessage {}
|
137 |
|
138 | interface NodeMessageParts extends registry.NodeMessageParts {}
|
139 |
|
140 | interface NodeMessageInFlow extends registry.NodeMessageInFlow {}
|
141 |
|
142 | interface NodeAPI<TSets extends NodeAPISettingsWithData = NodeAPISettingsWithData>
|
143 | extends registry.NodeAPI<TSets> {}
|
144 |
|
145 | interface Node<TCreds extends {} = {}> extends registry.Node<TCreds> {}
|
146 |
|
147 | type NodeStatusFill = registry.NodeStatusFill;
|
148 |
|
149 | type NodeStatusShape = registry.NodeStatusShape;
|
150 |
|
151 | interface NodeStatus extends registry.NodeStatus {}
|
152 |
|
153 | interface NodeDef extends registry.NodeDef {}
|
154 |
|
155 | interface NodeContextData extends registry.NodeContextData {}
|
156 |
|
157 | interface NodeContext extends registry.NodeContext {}
|
158 |
|
159 | |
160 |
|
161 |
|
162 |
|
163 | |
164 |
|
165 |
|
166 |
|
167 | interface EditorNodePropertyDef<TVal, TInstProps extends EditorNodeProperties = EditorNodeProperties>
|
168 | extends editorClient.NodePropertyDef<TVal, TInstProps> {}
|
169 |
|
170 | |
171 |
|
172 |
|
173 |
|
174 | type EditorNodePropertiesDef<
|
175 | TProps extends EditorNodeProperties,
|
176 | TInstProps extends TProps = TProps
|
177 | > = editorClient.NodePropertiesDef<TProps, TInstProps>;
|
178 |
|
179 | |
180 |
|
181 |
|
182 |
|
183 | interface EditorNodeProperties extends editorClient.NodeProperties {}
|
184 |
|
185 | type EditorNodeInstance<TProps extends EditorNodeProperties = EditorNodeProperties> = editorClient.NodeInstance<
|
186 | TProps
|
187 | >;
|
188 |
|
189 | type EditorNodeCredentials<T> = editorClient.NodeCredentials<T>;
|
190 |
|
191 | interface EditorNodeCredential extends editorClient.NodeCredential {}
|
192 |
|
193 | |
194 |
|
195 |
|
196 |
|
197 | interface EditorNodeDef<
|
198 | TProps extends EditorNodeProperties = EditorNodeProperties,
|
199 | TCreds = undefined,
|
200 | TInstProps extends TProps = TProps
|
201 | > extends editorClient.NodeDef<TProps, TCreds, TInstProps> {}
|
202 |
|
203 | |
204 |
|
205 |
|
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 |
|
213 |
|
214 |
|
215 |
|
216 |
|
217 |
|
218 |
|
219 |
|
220 | interface EditorRED extends editorClient.RED {}
|
221 |
|
222 | |
223 |
|
224 |
|
225 |
|
226 | interface EditorWidgetEditableListOptions<T> extends editorClient.WidgetEditableListOptions<T> {}
|
227 |
|
228 | interface EditorWidgetEditableList extends editorClient.WidgetEditableList {}
|
229 |
|
230 | interface EditorWidgetTypedInputOptions extends editorClient.WidgetTypedInputOptions {}
|
231 |
|
232 | type EditorWidgetTypedInputType = editorClient.WidgetTypedInputType;
|
233 |
|
234 | interface EditorWidgetTypedInputTypeDefinition extends editorClient.WidgetTypedInputTypeDefinition {}
|
235 |
|
236 | interface EditorWidgetTypedInput extends editorClient.WidgetTypedInput {}
|
237 | }
|