@iobroker/adapter-core
Advanced tools
Comparing version 2.2.1 to 2.3.0
@@ -6,7 +6,23 @@ /// <reference types="iobroker" /> | ||
export declare function getConfig(): Record<string, any>; | ||
/** | ||
* This type is used to include and exclude the states and objects cache from the adaptert type definition depending on the creation options | ||
*/ | ||
export interface AdapterInstance<HasObjectsCache extends boolean | undefined = undefined, HasStatesCache extends boolean | undefined = undefined> extends Omit<ioBroker.Adapter, "oObjects" | "oStates"> { | ||
oObjects: HasObjectsCache extends true ? Exclude<ioBroker.Adapter["oObjects"], undefined> : undefined; | ||
oStates: HasStatesCache extends true ? Exclude<ioBroker.Adapter["oStates"], undefined> : undefined; | ||
} | ||
/** This type augments the ioBroker Adapter options to accept two generics for the objects and states cache */ | ||
export declare type AdapterOptions<HasObjectsCache extends boolean | undefined = undefined, HasStatesCache extends boolean | undefined = undefined> = Omit<ioBroker.AdapterOptions, "objects" | "states"> & (true extends HasObjectsCache ? { | ||
objects: true; | ||
} : { | ||
objects?: HasObjectsCache; | ||
}) & (true extends HasStatesCache ? { | ||
states: true; | ||
} : { | ||
states?: HasStatesCache; | ||
}); | ||
/** Selects the correct instance type depending on the constructor params */ | ||
interface AdapterConstructor { | ||
new (adapterName: string): ioBroker.Adapter; | ||
new (adapterOptions: ioBroker.AdapterOptions): ioBroker.Adapter; | ||
(adapterName: string): ioBroker.Adapter; | ||
(adapterOptions: ioBroker.AdapterOptions): ioBroker.Adapter; | ||
new <HasObjectsCache extends boolean | undefined = undefined, HasStatesCache extends boolean | undefined = undefined>(adapterOptions: AdapterOptions<HasObjectsCache, HasStatesCache> | string): AdapterInstance<HasObjectsCache, HasStatesCache>; | ||
<HasObjectsCache extends boolean | undefined = undefined, HasStatesCache extends boolean | undefined = undefined>(adapterOptions: AdapterOptions<HasObjectsCache, HasStatesCache> | string): AdapterInstance<HasObjectsCache, HasStatesCache>; | ||
} | ||
@@ -13,0 +29,0 @@ /** Creates a new adapter instance */ |
"use strict"; | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -49,5 +50,4 @@ const fs = require("fs"); | ||
/** Creates a new adapter instance */ | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
exports.adapter = require(path.join(exports.controllerDir, "lib/adapter.js")); | ||
/** Creates a new adapter instance */ | ||
exports.Adapter = exports.adapter; |
{ | ||
"name": "@iobroker/adapter-core", | ||
"version": "2.2.1", | ||
"version": "2.3.0", | ||
"description": "Core module to be used in ioBroker adapters. Acts as the bridge to js-controller.", | ||
@@ -39,3 +39,3 @@ "author": { | ||
"@types/chai-as-promised": "^7.1.0", | ||
"@types/mocha": "^5.2.5", | ||
"@types/mocha": "^7.0.1", | ||
"@types/node": "^13.1.1", | ||
@@ -63,4 +63,4 @@ "@types/proxyquire": "^1.3.28", | ||
"dependencies": { | ||
"@types/iobroker": "^2.2.0" | ||
"@types/iobroker": "^3.0.2" | ||
} | ||
} |
@@ -78,2 +78,6 @@ # Adapter-Core | ||
### v2.3.0 (2020-04-15) | ||
- (AlCalzone) Updated core declarations to v3.0.2. This includes support for new methods in JS-Controller 3.0 | ||
### v2.2.1 (2020-01-27) | ||
@@ -80,0 +84,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15155
183
120
+ Added@types/iobroker@3.3.4(transitive)
- Removed@types/iobroker@2.2.2(transitive)
Updated@types/iobroker@^3.0.2