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