@iobroker/adapter-react-v5 7.0.1 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/Components/404.d.ts +3 -2
  2. package/Components/404.js +16 -15
  3. package/Components/ColorPicker.d.ts +22 -8
  4. package/Components/ColorPicker.js +34 -17
  5. package/Components/ComplexCron.js +24 -24
  6. package/Components/CopyToClipboard.d.ts +10 -1
  7. package/Components/CopyToClipboard.js +17 -8
  8. package/Components/CustomModal.d.ts +1 -1
  9. package/Components/CustomModal.js +8 -8
  10. package/Components/FileBrowser.d.ts +11 -11
  11. package/Components/FileBrowser.js +173 -164
  12. package/Components/FileViewer.js +34 -23
  13. package/Components/Icon.d.ts +16 -2
  14. package/Components/Icon.js +19 -8
  15. package/Components/IconPicker.js +10 -14
  16. package/Components/IconSelector.d.ts +1 -1
  17. package/Components/IconSelector.js +64 -74
  18. package/Components/Image.d.ts +8 -4
  19. package/Components/Image.js +13 -32
  20. package/Components/Loader.d.ts +2 -2
  21. package/Components/Loader.js +244 -241
  22. package/Components/Loaders/MV.d.ts +6 -1
  23. package/Components/Loaders/MV.js +23 -7
  24. package/Components/Loaders/PT.d.ts +7 -2
  25. package/Components/Loaders/PT.js +123 -110
  26. package/Components/Loaders/Vendor.d.ts +2 -2
  27. package/Components/Loaders/Vendor.js +22 -14
  28. package/Components/Logo.js +16 -18
  29. package/Components/MDUtils.d.ts +1 -1
  30. package/Components/MDUtils.js +8 -4
  31. package/Components/ObjectBrowser.d.ts +49 -38
  32. package/Components/ObjectBrowser.js +757 -494
  33. package/Components/Router.d.ts +1 -3
  34. package/Components/Router.js +3 -1
  35. package/Components/SaveCloseButtons.d.ts +3 -3
  36. package/Components/SaveCloseButtons.js +3 -3
  37. package/Components/Schedule.d.ts +15 -15
  38. package/Components/Schedule.js +177 -154
  39. package/Components/SelectWithIcon.d.ts +2 -2
  40. package/Components/SelectWithIcon.js +45 -34
  41. package/Components/SimpleCron/index.js +83 -43
  42. package/Components/TabContainer.js +2 -2
  43. package/Components/TabContent.js +1 -1
  44. package/Components/TabHeader.js +1 -1
  45. package/Components/TableResize.d.ts +2 -2
  46. package/Components/TableResize.js +5 -5
  47. package/Components/TextWithIcon.d.ts +1 -1
  48. package/Components/TextWithIcon.js +10 -8
  49. package/Components/ToggleThemeMenu.d.ts +2 -2
  50. package/Components/ToggleThemeMenu.js +3 -3
  51. package/Components/TreeTable.d.ts +18 -18
  52. package/Components/TreeTable.js +76 -72
  53. package/Components/UploadImage.d.ts +2 -2
  54. package/Components/UploadImage.js +330 -326
  55. package/Components/Utils.d.ts +42 -22
  56. package/Components/Utils.js +66 -65
  57. package/Components/withWidth.d.ts +2 -2
  58. package/Components/withWidth.js +10 -6
  59. package/Dialogs/ComplexCron.d.ts +2 -2
  60. package/Dialogs/ComplexCron.js +3 -3
  61. package/Dialogs/Confirm.d.ts +4 -4
  62. package/Dialogs/Confirm.js +18 -8
  63. package/Dialogs/Cron.d.ts +3 -3
  64. package/Dialogs/Cron.js +21 -17
  65. package/Dialogs/Error.d.ts +3 -3
  66. package/Dialogs/Error.js +6 -4
  67. package/Dialogs/Message.d.ts +3 -3
  68. package/Dialogs/Message.js +6 -4
  69. package/Dialogs/SelectFile.d.ts +4 -4
  70. package/Dialogs/SelectFile.js +6 -4
  71. package/Dialogs/SelectID.d.ts +12 -10
  72. package/Dialogs/SelectID.js +12 -8
  73. package/Dialogs/SimpleCron.d.ts +2 -2
  74. package/Dialogs/SimpleCron.js +2 -2
  75. package/Dialogs/TextInput.d.ts +2 -2
  76. package/Dialogs/TextInput.js +3 -3
  77. package/GenericApp.d.ts +19 -13
  78. package/GenericApp.js +177 -134
  79. package/LICENSE +22 -22
  80. package/LegacyConnection.d.ts +240 -248
  81. package/LegacyConnection.js +500 -525
  82. package/Prompt.js +7 -7
  83. package/README.md +1239 -1166
  84. package/Theme.d.ts +1 -1
  85. package/Theme.js +9 -12
  86. package/assets/devices.json +1 -0
  87. package/assets/lamp_ceiling.svg +8 -8
  88. package/assets/lamp_table.svg +7 -7
  89. package/assets/no_icon.svg +9 -9
  90. package/assets/rooms.json +1 -0
  91. package/craco-module-federation.js +62 -71
  92. package/i18n/de.json +434 -431
  93. package/i18n/en.json +434 -431
  94. package/i18n/es.json +434 -431
  95. package/i18n/fr.json +434 -431
  96. package/i18n/it.json +434 -431
  97. package/i18n/nl.json +434 -431
  98. package/i18n/pl.json +434 -431
  99. package/i18n/pt.json +434 -431
  100. package/i18n/ru.json +434 -431
  101. package/i18n/uk.json +434 -431
  102. package/i18n/zh-cn.json +434 -431
  103. package/i18n.d.ts +26 -19
  104. package/i18n.js +28 -22
  105. package/icons/IconAdapter.js +2 -2
  106. package/icons/IconAlias.js +2 -2
  107. package/icons/IconChannel.js +2 -2
  108. package/icons/IconClearFilter.js +2 -2
  109. package/icons/IconClosed.js +2 -2
  110. package/icons/IconCopy.js +2 -2
  111. package/icons/IconDevice.js +2 -2
  112. package/icons/IconDocument.js +2 -2
  113. package/icons/IconDocumentReadOnly.js +2 -2
  114. package/icons/IconExpert.js +2 -2
  115. package/icons/IconFx.js +2 -2
  116. package/icons/IconInstance.js +2 -2
  117. package/icons/IconLogout.js +2 -2
  118. package/icons/IconNoIcon.js +2 -2
  119. package/icons/IconOpen.d.ts +2 -2
  120. package/icons/IconOpen.js +2 -2
  121. package/icons/IconProps.d.ts +4 -3
  122. package/icons/IconState.d.ts +2 -2
  123. package/icons/IconState.js +2 -2
  124. package/index.css +56 -55
  125. package/modulefederation.admin.config.js +31 -31
  126. package/package.json +5 -5
  127. package/src/AdminConnection.tsx +3 -3
  128. package/src/Components/404.tsx +122 -121
  129. package/src/Components/ColorPicker.tsx +343 -315
  130. package/src/Components/ComplexCron.tsx +544 -507
  131. package/src/Components/CopyToClipboard.tsx +178 -165
  132. package/src/Components/CustomModal.tsx +170 -163
  133. package/src/Components/FileBrowser.tsx +2550 -2414
  134. package/src/Components/FileViewer.tsx +412 -393
  135. package/src/Components/Icon.tsx +238 -210
  136. package/src/Components/IconPicker.tsx +165 -149
  137. package/src/Components/IconSelector.tsx +2220 -2202
  138. package/src/Components/Image.tsx +193 -176
  139. package/src/Components/Loader.tsx +328 -304
  140. package/src/Components/Logo.tsx +176 -166
  141. package/src/Components/MDUtils.tsx +104 -100
  142. package/src/Components/ObjectBrowser.tsx +8935 -8032
  143. package/src/Components/Router.tsx +90 -90
  144. package/src/Components/SaveCloseButtons.tsx +117 -113
  145. package/src/Components/Schedule.tsx +1962 -1724
  146. package/src/Components/SelectWithIcon.tsx +239 -197
  147. package/src/Components/TabContainer.tsx +57 -55
  148. package/src/Components/TabContent.tsx +38 -37
  149. package/src/Components/TabHeader.tsx +20 -19
  150. package/src/Components/TableResize.tsx +274 -259
  151. package/src/Components/TextWithIcon.tsx +159 -148
  152. package/src/Components/ToggleThemeMenu.tsx +52 -34
  153. package/src/Components/TreeTable.tsx +1002 -919
  154. package/src/Components/UploadImage.tsx +631 -599
  155. package/src/Components/Utils.tsx +1802 -1794
  156. package/src/Components/loader.css +231 -222
  157. package/src/Components/withWidth.tsx +32 -21
  158. package/src/Connection.tsx +5 -7
  159. package/src/Dialogs/ComplexCron.tsx +123 -129
  160. package/src/Dialogs/Confirm.tsx +185 -162
  161. package/src/Dialogs/Cron.tsx +192 -182
  162. package/src/Dialogs/Error.tsx +67 -72
  163. package/src/Dialogs/Message.tsx +73 -71
  164. package/src/Dialogs/SelectFile.tsx +280 -270
  165. package/src/Dialogs/SelectID.tsx +310 -298
  166. package/src/Dialogs/SimpleCron.tsx +100 -100
  167. package/src/Dialogs/TextInput.tsx +99 -107
  168. package/src/GenericApp.tsx +1076 -976
  169. package/src/LegacyConnection.tsx +3719 -3589
  170. package/src/Prompt.tsx +22 -20
  171. package/src/Theme.tsx +472 -479
  172. package/src/icons/IconAdapter.tsx +22 -20
  173. package/src/icons/IconAlias.tsx +22 -20
  174. package/src/icons/IconChannel.tsx +60 -21
  175. package/src/icons/IconClearFilter.tsx +24 -22
  176. package/src/icons/IconClosed.tsx +22 -17
  177. package/src/icons/IconCopy.tsx +21 -16
  178. package/src/icons/IconDevice.tsx +126 -27
  179. package/src/icons/IconDocument.tsx +22 -17
  180. package/src/icons/IconDocumentReadOnly.tsx +27 -18
  181. package/src/icons/IconExpert.tsx +26 -18
  182. package/src/icons/IconFx.tsx +38 -36
  183. package/src/icons/IconInstance.tsx +22 -20
  184. package/src/icons/IconLogout.tsx +32 -30
  185. package/src/icons/IconNoIcon.tsx +21 -19
  186. package/src/icons/IconOpen.tsx +22 -17
  187. package/src/icons/IconProps.tsx +16 -15
  188. package/src/icons/IconState.tsx +38 -17
  189. package/src/index.css +56 -55
  190. package/tasks.js +91 -0
  191. package/types.d.ts +141 -134
  192. package/Components/Loaders/PT.css +0 -109
  193. package/Components/Loaders/Vendor.css +0 -13
  194. package/Components/loader.css +0 -222
  195. package/Components/types.d.ts +0 -82
  196. package/assets/devices/Alarm Systems.svg +0 -19
  197. package/assets/devices/Amplifier.svg +0 -22
  198. package/assets/devices/Awnings.svg +0 -5
  199. package/assets/devices/Battery Status.svg +0 -5
  200. package/assets/devices/Ceiling Spotlights.svg +0 -16
  201. package/assets/devices/Chandelier.svg +0 -7
  202. package/assets/devices/Climate.svg +0 -12
  203. package/assets/devices/Coffee Makers.svg +0 -6
  204. package/assets/devices/Cold Water.svg +0 -31
  205. package/assets/devices/Computer.svg +0 -21
  206. package/assets/devices/Consumption.svg +0 -8
  207. package/assets/devices/Curtains.svg +0 -43
  208. package/assets/devices/Dishwashers.svg +0 -12
  209. package/assets/devices/Doors.svg +0 -6
  210. package/assets/devices/Doorstep.svg +0 -35
  211. package/assets/devices/Dryer.svg +0 -14
  212. package/assets/devices/Fan.svg +0 -20
  213. package/assets/devices/Floor Lamps.svg +0 -5
  214. package/assets/devices/Garage Doors.svg +0 -9
  215. package/assets/devices/Gates.svg +0 -32
  216. package/assets/devices/Hairdryer.svg +0 -23
  217. package/assets/devices/Handle.svg +0 -6
  218. package/assets/devices/Hanging Lamps.svg +0 -9
  219. package/assets/devices/Heater.svg +0 -44
  220. package/assets/devices/Hoods.svg +0 -12
  221. package/assets/devices/Hot Water.svg +0 -10
  222. package/assets/devices/Humidity.svg +0 -41
  223. package/assets/devices/Iron.svg +0 -5
  224. package/assets/devices/Irrigation.svg +0 -23
  225. package/assets/devices/Led Strip.svg +0 -31
  226. package/assets/devices/Light.svg +0 -30
  227. package/assets/devices/Lightings.svg +0 -46
  228. package/assets/devices/Lock.svg +0 -19
  229. package/assets/devices/Louvre.svg +0 -7
  230. package/assets/devices/Mowing Machine.svg +0 -9
  231. package/assets/devices/Music.svg +0 -13
  232. package/assets/devices/Outdoor Blinds.svg +0 -7
  233. package/assets/devices/People.svg +0 -19
  234. package/assets/devices/Pool.svg +0 -8
  235. package/assets/devices/Power Consumption.svg +0 -13
  236. package/assets/devices/Printer.svg +0 -10
  237. package/assets/devices/Pump.svg +0 -10
  238. package/assets/devices/Receiver.svg +0 -19
  239. package/assets/devices/Sconces.svg +0 -10
  240. package/assets/devices/Security.svg +0 -34
  241. package/assets/devices/Shading.svg +0 -5
  242. package/assets/devices/Shutters.svg +0 -11
  243. package/assets/devices/SmokeDetector.svg +0 -13
  244. package/assets/devices/Sockets.svg +0 -13
  245. package/assets/devices/Speaker.svg +0 -35
  246. package/assets/devices/Stove.svg +0 -12
  247. package/assets/devices/Table Lamps.svg +0 -12
  248. package/assets/devices/Temperature Sensors.svg +0 -28
  249. package/assets/devices/Tv.svg +0 -8
  250. package/assets/devices/Vacuum Cleaner.svg +0 -16
  251. package/assets/devices/Ventilation.svg +0 -12
  252. package/assets/devices/Washing Machines.svg +0 -16
  253. package/assets/devices/Water Consumption.svg +0 -6
  254. package/assets/devices/Water Heater.svg +0 -8
  255. package/assets/devices/Water.svg +0 -40
  256. package/assets/devices/Weather.svg +0 -28
  257. package/assets/devices/Window.svg +0 -8
  258. package/assets/rooms/Anteroom.svg +0 -53
  259. package/assets/rooms/Attic.svg +0 -21
  260. package/assets/rooms/Balcony.svg +0 -13
  261. package/assets/rooms/Barn.svg +0 -6
  262. package/assets/rooms/Basement.svg +0 -5
  263. package/assets/rooms/Bathroom.svg +0 -38
  264. package/assets/rooms/Bedroom.svg +0 -5
  265. package/assets/rooms/Boiler Room.svg +0 -13
  266. package/assets/rooms/Carport.svg +0 -17
  267. package/assets/rooms/Cellar.svg +0 -89
  268. package/assets/rooms/Chamber.svg +0 -9
  269. package/assets/rooms/Corridor.svg +0 -53
  270. package/assets/rooms/Dining Area.svg +0 -37
  271. package/assets/rooms/Dining Room.svg +0 -37
  272. package/assets/rooms/Dining.svg +0 -37
  273. package/assets/rooms/Dressing Room.svg +0 -5
  274. package/assets/rooms/Driveway.svg +0 -15
  275. package/assets/rooms/Entrance.svg +0 -44
  276. package/assets/rooms/Equipment Room.svg +0 -15
  277. package/assets/rooms/Front Yard.svg +0 -64
  278. package/assets/rooms/Gallery.svg +0 -14
  279. package/assets/rooms/Garage.svg +0 -20
  280. package/assets/rooms/Garden.svg +0 -13
  281. package/assets/rooms/Ground Floor.svg +0 -95
  282. package/assets/rooms/Guest Bathroom.svg +0 -33
  283. package/assets/rooms/Guest Room.svg +0 -5
  284. package/assets/rooms/Gym.svg +0 -5
  285. package/assets/rooms/Hall.svg +0 -19
  286. package/assets/rooms/Home Theater.svg +0 -8
  287. package/assets/rooms/Kitchen.svg +0 -18
  288. package/assets/rooms/Laundry Room.svg +0 -12
  289. package/assets/rooms/Living Area.svg +0 -11
  290. package/assets/rooms/Living Room.svg +0 -10
  291. package/assets/rooms/Locker Room.svg +0 -17
  292. package/assets/rooms/Nursery.svg +0 -5
  293. package/assets/rooms/Office.svg +0 -8
  294. package/assets/rooms/Outdoors.svg +0 -7
  295. package/assets/rooms/Playroom.svg +0 -6
  296. package/assets/rooms/Pool.svg +0 -8
  297. package/assets/rooms/Rear Wall.svg +0 -30
  298. package/assets/rooms/Second Floor.svg +0 -95
  299. package/assets/rooms/Shed.svg +0 -16
  300. package/assets/rooms/Sleeping Area.svg +0 -22
  301. package/assets/rooms/Stairway.svg +0 -5
  302. package/assets/rooms/Stairwell.svg +0 -15
  303. package/assets/rooms/Storeroom.svg +0 -5
  304. package/assets/rooms/Summer House.svg +0 -27
  305. package/assets/rooms/Swimming Pool.svg +0 -21
  306. package/assets/rooms/Terrace.svg +0 -7
  307. package/assets/rooms/Toilet.svg +0 -10
  308. package/assets/rooms/Upstairs.svg +0 -6
  309. package/assets/rooms/Wardrobe.svg +0 -60
  310. package/assets/rooms/Washroom.svg +0 -20
  311. package/assets/rooms/Wc.svg +0 -10
  312. package/assets/rooms/Windscreen.svg +0 -60
  313. package/assets/rooms/Workshop.svg +0 -23
  314. package/assets/rooms/Workspace.svg +0 -8
