@iobroker/js-controller-adapter 7.2.2 → 7.2.3-alpha.1-20260621-61726ea22

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 (38) hide show
  1. package/build/cjs/lib/_Types.d.ts +256 -0
  2. package/build/cjs/lib/adapter/adapter.d.ts +1403 -3
  3. package/build/cjs/lib/adapter/adapter.js +147 -24
  4. package/build/cjs/lib/adapter/adapter.js.map +2 -2
  5. package/build/cjs/lib/adapter/defaultObjs.d.ts +5 -0
  6. package/build/cjs/lib/adapter/defaultObjs.js.map +2 -2
  7. package/build/cjs/lib/adapter/log.d.ts +25 -0
  8. package/build/cjs/lib/adapter/log.js +25 -0
  9. package/build/cjs/lib/adapter/log.js.map +2 -2
  10. package/build/cjs/lib/adapter/userInterfaceMessagingController.d.ts +10 -0
  11. package/build/cjs/lib/adapter/userInterfaceMessagingController.js +3 -0
  12. package/build/cjs/lib/adapter/userInterfaceMessagingController.js.map +2 -2
  13. package/build/cjs/lib/adapter/validator.d.ts +4 -0
  14. package/build/cjs/lib/adapter/validator.js.map +2 -2
  15. package/build/esm/lib/_Types.d.ts +256 -0
  16. package/build/esm/lib/_Types.d.ts.map +1 -1
  17. package/build/esm/lib/adapter/adapter.d.ts +1403 -3
  18. package/build/esm/lib/adapter/adapter.d.ts.map +1 -1
  19. package/build/esm/lib/adapter/adapter.js +147 -24
  20. package/build/esm/lib/adapter/adapter.js.map +1 -1
  21. package/build/esm/lib/adapter/defaultObjs.d.ts +5 -0
  22. package/build/esm/lib/adapter/defaultObjs.d.ts.map +1 -1
  23. package/build/esm/lib/adapter/defaultObjs.js +5 -0
  24. package/build/esm/lib/adapter/defaultObjs.js.map +1 -1
  25. package/build/esm/lib/adapter/log.d.ts +25 -0
  26. package/build/esm/lib/adapter/log.d.ts.map +1 -1
  27. package/build/esm/lib/adapter/log.js +25 -0
  28. package/build/esm/lib/adapter/log.js.map +1 -1
  29. package/build/esm/lib/adapter/userInterfaceMessagingController.d.ts +10 -0
  30. package/build/esm/lib/adapter/userInterfaceMessagingController.d.ts.map +1 -1
  31. package/build/esm/lib/adapter/userInterfaceMessagingController.js +6 -0
  32. package/build/esm/lib/adapter/userInterfaceMessagingController.js.map +1 -1
  33. package/build/esm/lib/adapter/validator.d.ts +4 -0
  34. package/build/esm/lib/adapter/validator.d.ts.map +1 -1
  35. package/build/esm/lib/adapter/validator.js +3 -0
  36. package/build/esm/lib/adapter/validator.js.map +1 -1
  37. package/build/tsconfig.build.tsbuildinfo +1 -1
  38. package/package.json +10 -10
@@ -7,15 +7,23 @@ import type { AdapterOptions, CalculatePermissionsCallback, CheckGroupCallback,
7
7
  * Here we define dynamically created methods
8
8
  */
9
9
  export interface AdapterClass {
10
+ /** Listen for state changes */
10
11
  on(event: 'stateChange', listener: ioBroker.StateChangeHandler): this;
12
+ /** Listen for object changes */
11
13
  on(event: 'objectChange', listener: ioBroker.ObjectChangeHandler): this;
14
+ /** Listen for file changes */
12
15
  on(event: 'fileChange', listener: ioBroker.FileChangeHandler): this;
16
+ /** Emitted when the adapter is ready */
13
17
  on(event: 'ready', listener: ioBroker.ReadyHandler): this;
18
+ /** Emitted when the adapter is installed */
14
19
  on(event: 'install', listener: ioBroker.ReadyHandler): this;
20
+ /** Emitted when the adapter is unloaded */
15
21
  on(event: 'unload', listener: ioBroker.UnloadHandler): this;
22
+ /** Emitted when a message is received */
16
23
  on(event: 'message', listener: ioBroker.MessageHandler): this;
17
24
  /** Only emitted for compact instances */
18
25
  on(event: 'exit', listener: (exitCode: number, reason: string) => Promise<void> | void): this;
26
+ /** Emitted on a new log message */
19
27
  on(event: 'log', listener: (message: ioBroker.LogMessage) => Promise<void> | void): this;
20
28
  /**
21
29
  * Extend an object and create it if it might not exist
@@ -66,11 +74,15 @@ export interface AdapterClass {
66
74
  setForeignObjectNotExistsAsync<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options?: unknown): ioBroker.SetObjectPromise;
67
75
  /** deletes a device, its channels and states */
68
76
  deleteDeviceAsync(deviceName: string, options?: unknown): Promise<void>;
77
+ /** Adds a channel to an enum */
69
78
  addChannelToEnumAsync(enumName: string, addTo: string, parentDevice: string, channelName: string, options?: unknown): Promise<void>;
79
+ /** Removes a channel from an enum */
70
80
  deleteChannelFromEnumAsync(enumName: string, parentDevice: string, channelName: string, options?: unknown): Promise<void>;
71
81
  /** Returns a list of all devices in this adapter instance */
72
82
  getDevicesAsync(options?: unknown): Promise<ioBroker.DeviceObject[]>;
83
+ /** Adds a state to an enum */
73
84
  addStateToEnumAsync(enumName: string, addTo: string, parentDevice: string, parentChannel: string, stateName: string, options?: unknown): Promise<void>;
85
+ /** Removes a state from an enum */
74
86
  deleteStateFromEnumAsync(enumName: string, parentDevice: string, parentChannel: string, stateName: string, options?: unknown): Promise<void>;
75
87
  /** Changes access rights of all files in the adapter directory */
76
88
  chmodFileAsync(adapter: string | null, path: string, options: {
@@ -79,6 +91,7 @@ export interface AdapterClass {
79
91
  entries: ioBroker.ChownFileResult[];
80
92
  id: string;
81
93
  }>;
94
+ /** Changes the owner of all files in the adapter directory */
82
95
  chownFileAsync(...args: any[]): Promise<any>;
83
96
  /** reads the content of directory from DB for given adapter and path */
84
97
  readDirAsync(adapterName: string | null, path: string, options?: unknown): ioBroker.ReadDirPromise;
@@ -86,10 +99,13 @@ export interface AdapterClass {
86
99
  unlinkAsync(adapterName: string | null, path: string, options?: unknown): Promise<void>;
87
100
  /** Deletes a given file */
88
101
  delFileAsync(adapterName: string | null, path: string, options?: unknown): Promise<void>;
102
+ /** Renames a file in the DB */
89
103
  renameAsync(adapterName: string | null, oldName: string, newName: string, options?: unknown): Promise<void>;
104
+ /** Creates a directory in the DB */
90
105
  mkdirAsync(adapterName: string | null, path: string, options?: unknown): Promise<void>;
91
106
  /** reads the content of directory from DB for given adapter and path */
92
107
  readFileAsync(adapterName: string | null, path: string, options?: unknown): ioBroker.ReadFilePromise;
108
+ /** Writes a file into the DB */
93
109
  writeFileAsync(adapterName: string | null, path: string, data: Buffer | string, options?: unknown): Promise<void>;
94
110
  /** Checks if a file exists in the DB */
95
111
  fileExistsAsync(adapterName: string | null, path: string, options?: unknown): Promise<boolean>;
@@ -141,6 +157,13 @@ export interface AdapterClass {
141
157
  * @deprecated use `adapter.setForeignObject` without a callback instead
142
158
  */
143
159
  setForeignObjectAsync<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options?: unknown): ioBroker.SetObjectPromise;
160
+ /**
161
+ * Get the certificates of the system.
162
+ *
163
+ * @param publicName name of the public certificate
164
+ * @param privateName name of the private key
165
+ * @param chainedName name of the chained certificate
166
+ */
144
167
  getCertificatesAsync(publicName?: string, privateName?: string, chainedName?: string): Promise<GetCertificatesPromiseReturnType>;
145
168
  /** Get all states, channels, devices and folders of this adapter */
146
169
  getAdapterObjectsAsync(): Promise<Record<string, ioBroker.AdapterScopedObject>>;
@@ -150,28 +173,81 @@ export interface AdapterClass {
150
173
  * Writes a value (which might not belong to this adapter) into the states DB only if it has changed.
151
174
  */
152
175
  setForeignStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack?: boolean): ioBroker.SetStateChangedPromise;
176
+ /**
177
+ * Writes a value (which might not belong to this adapter) into the states DB only if it has changed.
178
+ *
179
+ * @param id object ID of the state
180
+ * @param state simple value or object with attributes
181
+ * @param options optional user context
182
+ */
153
183
  setForeignStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options?: unknown): ioBroker.SetStateChangedPromise;
184
+ /**
185
+ * Writes a value (which might not belong to this adapter) into the states DB only if it has changed.
186
+ *
187
+ * @param id object ID of the state
188
+ * @param state simple value or object with attributes
189
+ * @param ack is command(false) or status(true)
190
+ * @param options optional user context
191
+ */
154
192
  setForeignStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown): ioBroker.SetStateChangedPromise;
155
193
  /**
156
194
  * Writes a value into the states DB only if it has changed.
157
195
  */
158
196
  setStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack?: boolean): ioBroker.SetStateChangedPromise;
197
+ /**
198
+ * Writes a value into the states DB only if it has changed.
199
+ *
200
+ * @param id object ID of the state
201
+ * @param state simple value or object with attributes
202
+ * @param options optional user context
203
+ */
159
204
  setStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options?: unknown): ioBroker.SetStateChangedPromise;
205
+ /**
206
+ * Writes a value into the states DB only if it has changed.
207
+ *
208
+ * @param id object ID of the state
209
+ * @param state simple value or object with attributes
210
+ * @param ack is command(false) or status(true)
211
+ * @param options optional user context
212
+ */
160
213
  setStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown): ioBroker.SetStateChangedPromise;
161
214
  /**
162
215
  * Sends a message to a specific host or all hosts.
163
216
  */
164
217
  sendToHostAsync(hostName: string, message: ioBroker.MessagePayload): Promise<ioBroker.Message | undefined>;
218
+ /**
219
+ * Sends a message to a specific host or all hosts.
220
+ *
221
+ * @param hostName name of the host
222
+ * @param command command name
223
+ * @param message message to send
224
+ */
165
225
  sendToHostAsync(hostName: string, command: string, message: ioBroker.MessagePayload): Promise<ioBroker.Message | undefined>;
166
226
  /**
167
227
  * Sends a message to a specific instance or all instances of some specific adapter.
168
228
  */
169
229
  sendToAsync(instanceName: string, message: ioBroker.MessagePayload): Promise<ioBroker.Message | undefined>;
230
+ /**
231
+ * Sends a message to a specific instance or all instances of some specific adapter.
232
+ *
233
+ * @param instanceName name of the instance
234
+ * @param command command name
235
+ * @param message message to send
236
+ * @param options optional options to control the send behaviour
237
+ */
170
238
  sendToAsync(instanceName: string, command: string, message: ioBroker.MessagePayload, options?: SendToOptions): Promise<ioBroker.Message | undefined>;
171
239
  /**
172
240
  * Deletes a given file
173
241
  */
174
242
  delFile(adapterName: string | null, path: string, callback: ioBroker.ErrnoCallback): void;
243
+ /**
244
+ * Deletes a given file
245
+ *
246
+ * @param adapterName adapter name, or null for the current adapter
247
+ * @param path path to the file
248
+ * @param options optional user context
249
+ * @param callback return result
250
+ */
175
251
  delFile(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ErrnoCallback): void;
176
252
  /**
177
253
  * Writes a value into the states DB.
@@ -187,13 +263,41 @@ export interface AdapterClass {
187
263
  * Writes a value (which might not belong to this adapter) into the states DB.
188
264
  */
189
265
  setForeignStateAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack?: boolean): ioBroker.SetStatePromise;
266
+ /**
267
+ * Writes a value (which might not belong to this adapter) into the states DB.
268
+ *
269
+ * @param id object ID of the state
270
+ * @param state simple value or object with attributes
271
+ * @param options optional user context
272
+ */
190
273
  setForeignStateAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options?: unknown): ioBroker.SetStatePromise;
274
+ /**
275
+ * Writes a value (which might not belong to this adapter) into the states DB.
276
+ *
277
+ * @param id object ID of the state
278
+ * @param state simple value or object with attributes
279
+ * @param ack is command(false) or status(true)
280
+ * @param options optional user context
281
+ */
191
282
  setForeignStateAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown): ioBroker.SetStatePromise;
192
283
  /**
193
284
  * Get foreign objects by pattern, by specific type and resolve their enums.
194
285
  */
195
286
  getForeignObjectsAsync<T extends ioBroker.ObjectType>(pattern: Pattern, type: T, enums?: ioBroker.EnumList | null, options?: unknown): ioBroker.GetObjectsPromiseTyped<T>;
287
+ /**
288
+ * Get foreign objects by pattern and specific type.
289
+ *
290
+ * @param pattern the pattern to match object ids against
291
+ * @param type restrict the result to objects of this type
292
+ * @param options optional user context
293
+ */
196
294
  getForeignObjectsAsync<T extends ioBroker.ObjectType>(pattern: Pattern, type: T, options?: unknown): ioBroker.GetObjectsPromiseTyped<T>;
295
+ /**
296
+ * Get foreign objects by pattern.
297
+ *
298
+ * @param pattern the pattern to match object ids against
299
+ * @param options optional user context
300
+ */
197
301
  getForeignObjectsAsync(pattern: Pattern, options?: unknown): ioBroker.GetObjectsPromise;
198
302
  /**
199
303
  * creates an object with type device
@@ -248,18 +352,43 @@ export interface AdapterClass {
248
352
  * of the parent device to filter the channels by @param options (optional) Some internal options.
249
353
  */
250
354
  getChannelsOfAsync(): Promise<ioBroker.ChannelObject[]>;
355
+ /**
356
+ * Returns a list of all channels in this adapter instance, optionally filtered by parent device.
357
+ *
358
+ * @param parentDevice Name of the parent device to filter the channels by
359
+ * @param options Some internal options
360
+ */
251
361
  getChannelsOfAsync(parentDevice: string, options?: unknown): Promise<ioBroker.ChannelObject[]>;
252
362
  /**
253
363
  * Returns a list of all channels in this adapter instance
254
364
  */
