@iobroker/types 6.0.6 → 6.0.7

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.
@@ -1,4 +1,5 @@
1
1
  import type * as os from 'node:os';
2
+ import type { Branded } from './utils';
2
3
 
3
4
  declare global {
4
5
  namespace ioBroker {
@@ -340,6 +341,9 @@ declare global {
340
341
  tab?: 'html' | 'materialize';
341
342
  }
342
343
 
344
+ /** Installed from attribute of instance/adapter object */
345
+ type InstalledFrom = Branded<string, 'InstalledFrom'>;
346
+
343
347
  interface InstanceCommon extends AdapterCommon {
344
348
  version: string;
345
349
  /** The name of the host where this instance is running */
@@ -364,7 +368,8 @@ declare global {
364
368
  compactGroup?: number;
365
369
  /** String (or array) with names of attributes in common of instance, which will not be deleted. */
366
370
  preserveSettings?: string | string[];
367
- installedFrom?: string;
371
+ /** Source, where this adapter has been installed from, to enable reinstalling on e.g., backup restore */
372
+ installedFrom?: InstalledFrom;
368
373
  /** Arguments passed to the adapter process, this disables compact mode */
369
374
  nodeProcessParams?: string[];
370
375
  /** If adapter can consume log messages, like admin, javascript or logparser */
@@ -624,7 +629,7 @@ declare global {
624
629
  /** The adapter will be executed once additionally after installation and the `install` event will be emitted during this run. This allows for executing one time installation code. */
625
630
  install?: boolean;
626
631
  /** Source, where this adapter has been installed from, to enable reinstalling on e.g., backup restore */
627
- installedFrom?: string;
632
+ installedFrom?: InstalledFrom;
628
633
  /** Which version of this adapter is installed */
629
634
  installedVersion: string;
630
635
  keywords?: string[];
package/build/shared.d.ts CHANGED
@@ -3,13 +3,10 @@
3
3
  import type * as fs from 'node:fs';
4
4
  import './objects';
5
5
  import type { IoBJson, DatabaseOptions, ObjectsDatabaseOptions as ObjectsDbOptions } from './config';
6
+ import type { Branded } from './utils';
6
7
 
7
8
  export {}; // avoids exporting AtLeastOne into the global scope
8
9
 
9
- declare const __brand: unique symbol;
10
- type Brand<B> = { [__brand]: B };
11
- type Branded<T, B> = T & Brand<B>;
12
-
13
10
  // Requires at least one of the properties of T to be given, whether it's optional or not
14
11
  type AtLeastOne<T, Req = { [K in keyof T]-?: T[K] }, Opt = { [K in keyof T]+?: T[K] }> = {
15
12
  [K in keyof Req]: Omit<Opt, K> & { [P in K]: Req[P] };
package/build/types.d.ts CHANGED
@@ -353,7 +353,7 @@ export declare class AdapterClass extends EventEmitter {
353
353
  /** contents of package.json */
354
354
  pack?: Record<string, any>;
355
355
  /** contents of io-package.json */
356
- ioPack: Record<string, any>;
356
+ ioPack: ioBroker.InstanceObject;
357
357
  private _initializeTimeout?;
358
358
  private inited?;
359
359
  /** contents of iobroker.json if required via AdapterOptions */
@@ -785,6 +785,13 @@ export declare class AdapterClass extends EventEmitter {
785
785
  * @param options information about version to remove feature and the log message
786
786
  */
787
787
  private reportDeprecation;
788
+ /**
789
+ * Initialize the plugin handler for this adapter
790
+ */
791
+ private _initPluginHandler;
792
+ /**
793
+ * Initializes the adapter
794
+ */
788
795
  private _init;
789
796
  }
790
797
 
@@ -0,0 +1,3 @@
1
+ declare const __brand: unique symbol;
2
+ type Brand<B> = { [__brand]: B };
3
+ export type Branded<T, B> = T & Brand<B>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iobroker/types",
3
- "version": "6.0.6",
3
+ "version": "6.0.7",
4
4
  "engines": {
5
5
  "node": ">=12.0.0"
6
6
  },
@@ -41,5 +41,5 @@
41
41
  ]
42
42
  }
43
43
  },
44
- "gitHead": "f8cc35d9fea0f63dbd1716f36d6d8f506aa1465a"
44
+ "gitHead": "106b564e263d42b33a8d7740ad21290481cd988f"
45
45
  }