inventoresed
Version:
Z-Wave driver written entirely in JavaScript/TypeScript
149 lines (134 loc) • 5.84 kB
Markdown
## API Report File for "@zwave-js/host"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
/// <reference types="node" />
import type { CommandClasses } from '@zwave-js/core';
import type { ConfigManager } from '@zwave-js/config';
import type { ControllerLogger } from '@zwave-js/core';
import type { DeviceConfig } from '@zwave-js/config';
import type { ICommandClass } from '@zwave-js/core';
import { IZWaveNode } from '@zwave-js/core';
import type { Maybe } from '@zwave-js/core';
import type { Overwrite } from 'alcalzone-shared/types';
import type { ReadonlyThrowingMap } from '@zwave-js/shared';
import type { SecurityClass } from '@zwave-js/core';
import type { SecurityManager } from '@zwave-js/core';
import type { SecurityManager2 } from '@zwave-js/core';
import type { SendCommandOptions } from '@zwave-js/core';
import type { SendCommandReturnType } from '@zwave-js/core';
import { ThrowingMap } from '@zwave-js/shared';
import type { ValueDB } from '@zwave-js/core';
import type { ValueID } from '@zwave-js/core';
// Warning: (ae-missing-release-tag) "createTestingHost" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export function createTestingHost(options?: Partial<CreateTestingHostOptions>): TestingHost;
// Warning: (ae-missing-release-tag) "CreateTestingHostOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface CreateTestingHostOptions {
// (undocumented)
getSafeCCVersionForNode: ZWaveHost["getSafeCCVersionForNode"];
// (undocumented)
homeId: ZWaveHost["homeId"];
// (undocumented)
ownNodeId: ZWaveHost["ownNodeId"];
}
// Warning: (ae-missing-release-tag) "FileSystem" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export interface FileSystem {
// (undocumented)
ensureDir(path: string): Promise<void>;
// (undocumented)
pathExists(path: string): Promise<boolean>;
// (undocumented)
readFile(file: string, encoding: string): Promise<string>;
// (undocumented)
writeFile(file: string, data: string | Buffer, options?: {
encoding: string;
} | string): Promise<void>;
}
// Warning: (ae-missing-release-tag) "NodeSchedulePollOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface NodeSchedulePollOptions {
expectedValue?: unknown;
timeoutMs?: number;
}
// Warning: (ae-missing-release-tag) "TestingHost" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type TestingHost = Overwrite<Omit<ZWaveApplicationHost, "__internalIsMockNode">, {
nodes: ThrowingMap<number, IZWaveNode>;
}>;
// Warning: (ae-missing-release-tag) "ZWaveApplicationHost" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export interface ZWaveApplicationHost extends ZWaveHost {
configManager: ConfigManager;
// (undocumented)
controllerLog: ControllerLogger;
getValueDB(nodeId: number): ValueDB;
isControllerNode(nodeId: number): boolean;
nodes: ReadonlyThrowingMap<number, IZWaveNode>;
// (undocumented)
options: ZWaveHostOptions;
// (undocumented)
schedulePoll(nodeId: number, valueId: ValueID, options: NodeSchedulePollOptions): boolean;
// (undocumented)
sendCommand<TResponse extends ICommandClass | undefined = undefined>(command: ICommandClass, options?: SendCommandOptions): Promise<SendCommandReturnType<TResponse>>;
tryGetValueDB(nodeId: number): ValueDB | undefined;
// (undocumented)
waitForCommand<T extends ICommandClass>(predicate: (cc: ICommandClass) => boolean, timeout: number): Promise<T>;
}
// Warning: (ae-missing-release-tag) "ZWaveHost" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export interface ZWaveHost {
// (undocumented)
__internalIsMockNode?: boolean;
// (undocumented)
getDeviceConfig?: (nodeId: number) => DeviceConfig | undefined;
// (undocumented)
getHighestSecurityClass(nodeId: number): SecurityClass | undefined;
getNextCallbackId(): number;
getNextSupervisionSessionId(): number;
getSafeCCVersionForNode(cc: CommandClasses, nodeId: number, endpointIndex?: number): number;
// (undocumented)
hasSecurityClass(nodeId: number, securityClass: SecurityClass): Maybe<boolean>;
homeId: number;
isCCSecure(cc: CommandClasses, nodeId: number, endpointIndex?: number): boolean;
ownNodeId: number;
securityManager: SecurityManager | undefined;
securityManager2: SecurityManager2 | undefined;
// (undocumented)
setSecurityClass(nodeId: number, securityClass: SecurityClass, granted: boolean): void;
}
// Warning: (ae-missing-release-tag) "ZWaveHostOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface ZWaveHostOptions {
// (undocumented)
attempts: {
controller: number;
sendData: number;
nodeInterview: number;
};
disableOptimisticValueUpdate?: boolean;
// (undocumented)
interview?: {
queryAllUserCodes?: boolean;
};
// (undocumented)
preferences?: {
scales: Partial<Record<string | number, string | number>>;
};
preserveUnknownValues?: boolean;
timeouts: {
refreshValue: number;
refreshValueAfterTransition: number;
};
}
// (No @packageDocumentation comment for this package)
```