255
365
  getChannels(callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
366
+ /**
367
+ * Returns a list of all channels in this adapter instance
368
+ *
369
+ * @param parentDevice Name of the parent device to filter the channels by
370
+ * @param callback return result
371
+ */
256
372
  getChannels(parentDevice: string, callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
373
+ /**
374
+ * Returns a list of all channels in this adapter instance
375
+ *
376
+ * @param parentDevice Name of the parent device to filter the channels by
377
+ * @param options optional user context
378
+ * @param callback return result
379
+ */
257
380
  getChannels(parentDevice: string, options: unknown, callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
258
381
  /**
259
382
  * Returns a list of all channels in this adapter instance @param parentDevice (optional)
260
383
  * Name of the parent device to filter the channels by @param options (optional) Some internal options.
261
384
  */
262
385
  getChannelsAsync(): Promise<ioBroker.ChannelObject[]>;
386
+ /**
387
+ * Returns a list of all channels in this adapter instance, optionally filtered by parent device.
388
+ *
389
+ * @param parentDevice Name of the parent device to filter the channels by
390
+ * @param options Some internal options
391
+ */
263
392
  getChannelsAsync(parentDevice: string, options?: unknown): Promise<ioBroker.ChannelObject[]>;
264
393
  /**
265
394
  * Returns a list of all states in this adapter instance @param parentDevice (optional)
@@ -267,7 +396,20 @@ export interface AdapterClass {
267
396
  * Name of the parent channel to filter the channels by @param options (optional) Some internal options.
268
397
  */
269
398
  getStatesOfAsync(): Promise<ioBroker.StateObject[]>;
399
+ /**
400
+ * Returns a list of all states in this adapter instance, optionally filtered by parent device/channel.
401
+ *
402
+ * @param parentDevice Name of the parent device to filter the states by
403
+ * @param parentChannel Name of the parent channel to filter the states by
404
+ */
270
405
  getStatesOfAsync(parentDevice: string, parentChannel?: string): Promise<ioBroker.StateObject[]>;
406
+ /**
407
+ * Returns a list of all states in this adapter instance, optionally filtered by parent device/channel.
408
+ *
409
+ * @param parentDevice Name of the parent device to filter the states by
410
+ * @param parentChannel Name of the parent channel to filter the states by
411
+ * @param options Some internal options
412
+ */
271
413
  getStatesOfAsync(parentDevice: string, parentChannel: string, options?: unknown): Promise<ioBroker.StateObject[]>;
272
414
  }
273
415
  /**
@@ -414,6 +556,9 @@ export declare class AdapterClass extends EventEmitter {
414
556
  private readonly SUPPORTED_FEATURES;
415
557
  /** Controller for messaging related functionality */
416
558
  private readonly uiMessagingController;
559
+ /**
560
+ * @param options Adapter options, or the adapter name as a string
561
+ */
417
562
  constructor(options: AdapterOptions | string);
418
563
  /**
419
564
  * Get the adapter scoped package identifier of a node module
@@ -421,47 +566,201 @@ export declare class AdapterClass extends EventEmitter {
421
566
  * @param moduleName name of the node module
422
567
  */
423
568
  getAdapterScopedPackageIdentifier(moduleName: string): string;
569
+ /**
570
+ * Install specified npm module
571
+ *
572
+ * @param moduleName name of the node module
573
+ * @param options install options including the version
574
+ */
424
575
  installNodeModule(moduleName: string, options: InstallNodeModuleOptions): Promise<CommandResult>;
425
576
  private _installNodeModule;
426
577
  /**
427
578
  * List all additional installed node modules from this adapter
428
579
  */
429
580
  listInstalledNodeModules(): Promise<string[]>;
581
+ /**
582
+ * Uninstall specified npm module
583
+ *
584
+ * @param moduleName name of the node module
585
+ */
430
586
  uninstallNodeModule(moduleName: string): Promise<CommandResult>;
587
+ /**
588
+ * Import a node module which has been installed via `installNodeModule`
589
+ *
590
+ * @param moduleName name of the node module
591
+ * @returns the required node module
592
+ */
431
593
  importNodeModule(moduleName: string): Promise<unknown>;
594
+ /**
595
+ * Decrypt the password/value with given key
596
+ *
597
+ * @param secretVal to use for decrypt (or value if only one parameter is given)
598
+ * @param value value to decrypt (if secret is provided)
599
+ */
432
600
  decrypt(secretVal: string, value?: string): string;
601
+ /**
602
+ * Decrypt the password/value with the system secret
603
+ *
604
+ * @param value value to decrypt
605
+ */
433
606
  decrypt(value: string): string;
607
+ /**
608
+ * Encrypt the password/value with given key
609
+ *
610
+ * @param secretVal to use for encrypting (or value if only one parameter is given)
611
+ * @param value value to encrypt (if secret is provided)
612
+ */
434
613
  encrypt(secretVal: string, value?: string): string;
614
+ /**
615
+ * Encrypt the password/value with the system secret
616
+ *
617
+ * @param value value to encrypt
618
+ */
435
619
  encrypt(value: string): string;
620
+ /**
621
+ * Read a session from the states DB
622
+ *
623
+ * @param id the session id
624
+ * @param callback return result
625
+ */
436
626
  getSession(id: string, callback: ioBroker.GetSessionCallback): MaybePromise;
437
627
  private _getSession;
628
+ /**
629
+ * Store a session in the states DB
630
+ *
631
+ * @param id the session id
632
+ * @param ttl time to live in seconds
633
+ * @param data the session data to store
634
+ * @param callback return result
635
+ */
438
636
  setSession(id: string, ttl: number, data: Record<string, any>, callback?: ioBroker.ErrorCallback): MaybePromise;
439
637
  private _setSession;
638
+ /**
639
+ * Destroy a session in the states DB
640
+ *
641
+ * @param id the session id
642
+ * @param callback return result
643
+ */
440
644
  destroySession(id: string, callback?: ioBroker.ErrorCallback): MaybePromise;
441
645
  private _destroySession;
442
646
  private _getObjectsByArray;
647
+ /**
648
+ * Stops the execution of adapter, but does not disable it.
649
+ *
650
+ * @param exitCode optional exit code
651
+ */
443
652
  terminate(exitCode?: number): never;
653
+ /**
654
+ * Stops the execution of adapter, but does not disable it.
655
+ *
656
+ * @param reason optional reason for termination
657
+ * @param exitCode optional exit code
658
+ */
444
659
  terminate(reason?: string, exitCode?: number): never;
660
+ /**
661
+ * Helper function to find next free port
662
+ *
663
+ * @param port port to start searching from
664
+ * @param host host to bind to
665
+ * @param callback return result
666
+ */
445
667
  getPort(port: number, host?: string, callback?: (port: number) => void): void;
668
+ /**
669
+ * Helper function to find next free port
670
+ *
671
+ * @param port port to start searching from
672
+ * @param callback return result
673
+ */
446
674
  getPort(port: number, callback?: (port: number) => void): void;
447
675
  private _getPort;
676
+ /**
677
+ * Method to check for available Features for adapter development
678
+ *
679
+ * @param featureName the name of the feature to check
680
+ * @returns true/false if the feature is in the list of supported features
681
+ */
448
682
  supportsFeature(featureName: ioBroker.SupportedFeature): boolean;
683
+ /**
684
+ * Validates user and password
685
+ *
686
+ * @param user user name as text
687
+ * @param pw password as text
688
+ * @param options optional user context
689
+ * @param callback return result
690
+ */
449
691
  checkPassword(user: string, pw: string, options: Record<string, any>, callback: CheckPasswordCallback): Promise<void>;
692
+ /**
693
+ * Validates user and password
694
+ *
695
+ * @param user user name as text
696
+ * @param pw password as text
697
+ * @param callback return result
698
+ */
450
699
  checkPassword(user: string, pw: string, callback: CheckPasswordCallback): Promise<void>;
451
700
  private _checkPassword;
452
701
  /**
453
702
  * This method updates the cached values in `this.usernames`
454
703
  */
455
704
  private _updateUsernameCache;
705
+ /**
706
+ * Return ID of given username
707
+ *
708
+ * @param username name of the user
709
+ */
456
710
  getUserID(username: string): Promise<string | undefined>;
457
711
  private _getUserID;
712
+ /**
713
+ * Sets the user's password
714
+ *
715
+ * @param user user name as text
716
+ * @param pw password as text
717
+ * @param options optional user context
718
+ * @param callback return result
719
+ */
458
720
  setPassword(user: string, pw: string, options: Record<string, any>, callback?: ioBroker.ErrorCallback): Promise<void>;
721
+ /**
722
+ * Sets the user's password
723
+ *
724
+ * @param user user name as text
725
+ * @param pw password as text
726
+ * @param callback return result
727
+ */
459
728
  setPassword(user: string, pw: string, callback?: ioBroker.ErrorCallback): Promise<void>;
460
729
  private _setPassword;
730
+ /**
731
+ * Returns if user exists and is in the group
732
+ *
733
+ * @param user user name as text
734
+ * @param group group name
735
+ * @param options optional user context
736
+ * @param callback return result
737
+ */
461
738
  checkGroup(user: string, group: string, options: Record<string, any>, callback?: CheckGroupCallback): Promise<void>;
739
+ /**
740
+ * Returns if user exists and is in the group
741
+ *
742
+ * @param user user name as text
743
+ * @param group group name
744
+ * @param callback return result
745
+ */
462
746
  checkGroup(user: string, group: string, callback?: CheckGroupCallback): Promise<void>;
463
747
  private _checkGroup;
748
+ /**
749
+ * Calculate the effective permissions of a user for the given commands
750
+ *
751
+ * @param user user name as text
752
+ * @param commandsPermissions the permission requirements of the commands
753
+ * @param options optional user context
754
+ * @param callback return result
755
+ */
464
756
  calculatePermissions(user: string, commandsPermissions: CommandsPermissions, options?: Record<string, any>, callback?: CalculatePermissionsCallback): Promise<void | ioBroker.PermissionSet>;
757
+ /**
758
+ * Calculate the effective permissions of a user for the given commands
759
+ *
760
+ * @param user user name as text
761
+ * @param commandsPermissions the permission requirements of the commands
762
+ * @param callback return result
763
+ */
465
764
  calculatePermissions(user: string, commandsPermissions: CommandsPermissions, callback?: CalculatePermissionsCallback): Promise<void | ioBroker.PermissionSet>;
466
765
  private _calculatePermissions;
467
766
  /**
@@ -477,6 +776,14 @@ export declare class AdapterClass extends EventEmitter {
477
776
  * @param cert cert or path to cert
478
777
  */
479
778
  private _readFileCertificate;
779
+ /**
780
+ * Get the certificates of the system.
781
+ *
782
+ * @param publicName name of the public certificate
783
+ * @param privateName name of the private key
784
+ * @param chainedName name of the chained certificate
785
+ * @param callback return result
786
+ */
480
787
  getCertificates(publicName?: string, privateName?: string, chainedName?: string, callback?: GetCertificatesCallback): void;
481
788
  private _getCertificates;
482
789
  /**
@@ -484,6 +791,11 @@ export declare class AdapterClass extends EventEmitter {
484
791
  *
485
792
  */
486
793
  restart(): void;
794
+ /**
795
+ * Updates the adapter config with new values, merged with the existing config.
796
+ *
797
+ * @param newConfig the new configuration values to merge into the existing config
798
+ */
487
799
  updateConfig(newConfig: Record<string, any>): ioBroker.SetObjectPromise;
488
800
  private _updateConfig;
489
801
  /**
@@ -491,20 +803,86 @@ export declare class AdapterClass extends EventEmitter {
491
803
  *
492
804
  */
493
805
  disable(): ioBroker.SetObjectPromise;
806
+ /**
807
+ * Reads the encrypted parameter from config.
808
+ *
809
+ * @param attribute the config attribute to decrypt
810
+ * @param callback return result
811
+ */
494
812
  getEncryptedConfig(attribute: string, callback?: GetEncryptedConfigCallback): Promise<string | string[] | void>;
495
813
  private _getEncryptedConfig;
496
814
  /**
497
815
  * Get the system secret, after retrieved once it will be read from the cache
498
816
  */
499
817
  private getSystemSecret;
818
+ /**
819
+ * Same as setTimeout, but it clears the running timers during the unloading process
820
+ *
821
+ * @param cb timer callback
822
+ * @param timeout timeout in milliseconds
823
+ * @param args as many arguments as needed, which will be passed to setTimeout
824
+ * @returns timer id
825
+ */
500
826
  setTimeout<TCallback extends TimeoutCallback>(cb: TCallback, timeout: number, ...args: Parameters<TCallback>): ioBroker.Timeout | undefined;
827
+ /**
828
+ * Same as clearTimeout but it checks the running timers on unload
829
+ *
830
+ * @param timer the timer object
831
+ */
501
832
  clearTimeout(timer: ioBroker.Timeout | undefined): void;
833
+ /**
834
+ * Delays the fulfillment of the promise the amount of time.
835
+ *
836
+ * @param timeout timeout in milliseconds
837
+ * @returns promise when timeout is over
838
+ */
502
839
  delay(timeout: number): Promise<void>;
840
+ /**
841
+ * Same as setInterval, but it clears the running intervals during the unloading process
842
+ *
843
+ * @param cb interval callback
844
+ * @param timeout interval in milliseconds
845
+ * @param args as many arguments as needed, which will be passed to setInterval
846
+ * @returns interval id
847
+ */
503
848
  setInterval<TCallback extends TimeoutCallback>(cb: TCallback, timeout: number, ...args: Parameters<TCallback>): ioBroker.Interval | undefined;
849
+ /**
850
+ * Same as clearInterval but it checks the running intervals on unload
851
+ *
852
+ * @param interval interval object
853
+ */
504
854
  clearInterval(interval: ioBroker.Interval | undefined): void;
855
+ /**
856
+ * Creates or overwrites an object in objectDB.
857
+ *
858
+ * @param id object ID (without namespace)
859
+ * @param obj the object to write
860
+ */
505
861
  setObject(id: string, obj: ioBroker.SettableObject): Promise<ioBroker.NonNullCallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
862
+ /**
863
+ * Creates or overwrites an object in objectDB.
864
+ *
865
+ * @param id object ID (without namespace)
866
+ * @param obj the object to write
867
+ * @param callback return result
868
+ */
506
869
  setObject(id: string, obj: ioBroker.SettableObject, callback: ioBroker.SetObjectCallback): void;
870
+ /**
871
+ * Creates or overwrites an object in objectDB.
872
+ *
873
+ * @param id object ID (without namespace)
874
+ * @param obj the object to write
875
+ * @param options optional user context
876
+ * @param callback return result
877
+ */
507
878
  setObject(id: string, obj: ioBroker.SettableObject, options: unknown, callback: ioBroker.SetObjectCallback): void;
879
+ /**
880
+ * Creates or overwrites an object in objectDB.
881
+ *
882
+ * @param id object ID (without namespace)
883
+ * @param obj the object to write
884
+ * @param options optional user context
885
+ */
508
886
  setObject(id: string, obj: ioBroker.SettableObject, options: unknown): Promise<ioBroker.NonNullCallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
509
887
  private _setObject;
510
888
  /**
@@ -516,51 +894,296 @@ export declare class AdapterClass extends EventEmitter {
516
894
  * @param callback optional callback
517
895
  */
518
896
  private _setObjectWithDefaultValue;
897
+ /**
898
+ * Get all states, channels and devices of this adapter.
899
+ *
900
+ * @param callback return result
901
+ */
519
902
  getAdapterObjects(callback: (objects: Record<string, ioBroker.AdapterScopedObject>) => void): Promise<Record<string, ioBroker.AdapterScopedObject> | void>;
520
903
  private _getAdapterObjects;
904
+ /**
905
+ * Extend some object and create it if it does not exist
906
+ *
907
+ * @param id object ID (without namespace)
908
+ * @param objPart the partial object to merge into the existing object
909
+ */
521
910
  extendObject(id: string, objPart: ioBroker.PartialObject): ioBroker.SetObjectPromise;
911
+ /**
912
+ * Extend some object and create it if it does not exist
913
+ *
914
+ * @param id object ID (without namespace)
915
+ * @param objPart the partial object to merge into the existing object
916
+ * @param callback return result
917
+ */
522
918
  extendObject(id: string, objPart: ioBroker.PartialObject, callback?: ioBroker.SetObjectCallback): void;
919
+ /**
920
+ * Extend some object and create it if it does not exist
921
+ *
922
+ * @param id object ID (without namespace)
923
+ * @param objPart the partial object to merge into the existing object
924
+ * @param options optional user context
925
+ */
523
926
  extendObject(id: string, objPart: ioBroker.PartialObject, options: ioBroker.ExtendObjectOptions): ioBroker.SetObjectPromise;
927
+ /**
928
+ * Extend some object and create it if it does not exist
929
+ *
930
+ * @param id object ID (without namespace)
931
+ * @param objPart the partial object to merge into the existing object
932
+ * @param options optional user context
933
+ * @param callback return result
934
+ */
524
935
  extendObject(id: string, objPart: ioBroker.PartialObject, options: ioBroker.ExtendObjectOptions, callback?: ioBroker.SetObjectCallback): void;
525
936
  private _extendObject;
937
+ /**
938
+ * Same as {@link AdapterClass.setObject}, but for any object.
939
+ *
940
+ * @param id object ID with namespace
941
+ * @param obj new object
942
+ */
526
943
  setForeignObject<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>): Promise<ioBroker.NonNullCallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
944
+ /**
945
+ * Same as {@link AdapterClass.setObject}, but for any object.
946
+ *
947
+ * @param id object ID with namespace
948
+ * @param obj new object
949
+ * @param callback return result
950
+ */
527
951
  setForeignObject<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, callback: ioBroker.SetObjectCallback): void;
952
+ /**
953
+ * Same as {@link AdapterClass.setObject}, but for any object.
954
+ *
955
+ * @param id object ID with namespace
956
+ * @param obj new object
957
+ * @param options optional user context
958
+ */
528
959
  setForeignObject<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options: unknown): Promise<ioBroker.NonNullCallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
960
+ /**
961
+ * Same as {@link AdapterClass.setObject}, but for any object.
962
+ *
963
+ * @param id object ID with namespace
964
+ * @param obj new object
965
+ * @param options optional user context
966
+ * @param callback return result
967
+ */
529
968
  setForeignObject<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options: unknown, callback?: ioBroker.SetObjectCallback): void | Promise<ioBroker.NonNullCallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
