Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@iobroker/adapter-core

Package Overview
Dependencies
Maintainers
5
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iobroker/adapter-core - npm Package Compare versions

Comparing version 2.2.1 to 2.3.0

24

build/utils.d.ts

@@ -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 */

2

build/utils.js
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc