@iobroker/types 5.0.19 → 5.0.20-alpha.0-20240205-49d93c99
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.
- package/build/objects.d.ts +222 -80
- package/build/shared.d.ts +1 -1
- package/build/types.d.ts +11 -3
- package/package.json +43 -43
- package/public.d.ts +1 -1
package/build/objects.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as os from 'os';
|
|
1
|
+
import type * as os from 'os';
|
|
2
2
|
|
|
3
3
|
declare global {
|
|
4
4
|
namespace ioBroker {
|
|
@@ -11,6 +11,7 @@ declare global {
|
|
|
11
11
|
/** Linux-type permissions defining access to this file */
|
|
12
12
|
permissions: number;
|
|
13
13
|
}
|
|
14
|
+
|
|
14
15
|
/** Defines access rights for a single file, applied to a user or group */
|
|
15
16
|
interface EvaluatedFileACL extends FileACL {
|
|
16
17
|
/** Whether the user may read the file */
|
|
@@ -28,6 +29,7 @@ declare global {
|
|
|
28
29
|
/** Linux-type permissions defining access to this object */
|
|
29
30
|
object: number;
|
|
30
31
|
}
|
|
32
|
+
|
|
31
33
|
/** Defines access rights for a single state object */
|
|
32
34
|
interface StateACL extends ObjectACL {
|
|
33
35
|
/** Linux-type permissions defining access to this state */
|
|
@@ -53,8 +55,7 @@ declare global {
|
|
|
53
55
|
| 'schedule'
|
|
54
56
|
| 'design';
|
|
55
57
|
|
|
56
|
-
// Define the naming schemes for objects so we can provide more specific types for get/setObject
|
|
57
|
-
|
|
58
|
+
// Define the naming schemes for objects, so we can provide more specific types for get/setObject
|
|
58
59
|
namespace ObjectIDs {
|
|
59
60
|
// Guaranteed meta objects
|
|
60
61
|
type Meta =
|
|
@@ -85,8 +86,12 @@ declare global {
|
|
|
85
86
|
type User = `system.user.${string}`;
|
|
86
87
|
// Guaranteed host objects
|
|
87
88
|
type Host = `system.host.${string}`;
|
|
89
|
+
// Guaranteed repository object
|
|
90
|
+
type Repository = 'system.repositories';
|
|
88
91
|
// Guaranteed config objects
|
|
89
|
-
type Config =
|
|
92
|
+
type Config = 'system.certificates';
|
|
93
|
+
// Guaranteed system config objects
|
|
94
|
+
type SystemConfig = 'system.config';
|
|
90
95
|
// Guaranteed design objects
|
|
91
96
|
type Design = `_design/${string}`;
|
|
92
97
|
|
|
@@ -115,35 +120,39 @@ declare global {
|
|
|
115
120
|
T extends ObjectIDs.State
|
|
116
121
|
? StateObject
|
|
117
122
|
: // Instance and Adapter must come before meta or `system.adapter.admin` will resolve to MetaObject
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
123
|
+
T extends ObjectIDs.Instance
|
|
124
|
+
? InstanceObject
|
|
125
|
+
: T extends ObjectIDs.Adapter
|
|
126
|
+
? AdapterObject
|
|
127
|
+
: T extends ObjectIDs.Channel
|
|
128
|
+
? ChannelObject
|
|
129
|
+
: T extends ObjectIDs.Meta
|
|
130
|
+
? MetaObject
|
|
131
|
+
: T extends ObjectIDs.Misc
|
|
132
|
+
? AdapterScopedObject
|
|
133
|
+
: T extends ObjectIDs.ScriptOrChannel
|
|
134
|
+
? ScriptObject | ChannelObject
|
|
135
|
+
: T extends ObjectIDs.Enum
|
|
136
|
+
? EnumObject
|
|
137
|
+
: T extends ObjectIDs.Group
|
|
138
|
+
? GroupObject
|
|
139
|
+
: T extends ObjectIDs.User
|
|
140
|
+
? UserObject
|
|
141
|
+
: T extends ObjectIDs.Host
|
|
142
|
+
? HostObject
|
|
143
|
+
: T extends ObjectIDs.Design
|
|
144
|
+
? DesignObject
|
|
145
|
+
: T extends ObjectIDs.Repository
|
|
146
|
+
? RepositoryObject
|
|
147
|
+
: T extends ObjectIDs.SystemConfig
|
|
148
|
+
? SystemConfigObject
|
|
149
|
+
: T extends ObjectIDs.Config
|
|
150
|
+
? OtherObject & { type: 'config' }
|
|
151
|
+
: T extends ObjectIDs.AdapterScoped
|
|
152
|
+
? AdapterScopedObject
|
|
153
|
+
: Read extends 'read'
|
|
154
|
+
? ioBroker.Object
|
|
155
|
+
: AnyObject;
|
|
147
156
|
|
|
148
157
|
type Languages = 'en' | 'de' | 'ru' | 'pt' | 'nl' | 'fr' | 'it' | 'es' | 'pl' | 'uk' | 'zh-cn';
|
|
149
158
|
type Translated = { en: string } & { [lang in Languages]?: string };
|
|
@@ -157,6 +166,9 @@ declare global {
|
|
|
157
166
|
/** The name of this object as a simple string or an object with translations */
|
|
158
167
|
name: StringOrTranslated;
|
|
159
168
|
|
|
169
|
+
/** Description of this object */
|
|
170
|
+
desc?: StringOrTranslated;
|
|
171
|
+
|
|
160
172
|
/** When set to true, this object may not be deleted */
|
|
161
173
|
dontDelete?: true;
|
|
162
174
|
|
|
@@ -182,8 +194,6 @@ declare global {
|
|
|
182
194
|
step?: number;
|
|
183
195
|
/** unit of the value */
|
|
184
196
|
unit?: string;
|
|
185
|
-
/** description of this state */
|
|
186
|
-
desc?: StringOrTranslated;
|
|
187
197
|
|
|
188
198
|
/** if this state is readable */
|
|
189
199
|
read: boolean;
|
|
@@ -251,49 +261,56 @@ declare global {
|
|
|
251
261
|
mobile?: any;
|
|
252
262
|
|
|
253
263
|
/**
|
|
254
|
-
* Settings for IOT adapters and how the state should be named in e.g
|
|
264
|
+
* Settings for IOT adapters and how the state should be named in e.g., Alexa.
|
|
255
265
|
* The string "ignore" is a special case, causing the state to be ignored.
|
|
266
|
+
* A value of `null` means, that the device should be removed by the IOT adapters
|
|
256
267
|
*/
|
|
257
268
|
smartName?:
|
|
269
|
+
| null
|
|
258
270
|
| string
|
|
259
271
|
| ({ [lang in Languages]?: string } & {
|
|
260
|
-
/** Which kind of device
|
|
272
|
+
/** Which kind of device it is */
|
|
261
273
|
smartType?: string | null;
|
|
262
274
|
/** Which value to set when the ON command is issued */
|
|
263
275
|
byOn?: string | null;
|
|
264
276
|
});
|
|
265
277
|
}
|
|
266
|
-
interface ChannelCommon extends ObjectCommon {
|
|
267
|
-
/** description of this channel */
|
|
268
|
-
desc?: string;
|
|
269
278
|
|
|
279
|
+
interface ChannelCommon extends ObjectCommon {
|
|
270
280
|
// Make it possible to narrow the object type using the custom property
|
|
271
281
|
custom?: undefined;
|
|
272
282
|
}
|
|
283
|
+
|
|
273
284
|
interface DeviceCommon extends ObjectCommon {
|
|
274
285
|
statusStates?: {
|
|
275
|
-
/** State which is truthy if device is online */
|
|
286
|
+
/** State, which is truthy if a device is online */
|
|
276
287
|
onlineId?: string;
|
|
277
|
-
/** State which is truthy if device is offline */
|
|
288
|
+
/** State, which is truthy if a device is offline */
|
|
278
289
|
offlineId?: string;
|
|
279
|
-
/** State which is truthy if device is in error state */
|
|
290
|
+
/** State, which is truthy if a device is in error state */
|
|
280
291
|
errorId?: string;
|
|
281
292
|
};
|
|
282
293
|
// Make it possible to narrow the object type using the custom property
|
|
283
294
|
custom?: undefined;
|
|
284
295
|
}
|
|
296
|
+
|
|
285
297
|
interface ScheduleCommon extends ObjectCommon {
|
|
286
298
|
enabled?: boolean;
|
|
287
299
|
// Make it possible to narrow the object type using the custom property
|
|
288
300
|
custom?: undefined;
|
|
289
301
|
}
|
|
290
302
|
|
|
303
|
+
interface RepositoryCommon extends ObjectCommon {
|
|
304
|
+
custom?: undefined;
|
|
305
|
+
}
|
|
306
|
+
|
|
291
307
|
interface ChartCommon extends ObjectCommon {
|
|
292
308
|
enabled?: boolean;
|
|
293
309
|
color?: string;
|
|
294
310
|
// Make it possible to narrow the object type using the custom property
|
|
295
311
|
custom?: undefined;
|
|
296
312
|
}
|
|
313
|
+
|
|
297
314
|
interface EnumCommon extends ObjectCommon {
|
|
298
315
|
/** The IDs of the enum members */
|
|
299
316
|
members?: string[];
|
|
@@ -424,7 +441,7 @@ declare global {
|
|
|
424
441
|
members: ObjectIDs.User[]; // system.user.name, ...
|
|
425
442
|
/** The default permissions of this group */
|
|
426
443
|
acl: Omit<PermissionSet, 'user' | 'groups'>;
|
|
427
|
-
/** A group can be disabled, if missing, group is active */
|
|
444
|
+
/** A group can be disabled, if missing, a group is active */
|
|
428
445
|
enabled?: boolean;
|
|
429
446
|
// Make it possible to narrow the object type using the custom property
|
|
430
447
|
custom?: undefined;
|
|
@@ -432,7 +449,7 @@ declare global {
|
|
|
432
449
|
|
|
433
450
|
interface ScriptCommon extends ObjectCommon {
|
|
434
451
|
name: string;
|
|
435
|
-
/** Defines the type of the script, e.g
|
|
452
|
+
/** Defines the type of the script, e.g., TypeScript/ts, JavaScript/js or Blockly */
|
|
436
453
|
engineType: string;
|
|
437
454
|
/** The instance id of the instance which executes this script */
|
|
438
455
|
engine: string;
|
|
@@ -529,6 +546,8 @@ declare global {
|
|
|
529
546
|
singleton?: boolean;
|
|
530
547
|
};
|
|
531
548
|
allowInit?: boolean;
|
|
549
|
+
/** If the adapter should be automatically upgraded and which version ranges are supported */
|
|
550
|
+
automaticUpgrade?: AutoUpgradePolicy;
|
|
532
551
|
/** Possible values for the instance mode (if more than one is possible) */
|
|
533
552
|
availableModes?: InstanceMode[];
|
|
534
553
|
/** Array which lists all blocked versions. Blocked versions will not be started. Use semver notation to specify the version ranges. The information is always used from the io-package.json in the GitHub repository. */
|
|
@@ -559,7 +578,7 @@ declare global {
|
|
|
559
578
|
getHistory?: boolean;
|
|
560
579
|
/** Filename of the local icon which is shown for installed adapters. Should be located in the `admin` directory */
|
|
561
580
|
icon?: string;
|
|
562
|
-
/** Source, where this adapter has been installed from, to enable
|
|
581
|
+
/** Source, where this adapter has been installed from, to enable reinstalling on e.g., backup restore */
|
|
563
582
|
installedFrom?: string;
|
|
564
583
|
/** Which version of this adapter is installed */
|
|
565
584
|
installedVersion: string;
|
|
@@ -569,7 +588,7 @@ declare global {
|
|
|
569
588
|
/** @deprecated Use @see localLinks */
|
|
570
589
|
localLink?: string;
|
|
571
590
|
loglevel?: LogLevel;
|
|
572
|
-
/** Whether this adapter receives logs from other hosts and adapters (e.g
|
|
591
|
+
/** Whether this adapter receives logs from other hosts and adapters (e.g., to strore them somewhere) */
|
|
573
592
|
logTransporter?: boolean;
|
|
574
593
|
/** Path to the start file of the adapter. Should be the same as in `package.json` */
|
|
575
594
|
main?: string;
|
|
@@ -644,7 +663,7 @@ declare global {
|
|
|
644
663
|
/** The available version in the ioBroker repo. */
|
|
645
664
|
version: string;
|
|
646
665
|
visWidgets?: Record<string, VisWidget>;
|
|
647
|
-
/** If `true`, the adapter will be started if any value is written into `system.adapter.<name>.<instance>.wakeup. Normally the adapter should stop after processing the event. */
|
|
666
|
+
/** If `true`, the adapter will be started if any value is written into `system.adapter.<name>.<instance>.wakeup. Normally, the adapter should stop after processing the event. */
|
|
648
667
|
wakeup?: boolean;
|
|
649
668
|
/** Include the adapter version in the URL of the web adapter, e.g. `http://ip:port/1.2.3/material` instead of `http://ip:port/material` */
|
|
650
669
|
webByVersion?: boolean;
|
|
@@ -668,6 +687,49 @@ declare global {
|
|
|
668
687
|
custom?: undefined;
|
|
669
688
|
}
|
|
670
689
|
|
|
690
|
+
interface SystemConfigCommon extends ObjectCommon {
|
|
691
|
+
/** Name of all active repositories */
|
|
692
|
+
activeRepo: string[];
|
|
693
|
+
/** Current configured language */
|
|
694
|
+
language: Languages;
|
|
695
|
+
/** If floating comma is used instead of dot */
|
|
696
|
+
isFloatComma: boolean;
|
|
697
|
+
/** Configured longitude */
|
|
698
|
+
longitude: string;
|
|
699
|
+
/** Configured latitude */
|
|
700
|
+
latitude: string;
|
|
701
|
+
/** Default history instance */
|
|
702
|
+
defaultHistory: string;
|
|
703
|
+
/** Which diag data is allowed to be sent */
|
|
704
|
+
diag: 'none' | 'extended' | 'no-city';
|
|
705
|
+
/** If license has already been confirmed */
|
|
706
|
+
licenseConfirmed: boolean;
|
|
707
|
+
/** System wide default log level */
|
|
708
|
+
defaultLogLevel?: LogLevel;
|
|
709
|
+
/** Used date format for formatting */
|
|
710
|
+
dateFormat: string;
|
|
711
|
+
/** Default acl for new objects */
|
|
712
|
+
defaultNewAcl: {
|
|
713
|
+
object: number;
|
|
714
|
+
state: number;
|
|
715
|
+
file: number;
|
|
716
|
+
owner: ObjectIDs.User;
|
|
717
|
+
ownerGroup: ObjectIDs.Group;
|
|
718
|
+
};
|
|
719
|
+
/** Configured auto upgrade policy */
|
|
720
|
+
adapterAutoUpgrade?: {
|
|
721
|
+
/** Configuration for each repository */
|
|
722
|
+
repositories: {
|
|
723
|
+
[repoName: string]: boolean;
|
|
724
|
+
};
|
|
725
|
+
/** Default policy, if none has been set explicit for the adapter */
|
|
726
|
+
defaultPolicy: AutoUpgradePolicy;
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
// Make it possible to narrow the object type using the custom property
|
|
730
|
+
custom?: undefined;
|
|
731
|
+
}
|
|
732
|
+
|
|
671
733
|
interface OtherCommon extends ObjectCommon {
|
|
672
734
|
[propName: string]: any;
|
|
673
735
|
|
|
@@ -708,7 +770,7 @@ declare global {
|
|
|
708
770
|
/** The user who created or updated this object */
|
|
709
771
|
user?: string;
|
|
710
772
|
ts?: number;
|
|
711
|
-
/** These properties can only be edited if correct password is provided */
|
|
773
|
+
/** These properties can only be edited if the correct password is provided */
|
|
712
774
|
nonEdit?: NonEditable;
|
|
713
775
|
}
|
|
714
776
|
|
|
@@ -727,6 +789,7 @@ declare global {
|
|
|
727
789
|
type: 'channel';
|
|
728
790
|
common: ChannelCommon;
|
|
729
791
|
}
|
|
792
|
+
|
|
730
793
|
interface PartialChannelObject extends Partial<Omit<ChannelObject, 'common'>> {
|
|
731
794
|
common?: Partial<ChannelCommon>;
|
|
732
795
|
}
|
|
@@ -735,6 +798,7 @@ declare global {
|
|
|
735
798
|
type: 'device';
|
|
736
799
|
common: DeviceCommon;
|
|
737
800
|
}
|
|
801
|
+
|
|
738
802
|
interface PartialDeviceObject extends Partial<Omit<DeviceObject, 'common'>> {
|
|
739
803
|
common?: Partial<DeviceCommon>;
|
|
740
804
|
}
|
|
@@ -744,6 +808,7 @@ declare global {
|
|
|
744
808
|
// Nothing is set in stone here, so start with allowing every property
|
|
745
809
|
common: OtherCommon;
|
|
746
810
|
}
|
|
811
|
+
|
|
747
812
|
interface PartialFolderObject extends Partial<Omit<FolderObject, 'common'>> {
|
|
748
813
|
common?: Partial<OtherCommon>;
|
|
749
814
|
}
|
|
@@ -752,6 +817,7 @@ declare global {
|
|
|
752
817
|
type: 'enum';
|
|
753
818
|
common: EnumCommon;
|
|
754
819
|
}
|
|
820
|
+
|
|
755
821
|
interface PartialEnumObject extends Partial<Omit<EnumObject, 'common'>> {
|
|
756
822
|
common?: Partial<EnumCommon>;
|
|
757
823
|
}
|
|
@@ -760,6 +826,7 @@ declare global {
|
|
|
760
826
|
type: 'meta';
|
|
761
827
|
common: MetaCommon;
|
|
762
828
|
}
|
|
829
|
+
|
|
763
830
|
interface PartialMetaObject extends Partial<Omit<MetaObject, 'common'>> {
|
|
764
831
|
common?: Partial<MetaCommon>;
|
|
765
832
|
}
|
|
@@ -780,6 +847,56 @@ declare global {
|
|
|
780
847
|
common?: Partial<ScheduleCommon>;
|
|
781
848
|
}
|
|
782
849
|
|
|
850
|
+
interface PartialRepositoryObject extends Partial<Omit<RepositoryObject, 'common'>> {
|
|
851
|
+
common?: Partial<RepositoryCommon>;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
interface RepositoryJsonAdapterContent {
|
|
855
|
+
/** Adapter name */
|
|
856
|
+
name: string;
|
|
857
|
+
/** Newest available version */
|
|
858
|
+
version: string;
|
|
859
|
+
|
|
860
|
+
/** Other Adapter related properties, not important for this implementation */
|
|
861
|
+
[other: string]: unknown;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
interface RepositoryJson {
|
|
865
|
+
_repoInfo: {
|
|
866
|
+
/** If it is the official stable repository */
|
|
867
|
+
stable?: boolean;
|
|
868
|
+
/** i18n name of the repository */
|
|
869
|
+
name: Required<ioBroker.Translated>;
|
|
870
|
+
/** Time of repository update */
|
|
871
|
+
repoTime: string;
|
|
872
|
+
};
|
|
873
|
+
|
|
874
|
+
/** Information about each adapter - Record needed for _repoInfo */
|
|
875
|
+
[adapter: string]: RepositoryJsonAdapterContent | Record<string, any>;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
interface RepositoryInformation {
|
|
879
|
+
/** Url to the repository */
|
|
880
|
+
link: string;
|
|
881
|
+
json: RepositoryJson | null;
|
|
882
|
+
hash?: string;
|
|
883
|
+
time?: string;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
interface RepositoryObject extends BaseObject {
|
|
887
|
+
_id: ObjectIDs.Repository;
|
|
888
|
+
type: 'config';
|
|
889
|
+
native: {
|
|
890
|
+
repositories: {
|
|
891
|
+
[repoName: string]: RepositoryInformation;
|
|
892
|
+
};
|
|
893
|
+
oldRepositories?: {
|
|
894
|
+
[repoName: string]: RepositoryInformation;
|
|
895
|
+
};
|
|
896
|
+
};
|
|
897
|
+
common: RepositoryCommon;
|
|
898
|
+
}
|
|
899
|
+
|
|
783
900
|
interface InstanceObject extends BaseObject {
|
|
784
901
|
_id: ObjectIDs.Instance;
|
|
785
902
|
type: 'instance';
|
|
@@ -795,6 +912,7 @@ declare global {
|
|
|
795
912
|
/** Objects created for the adapter, anywhere in the global namespace */
|
|
796
913
|
objects: ioBroker.AnyObject[];
|
|
797
914
|
}
|
|
915
|
+
|
|
798
916
|
interface PartialInstanceObject extends Partial<Omit<InstanceObject, 'common'>> {
|
|
799
917
|
common?: Partial<InstanceCommon>;
|
|
800
918
|
}
|
|
@@ -824,6 +942,7 @@ declare global {
|
|
|
824
942
|
/** Objects created for the adapter, anywhere in the global namespace */
|
|
825
943
|
objects: ioBroker.AnyObject[];
|
|
826
944
|
}
|
|
945
|
+
|
|
827
946
|
interface PartialAdapterObject extends Partial<Omit<AdapterObject, 'common'>> {
|
|
828
947
|
common?: Partial<AdapterCommon>;
|
|
829
948
|
}
|
|
@@ -834,6 +953,7 @@ declare global {
|
|
|
834
953
|
common: HostCommon;
|
|
835
954
|
native: HostNative;
|
|
836
955
|
}
|
|
956
|
+
|
|
837
957
|
interface PartialHostObject extends Partial<Omit<HostObject, 'common' | 'native'>> {
|
|
838
958
|
common?: Partial<HostCommon>;
|
|
839
959
|
native?: Partial<HostNative>;
|
|
@@ -844,6 +964,7 @@ declare global {
|
|
|
844
964
|
type: 'user';
|
|
845
965
|
common: UserCommon;
|
|
846
966
|
}
|
|
967
|
+
|
|
847
968
|
interface PartialUserObject extends Partial<Omit<UserObject, 'common'>> {
|
|
848
969
|
common?: Partial<UserCommon>;
|
|
849
970
|
}
|
|
@@ -853,6 +974,7 @@ declare global {
|
|
|
853
974
|
type: 'group';
|
|
854
975
|
common: GroupCommon;
|
|
855
976
|
}
|
|
977
|
+
|
|
856
978
|
interface PartialGroupObject extends Partial<Omit<GroupObject, 'common'>> {
|
|
857
979
|
common?: Partial<GroupCommon>;
|
|
858
980
|
}
|
|
@@ -861,10 +983,20 @@ declare global {
|
|
|
861
983
|
type: 'script';
|
|
862
984
|
common: ScriptCommon;
|
|
863
985
|
}
|
|
986
|
+
|
|
864
987
|
interface PartialScriptObject extends Partial<Omit<ScriptObject, 'common'>> {
|
|
865
988
|
common?: Partial<ScriptCommon>;
|
|
866
989
|
}
|
|
867
990
|
|
|
991
|
+
interface SystemConfigObject extends BaseObject {
|
|
992
|
+
type: 'config';
|
|
993
|
+
common: SystemConfigCommon;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
interface PartialSystemConfigObject extends Partial<Omit<SystemConfigObject, 'common'>> {
|
|
997
|
+
common?: Partial<SystemConfigCommon>;
|
|
998
|
+
}
|
|
999
|
+
|
|
868
1000
|
interface OtherObject extends BaseObject {
|
|
869
1001
|
type: 'config' | 'chart';
|
|
870
1002
|
common: OtherCommon;
|
|
@@ -902,6 +1034,7 @@ declare global {
|
|
|
902
1034
|
| ScriptObject
|
|
903
1035
|
| ChartObject
|
|
904
1036
|
| ScheduleObject
|
|
1037
|
+
| RepositoryObject
|
|
905
1038
|
| OtherObject
|
|
906
1039
|
| DesignObject;
|
|
907
1040
|
|
|
@@ -920,13 +1053,15 @@ declare global {
|
|
|
920
1053
|
| PartialScriptObject
|
|
921
1054
|
| PartialChartObject
|
|
922
1055
|
| PartialScheduleObject
|
|
1056
|
+
| PartialRepositoryObject
|
|
1057
|
+
| PartialSystemConfigObject
|
|
923
1058
|
| PartialOtherObject
|
|
924
1059
|
| PartialDesignObject;
|
|
925
1060
|
|
|
926
1061
|
/** All objects that usually appear in an adapter scope */
|
|
927
1062
|
type AdapterScopedObject = FolderObject | DeviceObject | ChannelObject | StateObject;
|
|
928
1063
|
|
|
929
|
-
// For all objects that are exposed to the user we need to tone the strictness down.
|
|
1064
|
+
// For all objects that are exposed to the user, we need to tone the strictness down.
|
|
930
1065
|
// Otherwise, every operation on objects becomes a pain to work with
|
|
931
1066
|
type Object = AnyObject & {
|
|
932
1067
|
common: Record<string, any>;
|
|
@@ -962,6 +1097,8 @@ declare global {
|
|
|
962
1097
|
type SettableScheduleObject = SettableObject<ScheduleObject>;
|
|
963
1098
|
type SettableChartObject = SettableObject<ChartObject>;
|
|
964
1099
|
type SettableDesignObject = SettableObject<DesignObject>;
|
|
1100
|
+
type SettableRepositoryObject = SettableObject<RepositoryObject>;
|
|
1101
|
+
type SettableSystemConfigObject = SettableObject<SystemConfigObject>;
|
|
965
1102
|
type SettableOtherObject = SettableObject<OtherObject>;
|
|
966
1103
|
|
|
967
1104
|
// Used to infer the return type of GetObjectView
|
|
@@ -969,36 +1106,41 @@ declare global {
|
|
|
969
1106
|
? View extends 'host'
|
|
970
1107
|
? HostObject
|
|
971
1108
|
: View extends 'adapter'
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1109
|
+
? AdapterObject
|
|
1110
|
+
: View extends 'instance'
|
|
1111
|
+
? InstanceObject
|
|
1112
|
+
: View extends 'meta'
|
|
1113
|
+
? MetaObject
|
|
1114
|
+
: View extends 'device'
|
|
1115
|
+
? DeviceObject
|
|
1116
|
+
: View extends 'channel'
|
|
1117
|
+
? ChannelObject
|
|
1118
|
+
: View extends 'state'
|
|
1119
|
+
? StateObject
|
|
1120
|
+
: View extends 'folder'
|
|
1121
|
+
? FolderObject
|
|
1122
|
+
: View extends 'enum'
|
|
1123
|
+
? EnumObject
|
|
1124
|
+
: View extends 'script'
|
|
1125
|
+
? ScriptObject
|
|
1126
|
+
: View extends 'group'
|
|
1127
|
+
? GroupObject
|
|
1128
|
+
: View extends 'user'
|
|
1129
|
+
? UserObject
|
|
1130
|
+
: View extends 'chart'
|
|
1131
|
+
? ChartObject
|
|
1132
|
+
: View extends 'schedule'
|
|
1133
|
+
? ScheduleObject
|
|
1134
|
+
: View extends 'config'
|
|
1135
|
+
?
|
|
1136
|
+
| RepositoryObject
|
|
1137
|
+
| SystemConfigObject
|
|
1138
|
+
| (OtherObject & {
|
|
1139
|
+
type: 'config';
|
|
1140
|
+
})
|
|
1141
|
+
: View extends 'custom'
|
|
1142
|
+
? NonNullable<StateObject['common']['custom']>
|
|
1143
|
+
: ioBroker.Object
|
|
1002
1144
|
: any;
|
|
1003
1145
|
}
|
|
1004
1146
|
}
|
package/build/shared.d.ts
CHANGED
package/build/types.d.ts
CHANGED
|
@@ -22,7 +22,10 @@ export declare interface AdapterClass {
|
|
|
22
22
|
/** Only emitted for compact instances */
|
|
23
23
|
on(event: 'exit', listener: (exitCode: number, reason: string) => Promise<void> | void): this;
|
|
24
24
|
on(event: 'log', listener: (info: any) => Promise<void> | void): this;
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Extend an object and create it if it might not exist
|
|
27
|
+
* @deprecated use `adapter.extendObject` without callback instead
|
|
28
|
+
*/
|
|
26
29
|
extendObjectAsync(id: string, objPart: ioBroker.PartialObject, options?: ioBroker.ExtendObjectOptions): ioBroker.SetObjectPromise;
|
|
27
30
|
/** Set capabilities of the given executable. Only works on Linux systems. */
|
|
28
31
|
setExecutableCapabilities(execPath: string, capabilities: string[], modeEffective?: boolean, modePermitted?: boolean, modeInherited?: boolean): Promise<void>;
|
|
@@ -199,9 +202,12 @@ export declare interface AdapterClass {
|
|
|
199
202
|
delFile(adapterName: string | null, path: string, options: unknown, callback: ioBroker.ErrnoCallback): void;
|
|
200
203
|
/**
|
|
201
204
|
* Writes a value into the states DB.
|
|
205
|
+
* @deprecated use `adapter.setState` without callback instead
|
|
202
206
|
*/
|
|
203
207
|
setStateAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack?: boolean): ioBroker.SetStatePromise;
|
|
208
|
+
/** @deprecated use `adapter.setState` without callback instead */
|
|
204
209
|
setStateAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, options?: unknown): ioBroker.SetStatePromise;
|
|
210
|
+
/** @deprecated use `adapter.setState` without callback instead */
|
|
205
211
|
setStateAsync(id: string, state: ioBroker.State | ioBroker.StateValue | ioBroker.SettableState, ack: boolean, options: unknown): ioBroker.SetStatePromise;
|
|
206
212
|
/**
|
|
207
213
|
* Writes a value (which might not belong to this adapter) into the states DB.
|
|
@@ -372,9 +378,9 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
372
378
|
/** configured language of system.config, only available if requested via AdapterOptions `useFormatDate` */
|
|
373
379
|
language?: ioBroker.Languages;
|
|
374
380
|
/** longitude configured in system.config, only available if requested via AdapterOptions `useFormatDate`*/
|
|
375
|
-
longitude?:
|
|
381
|
+
longitude?: string;
|
|
376
382
|
/** latitude configured in system.config, only available if requested via AdapterOptions `useFormatDate`*/
|
|
377
|
-
latitude?:
|
|
383
|
+
latitude?: string;
|
|
378
384
|
private _defaultObjs?;
|
|
379
385
|
private _aliasObjectsSubscribed?;
|
|
380
386
|
config: ioBroker.AdapterConfig;
|
|
@@ -491,7 +497,9 @@ export declare class AdapterClass extends EventEmitter {
|
|
|
491
497
|
private _setObjectWithDefaultValue;
|
|
492
498
|
getAdapterObjects(callback: (objects: Record<string, ioBroker.AdapterScopedObject>) => void): Promise<Record<string, ioBroker.AdapterScopedObject> | void>;
|
|
493
499
|
private _getAdapterObjects;
|
|
500
|
+
extendObject(id: string, objPart: ioBroker.PartialObject): ioBroker.SetObjectPromise;
|
|
494
501
|
extendObject(id: string, objPart: ioBroker.PartialObject, callback?: ioBroker.SetObjectCallback): void;
|
|
502
|
+
extendObject(id: string, objPart: ioBroker.PartialObject, options: ioBroker.ExtendObjectOptions): ioBroker.SetObjectPromise;
|
|
495
503
|
extendObject(id: string, objPart: ioBroker.PartialObject, options: ioBroker.ExtendObjectOptions, callback?: ioBroker.SetObjectCallback): void;
|
|
496
504
|
private _extendObject;
|
|
497
505
|
setForeignObject<T extends string>(id: T, obj: ioBroker.SettableObject<ioBroker.ObjectIdToObjectType<T, 'write'>>, callback?: ioBroker.SetObjectCallback): void;
|
package/package.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
2
|
+
"name": "@iobroker/types",
|
|
3
|
+
"version": "5.0.20-alpha.0-20240205-49d93c99",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": ">=12.0.0"
|
|
6
|
+
},
|
|
7
|
+
"keywords": [
|
|
8
|
+
"ioBroker"
|
|
9
|
+
],
|
|
10
|
+
"author": "foxriver76 <moritz.heusinger@gmail.com>",
|
|
11
|
+
"contributors": [
|
|
12
|
+
"foxriver76 <moritz.heusinger@gmail.com>"
|
|
13
|
+
],
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/ioBroker/ioBroker.js-controller/packages/types"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"tsd": "^0.24.1"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "ts-node build.ts",
|
|
23
|
+
"test": "tsd"
|
|
24
|
+
},
|
|
25
|
+
"main": "index.js",
|
|
26
|
+
"types": "index.d.ts",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"build/",
|
|
33
|
+
"index.d.ts",
|
|
34
|
+
"public.d.ts",
|
|
35
|
+
"LICENSE"
|
|
36
|
+
],
|
|
37
|
+
"tsd": {
|
|
38
|
+
"compilerOptions": {
|
|
39
|
+
"types": [
|
|
40
|
+
"@iobroker/types"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"gitHead": "df58acbed8fa3f0dc815fb0d34121447e5930d8d"
|
|
45
45
|
}
|
package/public.d.ts
CHANGED