@iobroker/types 5.0.0-alpha.0-20221217-d87d529d

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.
@@ -0,0 +1,1239 @@
1
+ /// <reference types="@iobroker/types" />
2
+ /// <reference types="node" />
3
+
4
+ import type { ChangeFileFunction } from '@iobroker/db-objects-redis';
5
+ import { EventEmitter } from 'events';
6
+
7
+ /**
8
+ * Polyfill to allow calling without `new`
9
+ * @type {AdapterClass}
10
+ */
11
+ export declare const Adapter: typeof AdapterClass;
12
+
13
+ /**
14
+ * Here we define dynamically created methods
15
+ */
16
+ export declare interface AdapterClass {
17
+ /** Extend an object and create it if it might not exist */
18
+ extendObjectAsync(id: string, objPart: ioBroker.PartialObject, options?: ioBroker.ExtendObjectOptions): ioBroker.SetObjectPromise;
19
+ /** Set capabilities of the given executable. Only works on Linux systems. */
20
+ setExecutableCapabilities(execPath: string, capabilities: string[], modeEffective?: boolean, modePermitted?: boolean, modeInherited?: boolean): Promise<void>;
21
+ /** Extend an object (which might not belong to this adapter) and create it if it might not exist */
22
+ extendForeignObjectAsync<T extends string>(id: T, objPart: ioBroker.PartialObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options?: ioBroker.ExtendObjectOptions): ioBroker.SetObjectPromise;
23
+ /** Reads an object from the object db */
24
+ getObjectAsync(id: string, options?: unknown): ioBroker.GetObjectPromise;
25
+ /**
26
+ * Query a predefined object view (similar to SQL stored procedures) and return the results
27
+ * For a detailed description refer to https://github.com/ioBroker/ioBroker/wiki/Adapter-Development-Documentation#object-fields
28
+ * or http://guide.couchdb.org/editions/1/en/views.html
29
+ */
30
+ getObjectViewAsync<Design extends string = string, Search extends string = string>(design: Design, search: Search, params: ioBroker.GetObjectViewParams | null | undefined, options?: unknown): ioBroker.GetObjectViewPromise<ioBroker.InferGetObjectViewItemType<Design, Search>>;
31
+ /** Returns a list of objects with id between params.startkey and params.endkey */
32
+ getObjectListAsync(params: ioBroker.GetObjectListParams | null, options?: {
33
+ sorted?: boolean;
34
+ } | Record<string, any>): ioBroker.GetObjectListPromise;
35
+ /** Returns the enum tree, filtered by the optional enum name */
36
+ getEnumAsync(name: string, options?: unknown): Promise<{
37
+ result: Record<string, any>;
38
+ requestEnum: string;
39
+ }>;
40
+ /** Returns the enum tree, filtered by the optional enum name */
41
+ getEnumsAsync(enumList: ioBroker.EnumList, options?: unknown): ioBroker.GetEnumsPromise;
42
+ /** Deletes an object from the object db */
43
+ delObjectAsync(id: string, options?: ioBroker.DelObjectOptions): Promise<void>;
44
+ /** Deletes an object (which might not belong to this adapter) from the object db */
45
+ delForeignObjectAsync(id: string, options?: ioBroker.DelObjectOptions): Promise<void>;
46
+ /** Subscribe to changes of objects in this instance */
47
+ subscribeObjectsAsync(pattern: string, options?: unknown): Promise<void>;
48
+ /** Unsubscribe from changes of objects in this instance */
49
+ unsubscribeObjectsAsync(pattern: string, options?: unknown): Promise<void>;
50
+ /** Read a value from the states DB. */
51
+ getStateAsync(id: string, options?: unknown): ioBroker.GetStatePromise;
52
+ /** Subscribe to changes of objects (which might not belong to this adapter) */
53
+ subscribeForeignObjectsAsync(pattern: string, options?: unknown): Promise<void>;
54
+ /** Unsubscribe from changes of objects (which might not belong to this adapter) */
55
+ unsubscribeForeignObjectsAsync(pattern: string, options?: unknown): Promise<void>;
56
+ /** Creates an object in the object db. Existing objects are not overwritten. */
57
+ setObjectNotExistsAsync(id: string, obj: ioBroker.SettableObject, options?: unknown): ioBroker.SetObjectPromise;
58
+ /** Creates an object (which might not belong to this adapter) in the object db. Existing objects are not overwritten. */
59
+ setForeignObjectNotExistsAsync<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options?: unknown): ioBroker.SetObjectPromise;
60
+ /** deletes a device, its channels and states */
61
+ deleteDeviceAsync(deviceName: string, options?: unknown): Promise<void>;
62
+ addChannelToEnumAsync(enumName: string, addTo: string, parentDevice: string, channelName: string, options?: unknown): Promise<void>;
63
+ deleteChannelFromEnumAsync(enumName: string, parentDevice: string, channelName: string, options?: unknown): Promise<void>;
64
+ /** Returns a list of all devices in this adapter instance */
65
+ getDevicesAsync(options?: unknown): Promise<ioBroker.DeviceObject[]>;
66
+ addStateToEnumAsync(enumName: string, addTo: string, parentDevice: string, parentChannel: string, stateName: string, options?: unknown): Promise<void>;
67
+ deleteStateFromEnumAsync(enumName: string, parentDevice: string, parentChannel: string, stateName: string, options?: unknown): Promise<void>;
68
+ /** Changes access rights of all files in the adapter directory */
69
+ chmodFileAsync(adapter: string | null, path: string, options: {
70
+ mode: number | string;
71
+ } | Record<string, any>): Promise<{
72
+ entries: ioBroker.ChownFileResult[];
73
+ id: string;
74
+ }>;
75
+ chownFileAsync(...args: any[]): Promise<any>;
76
+ /** reads the content of directory from DB for given adapter and path */
77
+ readDirAsync(adapterName: string | null, path: string, options?: unknown): ioBroker.ReadDirPromise;
78
+ /** Deletes a given file */
79
+ unlinkAsync(adapterName: string | null, path: string, options?: unknown): Promise<void>;
80
+ /** Deletes a given file */
81
+ delFileAsync(adapterName: string | null, path: string, options?: unknown): Promise<void>;
82
+ renameAsync(adapterName: string | null, oldName: string, newName: string, options?: unknown): Promise<void>;
83
+ mkdirAsync(adapterName: string | null, path: string, options?: unknown): Promise<void>;
84
+ /** reads the content of directory from DB for given adapter and path */
85
+ readFileAsync(adapterName: string | null, path: string, options?: unknown): ioBroker.ReadFilePromise;
86
+ writeFileAsync(adapterName: string | null, path: string, data: Buffer | string, options?: unknown): Promise<void>;
87
+ /** Checks if a file exists in the DB */
88
+ fileExistsAsync(adapterName: string | null, path: string, options?: unknown): Promise<boolean>;
89
+ getHistoryAsync(...args: any[]): Promise<any>;
90
+ /** Deletes a state from the states DB, but not the associated object. Consider using deleteState instead */
91
+ delStateAsync(id: string, options?: unknown): Promise<void>;
92
+ /** Deletes a state from the states DB, but not the associated object */
93
+ delForeignStateAsync(id: string, options?: unknown): Promise<void>;
94
+ /** Read all states of this adapter which match the given pattern */
95
+ getStatesAsync(pattern: string, options?: unknown): ioBroker.GetStatesPromise;
96
+ /** Read all states (which might not belong to this adapter) which match the given pattern */
97
+ getForeignStatesAsync(pattern: string, options?: unknown): ioBroker.GetStatesPromise;
98
+ /** Subscribe to changes of states (which might not belong to this adapter) */
99
+ subscribeForeignStatesAsync(pattern: string, options?: unknown): Promise<void>;
100
+ /** Subscribe from changes of states (which might not belong to this adapter) */
101
+ unsubscribeForeignStatesAsync(pattern: string, options?: unknown): Promise<void>;
102
+ /** Subscribe to changes of states in this instance */
103
+ subscribeStatesAsync(pattern: string, options?: unknown): Promise<void>;
104
+ /** Subscribe from changes of states in this instance */
105
+ unsubscribeStatesAsync(pattern: string, options?: unknown): Promise<void>;
106
+ /** Writes a binary state into Redis. The ID will not be prefixed with the adapter namespace. */
107
+ setForeignBinaryStateAsync(id: string, binary: Buffer, options?: unknown): ioBroker.SetStatePromise;
108
+ /**
109
+ * Despite the naming convention, this method doesn't prepend the adapter namespace. Use setForeignBinaryStateAsync instead.
110
+ * Writes a binary state into Redis
111
+ */
112
+ setBinaryStateAsync(id: string, binary: Buffer, options?: unknown): ioBroker.SetStatePromise;
113
+ getForeignBinaryStateAsync(id: string, options?: unknown): ioBroker.GetBinaryStatePromise;
114
+ /**
115
+ * Despite the naming convention, this method doesn't prepend the adapter namespace. Use getForeignBinaryStateAsync instead.
116
+ * Reads a binary state from Redis
117
+ */
118
+ getBinaryStateAsync(id: string, options?: unknown): ioBroker.GetBinaryStatePromise;
119
+ /** Deletes a binary state from the states DB. The ID will not be prefixed with the adapter namespace. */
120
+ delForeignBinaryStateAsync(id: string, options?: unknown): Promise<void>;
121
+ /**
122
+ * Despite the naming convention, this method doesn't prepend the adapter namespace. Use delForeignBinaryStateAsync instead.
123
+ * Deletes a binary state from the states DB
124
+ */
125
+ delBinaryStateAsync(id: string, options?: unknown): Promise<void>;
126
+ /**
127
+ * Helper function that looks for first free TCP port starting with the given one.
128
+ */
129
+ getPortAsync(port: number): Promise<number>;
130
+ /** Read a value (which might not belong to this adapter) from the states DB. */
131
+ getForeignStateAsync(id: string, options?: unknown): ioBroker.GetStatePromise;
132
+ /** Validates username and password */
133
+ checkPasswordAsync(user: string, password: string, options?: unknown): Promise<boolean>;
134
+ /** Sets a new password for the given user */
135
+ setPasswordAsync(user: string, password: string, options?: unknown): Promise<void>;
136
+ /** <INTERNAL> Checks if a user exists and is in the given group. */
137
+ checkGroupAsync(user: string, group: string, options?: unknown): Promise<boolean>;
138
+ /** <INTERNAL> Determines the users permissions */
139
+ calculatePermissionsAsync(user: string, commandsPermissions: CommandsPermissions, options?: unknown): Promise<ioBroker.PermissionSet>;
140
+ /** Creates or overwrites an object in the object db */
141
+ setObjectAsync(id: string, obj: ioBroker.SettableObject, options?: unknown): ioBroker.SetObjectPromise;
142
+ /** Creates or overwrites an object (which might not belong to this adapter) in the object db */
143
+ setForeignObjectAsync<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options?: unknown): ioBroker.SetObjectPromise;
144
+ getCertificatesAsync(...args: any[]): Promise<any>;
145
+ /** Get all states, channels, devices and folders of this adapter */
146
+ getAdapterObjectsAsync(): Promise<Record<string, ioBroker.AdapterScopedObject>>;
147
+ /** Reads an object (which might not belong to this adapter) from the object db*/
148
+ getForeignObjectAsync<T extends string>(id: T, options?: unknown): ioBroker.GetObjectPromise<T>;
149
+ /**
150
+ * Writes a value (which might not belong to this adapter) into the states DB only if it has changed.
151
+ */
152
+ setForeignStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack?: boolean): ioBroker.SetStateChangedPromise;
153
+ setForeignStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options?: unknown): ioBroker.SetStateChangedPromise;
154
+ setForeignStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown): ioBroker.SetStateChangedPromise;
155
+ /**
156
+ * Writes a value into the states DB only if it has changed.
157
+ */
158
+ setStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack?: boolean): ioBroker.SetStateChangedPromise;
159
+ setStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options?: unknown): ioBroker.SetStateChangedPromise;
160
+ setStateChangedAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown): ioBroker.SetStateChangedPromise;
161
+ /**
162
+ * Sends a message to a specific host or all hosts.
163
+ */
164
+ sendToHostAsync(hostName: string, message: ioBroker.MessagePayload): Promise<ioBroker.Message | undefined>;
165
+ sendToHostAsync(hostName: string, command: string, message: ioBroker.MessagePayload): Promise<ioBroker.Message | undefined>;
166
+ /**
167
+ * Sends a message to a specific instance or all instances of some specific adapter.
168
+ */
169
+ sendToAsync(instanceName: string, message: ioBroker.MessagePayload): Promise<ioBroker.Message | undefined>;
170
+ sendToAsync(instanceName: string, command: string, message: ioBroker.MessagePayload): Promise<ioBroker.Message | undefined>;
171
+ /**
172
+ * Deletes a given file
173
+ */
174
+ delFile(adapterName: string | null, path: string, callback: ioBroker.ErrnoCallback): void;
175
+ delFile(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ErrnoCallback): void;
176
+ /**
177
+ * Writes a value into the states DB.
178
+ */
179
+ setStateAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack?: boolean): ioBroker.SetStatePromise;
180
+ setStateAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options?: unknown): ioBroker.SetStatePromise;
181
+ setStateAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown): ioBroker.SetStatePromise;
182
+ /**
183
+ * Writes a value (which might not belong to this adapter) into the states DB.
184
+ */
185
+ setForeignStateAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack?: boolean): ioBroker.SetStatePromise;
186
+ setForeignStateAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options?: unknown): ioBroker.SetStatePromise;
187
+ setForeignStateAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown): ioBroker.SetStatePromise;
188
+ /**
189
+ * Get foreign objects by pattern, by specific type and resolve their enums.
190
+ */
191
+ getForeignObjectsAsync<T extends ioBroker.ObjectType>(pattern: string, type: T, enums?: ioBroker.EnumList | null, options?: unknown): ioBroker.GetObjectsPromiseTyped<T>;
192
+ getForeignObjectsAsync<T extends ioBroker.ObjectType>(pattern: string, type: T, options?: unknown): ioBroker.GetObjectsPromiseTyped<T>;
193
+ getForeignObjectsAsync(pattern: string, options?: unknown): ioBroker.GetObjectsPromise;
194
+ /**
195
+ * creates an object with type device
196
+ */
197
+ createDeviceAsync(deviceName: string, common?: Partial<ioBroker.DeviceCommon>): ioBroker.SetObjectPromise;
198
+ createDeviceAsync(deviceName: string, common: Partial<ioBroker.DeviceCommon>, native?: Record<string, any>): ioBroker.SetObjectPromise;
199
+ createDeviceAsync(deviceName: string, common: Partial<ioBroker.DeviceCommon>, native: Record<string, any>, options?: unknown): ioBroker.SetObjectPromise;
200
+ /**
201
+ * Finds an object by its ID or name
202
+ */
203
+ findForeignObjectAsync(idOrName: string, type: string): Promise<{
204
+ id: string;
205
+ name: string;
206
+ }>;
207
+ /**
208
+ * Creates an object with type channel. It must be located under a device
209
+ */
210
+ createChannelAsync(parentDevice: string, channelName: string, roleOrCommon?: string | Partial<ioBroker.ChannelCommon>): ioBroker.SetObjectPromise;
211
+ createChannelAsync(parentDevice: string, channelName: string, roleOrCommon: string | Partial<ioBroker.ChannelCommon>, native?: Record<string, any>): ioBroker.SetObjectPromise;
212
+ createChannelAsync(parentDevice: string, channelName: string, roleOrCommon: string | Partial<ioBroker.ChannelCommon>, native: Record<string, any>, options?: unknown): ioBroker.SetObjectPromise;
213
+ /**
214
+ * Creates a state and the corresponding object. It must be located in a channel under a device
215
+ */
216
+ createStateAsync(parentDevice: string, parentChannel: string, stateName: string, roleOrCommon?: string | Partial<ioBroker.StateCommon>): ioBroker.SetObjectPromise;
217
+ createStateAsync(parentDevice: string, parentChannel: string, stateName: string, roleOrCommon: string | Partial<ioBroker.StateCommon>, native?: Record<string, any>): ioBroker.SetObjectPromise;
218
+ createStateAsync(parentDevice: string, parentChannel: string, stateName: string, roleOrCommon: string | Partial<ioBroker.StateCommon>, native: Record<string, any>, options?: unknown): ioBroker.SetObjectPromise;
219
+ /**
220
+ * Deletes a channel and its states. It must have been created with createChannel
221
+ */
222
+ deleteChannelAsync(channelName: string, options?: unknown): Promise<void>;
223
+ deleteChannelAsync(parentDevice: string, channelName: string, options?: unknown): Promise<void>;
224
+ /**
225
+ * Deletes a state. It must have been created with createState
226
+ */
227
+ deleteStateAsync(stateName: string, options?: unknown): Promise<void>;
228
+ deleteStateAsync(parentChannel: string, stateName: string, options?: unknown): Promise<void>;
229
+ deleteStateAsync(parentDevice: string, parentChannel: string, stateName: string, options?: unknown): Promise<void>;
230
+ /**
231
+ * Returns a list of all channels in this adapter instance @param parentDevice (optional) Name
232
+ * of the parent device to filter the channels by @param options (optional) Some internal options.
233
+ */
234
+ getChannelsOfAsync(): Promise<ioBroker.ChannelObject[]>;
235
+ getChannelsOfAsync(parentDevice: string, options?: unknown): Promise<ioBroker.ChannelObject[]>;
236
+ /**
237
+ * Returns a list of all channels in this adapter instance
238
+ */
239
+ getChannels(callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
240
+ getChannels(parentDevice: string, callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
241
+ getChannels(parentDevice: string, options: unknown, callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
242
+ /**
243
+ * Returns a list of all channels in this adapter instance @param parentDevice (optional)
244
+ * Name of the parent device to filter the channels by @param options (optional) Some internal options.
245
+ */
246
+ getChannelsAsync(): Promise<ioBroker.ChannelObject[]>;
247
+ getChannelsAsync(parentDevice: string, options?: unknown): Promise<ioBroker.ChannelObject[]>;
248
+ /**
249
+ * Returns a list of all states in this adapter instance @param parentDevice (optional)
250
+ * Name of the parent device to filter the channels by @param parentChannel (optional)
251
+ * Name of the parent channel to filter the channels by @param options (optional) Some internal options.
252
+ */
253
+ getStatesOfAsync(): Promise<ioBroker.StateObject[]>;
254
+ getStatesOfAsync(parentDevice: string, parentChannel?: string): Promise<ioBroker.StateObject[]>;
255
+ getStatesOfAsync(parentDevice: string, parentChannel: string, options?: unknown): Promise<ioBroker.StateObject[]>;
256
+ }
257
+
258
+ /**
259
+ * Adapter class
260
+ *
261
+ * How the initialization happens:
262
+ * initObjects => initStates => prepareInitAdapter => initAdapter => initLogging => createInstancesObjects => ready
263
+ *
264
+ */
265
+ export declare class AdapterClass extends EventEmitter {
266
+ /** Contents of iobroker.json */
267
+ private readonly _config;
268
+ private readonly _options;
269
+ private readonly startedInCompactMode;
270
+ /** List of instances which want our logs */
271
+ private readonly logList;
272
+ private readonly aliases;
273
+ private readonly aliasPatterns;
274
+ private enums;
275
+ private eventLoopLags;
276
+ private overwriteLogLevel;
277
+ protected adapterReady: boolean;
278
+ private callbacks?;
279
+ /**
280
+ * Contains a live cache of the adapter's states.
281
+ * NOTE: This is only defined if the adapter was initialized with the option states: true.
282
+ */
283
+ oStates?: Record<string, ioBroker.State | undefined>;
284
+ /**
285
+ * Contains a live cache of the adapter's objects.
286
+ * NOTE: This is only defined if the adapter was initialized with the option objects: true.
287
+ */
288
+ oObjects?: Record<string, ioBroker.Object | undefined>;
289
+ private _stopInProgress;
290
+ private _callbackId;
291
+ private _firstConnection;
292
+ private readonly _timers;
293
+ private readonly _intervals;
294
+ private readonly _delays;
295
+ log?: Log;
296
+ performStrictObjectChecks: boolean;
297
+ private readonly _logger;
298
+ private _restartScheduleJob;
299
+ private _schedule;
300
+ private namespaceLog;
301
+ namespace: `${string}.${number}`;
302
+ protected name: string;
303
+ private _systemSecret?;
304
+ /** Whether the adapter has already terminated */
305
+ private terminated;
306
+ /** The cache of usernames */
307
+ private usernames;
308
+ /** A RegExp to test for forbidden chars in object IDs */
309
+ readonly FORBIDDEN_CHARS: RegExp;
310
+ private inputCount;
311
+ private outputCount;
312
+ /** The cache of users */
313
+ private users;
314
+ /** The cache of user groups */
315
+ private groups;
316
+ /** An array of instances, that support auto subscribe */
317
+ private autoSubscribe;
318
+ private defaultHistory;
319
+ private pluginHandler?;
320
+ private _reportInterval?;
321
+ private getPortRunning;
322
+ private readonly _namespaceRegExp;
323
+ protected instance?: number;
324
+ private _utils;
325
+ /** contents of io-package.json */
326
+ protected adapterConfig?: AdapterOptions | ioBroker.InstanceObject | null;
327
+ protected connected?: boolean;
328
+ protected adapterDir: string;
329
+ /** contents of package.json */
330
+ protected pack?: Record<string, any>;
331
+ /** contents of io-package.json */
332
+ protected ioPack: Record<string, any>;
333
+ private _initializeTimeout?;
334
+ private inited?;
335
+ /** contents of iobroker.json if required via AdapterOptions */
336
+ protected systemConfig?: Record<string, any>;
337
+ /** the configured date format of system.config, only available if requested via AdapterOptions `useFormatDate` */
338
+ protected dateFormat?: any;
339
+ /** if float comma instead of dot is used, only available if requested via AdapterOptions `useFormatDate` */
340
+ protected isFloatComma?: boolean;
341
+ /** configured language of system.config, only available if requested via AdapterOptions `useFormatDate` */
342
+ protected language?: ioBroker.Languages;
343
+ /** longitude configured in system.config, only available if requested via AdapterOptions `useFormatDate`*/
344
+ protected longitude?: number;
345
+ /** latitude configured in system.config, only available if requested via AdapterOptions `useFormatDate`*/
346
+ protected latitude?: number;
347
+ private _defaultObjs?;
348
+ private _aliasObjectsSubscribed?;
349
+ protected config?: Record<string, any>;
350
+ protected host?: string;
351
+ protected common?: Record<string, any>;
352
+ private mboxSubscribed?;
353
+ protected stop?: () => Promise<void>;
354
+ protected version?: string;
355
+ protected kill?: () => Promise<void>;
356
+ protected processLog?: (msg: any) => void;
357
+ protected requireLog?: (_isActive: boolean) => void;
358
+ private logOffTimer?;
359
+ private logRedirect?;
360
+ private logRequired?;
361
+ private patterns?;
362
+ private statesConnectedTime?;
363
+ constructor(options: AdapterOptions | string);
364
+ decrypt(secretVal: string, value?: string): string;
365
+ decrypt(value: string): string;
366
+ encrypt(secretVal: string, value?: string): string;
367
+ encrypt(value: string): string;
368
+ getSession(id: string, callback: ioBroker.GetSessionCallback): MaybePromise;
369
+ private _getSession;
370
+ setSession(id: string, ttl: number, data: Record<string, any>, callback?: ioBroker.ErrorCallback): MaybePromise;
371
+ private _setSession;
372
+ destroySession(id: string, callback?: ioBroker.ErrorCallback): MaybePromise;
373
+ private _destroySession;
374
+ private _getObjectsByArray;
375
+ terminate(exitCode?: number): never;
376
+ terminate(reason?: string, exitCode?: number): never;
377
+ getPort(port: number, host?: string, callback?: (port: number) => void): void;
378
+ getPort(port: number, callback?: (port: number) => void): void;
379
+ private _getPort;
380
+ supportsFeature(featureName: string): boolean;
381
+ checkPassword(user: string, pw: string, options: Record<string, any>, callback: CheckPasswordCallback): Promise<void>;
382
+ checkPassword(user: string, pw: string, callback: CheckPasswordCallback): Promise<void>;
383
+ private _checkPassword;
384
+ /**
385
+ * This method update the cached values in `this.usernames`
386
+ */
387
+ private _updateUsernameCache;
388
+ getUserID(username: string): Promise<string | void>;
389
+ private _getUserID;
390
+ setPassword(user: string, pw: string, options: Record<string, any>, callback?: ioBroker.ErrorCallback): Promise<void>;
391
+ setPassword(user: string, pw: string, callback?: ioBroker.ErrorCallback): Promise<void>;
392
+ private _setPassword;
393
+ checkGroup(user: string, group: string, options: Record<string, any>, callback?: CheckGroupCallback): Promise<void>;
394
+ checkGroup(user: string, group: string, callback?: CheckGroupCallback): Promise<void>;
395
+ private _checkGroup;
396
+ calculatePermissions(user: string, commandsPermissions: CommandsPermissions, options?: Record<string, any>, callback?: CalculatePermissionsCallback): Promise<void | ioBroker.PermissionSet>;
397
+ calculatePermissions(user: string, commandsPermissions: CommandsPermissions, callback?: CalculatePermissionsCallback): Promise<void | ioBroker.PermissionSet>;
398
+ private _calculatePermissions;
399
+ private _stop;
400
+ /**
401
+ * Reads the file certificate from given path and adds a file watcher to restart adapter on cert changes
402
+ * if a cert is passed it is returned as it is
403
+ * @param cert
404
+ */
405
+ private _readFileCertificate;
406
+ getCertificates(publicName?: string, privateName?: string, chainedName?: string, callback?: GetCertificatesCallback): void;
407
+ private _getCertificates;
408
+ /**
409
+ * Restarts an instance of the adapter.
410
+ *
411
+ */
412
+ restart(): void;
413
+ updateConfig(newConfig: Record<string, any>): ioBroker.SetObjectPromise;
414
+ private _updateConfig;
415
+ /**
416
+ * Disables and stops the adapter instance.
417
+ *
418
+ */
419
+ disable(): ioBroker.SetObjectPromise;
420
+ getEncryptedConfig(attribute: string, callback?: GetEncryptedConfigCallback): Promise<string | void>;
421
+ private _getEncryptedConfig;
422
+ setTimeout(cb: TimeoutCallback, timeout: number, ...args: any[]): NodeJS.Timeout | void;
423
+ clearTimeout(timer: NodeJS.Timeout): void;
424
+ delay(timeout: number): Promise<void>;
425
+ setInterval(cb: TimeoutCallback, timeout: number, ...args: any[]): NodeJS.Timeout | void;
426
+ clearInterval(interval: NodeJS.Timeout): void;
427
+ setObject(id: string, obj: ioBroker.SettableObject, callback?: ioBroker.SetObjectCallback): Promise<void>;
428
+ setObject(id: string, obj: ioBroker.SettableObject, options: unknown, callback?: ioBroker.SetObjectCallback): Promise<void>;
429
+ setObject(id: string, obj: ioBroker.SettableObject, callback?: ioBroker.SetObjectCallback): Promise<void>;
430
+ private _setObject;
431
+ /**
432
+ * Helper method for `set[Foreign]Object[NotExists]` that also sets the default value if one is configured
433
+ * @param id of the object
434
+ * @param obj The object to set
435
+ * @param [options]
436
+ * @param [callback]
437
+ */
438
+ private _setObjectWithDefaultValue;
439
+ getAdapterObjects(callback: (objects: Record<string, ioBroker.AdapterScopedObject>) => void): Promise<Record<string, ioBroker.AdapterScopedObject> | void>;
440
+ private _getAdapterObjects;
441
+ extendObject(id: string, objPart: ioBroker.PartialObject, callback?: ioBroker.SetObjectCallback): void;
442
+ extendObject(id: string, objPart: ioBroker.PartialObject, options: ioBroker.ExtendObjectOptions, callback?: ioBroker.SetObjectCallback): void;
443
+ private _extendObject;
444
+ setForeignObject<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, callback?: ioBroker.SetObjectCallback): void;
445
+ setForeignObject<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options: unknown, callback?: ioBroker.SetObjectCallback): void;
446
+ private _setForeignObject;
447
+ extendForeignObject<T extends string>(id: T, objPart: ioBroker.PartialObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, callback?: ioBroker.SetObjectCallback): void;
448
+ extendForeignObject<T extends string>(id: T, objPart: ioBroker.PartialObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options: ioBroker.ExtendObjectOptions, callback?: ioBroker.SetObjectCallback): void;
449
+ private _extendForeignObjectAsync;
450
+ objectExists(id: string, options?: Record<string, any> | null): Promise<boolean | void>;
451
+ foreignObjectExists(id: string, options?: Record<string, any> | null): Promise<boolean | void>;
452
+ getObject(id: string, callback: ioBroker.GetObjectCallback): void;
453
+ getObject(id: string, options: unknown, callback: ioBroker.GetObjectCallback): void;
454
+ 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;
455
+ 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;
456
+ private _getObjectView;
457
+ getObjectList(params: ioBroker.GetObjectListParams | null, callback: ioBroker.GetObjectListCallback): void;
458
+ getObjectList(params: ioBroker.GetObjectListParams | null, options: {
459
+ sorted?: boolean;
460
+ } | Record<string, any>, callback: ioBroker.GetObjectListCallback): void;
461
+ getEnum(callback: ioBroker.GetEnumCallback): void;
462
+ getEnum(name: string, callback: ioBroker.GetEnumCallback): void;
463
+ getEnum(name: string, options: unknown, callback: ioBroker.GetEnumCallback): void;
464
+ private _getEnum;
465
+ getEnums(callback: ioBroker.GetEnumsCallback): void;
466
+ getEnums(enumList: ioBroker.EnumList, callback: ioBroker.GetEnumsCallback): void;
467
+ getEnums(enumList: ioBroker.EnumList, options: unknown, callback: ioBroker.GetEnumsCallback): void;
468
+ private _getEnums;
469
+ getForeignObjects(pattern: string, callback: ioBroker.GetObjectsCallback): void;
470
+ getForeignObjects(pattern: string, options: unknown, callback: ioBroker.GetObjectsCallback): void;
471
+ getForeignObjects<T extends ioBroker.ObjectType>(pattern: string, type: T, callback: ioBroker.GetObjectsCallbackTyped<T>): void;
472
+ getForeignObjects<T extends ioBroker.ObjectType>(pattern: string, type: T, enums: ioBroker.EnumList, callback: ioBroker.GetObjectsCallbackTyped<T>): void;
473
+ getForeignObjects<T extends ioBroker.ObjectType>(pattern: string, type: T, options: unknown, callback: ioBroker.GetObjectsCallbackTyped<T>): void;
474
+ getForeignObjects<T extends ioBroker.ObjectType>(pattern: string, type: T, enums: ioBroker.EnumList | null, options: unknown, callback: ioBroker.GetObjectsCallbackTyped<T>): void;
475
+ private _getForeignObjects;
476
+ findForeignObject(idOrName: string, type: string, callback: ioBroker.FindObjectCallback): void;
477
+ findForeignObject(idOrName: string, type: string, options: unknown, callback: ioBroker.FindObjectCallback): void;
478
+ getForeignObject<T extends string>(id: T, callback: ioBroker.GetObjectCallback<T>): MaybePromise;
479
+ getForeignObject<T extends string>(id: T, options: unknown, callback: ioBroker.GetObjectCallback<T>): MaybePromise;
480
+ private _getForeignObject;
481
+ delObject(id: string, callback?: ioBroker.ErrorCallback): void;
482
+ delObject(id: string, options?: ioBroker.DelObjectOptions | null, callback?: ioBroker.ErrorCallback): void;
483
+ private _deleteObjects;
484
+ delForeignObject(id: string, callback?: ioBroker.ErrorCallback): void;
485
+ delForeignObject(id: string, options: ioBroker.DelObjectOptions, callback?: ioBroker.ErrorCallback): void;
486
+ private _delForeignObject;
487
+ subscribeObjects(pattern: string, callback?: ioBroker.ErrorCallback): void;
488
+ subscribeObjects(pattern: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
489
+ unsubscribeObjects(pattern: string, callback?: ioBroker.ErrorCallback): void;
490
+ unsubscribeObjects(pattern: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
491
+ subscribeForeignObjects(pattern: string, callback?: ioBroker.ErrorCallback): void;
492
+ subscribeForeignObjects(pattern: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
493
+ unsubscribeForeignObjects(pattern: string, callback?: ioBroker.ErrorCallback): void;
494
+ unsubscribeForeignObjects(pattern: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
495
+ subscribeForeignFiles(pattern: string, callback?: ioBroker.ErrorCallback): void;
496
+ subscribeForeignFiles(pattern: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
497
+ unsubscribeForeignFiles(pattern: string, callback?: ioBroker.ErrorCallback): void;
498
+ unsubscribeForeignFiles(pattern: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
499
+ setObjectNotExists(id: string, obj: ioBroker.SettableObject, callback?: ioBroker.SetObjectCallback): Promise<void | ioBroker.CallbackReturnTypeOf<ioBroker.SetObjectCallback>> | void;
500
+ setObjectNotExists(id: string, obj: ioBroker.SettableObject, options: unknown, callback?: ioBroker.SetObjectCallback): Promise<void | ioBroker.CallbackReturnTypeOf<ioBroker.SetObjectCallback>> | void;
501
+ private _setObjectNotExists;
502
+ setForeignObjectNotExists<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, callback?: ioBroker.SetObjectCallback): void;
503
+ setForeignObjectNotExists<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, options: unknown, callback?: ioBroker.SetObjectCallback): void;
504
+ private _setForeignObjectNotExists;
505
+ private _DCS2ID;
506
+ createDevice(deviceName: string, callback?: ioBroker.SetObjectCallback): void;
507
+ createDevice(deviceName: string, common: Partial<ioBroker.DeviceCommon>, callback?: ioBroker.SetObjectCallback): void;
508
+ createDevice(deviceName: string, common: Partial<ioBroker.DeviceCommon>, native: Record<string, any>, callback?: ioBroker.SetObjectCallback): void;
509
+ createDevice(deviceName: string, common: Partial<ioBroker.DeviceCommon>, native: Record<string, any>, options: unknown, callback?: ioBroker.SetObjectCallback): void;
510
+ private _createDevice;
511
+ createChannel(parentDevice: string, channelName: string, callback?: ioBroker.SetObjectCallback): void;
512
+ createChannel(parentDevice: string, channelName: string, roleOrCommon: string | Partial<ioBroker.ChannelCommon>, callback?: ioBroker.SetObjectCallback): void;
513
+ createChannel(parentDevice: string, channelName: string, roleOrCommon: string | Partial<ioBroker.ChannelCommon>, native: Record<string, any>, callback?: ioBroker.SetObjectCallback): void;
514
+ createChannel(parentDevice: string, channelName: string, roleOrCommon: string | Partial<ioBroker.ChannelCommon>, native: Record<string, any>, options: unknown, callback?: ioBroker.SetObjectCallback): void;
515
+ createState(parentDevice: string, parentChannel: string, stateName: string, callback?: ioBroker.SetObjectCallback): void;
516
+ createState(parentDevice: string, parentChannel: string, stateName: string, roleOrCommon: string | Partial<ioBroker.StateCommon>, callback?: ioBroker.SetObjectCallback): void;
517
+ createState(parentDevice: string, parentChannel: string, stateName: string, roleOrCommon: string | Partial<ioBroker.StateCommon>, native: Record<string, any>, callback?: ioBroker.SetObjectCallback): void;
518
+ createState(parentDevice: string, parentChannel: string, stateName: string, roleOrCommon: string | Partial<ioBroker.StateCommon>, native: Record<string, any>, options: unknown, callback?: ioBroker.SetObjectCallback): void;
519
+ private _createState;
520
+ deleteDevice(deviceName: string, callback?: ioBroker.ErrorCallback): void;
521
+ deleteDevice(deviceName: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
522
+ private _deleteDevice;
523
+ addChannelToEnum(enumName: string, addTo: string, parentDevice: string, channelName: string, callback?: ioBroker.ErrorCallback): void;
524
+ addChannelToEnum(enumName: string, addTo: string, parentDevice: string, channelName: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
525
+ private _addChannelToEnum;
526
+ deleteChannelFromEnum(enumName: string, parentDevice: string, channelName: string, callback?: ioBroker.ErrorCallback): void;
527
+ deleteChannelFromEnum(enumName: string, parentDevice: string, channelName: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
528
+ private _deleteChannelFromEnum;
529
+ deleteChannel(channelName: string, callback?: ioBroker.ErrorCallback): void;
530
+ deleteChannel(channelName: string, options?: unknown, callback?: ioBroker.ErrorCallback): void;
531
+ deleteChannel(parentDevice: string, channelName: string, options?: unknown, callback?: ioBroker.ErrorCallback): void;
532
+ private _deleteChannel;
533
+ deleteState(stateName: string, options?: unknown, callback?: ioBroker.ErrorCallback): void;
534
+ deleteState(parentChannel: string, stateName: string, options?: unknown, callback?: ioBroker.ErrorCallback): void;
535
+ deleteState(parentDevice: string, parentChannel: string, stateName: string, options?: unknown, callback?: ioBroker.ErrorCallback): void;
536
+ private _deleteState;
537
+ getDevices(callback: ioBroker.GetObjectsCallback3<ioBroker.DeviceObject>): void;
538
+ getDevices(options: unknown, callback: ioBroker.GetObjectsCallback3<ioBroker.DeviceObject>): void;
539
+ private _getDevices;
540
+ getChannelsOf(callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
541
+ getChannelsOf(parentDevice: string, callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
542
+ getChannelsOf(parentDevice: string, options: unknown, callback: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>): void;
543
+ private _getChannelsOf;
544
+ getStatesOf(callback: ioBroker.GetObjectsCallback3<ioBroker.StateObject>): void;
545
+ getStatesOf(parentDevice: string, callback: ioBroker.GetObjectsCallback3<ioBroker.StateObject>): void;
546
+ getStatesOf(parentDevice: string | null | undefined, parentChannel: string | null | undefined, callback: ioBroker.GetObjectsCallback3<ioBroker.StateObject>): void;
547
+ getStatesOf(parentDevice: string | null | undefined, parentChannel: string | null | undefined, options: unknown, callback: ioBroker.GetObjectsCallback3<ioBroker.StateObject>): void;
548
+ private _getStatesOf;
549
+ addStateToEnum(enumName: string, addTo: string, parentDevice: string, parentChannel: string, stateName: string, callback?: ioBroker.ErrorCallback): void;
550
+ addStateToEnum(enumName: string, addTo: string, parentDevice: string, parentChannel: string, stateName: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
551
+ private _addStateToEnum;
552
+ deleteStateFromEnum(enumName: string, parentDevice: string, parentChannel: string, stateName: string, callback?: ioBroker.ErrorCallback): void;
553
+ deleteStateFromEnum(enumName: string, parentDevice: string, parentChannel: string, stateName: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
554
+ private _deleteStateFromEnum;
555
+ chmodFile(adapter: string | null, path: string, options: {
556
+ mode: number | string;
557
+ } | Record<string, any>, callback: ioBroker.ChownFileCallback): void;
558
+ chmodFile(adapter: string | null, path: string, callback: ioBroker.ChownFileCallback): void;
559
+ chownFile(_adapter: string, path: string, options: unknown, callback: (err?: Error | null, processedFiles?: any) => void): void;
560
+ chownFile(_adapter: string, path: string, callback: (err?: Error | null, processedFiles?: any) => void): void;
561
+ readDir(adapterName: string | null, path: string, callback: ioBroker.ReadDirCallback): void;
562
+ readDir(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ReadDirCallback): void;
563
+ unlink(adapterName: string | null, path: string, callback: ioBroker.ErrnoCallback): void;
564
+ unlink(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ErrnoCallback): void;
565
+ rename(adapterName: string | null, oldName: string, newName: string, callback: ioBroker.ErrnoCallback): void;
566
+ rename(adapterName: string | null, oldName: string, newName: string, options: unknown, callback: ioBroker.ErrnoCallback): void;
567
+ mkdir(adapterName: string | null, path: string, callback: ioBroker.ErrnoCallback): void;
568
+ mkdir(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ErrnoCallback): void;
569
+ readFile(adapterName: string | null, path: string, callback: ioBroker.ReadFileCallback): void;
570
+ readFile(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ReadFileCallback): void;
571
+ writeFile(adapterName: string | null, path: string, data: Buffer | string, callback: ioBroker.ErrnoCallback): void;
572
+ writeFile(adapterName: string | null, path: string, data: Buffer | string, options: unknown, callback: ioBroker.ErrnoCallback): void;
573
+ fileExists(adapterName: string | null, path: string, callback: ioBroker.GenericCallback<boolean>): void;
574
+ fileExists(adapterName: string | null, path: string, options: unknown, callback: ioBroker.GenericCallback<boolean>): void;
575
+ formatValue(value: number | string, format: any): string;
576
+ formatValue(value: number | string, decimals: number, format: any): string;
577
+ formatDate(dateObj: string | Date | number, format: string): string;
578
+ formatDate(dateObj: string | Date | number, isDuration: boolean | string, format: string): string;
579
+ private _formatDate;
580
+ sendTo(instanceName: string, message: any, callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo): void;
581
+ sendTo(instanceName: string, command: string, message: any, callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo): void;
582
+ private _sendTo;
583
+ sendToHost(hostName: string, message: any, callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo): void;
584
+ sendToHost(hostName: string, command: string, message: any, callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo): void;
585
+ private _sendToHost;
586
+ registerNotification<Scope extends keyof ioBroker.NotificationScopes>(scope: Scope, category: ioBroker.NotificationScopes[Scope] | null, message: string): Promise<void>;
587
+ setState<T extends ioBroker.SetStateCallback | undefined>(id: string | IdObject, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, callback?: T): T extends ioBroker.SetStateCallback ? Promise<void> : ioBroker.SetStatePromise;
588
+ setState<T extends ioBroker.SetStateCallback>(id: string | IdObject, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, callback?: T): T extends ioBroker.SetStateCallback ? Promise<void> : ioBroker.SetStatePromise;
589
+ setState<T extends ioBroker.SetStateCallback>(id: string | IdObject, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options: unknown, callback?: T): T extends ioBroker.SetStateCallback ? Promise<void> : ioBroker.SetStatePromise;
590
+ setState<T extends ioBroker.SetStateCallback>(id: string | IdObject, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown, callback?: T): T extends ioBroker.SetStateCallback ? Promise<void> : ioBroker.SetStatePromise;
591
+ private _setState;
592
+ private _getUserGroups;
593
+ private _checkState;
594
+ private _checkStates;
595
+ private _getGroups;
596
+ private _setStateChangedHelper;
597
+ setStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, callback?: ioBroker.SetStateChangedCallback): void;
598
+ setStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, callback?: ioBroker.SetStateChangedCallback): void;
599
+ setStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options: unknown, callback?: ioBroker.SetStateChangedCallback): void;
600
+ setStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown, callback?: ioBroker.SetStateChangedCallback): void;
601
+ private _setStateChanged;
602
+ setForeignState(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, callback?: ioBroker.SetStateCallback): void;
603
+ setForeignState(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, callback?: ioBroker.SetStateCallback): void;
604
+ setForeignState(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options: unknown, callback?: ioBroker.SetStateCallback): void;
605
+ setForeignState(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown, callback?: ioBroker.SetStateCallback): void;
606
+ setForeignStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, callback?: ioBroker.SetStateChangedCallback): void;
607
+ setForeignStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, callback?: ioBroker.SetStateChangedCallback): void;
608
+ setForeignStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options: unknown, callback?: ioBroker.SetStateChangedCallback): void;
609
+ setForeignStateChanged(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown, callback?: ioBroker.SetStateChangedCallback): void;
610
+ getState(id: string, callback: ioBroker.GetStateCallback): void;
611
+ getState(id: string, options: unknown, callback: ioBroker.GetStateCallback): void;
612
+ getForeignState(id: string, callback: ioBroker.GetStateCallback): ioBroker.GetStatePromise;
613
+ getForeignState(id: string, options: unknown, callback: ioBroker.GetStateCallback): ioBroker.GetStatePromise;
614
+ private _getForeignState;
615
+ private _getDefaultHistory;
616
+ getHistory(id: string, options: ioBroker.GetHistoryOptions, callback: ioBroker.GetHistoryCallback): void;
617
+ getHistory(id: string, callback: ioBroker.GetHistoryCallback): void;
618
+ private _getHistory;
619
+ idToDCS(id: string): {
620
+ device: string;
621
+ channel: string;
622
+ state: string;
623
+ } | null;
624
+ delState(id: string, callback?: ioBroker.ErrorCallback): void;
625
+ delState(id: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
626
+ private _delState;
627
+ delForeignState(id: string, callback?: ioBroker.ErrorCallback): void;
628
+ delForeignState(id: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
629
+ private _delForeignState;
630
+ getStates(pattern: string, callback: ioBroker.GetStatesCallback): void;
631
+ getStates(pattern: string, options: unknown, callback: ioBroker.GetStatesCallback): void;
632
+ private _processStatesSecondary;
633
+ private _processStates;
634
+ getForeignStates(pattern: string | string[], callback: ioBroker.GetStatesCallback): void;
635
+ getForeignStates(pattern: string | string[], options: unknown, callback: ioBroker.GetStatesCallback): void;
636
+ private _getForeignStates;
637
+ private _addAliasSubscribe;
638
+ private _removeAliasSubscribe;
639
+ subscribeForeignStates(pattern: string | string[], callback?: ioBroker.ErrorCallback): void;
640
+ subscribeForeignStates(pattern: string | string[], options: unknown, callback?: ioBroker.ErrorCallback): void;
641
+ private _subscribeForeignStates;
642
+ unsubscribeForeignStates(pattern: string, callback?: ioBroker.ErrorCallback): void;
643
+ unsubscribeForeignStates(pattern: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
644
+ private _unsubscribeForeignStates;
645
+ subscribeStates(pattern: string, callback?: ioBroker.ErrorCallback): void;
646
+ subscribeStates(pattern: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
647
+ unsubscribeStates(pattern: string, callback?: ioBroker.ErrorCallback): void;
648
+ unsubscribeStates(pattern: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
649
+ setForeignBinaryState(id: string, binary: Buffer, callback: ioBroker.SetStateCallback): void;
650
+ setForeignBinaryState(id: string, binary: Buffer, options: unknown, callback: ioBroker.SetStateCallback): void;
651
+ private _setForeignBinaryState;
652
+ setBinaryState(id: string, binary: Buffer, callback: ioBroker.SetStateCallback): void;
653
+ setBinaryState(id: string, binary: Buffer, options: unknown, callback: ioBroker.SetStateCallback): void;
654
+ getForeignBinaryState(id: string, callback: ioBroker.GetBinaryStateCallback): void;
655
+ getForeignBinaryState(id: string, options: unknown, callback: ioBroker.GetBinaryStateCallback): void;
656
+ private _getForeignBinaryState;
657
+ getBinaryState(id: string, callback: ioBroker.GetBinaryStateCallback): void;
658
+ getBinaryState(id: string, options: unknown, callback: ioBroker.GetBinaryStateCallback): void;
659
+ delForeignBinaryState(id: string, callback?: ioBroker.ErrorCallback): void;
660
+ delForeignBinaryState(id: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
661
+ private _delForeignBinaryState;
662
+ delBinaryState(id: string, callback?: ioBroker.ErrorCallback): void;
663
+ delBinaryState(id: string, options: unknown, callback?: ioBroker.ErrorCallback): void;
664
+ getPluginInstance(name: string): ioBroker.Plugin | null;
665
+ getPluginConfig(name: string): Record<string, any> | null;
666
+ private _autoSubscribeOn;
667
+ getSuitableLicenses(all?: boolean, adapterName?: string): Promise<any[]>;
668
+ private _reportStatus;
669
+ private _checkLogging;
670
+ private _initLogging;
671
+ private _initStates;
672
+ private _initObjects;
673
+ /**
674
+ * Called if states and objects successfully initialized
675
+ */
676
+ private _prepareInitAdapter;
677
+ private _initAdapter;
678
+ private _exceptionHandler;
679
+ private _createInstancesObjects;
680
+ private _extendObjects;
681
+ private _init;
682
+ }
683
+
684
+ export declare interface AdapterOptions {
685
+ subscribesChange?: (subs: Record<string, {
686
+ regex: RegExp;
687
+ }>) => void;
688
+ /** If the adapter collects logs from all adapters (experts only). Default: false */
689
+ logTransporter?: boolean;
690
+ /** if true, the date format from system.config */
691
+ useFormatDate?: boolean;
692
+ /** if it is possible for other instances to retrive states of this adapter automatically */
693
+ subscribable?: boolean;
694
+ /** compact group instance if running in compact mode */
695
+ compactInstance?: number;
696
+ /** if desired to have oStates. This is a list with all states values, and it will be updated automatically. */
697
+ states?: boolean;
698
+ /** if desired to have oObjects. This is a list with all states, channels and devices of this adapter, and it will be updated automatically.*/
699
+ objects?: boolean;
700
+ /** instance number of adapter */
701
+ instance?: number;
702
+ /** adapter directory name */
703
+ dirname?: string;
704
+ /** flag which defaults to true - if true, adapter warns if states are set without a corresponding existing object */
705
+ strictObjectChecks?: boolean;
706
+ /** If true runs in compact mode */
707
+ compact?: boolean;
708
+ /** configuration of the connection to controller */
709
+ config?: AdapterOptionsConfig;
710
+ /** name of the adapter. Must be exactly the same as directory name. */
711
+ name: string;
712
+ /** If true, the systemConfig (iobroker.json) will be available in this.systemConfig */
713
+ systemConfig?: boolean;
714
+ /** callback function (id, obj) that will be called if object changed */
715
+ objectChange?: ioBroker.ObjectChangeHandler;
716
+ /** callback function (id, obj) that will be called if state changed */
717
+ stateChange?: ioBroker.StateChangeHandler;
718
+ /** callback function (id, file) that will be called if file changed */
719
+ fileChange?: ChangeFileFunction;
720
+ /** callback to inform about new message the adapter */
721
+ message?: ioBroker.MessageHandler;
722
+ /** callback to stop the adapter */
723
+ unload?: ioBroker.UnloadHandler;
724
+ /** called when adapter is ready */
725
+ ready?: ioBroker.ReadyHandler;
726
+ /** called on reconnection to DB */
727
+ reconnect?: () => MaybePromise;
728
+ /** Handler to handle uncaught exceptions, return true if no further handling required */
729
+ error?: ioBroker.ErrorHandler;
730
+ }
731
+
732
+ export declare interface AdapterOptionsConfig {
733
+ log: {
734
+ level: ioBroker.LogLevel;
735
+ };
736
+ }
737
+
738
+ export declare interface AliasDetails {
739
+ source: AliasDetailsSource | null;
740
+ targets: AliasTargetEntry[];
741
+ }
742
+
743
+ export declare interface AliasDetailsSource {
744
+ min?: number;
745
+ max?: number;
746
+ type: string;
747
+ unit?: string;
748
+ }
749
+
750
+ export declare interface AliasTargetEntry {
751
+ alias: ioBroker.StateCommon['alias'];
752
+ id: string;
753
+ pattern: string;
754
+ type: string;
755
+ max?: number;
756
+ min?: number;
757
+ unit?: string;
758
+ }
759
+
760
+ export declare type CalculatePermissionsCallback = (result: ioBroker.PermissionSet) => void;
761
+
762
+ declare type Callback = (...args: any[]) => void | Promise<void>;
763
+
764
+ export declare type CheckGroupCallback = (result: boolean) => void;
765
+
766
+ export declare type CheckPasswordCallback = (success: boolean, user: string) => void;
767
+
768
+ export declare type CheckStateCommand = 'getState' | 'setState' | 'delState';
769
+
770
+ export declare interface CheckStatesResult {
771
+ objs: ioBroker.StateObject[];
772
+ ids: string[];
773
+ }
774
+
775
+ export declare type CommandsPermissions = CommandsPermissionsObject | CommandsPermissionsEntry[];
776
+
777
+ export declare type CommandsPermissionsEntry = {
778
+ type: 'object' | 'state' | '' | 'other' | 'file';
779
+ operation: string;
780
+ };
781
+
782
+ export declare type CommandsPermissionsObject = {
783
+ [permission: string]: CommandsPermissionsEntry;
784
+ };
785
+
786
+ export declare type GetCertificatesCallback = (err: string | null, certs?: ioBroker.Certificates, useLetsEncryptCert?: boolean) => void;
787
+
788
+ export declare type GetEncryptedConfigCallback = (error: Error | null | undefined, result?: string) => void;
789
+
790
+ export declare interface GetUserGroupsOptions {
791
+ user: `system.user.${string}`;
792
+ [other: string]: any;
793
+ }
794
+
795
+ declare interface IdObject {
796
+ device?: string;
797
+ channel?: string;
798
+ state?: string;
799
+ }
800
+
801
+ export declare interface InternalAddChannelToEnumOptions {
802
+ enumName: string;
803
+ addTo: string;
804
+ parentDevice: string;
805
+ channelName: string;
806
+ options?: Record<string, any> | null;
807
+ callback?: ioBroker.ErrorCallback;
808
+ }
809
+
810
+ export declare interface InternalAddStateToEnumOptions {
811
+ enumName: string;
812
+ addTo: string;
813
+ parentDevice: string;
814
+ parentChannel: string;
815
+ stateName: string;
816
+ options?: Record<string, any> | null;
817
+ callback?: ioBroker.ErrorCallback;
818
+ }
819
+
820
+ export declare interface InternalCalculatePermissionsOptions {
821
+ user: string;
822
+ commandsPermissions: CommandsPermissions;
823
+ options?: Record<string, any> | null;
824
+ callback?: CalculatePermissionsCallback;
825
+ }
826
+
827
+ export declare interface InternalCheckGroupOptions {
828
+ user: string;
829
+ group: string;
830
+ options?: Record<string, any> | null;
831
+ callback?: CheckGroupCallback;
832
+ }
833
+
834
+ export declare interface InternalCheckPasswordOptions {
835
+ user: string;
836
+ pw: string;
837
+ options?: Record<string, any> | null;
838
+ callback: CheckPasswordCallback;
839
+ }
840
+
841
+ export declare interface InternalCreateDeviceOptions {
842
+ deviceName: string;
843
+ common?: Partial<ioBroker.DeviceCommon>;
844
+ _native?: Record<string, any> | null;
845
+ options: unknown;
846
+ callback?: ioBroker.SetObjectCallback;
847
+ }
848
+
849
+ export declare interface InternalCreateStateOptions {
850
+ parentDevice: string;
851
+ parentChannel: string;
852
+ stateName: string;
853
+ common: Partial<ioBroker.StateCommon>;
854
+ _native: Record<string, any>;
855
+ options?: Record<string, any> | null;
856
+ callback?: ioBroker.SetObjectCallback;
857
+ }
858
+
859
+ export declare interface InternalDelBinaryStateOptions {
860
+ id: string;
861
+ options: Record<string, any>;
862
+ callback?: ioBroker.ErrorCallback;
863
+ }
864
+
865
+ export declare interface InternalDeleteChannelFromEnumOptions {
866
+ enumName: string;
867
+ parentDevice: string;
868
+ channelName: string;
869
+ options?: Record<string, any> | null;
870
+ callback?: ioBroker.ErrorCallback;
871
+ }
872
+
873
+ export declare interface InternalDeleteChannelOptions {
874
+ parentDevice: string;
875
+ channelName: string;
876
+ callback?: ioBroker.ErrorCallback;
877
+ }
878
+
879
+ export declare interface InternalDeleteDeviceOptions {
880
+ deviceName: string;
881
+ callback?: ioBroker.ErrorCallback;
882
+ }
883
+
884
+ export declare interface InternalDeleteStateFromEnumOptions {
885
+ enumName: string;
886
+ parentDevice: string;
887
+ parentChannel: string;
888
+ stateName: string;
889
+ options?: Record<string, any> | null;
890
+ callback?: ioBroker.ErrorCallback;
891
+ }
892
+
893
+ export declare interface InternalDeleteStateOptions {
894
+ parentDevice: string;
895
+ parentChannel: string;
896
+ stateName: string;
897
+ options?: Record<string, any> | null;
898
+ callback?: ioBroker.ErrorCallback;
899
+ }
900
+
901
+ export declare interface InternalDelObjectOptions {
902
+ id: string;
903
+ options?: ioBroker.DelObjectOptions | null;
904
+ callback?: ioBroker.ErrorCallback;
905
+ }
906
+
907
+ export declare interface InternalDelStateOptions {
908
+ id: string;
909
+ options?: Record<string, any> | null;
910
+ callback?: ioBroker.ErrorCallback;
911
+ }
912
+
913
+ export declare interface InternalDestroySessionOptions {
914
+ id: string;
915
+ callback?: ioBroker.ErrorCallback;
916
+ }
917
+
918
+ export declare interface InternalFormatDateOptions {
919
+ dateObj: string | Date | number;
920
+ isDuration: boolean;
921
+ _format?: string;
922
+ }
923
+
924
+ export declare interface InternalGetAdapterObjectsOptions {
925
+ callback?: (objects: Record<string, ioBroker.AdapterScopedObject>) => void;
926
+ }
927
+
928
+ export declare interface InternalGetBinaryStateOption {
929
+ id: string;
930
+ options: Record<string, any>;
931
+ callback?: ioBroker.GetBinaryStateCallback;
932
+ }
933
+
934
+ export declare interface InternalGetCertificatesOptions {
935
+ publicName: string;
936
+ privateName: string;
937
+ chainedName: string;
938
+ callback?: GetCertificatesCallback;
939
+ }
940
+
941
+ export declare interface InternalGetChannelsOfOptions {
942
+ parentDevice: string;
943
+ callback?: ioBroker.GetObjectsCallback3<ioBroker.ChannelObject>;
944
+ options?: Record<string, any> | null;
945
+ }
946
+
947
+ export declare interface InternalGetDevicesOptions {
948
+ options?: Record<string, any> | null;
949
+ callback: ioBroker.GetObjectsCallback3<ioBroker.DeviceObject>;
950
+ }
951
+
952
+ export declare interface InternalGetEncryptedConfigOptions {
953
+ attribute: string;
954
+ callback?: GetEncryptedConfigCallback;
955
+ }
956
+
957
+ export declare interface InternalGetEnumOptions {
958
+ _enum: string;
959
+ options?: Record<string, any> | null;
960
+ callback?: ioBroker.GetEnumCallback;
961
+ }
962
+
963
+ export declare interface InternalGetEnumsOptions {
964
+ _enumList?: ioBroker.EnumList;
965
+ options?: Record<string, any> | null;
966
+ callback?: ioBroker.GetEnumsCallback;
967
+ }
968
+
969
+ export declare interface InternalGetHistoryOptions {
970
+ id: string;
971
+ options?: ioBroker.GetHistoryOptions | null;
972
+ callback: ioBroker.GetHistoryCallback;
973
+ }
974
+
975
+ export declare interface InternalGetObjectOptions {
976
+ id: string;
977
+ options: unknown;
978
+ callback?: ioBroker.GetObjectCallback<any>;
979
+ }
980
+
981
+ export declare interface InternalGetObjectsOptions {
982
+ pattern: string;
983
+ type?: string;
984
+ enums?: ioBroker.EnumList | null;
985
+ options?: Record<string, any> | null;
986
+ callback?: ioBroker.GetObjectsCallbackTyped<any>;
987
+ }
988
+
989
+ export declare interface InternalGetObjectViewOptions {
990
+ design: string;
991
+ search: string;
992
+ params: ioBroker.GetObjectViewParams;
993
+ options?: Record<string, any> | null;
994
+ callback?: ioBroker.GetObjectViewCallback<ioBroker.AnyObject>;
995
+ }
996
+
997
+ export declare interface InternalGetPortOptions {
998
+ port: number;
999
+ host?: string;
1000
+ callback?: (port: number) => void;
1001
+ }
1002
+
1003
+ export declare interface InternalGetSessionOptions {
1004
+ id: string;
1005
+ callback: ioBroker.GetSessionCallback;
1006
+ }
1007
+
1008
+ export declare interface InternalGetStateOptions {
1009
+ id: string;
1010
+ options?: Record<string, any> | null;
1011
+ callback?: ioBroker.GetStateCallback;
1012
+ }
1013
+
1014
+ export declare interface InternalGetStatesOfOptions {
1015
+ parentDevice: string | null | undefined;
1016
+ parentChannel: string | null | undefined;
1017
+ options?: Record<string, any> | null;
1018
+ callback: ioBroker.GetObjectsCallback3<ioBroker.StateObject>;
1019
+ }
1020
+
1021
+ export declare interface InternalGetStatesOptions {
1022
+ pattern: string | string[];
1023
+ options: Record<string, any>;
1024
+ callback: ioBroker.GetStatesCallback;
1025
+ }
1026
+
1027
+ export declare interface InternalGetUserIDOptions {
1028
+ username: string;
1029
+ }
1030
+
1031
+ export declare interface InternalSendToHostOptions {
1032
+ hostName: string;
1033
+ command: string;
1034
+ message: any;
1035
+ callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo;
1036
+ }
1037
+
1038
+ export declare interface InternalSendToOptions {
1039
+ instanceName: string;
1040
+ command: string;
1041
+ message: any;
1042
+ callback?: ioBroker.MessageCallback | ioBroker.MessageCallbackInfo;
1043
+ }
1044
+
1045
+ export declare interface InternalSetBinaryStateOptions {
1046
+ id: string;
1047
+ options?: Record<string, any> | null;
1048
+ binary: Buffer;
1049
+ callback?: ioBroker.SetStateCallback;
1050
+ }
1051
+
1052
+ export declare interface InternalSetObjectOptions {
1053
+ id: string;
1054
+ options?: Record<string, any> | null;
1055
+ obj: ioBroker.SettableObject;
1056
+ callback?: ioBroker.SetObjectCallback;
1057
+ }
1058
+
1059
+ export declare interface InternalSetPasswordOptions {
1060
+ user: string;
1061
+ pw: string;
1062
+ options?: Record<string, any> | null;
1063
+ callback?: ioBroker.ErrorCallback;
1064
+ }
1065
+
1066
+ export declare interface InternalSetSessionOptions {
1067
+ id: string;
1068
+ ttl: number;
1069
+ data: Record<string, any>;
1070
+ callback?: ioBroker.ErrorCallback;
1071
+ }
1072
+
1073
+ export declare interface InternalSetStateChangedOptions extends InternalSetStateOptions {
1074
+ callback?: ioBroker.SetStateChangedCallback;
1075
+ }
1076
+
1077
+ export declare interface InternalSetStateOptions {
1078
+ id: string | IdObject;
1079
+ state: ioBroker.StateValue | ioBroker.SettableState;
1080
+ ack?: boolean;
1081
+ options?: Record<string, any> | null;
1082
+ callback?: ioBroker.SetStateCallback;
1083
+ }
1084
+
1085
+ export declare interface InternalSubscribeOptions {
1086
+ pattern: string | string[];
1087
+ options?: Record<string, any> | null;
1088
+ callback?: ioBroker.ErrorCallback;
1089
+ }
1090
+
1091
+ export declare interface InternalUpdateConfigOptions {
1092
+ newConfig: Record<string, any>;
1093
+ }
1094
+
1095
+ /**
1096
+ * Log class for adapter.js
1097
+ *
1098
+ * It prefixes every message with the given namespace
1099
+ */
1100
+ declare class Log {
1101
+ private readonly namespaceLog;
1102
+ readonly level: string;
1103
+ private readonly logger;
1104
+ /**
1105
+ * @param namespaceLog Logging namespace to prefix
1106
+ * @param level The log level
1107
+ * @param logger logger instance
1108
+ */
1109
+ constructor(namespaceLog: string, level: string, logger: any);
1110
+ silly(msg: string): void;
1111
+ debug(msg: string): void;
1112
+ info(msg: string): void;
1113
+ error(msg: string): void;
1114
+ warn(msg: string): void;
1115
+ }
1116
+
1117
+ export declare type MaybePromise = Promise<void> | void;
1118
+
1119
+ declare type OptionalCallback = undefined | Callback;
1120
+
1121
+ declare type Pattern = string | string[];
1122
+
1123
+ export declare interface SetStateChangedResult {
1124
+ notChanged: boolean;
1125
+ id: string;
1126
+ }
1127
+
1128
+ export declare type TimeoutCallback = (args?: any[]) => void;
1129
+
1130
+ export declare class Utils {
1131
+ private readonly objects;
1132
+ private readonly states;
1133
+ private readonly namespaceLog;
1134
+ private readonly log;
1135
+ private readonly namespace;
1136
+ private readonly namespaceRegExp;
1137
+ /**
1138
+ * Utils for internal adapter.js usage
1139
+ * @param objects - Objects DB
1140
+ * @param states - States DB
1141
+ * @param namespaceLog - Log prefix
1142
+ * @param logger - Logger instance
1143
+ * @param namespace - the namespace of the adapter
1144
+ * @param namespaceRegExp - the namespace RegExp of the adapter adapter.0
1145
+ */
1146
+ constructor(objects: any, states: any, namespaceLog: string, logger: any, namespace: string, namespaceRegExp: RegExp);
1147
+ /**
1148
+ * Performs the strict object check, which includes checking object existence, read-only logic, type and min/max
1149
+ * additionally it rounds state values whose objects have a common.step attribute defined
1150
+ *
1151
+ * @param id - id of the state
1152
+ * @param state - ioBroker setState object
1153
+ */
1154
+ performStrictObjectCheck(id: string, state: ioBroker.SettableState): Promise<void>;
1155
+ /**
1156
+ * Checks if a passed ID is valid. Throws an error if id is invalid
1157
+ *
1158
+ * @param id id to check or object with properties device, channel and state
1159
+ * @param isForeignId true&false if the ID is a foreign/full ID or only an "adapter local" id
1160
+ * @param options optional
1161
+ * @throws Error when id is invalid
1162
+ */
1163
+ validateId(id: string | any, isForeignId: boolean, options?: ValidateIdOptions | null): asserts id is string;
1164
+ /**
1165
+ * Look up the error description for an error code
1166
+ *
1167
+ * @param code error code
1168
+ * @return error description
1169
+ */
1170
+ static getErrorText(code: number): string;
1171
+ /**
1172
+ * Throws if type is not matching the expected type
1173
+ * @param value value to check type of
1174
+ * @param name name of the parameter for logging
1175
+ */
1176
+ static assertString(value: unknown, name: string): asserts value is string;
1177
+ /**
1178
+ * Throws if type is not a pattern
1179
+ * @param value value to check type of
1180
+ * @param name name of the parameter for logging
1181
+ */
1182
+ static assertPattern(value: unknown, name: string): asserts value is Pattern;
1183
+ /**
1184
+ * Throws if type is not matching the expected type
1185
+ * @param value value to check type of
1186
+ * @param name name of the parameter for logging
1187
+ */
1188
+ static assertBoolean(value: unknown, name: string): asserts value is boolean;
1189
+ /**
1190
+ * Throws if type is not matching the expected type
1191
+ * @param value value to check type of
1192
+ * @param name name of the parameter for logging
1193
+ */
1194
+ static assertNumber(value: unknown, name: string): asserts value is number;
1195
+ /**
1196
+ * Throws if type is not matching the expected type
1197
+ * @param value value to check type of
1198
+ * @param name name of the parameter for logging
1199
+ */
1200
+ static assertObject(value: unknown, name: string): asserts value is Record<string, any>;
1201
+ /**
1202
+ * Throws if type is not an optional callback
1203
+ * @param value value to check type of
1204
+ * @param name name of the parameter for logging
1205
+ */
1206
+ static assertBuffer(value: unknown, name: string): asserts value is Buffer;
1207
+ /**
1208
+ * Throws if type is not an optional callback
1209
+ * @param value value to check type of
1210
+ * @param name name of the parameter for logging
1211
+ */
1212
+ static assertOptionalCallback(value: unknown, name: string): asserts value is OptionalCallback;
1213
+ /**
1214
+ * Throws if type is not an optional callback
1215
+ * @param value value to check type of
1216
+ * @param name name of the parameter for logging
1217
+ */
1218
+ static assertCallback(value: unknown, name: string): asserts value is Callback;
1219
+ /**
1220
+ * Adds the namespace to the id if it is missing, if an object is passed it will be converted to an id string
1221
+ *
1222
+ * @param id id which will be fixed
1223
+ * @param isPattern if the id is a pattern
1224
+ */
1225
+ fixId(id: string | IdObject, isPattern?: boolean): string;
1226
+ /**
1227
+ * Validates the object-type argument that is passed to setState
1228
+ * @param obj object to validate
1229
+ */
1230
+ validateSetStateObjectArgument(obj: Record<string, any>): void;
1231
+ }
1232
+
1233
+ declare interface ValidateIdOptions {
1234
+ /** in maintenance mode we can access ivnalid ids to delete them, only works with the admin user */
1235
+ maintenance?: boolean;
1236
+ user?: string;
1237
+ }
1238
+
1239
+ export { }