@@ -3,9 +3,10 @@
3
3
  *
4
4
  * MIT License
5
5
  *
6
- * */
6
+ */
7
7
  import { type HostInfo } from '@iobroker/js-controller-common-db/build/esm/lib/common/tools';
8
8
  import { type FilteredNotificationInformation } from '@iobroker/js-controller-common/build/esm/lib/common/notificationHandler';
9
+ import type { IoBJson } from '@iobroker/types/build/config';
9
10
  declare global {
10
11
  interface Window {
11
12
  adapterName: undefined | string;
@@ -15,6 +16,27 @@ declare global {
15
16
  io: any;
16
17
  }
17
18
  }
19
+ export type CompactSystemRepositoryEntry = {
20
+ link: string;
21
+ hash?: string;
22
+ stable?: boolean;
23
+ json: {
24
+ _repoInfo: {
25
+ stable?: boolean;
26
+ name?: ioBroker.StringOrTranslated;
27
+ };
28
+ } | null | undefined;
29
+ };
30
+ export type CompactSystemRepository = {
31
+ _id: ioBroker.HostObject['_id'];
32
+ common: {
33
+ name: ioBroker.HostCommon['name'];
34
+ dontDelete: boolean;
35
+ };
36
+ native: {
37
+ repositories: Record<string, CompactSystemRepositoryEntry>;
38
+ };
39
+ };
18
40
  /** Possible progress states. */
19
41
  export declare const PROGRESS: {
20
42
  /** The socket is connecting. */
@@ -133,7 +155,8 @@ declare class Connection {
133
155
  constructor(props: ConnectionProps);
134
156
  /**
135
157
  * Checks if this connection is running in a web adapter and not in an admin.
136
- * @returns {boolean} True if running in a web adapter or in a socketio adapter.
158
+ *
159
+ * @returns True if running in a web adapter or in a socketio adapter.
137
160
  */
138
161
  static isWeb(): boolean;
139
162
  /**
@@ -167,19 +190,16 @@ declare class Connection {
167
190
  private onConnect;
168
191
  /**
169
192
  * Called internally.
170
- * @private
171
193
  */
172
- static authenticate(): void;
194
+ private static authenticate;
173
195
  /**
174
196
  * Subscribe to changes of the given state.
197
+ *
198
+ * @param id The ioBroker state ID or array of states
199
+ * @param binary Set to true if the given state is binary and requires Base64 decoding
200
+ * @param cb The callback
175
201
  */
176
- subscribeState(
177
- /** The ioBroker state ID. */
178
- id: string | string[],
179
- /** Set to true if the given state is binary and requires Base64 decoding. */
180
- binary: boolean | ioBroker.StateChangeHandler | BinaryStateChangeHandler,
181
- /** The callback. */
182
- cb?: ioBroker.StateChangeHandler | BinaryStateChangeHandler): void;
202
+ subscribeState(id: string | string[], binary: boolean | ioBroker.StateChangeHandler | BinaryStateChangeHandler, cb?: ioBroker.StateChangeHandler | BinaryStateChangeHandler): void;
183
203
  /**
184
204
  * Subscribe to changes of the given state.
185
205
  */
@@ -198,29 +218,28 @@ declare class Connection {
198
218
  cb?: ioBroker.StateChangeHandler | BinaryStateChangeHandler): void;
199
219
  /**
200
220
  * Subscribe to changes of the given object.
221
+ *
222
+ * @param id The ioBroker object ID or array of objects
223
+ * @param cb The callback
201
224
  */
202
- subscribeObject(
203
- /** The ioBroker object ID. */
204
- id: string | string[],
205
- /** The callback. */
206
- cb: ioBroker.ObjectChangeHandler): Promise<void>;
225
+ subscribeObject(id: string | string[], cb: ioBroker.ObjectChangeHandler): Promise<void>;
207
226
  /**
208
227
  * Unsubscribes all or the given callback from changes of the given object.
228
+ *
229
+ * @param id The ioBroker object ID or array of objects
230
+ * @param cb The callback
209
231
  */
210
- unsubscribeObject(
211
- /** The ioBroker object ID. */
212
- id: string | string[],
213
- /** The callback. */
214
- cb?: ioBroker.ObjectChangeHandler): Promise<void>;
232
+ unsubscribeObject(id: string | string[], cb?: ioBroker.ObjectChangeHandler): Promise<void>;
215
233
  /**
216
234
  * Called internally.
217
235
  */
218
236
  private fileChange;
219
237
  /**
220
238
  * Subscribe to changes of the files.
221
- * @param {string} id The ioBroker state ID for meta-object. Could be a pattern
222
- * @param {string} filePattern Pattern or file name, like 'main/*' or 'main/visViews.json`
223
- * @param {function} cb The callback.
239
+ *
240
+ * @param id The ioBroker state ID for meta-object. Could be a pattern
241
+ * @param filePattern Pattern or file name, like 'main/*' or 'main/visViews.json`
242
+ * @param cb The callback.
224
243
  */
225
244
  subscribeFiles(
226
245
  /** The ioBroker state ID for meta-object. Could be a pattern */
@@ -231,9 +250,10 @@ declare class Connection {
231
250
  cb: ioBroker.FileChangeHandler): Promise<void>;
232
251
  /**
233
252
  * Unsubscribes the given callback from changes of files.
234
- * @param {string} id The ioBroker state ID.
235
- * @param {string} filePattern Pattern or file name, like 'main/*' or 'main/visViews.json`
236
- * @param {function} cb The callback.
253
+ *
254
+ * @param id The ioBroker state ID.
255
+ * @param filePattern Pattern or file name, like 'main/*' or 'main/visViews.json`
256
+ * @param cb The callback.
237
257
  */
238
258
  unsubscribeFiles(id: string, filePattern: string, cb?: ioBroker.FileChangeHandler): void;
239
259
  /**
@@ -246,91 +266,85 @@ declare class Connection {
246
266
  private stateChange;
247
267
  /**
248
268
  * Called internally.
249
- * @param {string} messageType
250
- * @param {string} sourceInstance
251
- * @param {object} data
269
+ *
270
+ * @param messageType The message type
271
+ * @param sourceInstance The source instance
272
+ * @param data Payload
252
273
  */
253
274
  instanceMessage(messageType: string, sourceInstance: string, data: Record<string, any>): void;
254
275
  /**
255
276
  * Gets all states.
277
+ *
278
+ * @param pattern The pattern to filter states
279
+ * @param disableProgressUpdate Don't call onProgress() when done
256
280
  */
257
- getStates(
258
- /** The pattern to filter states. */
259
- pattern?: string | boolean,
260
- /** don't call onProgress() when done */
261
- disableProgressUpdate?: boolean): Promise<Record<string, ioBroker.State>>;
281
+ getStates(pattern?: string | boolean, disableProgressUpdate?: boolean): Promise<Record<string, ioBroker.State>>;
262
282
  /**
263
283
  * Gets the given state.
284
+ *
285
+ * @param id The state ID
264
286
  */
265
- getState(
266
- /** The state ID. */
267
- id: string): Promise<ioBroker.State | null>;
287
+ getState(id: string): Promise<ioBroker.State | null>;
268
288
  /**
269
- * @deprecated since js-controller 5.0. Use files instead.
270
289
  * Get the given binary state.
290
+ *
291
+ * @deprecated since js-controller 5.0. Use files instead.
292
+ * @param id The state ID.
271
293
  */
272
- getBinaryState(
273
- /** The state ID. */
274
- id: string): Promise<string>;
294
+ getBinaryState(id: string): Promise<string>;
275
295
  /**
276
- * @deprecated since js-controller 5.0. Use files instead.
277
296
  * Set the given binary state.
297
+ *
298
+ * @deprecated since js-controller 5.0. Use files instead.
299
+ * @param id The state ID.
300
+ * @param base64 The Base64 encoded binary data.
278
301
  */
279
- setBinaryState(
280
- /** The state ID. */
281
- id: string,
282
- /** The Base64 encoded binary data. */
283
- base64: string): Promise<void>;
302
+ setBinaryState(id: string, base64: string): Promise<void>;
284
303
  /**
285
304
  * Sets the given state value.
305
+ *
306
+ * @param id The state ID
307
+ * @param val The state value
308
+ * @param ack The acknowledgment flag
286
309
  */
287
- setState(
288
- /** The state ID. */
289
- id: string,
290
- /** The state value. */
291
- val: string | number | boolean | ioBroker.SettableState | null,
292
- /** The acknowledgment flag. */
293
- ack?: boolean): Promise<void>;
310
+ setState(id: string, val: string | number | boolean | ioBroker.SettableState | null, ack?: boolean): Promise<void>;
294
311
  /**
295
312
  * Gets all objects.
313
+ *
314
+ * @param update Set to true to retrieve all objects from the server (instead of using the local cache)
315
+ * @param disableProgressUpdate Don't call onProgress() when done
296
316
  */
297
- getObjects(
298
- /** Set to true to retrieve all objects from the server (instead of using the local cache). */
299
- update?: boolean,
300
- /** don't call onProgress() when done */
301
- disableProgressUpdate?: boolean): Promise<Record<string, ioBroker.Object>>;
317
+ getObjects(update?: boolean, disableProgressUpdate?: boolean): Promise<Record<string, ioBroker.Object>>;
302
318
  /**
303
319
  * Gets objects by list of IDs.
320
+ *
321
+ * @param list Array of object IDs to retrieve
304
322
  */
305
- getObjectsById(
306
- /** Array of object IDs to retrieve. */
307
- list: string[]): Promise<Record<string, ioBroker.Object>>;
323
+ getObjectsById(list: string[]): Promise<Record<string, ioBroker.Object>>;
308
324
  /**
309
325
  * Called internally.
310
326
  */
311
327
  private _subscribe;
312
328
  /**
313
329
  * Requests log updates.
330
+ *
331
+ * @param isEnabled Set to true to get logs
314
332
  */
315
- requireLog(
316
- /** Set to true to get logs. */
317
- isEnabled: boolean): Promise<void>;
333
+ requireLog(isEnabled: boolean): Promise<void>;
318
334
  /**
319
335
  * Deletes the given object.
336
+ *
337
+ * @param id The object ID
338
+ * @param maintenance Force deletion of non-conform IDs
320
339
  */
321
- delObject(
322
- /** The object ID. */
323
- id: string,
324
- /** Force deletion of non-conform IDs. */
325
- maintenance?: boolean): Promise<void>;
340
+ delObject(id: string, maintenance?: boolean): Promise<void>;
326
341
  /**
327
342
  * Deletes the given object and all its children.
343
+ *
344
+ * @param id The object ID
345
+ * @param maintenance Force deletion of non-conform IDs
328
346
  */
329
- delObjects(
330
- /** The object ID. */
331
- id: string,
332
- /** Force deletion of non-conform IDs. */
333
- maintenance?: boolean): Promise<void>;
347
+ delObjects(id: string, maintenance?: boolean): Promise<void>;
334
348
  /**
335
349
  * Sets the object.
336
350
  */
@@ -341,53 +355,48 @@ declare class Connection {
341
355
  getObject(id: string): Promise<ioBroker.Object>;
342
356
  /**
343
357
  * Get all instances of the given adapter or all instances of all adapters.
358
+ *
359
+ * @param adapter The name of the adapter
360
+ * @param update Force update
344
361
  */
345
- getAdapterInstances(
346
- /** The name of the adapter. */
347
- adapter?: string | boolean,
348
- /** Force update. */
349
- update?: boolean): Promise<ioBroker.InstanceObject[]>;
362
+ getAdapterInstances(adapter?: string | boolean, update?: boolean): Promise<ioBroker.InstanceObject[]>;
350
363
  /**
351
364
  * Get adapters with the given name or all adapters.
365
+ *
366
+ * @param adapter The name of the adapter
367
+ * @param update Force update
352
368
  */
353
- getAdapters(
354
- /** The name of the adapter. */
355
- adapter?: string | boolean,
356
- /** Force update. */
357
- update?: boolean): Promise<ioBroker.AdapterObject[]>;
369
+ getAdapters(adapter?: string | boolean, update?: boolean): Promise<ioBroker.AdapterObject[]>;
358
370
  /**
359
371
  * Called internally.
360
372
  */
361
373
  private _renameGroups;
362
374
  /**
363
375
  * Rename a group.
376
+ *
364
377
  * @param id The id.
365
- * @param newId The new id.
366
- * @param {string | { [lang in ioBroker.Languages]?: string; }} newName The new name.
378
+ * @param newId The new id.
379
+ * @param newName The new name.
367
380
  */
368
381
  renameGroup(id: string, newId: string, newName: ioBroker.StringOrTranslated): Promise<void>;
369
382
  /**
370
383
  * Sends a message to a specific instance or all instances of some specific adapter.
371
- * @returns {Promise<ioBroker.Message | undefined>}
372
- */
373
- sendTo(
374
- /** The instance to send this message to. */
375
- instance: string,
376
- /** Command name of the target instance. */
377
- command: string,
378
- /** The message data to send. */
379
- data: any): Promise<{
384
+ *
385
+ * @param instance The instance to send this message to.
386
+ * @param command Command name of the target instance.
387
+ * @param data The message data to send.
388
+ */
389
+ sendTo(instance: string, command: string, data: any): Promise<{
380
390
  result?: any;
381
391
  error?: string;
382
392
  }>;
383
393
  /**
384
394
  * Extend an object and create it if it might not exist.
395
+ *
396
+ * @param id The id.
397
+ * @param obj The object.
385
398
  */
386
- extendObject(
387
- /** The id. */
388
- id: string,
389
- /** The object. */
390
- obj: ioBroker.PartialObject): Promise<void>;
399
+ extendObject(id: string, obj: ioBroker.PartialObject): Promise<void>;
391
400
  /**
392
401
  * Register a handler for log messages.
393
402
  */
@@ -406,7 +415,8 @@ declare class Connection {
406
415
  unregisterConnectionHandler(handler: (connected: boolean) => void): void;
407
416
  /**
408
417
  * Set the handler for standard output of a command.
409
- * @param {(id: string, text: string) => void} handler The handler.
418
+ *
419
+ * @param handler The handler.
410
420
  */
411
421
  registerCmdStdoutHandler(handler: (id: string, text: string) => void): void;
412
422
  /**
@@ -415,7 +425,8 @@ declare class Connection {
415
425
  unregisterCmdStdoutHandler(): void;
416
426
  /**
417
427
  * Set the handler for standard error of a command.
418
- * @param {(id: string, text: string) => void} handler The handler.
428
+ *
429
+ * @param handler The handler.
419
430
  */
420
431
  registerCmdStderrHandler(handler: (id: string, text: string) => void): void;
421
432
  /**
@@ -440,10 +451,11 @@ declare class Connection {
440
451
  update?: boolean): Promise<Record<string, ioBroker.EnumObject>>;
441
452
  /**
442
453
  * Query a predefined object view.
454
+ *
443
455
  * @param design design - 'system' or other designs like `custom`.
444
456
  * @param type The type of object.
445
457
  * @param start The start ID.
446
- * @param [end] The end ID.
458
+ * @param end The end ID.
447
459
  */
448
460
  getObjectViewCustom(
449
461
  /** The design: 'system' or other designs like `custom`. */
@@ -456,32 +468,27 @@ declare class Connection {
456
468
  end?: string): Promise<Record<string, ioBroker.Object>>;
457
469
  /**
458
470
  * Query a predefined object view.
471
+ *
459
472
  * @param type The type of object.
460
473
  * @param start The start ID.
461
- * @param [end] The end ID.
474
+ * @param end The end ID.
462
475
  */
463
- getObjectViewSystem(
464
- /** The type of object. */
465
- type: ioBroker.ObjectType,
466
- /** The start ID. */
467
- start: string,
468
- /** The end ID. */
469
- end?: string): Promise<Record<string, ioBroker.Object>>;
476
+ getObjectViewSystem(type: ioBroker.ObjectType, start: string, end?: string): Promise<Record<string, ioBroker.Object>>;
470
477
  /**
471
478
  * @deprecated since version 1.1.15, cause parameter order does not match backend
479
+ *
472
480
  * Query a predefined object view.
473
- * @param {string} start The start ID.
474
- * @param {string} end The end ID.
475
- * @param {string} type The type of object.
476
- * @returns {Promise<Record<string, ioBroker.Object>>}
481
+ * @param start The start ID.
482
+ * @param end The end ID.
483
+ * @param type The type of object.
477
484
  */
478
485
  getObjectView(start: string, end: string, type: ioBroker.ObjectType): Promise<Record<string, ioBroker.Object>>;
479
486
  /**
480
487
  * Get the stored certificates.
488
+ *
489
+ * @param update Force update.
481
490
  */
482
- getCertificates(
483
- /** Force update. */
484
- update?: boolean): Promise<{
491
+ getCertificates(update?: boolean): Promise<{
485
492
  name: string;
486
493
  type: 'public' | 'private' | 'chained' | '';
487
494
  }[]>;
@@ -503,114 +510,107 @@ declare class Connection {
503
510
  readMetaItems(): Promise<ioBroker.MetaObject[]>;
504
511
  /**
505
512
  * Read the directory of an adapter.
513
+ *
514
+ * @param adapter The adapter name.
515
+ * @param fileName The directory name.
506
516
  */
507
- readDir(
508
- /** The adapter name. */
509
- adapter: string,
510
- /** The directory name. */
511
- fileName: string): Promise<ioBroker.ReadDirResult[]>;
517
+ readDir(adapter: string, fileName: string): Promise<ioBroker.ReadDirResult[]>;
512
518
  /**
513
519
  * Read a file of an adapter.
520
+ *
521
+ * @param adapter The adapter name.
522
+ * @param fileName The file name.
523
+ * @param base64 If it must be a base64 format.
514
524
  */
515
- readFile(
516
- /** The adapter name. */
517
- adapter: string,
518
- /** The file name. */
519
- fileName: string,
520
- /** If it must be a base64 format */
521
- base64?: boolean): Promise<string | {
525
+ readFile(adapter: string, fileName: string, base64?: boolean): Promise<string | {
522
526
  data: string;
523
527
  type: string;
524
528
  }>;
525
529
  /**
526
530
  * Write a file of an adapter.
531
+ *
532
+ * @param adapter The adapter name.
533
+ * @param fileName The file name.
534
+ * @param data The data (if it's a Buffer, it will be converted to Base64)
527
535
  */
528
- writeFile64(
529
- /** The adapter name. */
530
- adapter: string,
531
- /** The file name. */
532
- fileName: string,
533
- /** The data (if it's a Buffer, it will be converted to Base64). */
534
- data: Buffer | string): Promise<void>;
536
+ writeFile64(adapter: string, fileName: string, data: Buffer | string): Promise<void>;
535
537
  /**
536
538
  * Delete a file of an adapter.
539
+ *
540
+ * @param adapter The adapter name.
541
+ * @param fileName The file name.
537
542
  */
538
- deleteFile(
539
- /** The adapter name. */
540
- adapter: string,
541
- /** The file name. */
542
- fileName: string): Promise<void>;
543
+ deleteFile(adapter: string, fileName: string): Promise<void>;
543
544
  /**
544
545
  * Delete a folder of an adapter.
545
546
  * All files in folder will be deleted.
547
+ *
548
+ * @param adapter The adapter name.
549
+ * @param folderName The folder name.
546
550
  */
547
- deleteFolder(
548
- /** The adapter name. */
549
- adapter: string,
550
- /** The file name. */
551
- folderName: string): Promise<void>;
551
+ deleteFolder(adapter: string, folderName: string): Promise<void>;
552
552
  /**
553
553
  * Get the list of all hosts.
554
- * @param {boolean} [update] Force update.
554
+ *
555
+ * @param update Force update.
555
556
  */
556
557
  getHosts(update?: boolean): Promise<ioBroker.HostObject[]>;
557
558
  /**
558
559
  * Get the list of all users.
560
+ *
561
+ * @param update Force update.
559
562
  */
560
- getUsers(
561
- /** Force update. */
562
- update?: boolean): Promise<ioBroker.UserObject[]>;
563
+ getUsers(update?: boolean): Promise<ioBroker.UserObject[]>;
563
564
  /**
564
565
  * Get the list of all groups.
566
+ *
567
+ * @param update Force update.
565
568
  */
566
- getGroups(
567
- /** Force update. */
568
- update?: boolean): Promise<ioBroker.GroupObject[]>;
569
+ getGroups(update?: boolean): Promise<ioBroker.GroupObject[]>;
569
570
  /**
570
571
  * Get the host information.
572
+ *
573
+ * @param host The host name.
574
+ * @param update Force update.
575
+ * @param timeoutMs Optional read timeout.
571
576
  */
572
- getHostInfo(host: string,
573
- /** Force update. */
574
- update?: boolean,
575
- /** optional read timeout. */
576
- timeoutMs?: number): Promise<HostInfo>;
577
+ getHostInfo(host: string, update?: boolean, timeoutMs?: number): Promise<HostInfo>;
577
578
  /**
578
579
  * Get the host information (short version).
580
+ *
581
+ * @param host The host name.
582
+ * @param update Force update.
583
+ * @param timeoutMs Optional read timeout.
579
584
  */
580
- getHostInfoShort(host: string,
581
- /** Force update. */
582
- update?: boolean,
583
- /** optional read timeout. */
584
- timeoutMs?: number): Promise<HostInfo>;
585
+ getHostInfoShort(host: string, update?: boolean, timeoutMs?: number): Promise<HostInfo>;
585
586
  /**
586
587
  * Get the repository.
588
+ *
589
+ * @param host The host name.
590
+ * @param options Options.
591
+ * @param update Force update.
592
+ * @param timeoutMs Timeout in ms.
587
593
  */
588
594
  getRepository(host: string, options?: {
589
595
  update: boolean;
590
596
  repo: string;
591
- } | string,
592
- /** Force update. */
593
- update?: boolean,
594
- /** timeout in ms. */
595
- timeoutMs?: number): Promise<Record<string, ioBroker.AdapterObject>>;
597
+ } | string, update?: boolean, timeoutMs?: number): Promise<Record<string, ioBroker.AdapterObject>>;
596
598
  /**
597
599
  * Get the installed.
600
+ *
601
+ * @param host The host name.
602
+ * @param update Force update.
603
+ * @param cmdTimeout Timeout in ms.
598
604
  */
599
- getInstalled(host: string,
600
- /** Force update. */
601
- update?: boolean,
602
- /** timeout in ms */
603
- cmdTimeout?: number): Promise<Record<string, ioBroker.AdapterObject>>;
605
+ getInstalled(host: string, update?: boolean, cmdTimeout?: number): Promise<Record<string, ioBroker.AdapterObject>>;
604
606
  /**
605
607
  * Rename file or folder in ioBroker DB
608
+ *
609
+ * @param adapter Instance name, like `vis-2.0`.
610
+ * @param oldName The current file name, e.g., main/vis-views.json
611
+ * @param newName The new file name, e.g., main/vis-views-new.json
606
612
  */
607
- rename(
608
- /** instance name */
609
- adapter: string,
610
- /** current file name, e.g., main/vis-views.json */
611
- oldName: string,
612
- /** new file name, e.g., main/vis-views-new.json */
613
- newName: string): Promise<void>;
613
+ rename(adapter: string, oldName: string, newName: string): Promise<void>;
614
614
  /**
615
615
  * Rename file in ioBroker DB
616
616
  */
@@ -647,11 +647,11 @@ declare class Connection {
647
647
  readBaseSettings(host: string): Promise<Record<string, any>>;
648
648
  /**
649
649
  * Write the base settings of a given host.
650
- * @param {string} host
651
- * @param {any} config
652
- * @returns {Promise<any>}
650
+ *
651
+ * @param host The host name.
652
+ * @param config The new base settings.
653
653
  */
654
- writeBaseSettings(host: string, config: Record<string, any>): Promise<{
654
+ writeBaseSettings(host: string, config: IoBJson): Promise<{
655
655
  result?: 'ok';
656
656
  error?: string;
657
657
  }>;
@@ -661,9 +661,9 @@ declare class Connection {
661
661
  restartController(host: string): Promise<boolean>;
662
662
  /**
663
663
  * Read statistics information from host
664
- * @param {string} host
665
- * @param {string} typeOfDiag one of none, normal, no-city, extended
666
- * @returns {Promise<any>}
664
+ *
665
+ * @param host Host name
666
+ * @param typeOfDiag one of none, normal, no-city, extended
667
667
  */
668
668
  getDiagData(host: string, typeOfDiag: 'none' | 'normal' | 'no-city' | 'extended'): Promise<Record<string, any>>;
669
669
  /**
@@ -672,13 +672,12 @@ declare class Connection {
672
672
  getForeignStates(pattern?: string): Promise<Record<string, ioBroker.State>>;
673
673
  /**
674
674
  * Get foreign objects by pattern, by specific type and resolve their enums. (Only admin)
675
- * @returns {ioBroker.GetObjectsPromise}
676
675
  */
677
676
  getForeignObjects(pattern: string, type?: ioBroker.ObjectType): Promise<Record<string, ioBroker.State>>;
678
677
  /**
679
678
  * Gets the system configuration.
680
- * @param {boolean} [update] Force update.
681
- * @returns {Promise<ioBroker.OtherObject>}
679
+ *
680
+ * @param update Force update.
682
681
  */
683
682
  getSystemConfig(update?: boolean): Promise<ioBroker.SystemConfigObject>;
684
683
  /**
@@ -731,7 +730,6 @@ declare class Connection {
731
730
  decrypt(encryptedText: string): Promise<string>;
732
731
  /**
733
732
  * Gets the version.
734
- * @returns {Promise<{version: string; serverName: string}>}
735
733
  */
736
734
  getVersion(update?: boolean): Promise<{
737
735
  version: string;
@@ -739,11 +737,11 @@ declare class Connection {
739
737
  }>;
740
738
  /**
741
739
  * Gets the web server name.
742
- * @returns {Promise<string>}
743
740
  */
744
741
  getWebServerName(): Promise<string>;
745
742
  /**
746
743
  * Gets the admin version.
744
+ *
747
745
  * @deprecated use getVersion()
748
746
  */
749
747
  getAdminVersion(): Promise<{
@@ -751,28 +749,29 @@ declare class Connection {
751
749
  serverName: string;
752
750
  }>;
753
751
  /**
754
- * Change access rights for file
752
+ * Change access rights for a file
753
+ *
754
+ * @param adapter The adapter name.
755
+ * @param fileName file name with a full path. It could be like vis.0/*
756
+ * @param options like {mode: 0x644}
757
+ * @param options.mode Access rights. Default is 0x644
755
758
  */
756
- chmodFile(
757
- /** adapter name */
758
- adapter: string,
759
- /** file name with a full path. It could be like vis.0/* */
760
- filename: string,
761
- /** like {mode: 0x644} */
762
- options?: {
759
+ chmodFile(adapter: string, fileName: string, options?: {
763
760
  mode: number;
764
761
  }): Promise<{
765
762
  entries: ioBroker.ChownFileResult[];
766
763
  id: string;
767
764
  }>;
768
765
  /**
769
- * Change an owner or/and owner group for file
766
+ * Change an owner or/and owner group for a file
767
+ *
768
+ * @param adapter The adapter name.
769
+ * @param fileName file name with a full path. It could be like vis.0/*
770
+ * @param options like {owner: 'user', ownerGroup: 'group'}
771
+ * @param options.owner User name
772
+ * @param options.ownerGroup Group name
770
773
  */
771
- chownFile(
772
- /** adapter name */
773
- adapter: string,
774
- /** file name with a full path. It could be like vis.0/* */
775
- fileName: string, options: {
774
+ chownFile(adapter: string, fileName: string, options: {
776
775
  owner?: string;
777
776
  ownerGroup?: string;
778
777
  }): Promise<{
@@ -781,22 +780,20 @@ declare class Connection {
781
780
  }>;
782
781
  /**
783
782
  * Check if the file exists
783
+ *
784
+ * @param adapter The adapter name.
785
+ * @param fileName file name with a full path. It could be like vis.0/*
784
786
  */
785
- fileExists(
786
- /** adapter name */
787
- adapter: string,
788
- /** file name with a full path. It could be like vis.0/* */
789
- fileName: string): Promise<boolean>;
787
+ fileExists(adapter: string, fileName: string): Promise<boolean>;
790
788
  /**
791
789
  * Get the alarm notifications from a host (only for admin connection).
792
- * @returns {Promise<any>}
793
790
  */
794
791
  getNotifications(host: string, category?: string): Promise<FilteredNotificationInformation>;
795
792
  /**
796
793
  * Clear the alarm notifications on a host (only for admin connection).
797
- * @param {string} host
798
- * @param {string} [category] - optional
799
- * @returns {Promise<any>}
794
+ *
795
+ * @param host The host name.
796
+ * @param category optional
800
797
  */
801
798
  clearNotifications(host: string, category?: string): Promise<{
802
799
  result: 'ok';
@@ -807,18 +804,17 @@ declare class Connection {
807
804
  getIsEasyModeStrict(): Promise<boolean>;
808
805
  /**
809
806
  * Read easy mode configuration (only for admin connection).
810
- * @returns {Promise<any>}
811
807
  */
812
808
  getEasyMode(): Promise<any>;
813
809
  /**
814
810
  * Read current user
815
- * @returns {Promise<string>}
816
811
  */
817
812
  getCurrentUser(): Promise<string>;
818
- getCurrentSession(cmdTimeout?: number): Promise<unknown>;
813
+ getCurrentSession(cmdTimeout?: number): Promise<{
814
+ expireInSec: number;
815
+ }>;
819
816
  /**
820
817
  * Read adapter ratings
821
- * @returns {Promise<any>}
822
818
  */
823
819
  getRatings(update?: boolean): Promise<any>;
824
820
  /**
@@ -834,14 +830,14 @@ declare class Connection {
834
830
  * Reads only version of installed adapter
835
831
  */
836
832
  getCompactInstalled(host: string, update?: boolean, cmdTimeout?: number): Promise<Record<string, ioBroker.AdapterObject>>;
837
- getCompactSystemRepositories(update?: boolean, cmdTimeout?: number): Promise<ioBroker.Object>;
833
+ getCompactSystemRepositories(update?: boolean, cmdTimeout?: number): Promise<CompactSystemRepository>;
838
834
  getCompactSystemConfig(update?: boolean): Promise<ioBroker.SystemConfigObject>;
839
835
  /**
840
836
  * Get the repository in compact form (only version and icon).
841
- * @param {string} host
842
- * @param {boolean} [update] Force update.
843
- * @param {number} [timeoutMs] timeout in ms.
844
- * @returns {Promise<any>}
837
+ *
838
+ * @param host The host name.
839
+ * @param update Force update.
840
+ * @param timeoutMs timeout in ms.
845
841
  */
846
842
  getCompactRepository(host: string, update?: boolean, timeoutMs?: number): Promise<Record<string, {
847
843
  version: string;
@@ -858,41 +854,37 @@ declare class Connection {
858
854
  getUuid(): Promise<string | undefined>;
859
855
  /**
860
856
  * Subscribe on instance message
861
- * @param {string} [targetInstance] instance, like 'cameras.0'
862
- * @param {string} [messageType] message type like 'startCamera/cam3'
863
- * @param {object} [data] optional data object
864
- * @param {function} [callback] message handler
865
- * @returns {Promise<null>}
866
- */
867
- subscribeOnInstance(
868
- /** instance, like 'cameras.0' */
869
- targetInstance: string,
870
- /** message type like 'startCamera/cam3' */
871
- messageType: string, data: any,
872
- /** message handler. Could be null if all callbacks for this messageType should be unsubscribed */
873
- callback: (_data: Record<string, any>, sourceInstance: string, _messageType: string) => void): Promise<unknown>;
857
+ *
858
+ * @param targetInstance instance, like 'cameras.0'
859
+ * @param messageType message type like 'startCamera/cam3'
860
+ * @param data optional data object
861
+ * @param callback message handler
862
+ */
863
+ subscribeOnInstance(targetInstance: string, messageType: string, data: any, callback: (_data: Record<string, any>, sourceInstance: string, _messageType: string) => void): Promise<{
864
+ error?: string;
865
+ accepted?: boolean;
866
+ heartbeat?: number;
867
+ }>;
874
868
  /**
875
869
  * Unsubscribe from instance message
870
+ *
871
+ * @param targetInstance instance, like 'cameras.0'
872
+ * @param messageType message type like 'startCamera/cam3'
873
+ * @param callback message handler. Could be null if all callbacks for this messageType should be unsubscribed
876
874
  */
877
- unsubscribeFromInstance(
878
- /** instance, like 'cameras.0' */
879
- targetInstance: string,
880
- /** message type like 'startCamera/cam3' */
881
- messageType?: string,
882
- /** message handler. Could be null if all callbacks for this messageType should be unsubscribed */
883
- callback?: (data: Record<string, any>, sourceInstance: string, _messageType: string) => void): Promise<boolean>;
875
+ unsubscribeFromInstance(targetInstance: string, messageType?: string, callback?: (data: Record<string, any>, sourceInstance: string, _messageType: string) => void): Promise<boolean>;
884
876
  /**
885
877
  * Send log to ioBroker log
886
878
  */
887
879
  log(text: string, level?: 'info' | 'debug' | 'warn' | 'error' | 'silly'): void;
888
880
  /**
889
881
  * Logout current user
890
- * @returns {Promise<null>}
891
882
  */
892
883
  logout(): Promise<void>;
893
884
  /**
894
885
  * This is a special method for vis.
895
886
  * It is used to not send to server the changes about "nothing_selected" state
887
+ *
896
888
  * @param id The state that has to be ignored by communication
897
889
  */
898
890
  setStateToIgnore(id?: string | null): void;