530
969
  private _setForeignObject;
970
+ /**
971
+ * Extend any object and create it if it might not exist.
972
+ *
973
+ * @param id object ID with namespace
974
+ * @param objPart the partial object to merge into the existing object
975
+ */
531
976
  extendForeignObject<T extends string>(id: T, objPart: ioBroker.PartialObject<ioBroker.ObjectIdToObjectType<T, 'write'>>): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
977
+ /**
978
+ * Extend any object and create it if it might not exist.
979
+ *
980
+ * @param id object ID with namespace
981
+ * @param objPart the partial object to merge into the existing object
982
+ * @param callback return result
983
+ */
532
984
  extendForeignObject<T extends string>(id: T, objPart: ioBroker.PartialObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, callback: ioBroker.SetObjectCallback): void;
985
+ /**
986
+ * Extend any object and create it if it might not exist.
987
+ *
988
+ * @param id object ID with namespace
989
+ * @param objPart the partial object to merge into the existing object
990
+ * @param options optional user context
991
+ * @param callback return result
992
+ */
533
993
  extendForeignObject<T extends string>(id: T, objPart: ioBroker.PartialObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options: ioBroker.ExtendObjectOptions, callback: ioBroker.SetObjectCallback): void;
994
+ /**
995
+ * Extend any object and create it if it might not exist.
996
+ *
997
+ * @param id object ID with namespace
998
+ * @param objPart the partial object to merge into the existing object
999
+ * @param options optional user context
1000
+ */
534
1001
  extendForeignObject<T extends string>(id: T, objPart: ioBroker.PartialObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options: ioBroker.ExtendObjectOptions): Promise<ioBroker.CallbackReturnTypeOf<ioBroker.SetObjectCallback>>;
535
1002
  private _extendForeignObjectAsync;
1003
+ /**
1004
+ * Checks if an object exists to the given id, id will be fixed first
1005
+ *
1006
+ * @param id id of the object
1007
+ * @param options optional user context
1008
+ */
536
1009
  objectExists(id: string, options?: Record<string, any> | null): Promise<boolean | void>;
1010
+ /**
1011
+ * Checks if an object exists to the given id
1012
+ *
1013
+ * @param id id of the object
1014
+ * @param options optional user context
1015
+ */
537
1016
  foreignObjectExists(id: string, options?: Record<string, any> | null): Promise<boolean | void>;
1017
+ /**
1018
+ * Get object of this instance.
1019
+ *
1020
+ * @param id exactly object ID (without namespace)
1021
+ * @param callback return result
1022
+ */
538
1023
  getObject(id: string, callback: ioBroker.GetObjectCallback): void;
1024
+ /**
1025
+ * Get object of this instance.
1026
+ *
1027
+ * @param id exactly object ID (without namespace)
1028
+ * @param options optional user context
1029
+ * @param callback return result
1030
+ */
539
1031
  getObject(id: string, options: unknown, callback: ioBroker.GetObjectCallback): void;
540
- getObjectView<Design extends string = string, Search extends string = string>(design: Design, search: Search, params: ioBroker.GetObjectViewParams | null | undefined, callback: ioBroker.GetObjectViewCallback<ioBroker.InferGetObjectViewItemType<Design, Search>>): void;
541
- getObjectView<Design extends string = string, Search extends string = string>(design: Design, search: Search, params: ioBroker.GetObjectViewParams | null | undefined, options: unknown, callback: ioBroker.GetObjectViewCallback<ioBroker.InferGetObjectViewItemType<Design, Search>>): void;
1032
+ /**
1033
+ * Read object view from DB.
1034
+ *
1035
+ * @param design name of the design
1036
+ * @param search name of the view
1037
+ * @param params object containing startkey: first id to include in result; endkey: last id to include in result
1038
+ * @param callback return result
1039
+ */
1040
+ getObjectView<Design extends string = string, Search extends string = string>(design: Design, search: Search, params: ioBroker.GetObjectViewParams | null | undefined, callback: ioBroker.GetObjectViewCallback<ioBroker.InferGetObjectViewItemType<Design, Search>>): void;
1041
+ /**
1042
+ * Read object view from DB.
1043
+ *
1044
+ * @param design name of the design
1045
+ * @param search name of the view
1046
+ * @param params object containing startkey: first id to include in result; endkey: last id to include in result
1047
+ * @param options additional options, e.g. for permissions
1048
+ * @param callback return result
1049
+ */
1050
+ getObjectView<Design extends string = string, Search extends string = string>(design: Design, search: Search, params: ioBroker.GetObjectViewParams | null | undefined, options: unknown, callback: ioBroker.GetObjectViewCallback<ioBroker.InferGetObjectViewItemType<Design, Search>>): void;
542
1051
  private _getObjectView;
1052
+ /**
1053
+ * Read object list from DB.
1054
+ *
1055
+ * @param params startkey and endkey information
1056
+ * @param callback optional callback
1057
+ */
543
1058
  getObjectList(params: ioBroker.GetObjectListParams | null, callback: ioBroker.GetObjectListCallback<ioBroker.Object>): void;
1059
+ /**
1060
+ * Read object list from DB.
1061
+ *
1062
+ * @param params startkey and endkey information
1063
+ * @param options additional options, e.g. for permissions
1064
+ * @param callback optional callback
1065
+ */
544
1066
  getObjectList(params: ioBroker.GetObjectListParams | null, options: {
545
1067
  sorted?: boolean;
546
1068
  } | Record<string, any>, callback: ioBroker.GetObjectListCallback<ioBroker.Object>): void;
1069
+ /**
1070
+ * Get the enum tree.
1071
+ *
1072
+ * @param callback return result
1073
+ */
547
1074
  getEnum(callback: ioBroker.GetEnumCallback): void;
1075
+ /**
1076
+ * Get the enum tree.
1077
+ *
1078
+ * @param name the enum name to read
1079
+ * @param callback return result
1080
+ */
548
1081
  getEnum(name: string, callback: ioBroker.GetEnumCallback): void;
1082
+ /**
1083
+ * Get the enum tree.
1084
+ *
1085
+ * @param name the enum name to read
1086
+ * @param options optional user context
1087
+ * @param callback return result
1088
+ */
549
1089
  getEnum(name: string, options: unknown, callback: ioBroker.GetEnumCallback): void;
550
1090
  private _getEnum;
1091
+ /**
1092
+ * Read the members of given enums.
1093
+ *
1094
+ * @param callback return result
1095
+ */
551
1096
  getEnums(callback: ioBroker.GetEnumsCallback): void;
1097
+ /**
1098
+ * Read the members of given enums.
1099
+ *
1100
+ * @param enumList the enum(s) to read
1101
+ * @param callback return result
1102
+ */
552
1103
  getEnums(enumList: ioBroker.EnumList, callback: ioBroker.GetEnumsCallback): void;
1104
+ /**
1105
+ * Read the members of given enums.
1106
+ *
1107
+ * @param enumList the enum(s) to read
1108
+ * @param options optional user context
1109
+ * @param callback return result
1110
+ */
553
1111
  getEnums(enumList: ioBroker.EnumList, options: unknown, callback: ioBroker.GetEnumsCallback): void;
554
1112
  private _getEnums;
1113
+ /**
1114
+ * Get all objects matching the given pattern.
1115
+ *
1116
+ * @param patter the pattern to match object ids against
1117
+ */
555
1118
  getForeignObjects(patter: Pattern): Promise<ioBroker.NonNullCallbackReturnTypeOf<ioBroker.GetObjectsCallback>>;
1119
+ /**
1120
+ * Get all objects matching the given pattern.
1121
+ *
1122
+ * @param pattern the pattern to match object ids against
1123
+ * @param callback return result
1124
+ */
556
1125
  getForeignObjects(pattern: Pattern, callback: ioBroker.GetObjectsCallback): void;
1126
+ /**
1127
+ * Get all objects matching the given pattern.
1128
+ *
1129
+ * @param pattern the pattern to match object ids against
1130
+ * @param options optional user context
1131
+ * @param callback return result
1132
+ */
557
1133
  getForeignObjects(pattern: Pattern, options: unknown, callback: ioBroker.GetObjectsCallback): void;
1134
+ /**
1135
+ * Get all objects of the given type matching the given pattern.
1136
+ *
1137
+ * @param pattern the pattern to match object ids against
1138
+ * @param type restrict the result to objects of this type
1139
+ * @param callback return result
1140
+ */
558
1141
  getForeignObjects<T extends ioBroker.ObjectType>(pattern: Pattern, type: T, callback: ioBroker.GetObjectsCallbackTyped<T>): void;
1142
+ /**
1143
+ * Get all objects of the given type matching the given pattern.
1144
+ *
1145
+ * @param pattern the pattern to match object ids against
1146
+ * @param type restrict the result to objects of this type
1147
+ * @param enums restrict the result to objects within these enums
1148
+ * @param callback return result
1149
+ */
559
1150
  getForeignObjects<T extends ioBroker.ObjectType>(pattern: Pattern, type: T, enums: ioBroker.EnumList, callback: ioBroker.GetObjectsCallbackTyped<T>): void;
1151
+ /**
1152
+ * Get all objects of the given type matching the given pattern.
1153
+ *
1154
+ * @param pattern the pattern to match object ids against
1155
+ * @param type restrict the result to objects of this type
1156
+ * @param options optional user context
1157
+ * @param callback return result
1158
+ */
560
1159
  getForeignObjects<T extends ioBroker.ObjectType>(pattern: Pattern, type: T, options: unknown, callback: ioBroker.GetObjectsCallbackTyped<T>): void;
1160
+ /**
1161
+ * Get all objects of the given type matching the given pattern.
1162
+ *
1163
+ * @param pattern the pattern to match object ids against
1164
+ * @param type restrict the result to objects of this type
1165
+ * @param enums restrict the result to objects within these enums
1166
+ * @param options optional user context
1167
+ * @param callback return result
1168
+ */
561
1169
  getForeignObjects<T extends ioBroker.ObjectType>(pattern: Pattern, type: T, enums: ioBroker.EnumList | null, options: unknown, callback: ioBroker.GetObjectsCallbackTyped<T>): void;
562
1170
  private _getForeignObjects;
1171
+ /**
1172
+ * Find any object by name or ID.
1173
+ *
1174
+ * @param idOrName exactly object ID or name (without namespace)
1175
+ * @param type optional `common.type` of state: 'number', 'string', 'boolean', 'file', ...
1176
+ * @param callback return result
1177
+ */
563
1178
  findForeignObject(idOrName: string, type: ioBroker.CommonType | null, callback: ioBroker.FindObjectCallback): void;
1179
+ /**
1180
+ * Find any object by name or ID.
1181
+ *
1182
+ * @param idOrName exactly object ID or name (without namespace)
1183
+ * @param type optional `common.type` of state: 'number', 'string', 'boolean', 'file', ...
1184
+ * @param options optional user context
1185
+ * @param callback return result
1186
+ */
564
1187
  findForeignObject(idOrName: string, type: ioBroker.CommonType | null, options: {
565
1188
  user?: `system.user.${string}`;
566
1189
  language?: ioBroker.Languages;
@@ -577,7 +1200,7 @@ export declare class AdapterClass extends EventEmitter {
577
1200
  * @param options optional user context with language
578
1201
  * @param options.user current user
579
1202
  * @param options.language language in which the search must be done for multi-language names
580
- * @result if the object was found by ID it will return id and may be the multi-language name it exists. If the object was found by name it will return id and the multi-language name. If the object was not found, it will return only name that was searched for.
1203
+ * @returns if the object was found by ID it will return id and may be the multi-language name it exists. If the object was found by name it will return id and the multi-language name. If the object was not found, it will return only name that was searched for.
581
1204
  */
582
1205
  findForeignObjectAsync(id: string, type: ioBroker.CommonType | null, options?: {
583
1206
  user?: `system.user.${string}`;
@@ -586,29 +1209,164 @@ export declare class AdapterClass extends EventEmitter {
586
1209
  id?: string;
587
1210
  name: ioBroker.StringOrTranslated;
588
1211
  }>;
1212
+ /**
1213
+ * Get any object.
1214
+ *
1215
+ * @param id exactly object ID (with namespace)
1216
+ * @param callback return result
1217
+ */
589
1218
  getForeignObject<T extends string>(id: T, callback: ioBroker.GetObjectCallback<T>): void | Promise<void | ioBroker.ObjectIdToObjectType<T> | null>;
1219
+ /**
1220
+ * Get any object.
1221
+ *
1222
+ * @param id exactly object ID (with namespace)
1223
+ * @param options optional user context
1224
+ * @param callback return result
1225
+ */
590
1226
  getForeignObject<T extends string>(id: T, options: unknown, callback: ioBroker.GetObjectCallback<T>): void | Promise<void | ioBroker.ObjectIdToObjectType<T> | null>;
591
1227
  private _getForeignObject;
1228
+ /**
1229
+ * Delete an object of this instance.
1230
+ *
1231
+ * @param id exactly object ID (without namespace)
1232
+ * @param callback return result
1233
+ */
592
1234
  delObject(id: string, callback?: ioBroker.ErrorCallback): void;
1235
+ /**
1236
+ * Delete an object of this instance.
1237
+ *
1238
+ * @param id exactly object ID (without namespace)
1239
+ * @param options optional user context. E.g. recursive option could be true
1240
+ * @param callback return result
1241
+ */
593
1242
  delObject(id: string, options?: ioBroker.DelObjectOptions | null, callback?: ioBroker.ErrorCallback): void;
594
1243
  private _deleteObjects;
1244
+ /**
1245
+ * Delete any object.
1246
+ *
1247
+ * @param id exactly object ID (with namespace)
1248
+ * @param callback return result
1249
+ */
595
1250
  delForeignObject(id: string, callback?: ioBroker.ErrorCallback): void;
1251
+ /**
1252
+ * Delete any object.
1253
+ *
1254
+ * @param id exactly object ID (with namespace)
1255
+ * @param options optional user context or `{ recursive: true }` to delete all underlying objects
1256
+ * @param callback return result
1257
+ */
596
1258
  delForeignObject(id: string, options: ioBroker.DelObjectOptions, callback?: ioBroker.ErrorCallback): void;
597
1259
  private _delForeignObject;
1260
+ /**
1261
+ * Subscribe for the changes of objects in this instance.
1262
+ *
1263
+ * @param pattern pattern like 'channel.*' or '*' (all objects of this adapter) - without namespaces
1264
+ * @param callback optional returns result
1265
+ */
598
1266
  subscribeObjects(pattern: Pattern, callback?: ioBroker.ErrorCallback): void;
1267
+ /**
1268
+ * Subscribe for the changes of objects in this instance.
1269
+ *
1270
+ * @param pattern pattern like 'channel.*' or '*' (all objects of this adapter) - without namespaces
1271
+ * @param options optional user context
1272
+ * @param callback optional returns result
1273
+ */
599
1274
  subscribeObjects(pattern: Pattern, options: unknown, callback?: ioBroker.ErrorCallback): void;
1275
+ /**
1276
+ * Unsubscribe on the changes of objects in this instance.
1277
+ *
1278
+ * @param pattern pattern like 'channel.*' or '*' (all objects) - without namespaces
1279
+ * @param callback optional returns result
1280
+ */
600
1281
  unsubscribeObjects(pattern: Pattern, callback?: ioBroker.ErrorCallback): void;
1282
+ /**
1283
+ * Unsubscribe on the changes of objects in this instance.
1284
+ *
1285
+ * @param pattern pattern like 'channel.*' or '*' (all objects) - without namespaces
1286
+ * @param options optional user context
1287
+ * @param callback optional returns result
1288
+ */
601
1289
  unsubscribeObjects(pattern: Pattern, options: unknown, callback?: ioBroker.ErrorCallback): void;
1290
+ /**
1291
+ * Subscribe for the changes of objects in any instance.
1292
+ *
1293
+ * @param pattern pattern like 'channel.*' or '*' (all objects) - without namespaces. You can use array of patterns
1294
+ * @param callback optional returns result
1295
+ */
602
1296
  subscribeForeignObjects(pattern: string | string[], callback?: ioBroker.ErrorCallback): void;
1297
+ /**
1298
+ * Subscribe for the changes of objects in any instance.
1299
+ *
1300
+ * @param pattern pattern like 'channel.*' or '*' (all objects) - without namespaces. You can use array of patterns
1301
+ * @param options optional user context
1302
+ * @param callback optional returns result
1303
+ */
603
1304
  subscribeForeignObjects(pattern: string | string[], options: unknown, callback?: ioBroker.ErrorCallback): void;
1305
+ /**
1306
+ * Unsubscribe for the patterns on all objects.
1307
+ *
1308
+ * @param pattern pattern like 'channel.*' or '*' (all objects) - without namespaces
1309
+ * @param callback optional returns result
1310
+ */
604
1311
  unsubscribeForeignObjects(pattern: string | string[], callback?: ioBroker.ErrorCallback): void;
1312
+ /**
1313
+ * Unsubscribe for the patterns on all objects.
1314
+ *
1315
+ * @param pattern pattern like 'channel.*' or '*' (all objects) - without namespaces
1316
+ * @param options optional user context
1317
+ * @param callback optional returns result
1318
+ */
605
1319
  unsubscribeForeignObjects(pattern: string | string[], options: unknown, callback?: ioBroker.ErrorCallback): void;
1320
+ /**
1321
+ * Subscribe for the changes of files in specific instance.
1322
+ *
1323
+ * @param id adapter ID like 'vis-2.0' or 'vis-2.admin'
1324
+ * @param pattern pattern like 'channel.*' or '*' (all files) - without namespaces. You can use array of patterns
1325
+ * @param options optional user context
1326
+ */
606
1327
  subscribeForeignFiles(id: string, pattern: string | string[], options?: unknown): Promise<void>;
1328
+ /**
1329
+ * Unsubscribe for the changes of files on specific instance.
1330
+ *
1331
+ * @param id adapter ID like 'vis-2.0' or 'vis-2.admin'
1332
+ * @param pattern pattern like 'channel.*' or '*' (all objects) - without namespaces
1333
+ * @param options optional user context
1334
+ */
607
1335
  unsubscribeForeignFiles(id: string, pattern: string | string[], options?: unknown): Promise<void>;
1336
+ /**
1337
+ * Same as {@link AdapterClass.setObject}, but with check if the object exists.
1338
+ *
1339
+ * @param id object ID, that must be overwritten or created.
1340
+ * @param obj new object
1341
+ * @param callback return result
1342
+ */
608
1343
  setObjectNotExists(id: string, obj: ioBroker.SettableObject, callback?: ioBroker.SetObjectCallback): Promise<void | ioBroker.CallbackReturnTypeOf<ioBroker.SetObjectCallback>> | void;
1344
+ /**
1345
+ * Same as {@link AdapterClass.setObject}, but with check if the object exists.
1346
+ *
1347
+ * @param id object ID, that must be overwritten or created.
1348
+ * @param obj new object
1349
+ * @param options optional user context
1350
+ * @param callback return result
1351
+ */
609
1352
  setObjectNotExists(id: string, obj: ioBroker.SettableObject, options: unknown, callback?: ioBroker.SetObjectCallback): Promise<void | ioBroker.CallbackReturnTypeOf<ioBroker.SetObjectCallback>> | void;
610
1353
  private _setObjectNotExists;
1354
+ /**
1355
+ * Same as {@link AdapterClass.setForeignObject}, but with check if the object exists.
1356
+ *
1357
+ * @param id object ID, that must be overwritten or created.
1358
+ * @param obj new object
1359
+ * @param callback return result
1360
+ */
611
1361
  setForeignObjectNotExists<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, callback?: ioBroker.SetObjectCallback): void;
1362
+ /**
1363
+ * Same as {@link AdapterClass.setForeignObject}, but with check if the object exists.
1364
+ *
1365
+ * @param id object ID, that must be overwritten or created.
1366
+ * @param obj new object
1367
+ * @param options optional user context
1368
+ * @param callback return result
1369
+ */
612
1370
  setForeignObjectNotExists<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options: unknown, callback?: ioBroker.SetObjectCallback): void;
613
1371
  private _setForeignObjectNotExists;
614
1372
  private _DCS2ID;
@@ -643,10 +1401,46 @@ export declare class AdapterClass extends EventEmitter {
643
1401
  /** @deprecated use `this.delObject` instead */
644
1402
  deleteDevice(deviceName: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
645
1403
  private _deleteDevice;
1404
+ /**
1405
+ * Add a channel to an enum.
1406
+ *
1407
+ * @param enumName the enum category (e.g. rooms, functions)
1408
+ * @param addTo the enum id to add the channel to
1409
+ * @param parentDevice the parent device name
1410
+ * @param channelName the name of the channel
1411
+ * @param callback return result
1412
+ */
646
1413
  addChannelToEnum(enumName: string, addTo: string, parentDevice: string, channelName: string, callback?: ioBroker.ErrorCallback): void;
1414
+ /**
1415
+ * Add a channel to an enum.
1416
+ *
1417
+ * @param enumName the enum category (e.g. rooms, functions)
1418
+ * @param addTo the enum id to add the channel to
1419
+ * @param parentDevice the parent device name
1420
+ * @param channelName the name of the channel
1421
+ * @param options optional user context
1422
+ * @param callback return result
1423
+ */
647
1424
  addChannelToEnum(enumName: string, addTo: string, parentDevice: string, channelName: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
648
1425
  private _addChannelToEnum;
1426
+ /**
1427
+ * Remove a channel from an enum.
1428
+ *
1429
+ * @param enumName the enum category (e.g. rooms, functions)
1430
+ * @param parentDevice the parent device name
1431
+ * @param channelName the name of the channel
1432
+ * @param callback return result
1433
+ */
649
1434
  deleteChannelFromEnum(enumName: string, parentDevice: string, channelName: string, callback?: ioBroker.ErrorCallback): void;
1435
+ /**
1436
+ * Remove a channel from an enum.
1437
+ *
1438
+ * @param enumName the enum category (e.g. rooms, functions)
1439
+ * @param parentDevice the parent device name
1440
+ * @param channelName the name of the channel
1441
+ * @param options optional user context
1442
+ * @param callback return result
1443
+ */
650
1444
  deleteChannelFromEnum(enumName: string, parentDevice: string, channelName: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
651
1445
  private _deleteChannelFromEnum;
652
1446
  /** @deprecated use `this.delObject` instead */
@@ -663,61 +1457,403 @@ export declare class AdapterClass extends EventEmitter {
663
1457
  /** @deprecated use `this.delObject` instead */
664
1458
  deleteState(parentDevice: string | null, parentChannel: string | null, stateName: string, options?: unknown, callback?: ioBroker.ErrorCallback): void;
665
1459
  private _deleteState;
1460
+ /**
1461
+ * Get all devices of this adapter.
1462
+ *
1463
+ * @param callback return result
1464
+ */
666
1465
  getDevices(callback: ioBroker.GetObjectsCallback3<ioBroker.DeviceObject>): void;
1466
+ /**
1467
+ * Get all devices of this adapter.
1468
+ *
1469
+ * @param options optional user context
1470
+ * @param callback return result
1471
+ */
667
1472
  getDevices(options: unknown, callback: ioBroker.GetObjectsCallback3<ioBroker.DeviceObject>): void;
668
1473
  private _getDevices;
1474
+ /**
1475
+ * Get all channels of this adapter or of the given device.
1476
+ *
1477
+ * @param callback return result
1478
+ */
669
1479
  getChannelsOf(callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
1480
+ /**
1481
+ * Get all channels of this adapter or of the given device.
1482
+ *
1483
+ * @param parentDevice the parent device name
1484
+ * @param callback return result
1485
+ */
670
1486
  getChannelsOf(parentDevice: string, callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
1487
+ /**
1488
+ * Get all channels of this adapter or of the given device.
1489
+ *
1490
+ * @param parentDevice the parent device name
1491
+ * @param options optional user context
1492
+ * @param callback return result
1493
+ */
671
1494
  getChannelsOf(parentDevice: string, options: unknown, callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
672
1495
  private _getChannelsOf;
1496
+ /**
1497
+ * Get all states of this adapter or of the given device/channel.
1498
+ *
1499
+ * @param callback return result
1500
+ */
673
1501
  getStatesOf(callback: ioBroker.GetObjectsCallback3<ioBroker.StateObject>): void;
1502
+ /**
1503
+ * Get all states of this adapter or of the given device/channel.
1504
+ *
1505
+ * @param parentDevice the parent device name
1506
+ * @param callback return result
1507
+ */
674
1508
  getStatesOf(parentDevice: string, callback: ioBroker.GetObjectsCallback3<ioBroker.StateObject>): void;
1509
+ /**
1510
+ * Get all states of this adapter or of the given device/channel.
1511
+ *
1512
+ * @param parentDevice the parent device name
1513
+ * @param parentChannel the parent channel name
1514
+ * @param callback return result
1515
+ */
675
1516
  getStatesOf(parentDevice: string | null | undefined, parentChannel: string | null | undefined, callback: ioBroker.GetObjectsCallback3<ioBroker.StateObject>): void;
1517
+ /**
1518
+ * Get all states of this adapter or of the given device/channel.
1519
+ *
1520
+ * @param parentDevice the parent device name
1521
+ * @param parentChannel the parent channel name
1522
+ * @param options optional user context
1523
+ * @param callback return result
1524
+ */
676
1525
  getStatesOf(parentDevice: string | null | undefined, parentChannel: string | null | undefined, options: unknown, callback: ioBroker.GetObjectsCallback3<ioBroker.StateObject>): void;
677
1526
  private _getStatesOf;
1527
+ /**
1528
+ * Add a state to an enum.
1529
+ *
1530
+ * @param enumName the enum category (e.g. rooms, functions)
1531
+ * @param addTo the enum id to add the state to
1532
+ * @param parentDevice the parent device name
1533
+ * @param parentChannel the parent channel name
1534
+ * @param stateName the name of the state
1535
+ * @param callback return result
1536
+ */
678
1537
  addStateToEnum(enumName: string, addTo: string, parentDevice: string, parentChannel: string, stateName: string, callback?: ioBroker.ErrorCallback): void;
1538
+ /**
1539
+ * Add a state to an enum.
1540
+ *
1541
+ * @param enumName the enum category (e.g. rooms, functions)
1542
+ * @param addTo the enum id to add the state to
1543
+ * @param parentDevice the parent device name
1544
+ * @param parentChannel the parent channel name
1545
+ * @param stateName the name of the state
1546
+ * @param options optional user context
1547
+ * @param callback return result
1548
+ */
679
1549
  addStateToEnum(enumName: string, addTo: string, parentDevice: string, parentChannel: string, stateName: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
680
1550
  private _addStateToEnum;
1551
+ /**
1552
+ * Remove a state from an enum.
1553
+ *
1554
+ * @param enumName the enum category (e.g. rooms, functions)
1555
+ * @param parentDevice the parent device name
1556
+ * @param parentChannel the parent channel name
1557
+ * @param stateName the name of the state
1558
+ * @param callback return result
1559
+ */
681
1560
  deleteStateFromEnum(enumName: string, parentDevice: string, parentChannel: string, stateName: string, callback?: ioBroker.ErrorCallback): void;
1561
+ /**
1562
+ * Remove a state from an enum.
1563
+ *
1564
+ * @param enumName the enum category (e.g. rooms, functions)
1565
+ * @param parentDevice the parent device name
1566
+ * @param parentChannel the parent channel name
1567
+ * @param stateName the name of the state
1568
+ * @param options optional user context
1569
+ * @param callback return result
1570
+ */
682
1571
  deleteStateFromEnum(enumName: string, parentDevice: string, parentChannel: string, stateName: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
683
1572
  private _deleteStateFromEnum;
1573
+ /**
1574
+ * Change file access rights
1575
+ *
1576
+ * @param adapter adapter name, or null for the current adapter
1577
+ * @param path path to file without adapter name
1578
+ * @param options data with mode
1579
+ * @param callback return result
1580
+ */
684
1581
  chmodFile(adapter: string | null, path: string, options: {
685
1582
  mode: number | string;
686
1583
  } | Record<string, any>, callback: ioBroker.ChownFileCallback): void;
1584
+ /**
1585
+ * Change file access rights
1586
+ *
1587
+ * @param adapter adapter name, or null for the current adapter
1588
+ * @param path path to file without adapter name
1589
+ * @param callback return result
1590
+ */
687
1591
  chmodFile(adapter: string | null, path: string, callback: ioBroker.ChownFileCallback): void;
1592
+ /**
1593
+ * Change a file owner
1594
+ *
1595
+ * @param _adapter adapter name, or null for the current adapter
1596
+ * @param path path to file without adapter name
1597
+ * @param options data with owner and ownerGroup
1598
+ * @param callback return result
1599
+ */
688
1600
  chownFile(_adapter: string, path: string, options: unknown, callback: (err?: Error | null, processedFiles?: any) => void): void;
1601
+ /**
1602
+ * Change a file owner
1603
+ *
1604
+ * @param _adapter adapter name, or null for the current adapter
1605
+ * @param path path to file without adapter name
1606
+ * @param callback return result
1607
+ */
689
1608
  chownFile(_adapter: string, path: string, callback: (err?: Error | null, processedFiles?: any) => void): void;
1609
+ /**
1610
+ * Read directory from DB.
1611
+ *
1612
+ * @param adapterName adapter name, or null for the current adapter
1613
+ * @param path path to the directory
1614
+ * @param callback return result
1615
+ */
690
1616
  readDir(adapterName: string | null, path: string, callback: ioBroker.ReadDirCallback): void;
1617
+ /**
1618
+ * Read directory from DB.
1619
+ *
1620
+ * @param adapterName adapter name, or null for the current adapter
1621
+ * @param path path to the directory
1622
+ * @param options optional user context
1623
+ * @param callback return result
1624
+ */
691
1625
  readDir(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ReadDirCallback): void;
1626
+ /**
1627
+ * Deletes a file in the DB.
1628
+ *
1629
+ * @param adapterName adapter name, or null for the current adapter
1630
+ * @param path path to the file
1631
+ * @param callback return result
1632
+ */
692
1633
  unlink(adapterName: string | null, path: string, callback: ioBroker.ErrnoCallback): void;
1634
+ /**
1635
+ * Deletes a file in the DB.
1636
+ *
1637
+ * @param adapterName adapter name, or null for the current adapter
1638
+ * @param path path to the file
1639
+ * @param options optional user context
1640
+ * @param callback return result
1641
+ */
693
1642
  unlink(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ErrnoCallback): void;
1643
+ /**
1644
+ * Renames a file in the DB.
1645
+ *
1646
+ * @param adapterName adapter name, or null for the current adapter
1647
+ * @param oldName current path to the file
1648
+ * @param newName new path to the file
1649
+ * @param callback return result
1650
+ */
694
1651
  rename(adapterName: string | null, oldName: string, newName: string, callback: ioBroker.ErrnoCallback): void;
1652
+ /**
1653
+ * Renames a file in the DB.
1654
+ *
1655
+ * @param adapterName adapter name, or null for the current adapter
1656
+ * @param oldName current path to the file
1657
+ * @param newName new path to the file
1658
+ * @param options optional user context
1659
+ * @param callback return result
1660
+ */
695
1661
  rename(adapterName: string | null, oldName: string, newName: string, options: unknown, callback: ioBroker.ErrnoCallback): void;
1662
+ /**
1663
+ * Creates a directory in the DB.
1664
+ *
1665
+ * @param adapterName adapter name, or null for the current adapter
1666
+ * @param path path to the directory
1667
+ * @param callback return result
1668
+ */
696
1669
  mkdir(adapterName: string | null, path: string, callback: ioBroker.ErrnoCallback): void;
1670
+ /**
1671
+ * Creates a directory in the DB.
1672
+ *
1673
+ * @param adapterName adapter name, or null for the current adapter
1674
+ * @param path path to the directory
1675
+ * @param options optional user context
1676
+ * @param callback return result
1677
+ */
697
1678
  mkdir(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ErrnoCallback): void;
1679
+ /**
1680
+ * Read file from DB.
1681
+ *
1682
+ * @param adapterName adapter name, or null for the current adapter
1683
+ * @param path path to file without adapter name
1684
+ * @param callback return result
1685
+ */
698
1686
  readFile(adapterName: string | null, path: string, callback: ioBroker.ReadFileCallback): void;
1687
+ /**
1688
+ * Read file from DB.
1689
+ *
1690
+ * @param adapterName adapter name, or null for the current adapter
1691
+ * @param path path to file without adapter name
1692
+ * @param options optional user context
1693
+ * @param callback return result
1694
+ */
699
1695
  readFile(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ReadFileCallback): void;
1696
+ /**
1697
+ * Write file to DB.
1698
+ *
1699
+ * @param adapterName adapter name, or null for the current adapter
1700
+ * @param path path to the file
1701
+ * @param data data to write
1702
+ * @param callback return result
1703
+ */
700
1704
  writeFile(adapterName: string | null, path: string, data: Buffer | string, callback: ioBroker.ErrnoCallback): void;
1705
+ /**
1706
+ * Write file to DB.
1707
+ *
1708
+ * @param adapterName adapter name, or null for the current adapter
1709
+ * @param path path to the file
1710
+ * @param data data to write
1711
+ * @param options optional user context
1712
+ * @param callback return result
1713
+ */
701
1714
  writeFile(adapterName: string | null, path: string, data: Buffer | string, options: unknown, callback: ioBroker.ErrnoCallback): void;
1715
+ /**
1716
+ * Checks if file exists in DB.
1717
+ *
1718
+ * @param adapterName adapter name
1719
+ * @param path path to file without adapter name
1720
+ */
702
1721
  fileExists(adapterName: string | null, path: string): Promise<boolean>;
1722
+ /**
1723
+ * Checks if file exists in DB.
1724
+ *
1725
+ * @param adapterName adapter name
1726
+ * @param path path to file without adapter name
1727
+ * @param callback cb function if none provided, a promise is returned
1728
+ */
703
1729
  fileExists(adapterName: string | null, path: string, callback?: ioBroker.GenericCallback<boolean>): void;
1730
+ /**
1731
+ * Checks if file exists in DB.
1732
+ *
1733
+ * @param adapterName adapter name
1734
+ * @param path path to file without adapter name
1735
+ * @param options optional user context
1736
+ * @param callback cb function if none provided, a promise is returned
1737
+ */
704
1738
  fileExists(adapterName: string | null, path: string, options: unknown, callback: ioBroker.GenericCallback<boolean>): void;
1739
+ /**
1740
+ * Formats a numeric value using the given format string.
1741
+ *
1742
+ * @param value the value to format
1743
+ * @param format optional format string for the decimal and thousands separator
1744
+ */
705
1745
  formatValue(value: number | string, format?: string): string;
1746
+ /**
1747
+ * Formats a numeric value using the given format string.
1748
+ *
1749
+ * @param value the value to format
1750
+ * @param decimals number of decimals to keep
1751
+ * @param format optional format string for the decimal and thousands separator
1752
+ */
706
1753
  formatValue(value: number | string, decimals: number, format?: string): string;
1754
+ /**
1755
+ * Formats a date according to the given format string.
1756
+ *
1757
+ * @param dateObj the date to format
1758
+ * @param format optional format string
1759
+ */
707
1760
  formatDate(dateObj: string | Date | number, format?: string): string;
1761
+ /**
1762
+ * Formats a date or duration according to the given format string.
1763
+ *
1764
+ * @param dateObj the date to format
1765
+ * @param isDuration whether the value represents a duration
1766
+ * @param format optional format string
1767
+ */
708
1768
  formatDate(dateObj: string | Date | number, isDuration: boolean | string, format?: string): string;
709
1769
  private _formatDate;
1770
+ /**
1771
+ * Send a message to a specific instance or all instances of some specific adapter.
1772
+ *
1773
+ * @param instanceName name of the instance to send the message to
1774
+ * @param message message to send
1775
+ * @param callback optional return result
1776
+ */
710
1777
  sendTo(instanceName: string, message: any, callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo): void;
1778
+ /**
1779
+ * Send a message to a specific instance or all instances of some specific adapter.
1780
+ *
1781
+ * @param instanceName name of the instance to send the message to
1782
+ * @param command command name
1783
+ * @param message message to send
1784
+ * @param callback optional return result
1785
+ * @param options optional options to control the send behaviour
1786
+ */
711
1787
  sendTo(instanceName: string, command: string, message: any, callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo, options?: SendToOptions): void;
712
1788
  private _sendTo;
1789
+ /**
1790
+ * Send a message to a specific host or all hosts.
1791
+ *
1792
+ * @param hostName name of the host to send the message to, or null for all hosts
1793
+ * @param message message to send
1794
+ * @param callback optional return result
1795
+ */
713
1796
  sendToHost(hostName: string | null, message: any, callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo): void;
1797
+ /**
1798
+ * Send a message to a specific host or all hosts.
1799
+ *
1800
+ * @param hostName name of the host to send the message to, or null for all hosts
1801
+ * @param command command name
1802
+ * @param message message to send
1803
+ * @param callback optional return result
1804
+ */
714
1805
  sendToHost(hostName: string | null, command: string, message: any, callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo): void;
715
1806
  private _sendToHost;
1807
+ /**
1808
+ * Send a message to an active UI Client
1809
+ *
1810
+ * @param options clientId and data options
1811
+ */
716
1812
  sendToUI(options: SendToUserInterfaceClientOptions): Promise<void>;
1813
+ /**
1814
+ * Send notification with given scope and category to host of this adapter
1815
+ *
1816
+ * @param scope scope to be addressed
1817
+ * @param category to be addressed, if a null message will be checked by regex of given scope
1818
+ * @param message message to be stored/checked
1819
+ * @param options Additional options for the notification, currently `contextData` is supported
1820
+ */
717
1821
  registerNotification<Scope extends keyof ioBroker.NotificationScopes>(scope: Scope, category: ioBroker.NotificationScopes[Scope] | null, message: string, options?: NotificationOptions): Promise<void>;
1822
+ /**
1823
+ * Writes value into states DB.
1824
+ *
1825
+ * @param id object ID of the state.
1826
+ * @param state simple value or object with attributes.
1827
+ * @param callback return result
1828
+ */
718
1829
  setState<T extends ioBroker.SetStateCallback | undefined>(id: string | ioBroker.IdObject, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, callback?: T): T extends unknown ? ioBroker.SetStatePromise : void;
1830
+ /**
1831
+ * Writes value into states DB.
1832
+ *
1833
+ * @param id object ID of the state.
1834
+ * @param state simple value or object with attributes.
1835
+ * @param ack optional is command(false) or status(true)
1836
+ * @param callback return result
1837
+ */
719
1838
  setState<T extends ioBroker.SetStateCallback | undefined>(id: string | ioBroker.IdObject, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, callback?: T): T extends unknown ? ioBroker.SetStatePromise : void;
1839
+ /**
1840
+ * Writes value into states DB.
1841
+ *
1842
+ * @param id object ID of the state.
1843
+ * @param state simple value or object with attributes.
1844
+ * @param options optional user context
1845
+ * @param callback return result
1846
+ */
720
1847
  setState<T extends ioBroker.SetStateCallback | undefined>(id: string | ioBroker.IdObject, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options?: Partial<GetUserGroupsOptions> | null, callback?: T): T extends unknown ? ioBroker.SetStatePromise : void;
1848
+ /**
1849
+ * Writes value into states DB.
1850
+ *
1851
+ * @param id object ID of the state.
1852
+ * @param state simple value or object with attributes.
1853
+ * @param ack optional is command(false) or status(true)
1854
+ * @param options optional user context
1855
+ * @param callback return result
1856
+ */
721
1857
  setState<T extends ioBroker.SetStateCallback | undefined>(id: string | ioBroker.IdObject, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options?: Partial<GetUserGroupsOptions> | null, callback?: T): T extends unknown ? ioBroker.SetStatePromise : void;
722
1858
  private _setState;
723
1859
  private _getUserGroups;
@@ -725,40 +1861,220 @@ export declare class AdapterClass extends EventEmitter {
725
1861
  private _checkStates;
726
1862
  private _getGroups;
727
1863
  private _setStateChangedHelper;
1864
+ /**
1865
+ * Writes value into states DB only if the value really changed.
1866
+ *
1867
+ * @param id object ID of the state.
1868
+ * @param state simple value or object with attributes.
1869
+ * @param callback return result
1870
+ */
728
1871
  setStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, callback?: ioBroker.SetStateChangedCallback): void;
1872
+ /**
1873
+ * Writes value into states DB only if the value really changed.
1874
+ *
1875
+ * @param id object ID of the state.
1876
+ * @param state simple value or object with attributes.
1877
+ * @param ack optional is command(false) or status(true)
1878
+ * @param callback return result
1879
+ */
729
1880
  setStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, callback?: ioBroker.SetStateChangedCallback): void;
1881
+ /**
1882
+ * Writes value into states DB only if the value really changed.
1883
+ *
1884
+ * @param id object ID of the state.
1885
+ * @param state simple value or object with attributes.
1886
+ * @param options optional user context
1887
+ * @param callback return result
1888
+ */
730
1889
  setStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options: unknown, callback?: ioBroker.SetStateChangedCallback): void;
1890
+ /**
1891
+ * Writes value into states DB only if the value really changed.
1892
+ *
1893
+ * @param id object ID of the state.
1894
+ * @param state simple value or object with attributes.
1895
+ * @param ack optional is command(false) or status(true)
1896
+ * @param options optional user context
1897
+ * @param callback return result
1898
+ */
731
1899
  setStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown, callback?: ioBroker.SetStateChangedCallback): void;
732
1900
  private _setStateChanged;
1901
+ /**
1902
+ * Writes value into states DB for any instance.
1903
+ *
1904
+ * @param id object ID of the state.
1905
+ * @param state simple value or object with attributes.
1906
+ * @param callback return result
1907
+ */
733
1908
  setForeignState(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, callback?: ioBroker.SetStateCallback): void;
1909
+ /**
1910
+ * Writes value into states DB for any instance.
1911
+ *
1912
+ * @param id object ID of the state.
1913
+ * @param state simple value or object with attributes.
1914
+ * @param ack optional is command(false) or status(true)
1915
+ * @param callback return result
1916
+ */
734
1917
  setForeignState(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, callback?: ioBroker.SetStateCallback): void;
1918
+ /**
1919
+ * Writes value into states DB for any instance.
1920
+ *
1921
+ * @param id object ID of the state.
1922
+ * @param state simple value or object with attributes.
1923
+ * @param options optional user context
1924
+ * @param callback return result
1925
+ */
735
1926
  setForeignState(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options: unknown, callback?: ioBroker.SetStateCallback): void;
1927
+ /**
1928
+ * Writes value into states DB for any instance.
1929
+ *
1930
+ * @param id object ID of the state.
1931
+ * @param state simple value or object with attributes.
1932
+ * @param ack optional is command(false) or status(true)
1933
+ * @param options optional user context
1934
+ * @param callback return result
1935
+ */
736
1936
  setForeignState(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown, callback?: ioBroker.SetStateCallback): void;
1937
+ /**
1938
+ * Writes value into states DB for any instance only if the value really changed.
1939
+ *
1940
+ * @param id object ID of the state.
1941
+ * @param state simple value or object with attributes.
1942
+ * @param callback return result
1943
+ */
737
1944
  setForeignStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, callback?: ioBroker.SetStateChangedCallback): void;
1945
+ /**
1946
+ * Writes value into states DB for any instance only if the value really changed.
1947
+ *
1948
+ * @param id object ID of the state.
1949
+ * @param state simple value or object with attributes.
1950
+ * @param ack optional is command(false) or status(true)
1951
+ * @param callback return result
1952
+ */
738
1953
  setForeignStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, callback?: ioBroker.SetStateChangedCallback): void;
1954
+ /**
1955
+ * Writes value into states DB for any instance only if the value really changed.
1956
+ *
1957
+ * @param id object ID of the state.
1958
+ * @param state simple value or object with attributes.
1959
+ * @param options optional user context
1960
+ * @param callback return result
1961
+ */
739
1962
  setForeignStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options: unknown, callback?: ioBroker.SetStateChangedCallback): void;
1963
+ /**
1964
+ * Writes value into states DB for any instance only if the value really changed.
1965
+ *
1966
+ * @param id object ID of the state.
1967
+ * @param state simple value or object with attributes.
1968
+ * @param ack optional is command(false) or status(true)
1969
+ * @param options optional user context
1970
+ * @param callback return result
1971
+ */
740
1972
  setForeignStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown, callback?: ioBroker.SetStateChangedCallback): void;
1973
+ /**
1974
+ * Read value from states DB.
1975
+ *
1976
+ * @param id object ID of the state.
1977
+ * @param callback return result
1978
+ */
741
1979
  getState(id: string, callback: ioBroker.GetStateCallback): void;
1980
+ /**
1981
+ * Read value from states DB.
1982
+ *
1983
+ * @param id object ID of the state.
1984
+ * @param options optional user context
1985
+ * @param callback return result
1986
+ */
742
1987
  getState(id: string, options: unknown, callback: ioBroker.GetStateCallback): void;
1988
+ /**
1989
+ * Read value from states DB for any instance and system state.
1990
+ *
1991
+ * @param id object ID of the state.
1992
+ * @param callback return result
1993
+ */
743
1994
  getForeignState(id: string, callback: ioBroker.GetStateCallback): ioBroker.GetStatePromise;
1995
+ /**
1996
+ * Read value from states DB for any instance and system state.
1997
+ *
1998
+ * @param id object ID of the state.
1999
+ * @param options optional user context
2000
+ * @param callback return result
2001
+ */
744
2002
  getForeignState(id: string, options: unknown, callback: ioBroker.GetStateCallback): ioBroker.GetStatePromise;
745
2003
  private _getForeignState;
746
2004
  private _getDefaultHistory;
2005
+ /**
2006
+ * Read historian data for states of any instance or system state.
2007
+ *
2008
+ * @param id object ID of the state.
2009
+ * @param options the query options for the history
2010
+ * @param callback return result
2011
+ */
747
2012
  getHistory(id: string, options: ioBroker.GetHistoryOptions, callback: ioBroker.GetHistoryCallback): void;
2013
+ /**
2014
+ * Read historian data for states of any instance or system state.
2015
+ *
2016
+ * @param id object ID of the state.
2017
+ * @param callback return result
2018
+ */
748
2019
  getHistory(id: string, callback: ioBroker.GetHistoryCallback): void;
749
2020
  private _getHistory;
2021
+ /**
2022
+ * Convert ID into object with device's, channel's and state's name.
2023
+ *
2024
+ * @param id short or long string of ID like "stateID" or "adapterName.0.stateID".
2025
+ * @returns parsed ID as an object
2026
+ */
750
2027
  idToDCS(id: string): {
751
2028
  device: string;
752
2029
  channel: string;
753
2030
  state: string;
754
2031
  } | null;
2032
+ /**
2033
+ * Deletes a state of this instance. The object is NOT deleted.
2034
+ *
2035
+ * @param id exactly object ID (without namespace)
2036
+ * @param callback return result
2037
+ */
755
2038
  delState(id: string, callback?: ioBroker.ErrorCallback): void;
2039
+ /**
2040
+ * Deletes a state of this instance. The object is NOT deleted.
2041
+ *
2042
+ * @param id exactly object ID (without namespace)
2043
+ * @param options optional user context
2044
+ * @param callback return result
2045
+ */
756
2046
  delState(id: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
757
2047
  private _delState;
2048
+ /**
2049
+ * Deletes a state of any adapter. The object is NOT deleted.
2050
+ *
2051
+ * @param id long string for ID like "adapterName.0.stateID".
2052
+ * @param callback return result
2053
+ */
758
2054
  delForeignState(id: string, callback?: ioBroker.ErrorCallback): void;
2055
+ /**
2056
+ * Deletes a state of any adapter. The object is NOT deleted.
2057
+ *
2058
+ * @param id long string for ID like "adapterName.0.stateID".
2059
+ * @param options optional argument to describe the user context
2060
+ * @param callback return result
2061
+ */
759
2062
  delForeignState(id: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
760
2063
  private _delForeignState;
2064
+ /**
2065
+ * Read all states of this adapter, that pass the pattern
2066
+ *
2067
+ * @param pattern string in form 'adapter.0.*' or like this. It can be an array of IDs too.
2068
+ * @param callback return result
2069
+ */
761
2070
  getStates(pattern: Pattern, callback: ioBroker.GetStatesCallback): void;
2071
+ /**
2072
+ * Read all states of this adapter, that pass the pattern
2073
+ *
2074
+ * @param pattern string in form 'adapter.0.*' or like this. It can be an array of IDs too.
2075
+ * @param options optional argument to describe the user context
2076
+ * @param callback return result
2077
+ */
762
2078
  getStates(pattern: Pattern, options: unknown, callback: ioBroker.GetStatesCallback): void;
763
2079
  private _processStatesSecondary;
764
2080
  /**
@@ -769,7 +2085,20 @@ export declare class AdapterClass extends EventEmitter {
769
2085
  * @param targetObjs the target objects (e.g. alias objects or the actual objects)
770
2086
  */
771
2087
  private _processStates;
2088
+ /**
2089
+ * Read all states of all adapters (and system states), that pass the pattern
2090
+ *
2091
+ * @param pattern string in form 'adapter.0.*' or like this. It can be an array of IDs too.
2092
+ * @param callback return result
2093
+ */
772
2094
  getForeignStates(pattern: Pattern, callback: ioBroker.GetStatesCallback): void;
2095
+ /**
2096
+ * Read all states of all adapters (and system states), that pass the pattern
2097
+ *
2098
+ * @param pattern string in form 'adapter.0.*' or like this. It can be an array of IDs too.
2099
+ * @param options optional user context
2100
+ * @param callback return result
2101
+ */
773
2102
  getForeignStates(pattern: Pattern, options: unknown, callback: ioBroker.GetStatesCallback): void;
774
2103
  private _getForeignStates;
775
2104
  /**
@@ -786,19 +2115,90 @@ export declare class AdapterClass extends EventEmitter {
786
2115
  * @param aliasObjOrIdx the alias target or the index of the targets array
787
2116
  */
788
2117
  private _removeAliasSubscribe;
2118
+ /**
2119
+ * Subscribe for changes on all states of all adapters (and system states), that pass the pattern
2120
+ *
2121
+ * @param pattern string in form 'adapter.0.*' or like this. It can be an array of IDs too.
2122
+ * @param callback optional callback
2123
+ */
789
2124
  subscribeForeignStates(pattern: Pattern, callback?: ioBroker.ErrorCallback): void;
2125
+ /**
2126
+ * Subscribe for changes on all states of all adapters (and system states), that pass the pattern
2127
+ *
2128
+ * @param pattern string in form 'adapter.0.*' or like this. It can be an array of IDs too.
2129
+ * @param options optional argument to describe the user context
2130
+ * @param callback optional callback
2131
+ */
790
2132
  subscribeForeignStates(pattern: Pattern, options: unknown, callback?: ioBroker.ErrorCallback): void;
791
2133
  private _subscribeForeignStates;
2134
+ /**
2135
+ * Unsubscribe for changes for given pattern
2136
+ *
2137
+ * @param pattern string in form 'adapter.0.*'. Must be the same as subscribe.
2138
+ * @param callback optional callback
2139
+ */
792
2140
  unsubscribeForeignStates(pattern: string | string[], callback?: ioBroker.ErrorCallback): void;
2141
+ /**
2142
+ * Unsubscribe for changes for given pattern
2143
+ *
2144
+ * @param pattern string in form 'adapter.0.*'. Must be the same as subscribe.
2145
+ * @param options optional argument to describe the user context
2146
+ * @param callback optional callback
2147
+ */
793
2148
  unsubscribeForeignStates(pattern: string | string[], options: unknown, callback?: ioBroker.ErrorCallback): void;
794
2149
  private _unsubscribeForeignStates;
2150
+ /**
2151
+ * Subscribe for changes on all states of this instance, that pass the pattern
2152
+ *
2153
+ * @param pattern string in form 'adapter.0.*' or like this. Only string allowed
2154
+ * @param callback optional callback
2155
+ */
795
2156
  subscribeStates(pattern: Pattern, callback?: ioBroker.ErrorCallback): void;
2157
+ /**
2158
+ * Subscribe for changes on all states of this instance, that pass the pattern
2159
+ *
2160
+ * @param pattern string in form 'adapter.0.*' or like this. Only string allowed
2161
+ * @param options optional argument to describe the user context
2162
+ * @param callback optional callback
2163
+ */
796
2164
  subscribeStates(pattern: Pattern, options: unknown, callback?: ioBroker.ErrorCallback): void;
2165
+ /**
2166
+ * Unsubscribe for changes for given pattern for own states.
2167
+ *
2168
+ * @param pattern string in form 'adapter.0.*'. Must be the same as subscribe.
2169
+ * @param callback optional callback
2170
+ */
797
2171
  unsubscribeStates(pattern: Pattern, callback?: ioBroker.ErrorCallback): void;
2172
+ /**
2173
+ * Unsubscribe for changes for given pattern for own states.
2174
+ *
2175
+ * @param pattern string in form 'adapter.0.*'. Must be the same as subscribe.
2176
+ * @param options optional argument to describe the user context
2177
+ * @param callback optional callback
2178
+ */
798
2179
  unsubscribeStates(pattern: Pattern, options: unknown, callback?: ioBroker.ErrorCallback): void;
2180
+ /**
2181
+ * Return plugin instance
2182
+ *
2183
+ * @param name name of the plugin to return
2184
+ * @returns plugin instance or null if not existent or not isActive
2185
+ */
799
2186
  getPluginInstance(name: string): ioBroker.Plugin | null;
2187
+ /**
2188
+ * Return plugin configuration
2189
+ *
2190
+ * @param name name of the plugin to return
2191
+ * @returns plugin configuration or null if not existent or not isActive
2192
+ */
800
2193
  getPluginConfig(name: string): Record<string, any> | null;
801
2194
  private _autoSubscribeOn;
2195
+ /**
2196
+ * This method returns the list of license that can be used by this adapter
2197
+ *
2198
+ * @param all if return the licenses, that used by other instances (true) or only for this instance (false)
2199
+ * @param adapterName Return licenses for specific adapter
2200
+ * @returns list of suitable licenses
2201
+ */
802
2202
  getSuitableLicenses(all?: boolean, adapterName?: string): Promise<any[]>;
803
2203
  /**
804
2204
  * Add given id to log redirect list