Skip to content

Commit

Permalink
docs: update typed documentation and API report
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone committed Jul 25, 2024
1 parent 9fbb319 commit 4ca1b85
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 20 deletions.
4 changes: 2 additions & 2 deletions packages/cc/cc.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ import { MultiCommandCCAPI } from '../cc/MultiCommandCC';
import { MultilevelSensorCCAPI } from '../cc/MultilevelSensorCC';
import { MultilevelSwitchCCAPI } from '../cc/MultilevelSwitchCC';
import { NODE_ID_BROADCAST } from '@zwave-js/core';
import { NODE_ID_BROADCAST_LR } from '@zwave-js/core';
import { NodeInformationFrame } from '@zwave-js/core';
import { NodeNamingAndLocationCCAPI } from '../cc/NodeNamingCC';
import { NodeProtocolInfoAndDeviceClass } from '@zwave-js/core';
Expand Down Expand Up @@ -2915,7 +2916,7 @@ export class CCAPI {
// (undocumented)
protected isBroadcast(): this is this & {
endpoint: IVirtualEndpoint & {
nodeId: typeof NODE_ID_BROADCAST;
nodeId: typeof NODE_ID_BROADCAST | typeof NODE_ID_BROADCAST_LR;
};
};
// (undocumented)
Expand Down Expand Up @@ -22016,7 +22017,6 @@ export enum ZWaveProtocolCommand {
//
// src/cc/TransportServiceCC.ts:47:2 - (ae-unresolved-link) The @link reference could not be resolved: The package "@zwave-js/cc" does not have an export "RELAXED_TIMING_THRESHOLD"
// src/cc/TransportServiceCC.ts:49:2 - (ae-unresolved-link) The @link reference could not be resolved: The package "@zwave-js/cc" does not have an export "RELAXED_TIMING_THRESHOLD"
// /home/runner/work/node-zwave-js/node-zwave-js/packages/serial/src/message/ZnifferMessages.ts:268:18 - (TS2564) Property 'checksumOK' has no initializer and is not definitely assigned in the constructor.

// (No @packageDocumentation comment for this package)

Expand Down
7 changes: 4 additions & 3 deletions packages/core/core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export enum BeamingInfo {
//
// @public (undocumented)
export type BroadcastCC<T extends ICommandClass = ICommandClass> = T & {
nodeId: typeof NODE_ID_BROADCAST;
nodeId: typeof NODE_ID_BROADCAST | typeof NODE_ID_BROADCAST_LR;
};

// Warning: (ae-missing-release-tag) "CacheBackedMap" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
Expand Down Expand Up @@ -4262,6 +4262,7 @@ export enum ZWaveErrorCodes {
FWUpdateService_RequestError = 261,
HealthCheck_Busy = 400,
Invalid_Firmware_File = 1506,
LinkReliabilityCheck_Busy = 401,
ManufacturerProprietaryCC_NoManufacturerId = 1200,
NVM_InvalidFormat = 283,
NVM_InvalidJSON = 281,
Expand Down Expand Up @@ -4386,8 +4387,8 @@ export interface ZWaveLogInfo<TContext extends LogContext = LogContext> extends

// Warnings were encountered during analysis:
//
// src/security/Manager2.ts:116:79 - (tsdoc-escape-greater-than) The ">" character should be escaped using a backslash to avoid confusion with an HTML tag
// src/security/Manager2.ts:116:98 - (tsdoc-escape-greater-than) The ">" character should be escaped using a backslash to avoid confusion with an HTML tag
// src/security/Manager2.ts:117:79 - (tsdoc-escape-greater-than) The ">" character should be escaped using a backslash to avoid confusion with an HTML tag
// src/security/Manager2.ts:117:98 - (tsdoc-escape-greater-than) The ">" character should be escaped using a backslash to avoid confusion with an HTML tag
// src/security/QR.ts:99:3 - (ae-unresolved-link) The @link reference could not be resolved: The package "@zwave-js/core" does not have an export "requestedSecurityClasses"

// (No @packageDocumentation comment for this package)
Expand Down
44 changes: 39 additions & 5 deletions packages/testing/testing.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

```ts

import { CommandClass } from '@zwave-js/cc';
import { CommandClasses } from '@zwave-js/core';
import { CommandClassInfo } from '@zwave-js/core';
import { ConfigValue } from '@zwave-js/core';
Expand Down Expand Up @@ -85,7 +86,7 @@ export function createMockZWaveAckFrame(options?: Partial<Omit<MockZWaveAckFrame
// Warning: (ae-missing-release-tag) "createMockZWaveRequestFrame" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export function createMockZWaveRequestFrame(payload: ICommandClass | (() => ICommandClass), options?: Partial<Omit<MockZWaveRequestFrame, "direction" | "payload">>): LazyMockZWaveRequestFrame;
export function createMockZWaveRequestFrame(payload: CommandClass | (() => CommandClass), options?: Partial<Omit<MockZWaveRequestFrame, "direction" | "payload">>): LazyMockZWaveRequestFrame;

// Warning: (ae-missing-release-tag) "EnergyProductionCCCapabilities" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
Expand Down Expand Up @@ -142,7 +143,7 @@ export type LazyMockZWaveFrame = LazyMockZWaveRequestFrame | MockZWaveAckFrame;
// @public (undocumented)
export interface LazyMockZWaveRequestFrame {
ackRequested: boolean;
payload: ICommandClass | (() => ICommandClass);
payload: CommandClass | (() => CommandClass);
repeaters: number[];
// (undocumented)
type: MockZWaveFrameType.Request;
Expand Down Expand Up @@ -333,7 +334,9 @@ export class MockNode {
//
// @public (undocumented)
export interface MockNodeBehavior {
onControllerFrame?: (controller: MockController, self: MockNode, frame: MockZWaveFrame) => Promise<boolean | undefined> | boolean | undefined;
handleCC?: (controller: MockController, self: MockNode, receivedCC: CommandClass) => Promise<MockNodeResponse | undefined> | MockNodeResponse | undefined;
transformIncomingCC?: (controller: MockController, self: MockNode, cc: CommandClass) => Promise<CommandClass> | CommandClass;
transformResponse?: (controller: MockController, self: MockNode, receivedCC: CommandClass, response: MockNodeResponse) => Promise<MockNodeResponse> | MockNodeResponse;
}

// Warning: (ae-missing-release-tag) "MockNodeOptions" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
Expand All @@ -353,6 +356,23 @@ export interface MockNodeOptions {
id: number;
}

// Warning: (ae-missing-release-tag) "MockNodeResponse" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export type MockNodeResponse = {
action: "sendCC";
cc: CommandClass;
ackRequested?: boolean;
} | {
action: "ack";
} | {
action: "stop";
} | {
action: "ok";
} | {
action: "fail";
};

// Warning: (ae-missing-release-tag) "MockZWaveAckFrame" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
Expand Down Expand Up @@ -384,7 +404,7 @@ export enum MockZWaveFrameType {
// @public (undocumented)
export interface MockZWaveRequestFrame {
ackRequested: boolean;
payload: ICommandClass;
payload: CommandClass;
repeaters: number[];
// (undocumented)
type: MockZWaveFrameType.Request;
Expand Down Expand Up @@ -502,7 +522,21 @@ export interface WindowCoveringCCCapabilities {

// Warnings were encountered during analysis:
//
// /home/runner/work/node-zwave-js/node-zwave-js/packages/serial/src/message/ZnifferMessages.ts:268:18 - (TS2564) Property 'checksumOK' has no initializer and is not definitely assigned in the constructor.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/ColorSwitchCC.ts:477:9 - (TS2345) Argument of type '("index" | "warmWhite" | "coldWhite" | "red" | "green" | "blue" | "amber" | "cyan" | "purple" | undefined)[]' is not assignable to parameter of type 'readonly (string | number | symbol)[]'.
// Type 'string | undefined' is not assignable to type 'string | number | symbol'.
// Type 'undefined' is not assignable to type 'string | number | symbol'.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/ConfigurationCC.ts:1273:41 - (TS2345) Argument of type 'string | number' is not assignable to parameter of type 'number'.
// Type 'string' is not assignable to type 'number'.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/ConfigurationCC.ts:1280:20 - (TS2345) Argument of type 'string | number' is not assignable to parameter of type 'number'.
// Type 'string' is not assignable to type 'number'.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/ConfigurationCC.ts:1398:40 - (TS2345) Argument of type 'string | number' is not assignable to parameter of type 'number'.
// Type 'string' is not assignable to type 'number'.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/Security2CC.ts:1355:3 - (TS2322) Type 'Security2Extension | undefined' is not assignable to type 'MGRPExtension | undefined'.
// Property 'groupId' is missing in type 'Security2Extension' but required in type 'MGRPExtension'.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/Security2CC.ts:1366:3 - (TS2322) Type 'Security2Extension | undefined' is not assignable to type 'MPANExtension | undefined'.
// Type 'Security2Extension' is missing the following properties from type 'MPANExtension': groupId, innerMPANState
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/Security2CC.ts:1380:25 - (TS2339) Property 'senderEI' does not exist on type 'Security2Extension'.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/Security2CC.ts:1438:19 - (TS2339) Property 'senderEI' does not exist on type 'Security2Extension'.

// (No @packageDocumentation comment for this package)

Expand Down
87 changes: 77 additions & 10 deletions packages/zwave-js/zwave-js.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ import { MulticastDestination } from '@zwave-js/core/safe';
import { MultilevelSwitchCommand } from '@zwave-js/cc/safe';
import { NODE_ID_BROADCAST } from '@zwave-js/core/safe';
import { NODE_ID_BROADCAST as NODE_ID_BROADCAST_2 } from '@zwave-js/core';
import { NODE_ID_BROADCAST_LR } from '@zwave-js/core';
import { NODE_ID_BROADCAST_LR } from '@zwave-js/core/safe';
import { NODE_ID_BROADCAST_LR as NODE_ID_BROADCAST_LR_2 } from '@zwave-js/core';
import { NODE_ID_MAX } from '@zwave-js/core/safe';
import { NodeIDType } from '@zwave-js/core';
import type { NodeSchedulePollOptions } from '@zwave-js/host';
Expand Down Expand Up @@ -869,6 +870,66 @@ export interface LifelineRoutes {
nlwr?: RouteStatistics;
}

// Warning: (ae-missing-release-tag) "LinkReliabilityCheckMode" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export enum LinkReliabilityCheckMode {
// (undocumented)
BasicSetOnOff = 0
}

// Warning: (ae-missing-release-tag) "LinkReliabilityCheckOptions" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface LinkReliabilityCheckOptions {
// (undocumented)
interval: number;
// (undocumented)
mode: LinkReliabilityCheckMode;
// (undocumented)
onProgress?: (progress: LinkReliabilityCheckResult) => void;
// (undocumented)
rounds?: number;
}

// Warning: (ae-missing-release-tag) "LinkReliabilityCheckResult" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface LinkReliabilityCheckResult {
// (undocumented)
ackRSSI: {
min: number;
max: number;
average: number;
};
// (undocumented)
commandErrors: number;
// (undocumented)
commandsSent: number;
// (undocumented)
latency?: {
min: number;
max: number;
average: number;
};
// (undocumented)
missingResponses?: number;
// (undocumented)
responseRSSI?: {
min: number;
max: number;
average: number;
};
// (undocumented)
rounds: number;
// (undocumented)
rtt: {
min: number;
max: number;
average: number;
};
}

// Warning: (ae-missing-release-tag) "LongRangeFrame" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
Expand All @@ -891,7 +952,7 @@ export type LongRangeFrame = {
payload: Buffer | CommandClass;
} | {
type: LongRangeFrameType.Broadcast;
destinationNodeId: typeof NODE_ID_BROADCAST_LR;
destinationNodeId: typeof NODE_ID_BROADCAST_LR_2;
ackRequested: boolean;
payload: Buffer | CommandClass;
} | {
Expand Down Expand Up @@ -982,6 +1043,8 @@ export { MultilevelSwitchCommand }

export { NODE_ID_BROADCAST }

export { NODE_ID_BROADCAST_LR }

export { NODE_ID_MAX }

// Warning: (ae-missing-release-tag) "NodeDump" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
Expand Down Expand Up @@ -1498,6 +1561,7 @@ export class ZWaveController extends TypedEventEmitter<ControllerEventCallbacks>
rssiChannel3?: RSSI_2;
}>;
getBroadcastNode(): VirtualNode;
getBroadcastNodeLR(): VirtualNode;
// Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "zwave-js" does not have an export "assignCustomReturnRoutes"
getCustomReturnRoutesCached(nodeId: number, destinationNodeId: number): Route[];
// Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "zwave-js" does not have an export "assignCustomSUCReturnRoutes"
Expand Down Expand Up @@ -1800,11 +1864,14 @@ export class ZWaveNode extends Endpoint implements SecurityClassOwner, IZWaveNod
// Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "zwave-js" does not have an export "checkLifelineHealth"
// Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "zwave-js" does not have an export "checkRouteHealth"
abortHealthCheck(): void;
// Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "zwave-js" does not have an export "checkLinkReliability"
abortLinkReliabilityCheck(): void;
// (undocumented)
get aggregatedEndpointCount(): MaybeNotKnown<number>;
// (undocumented)
get canSleep(): MaybeNotKnown<boolean>;
checkLifelineHealth(rounds?: number, onProgress?: (round: number, totalRounds: number, lastRating: number, lastResult: LifelineHealthCheckResult) => void): Promise<LifelineHealthCheckSummary>;
checkLinkReliability(options: LinkReliabilityCheckOptions): Promise<LinkReliabilityCheckResult>;
checkRouteHealth(targetNodeId: number, rounds?: number, onProgress?: (round: number, totalRounds: number, lastRating: number, lastResult: RouteHealthCheckResult) => void): Promise<RouteHealthCheckSummary>;
createDump(): NodeDump;
get defaultTransitionDuration(): string | undefined;
Expand Down Expand Up @@ -1860,6 +1927,7 @@ export class ZWaveNode extends Endpoint implements SecurityClassOwner, IZWaveNod
isFirmwareUpdateInProgress(): boolean;
get isFrequentListening(): MaybeNotKnown<FLiRS_2>;
isHealthCheckInProgress(): boolean;
isLinkReliabilityCheckInProgress(): boolean;
get isListening(): MaybeNotKnown<boolean>;
get isRouting(): MaybeNotKnown<boolean>;
get isSecure(): MaybeNotKnown<boolean>;
Expand Down Expand Up @@ -2241,14 +2309,13 @@ export * from "@zwave-js/cc";
// Type 'string' is not assignable to type 'number'.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/ConfigurationCC.ts:1398:40 - (TS2345) Argument of type 'string | number' is not assignable to parameter of type 'number'.
// Type 'string' is not assignable to type 'number'.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/Security2CC.ts:1338:3 - (TS2322) Type 'Security2Extension | undefined' is not assignable to type 'MGRPExtension | undefined'.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/Security2CC.ts:1355:3 - (TS2322) Type 'Security2Extension | undefined' is not assignable to type 'MGRPExtension | undefined'.
// Property 'groupId' is missing in type 'Security2Extension' but required in type 'MGRPExtension'.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/Security2CC.ts:1349:3 - (TS2322) Type 'Security2Extension | undefined' is not assignable to type 'MPANExtension | undefined'.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/Security2CC.ts:1366:3 - (TS2322) Type 'Security2Extension | undefined' is not assignable to type 'MPANExtension | undefined'.
// Type 'Security2Extension' is missing the following properties from type 'MPANExtension': groupId, innerMPANState
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/Security2CC.ts:1363:25 - (TS2339) Property 'senderEI' does not exist on type 'Security2Extension'.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/Security2CC.ts:1421:19 - (TS2339) Property 'senderEI' does not exist on type 'Security2Extension'.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/serial/src/message/ZnifferMessages.ts:268:18 - (TS2564) Property 'checksumOK' has no initializer and is not definitely assigned in the constructor.
// src/lib/controller/Controller.ts:852:2 - (ae-missing-getter) The property "provisioningList" has a setter but no getter.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/Security2CC.ts:1380:25 - (TS2339) Property 'senderEI' does not exist on type 'Security2Extension'.
// /home/runner/work/node-zwave-js/node-zwave-js/packages/cc/src/cc/Security2CC.ts:1438:19 - (TS2339) Property 'senderEI' does not exist on type 'Security2Extension'.
// src/lib/controller/Controller.ts:865:2 - (ae-missing-getter) The property "provisioningList" has a setter but no getter.
// src/lib/driver/Driver.ts:701:24 - (tsdoc-escape-greater-than) The ">" character should be escaped using a backslash to avoid confusion with an HTML tag
// src/lib/driver/Driver.ts:4191:5 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/lib/driver/Driver.ts:5340:2 - (ae-unresolved-link) The @link reference could not be resolved: The package "zwave-js" does not have an export "drainSerialAPIQueue"
Expand All @@ -2258,8 +2325,8 @@ export * from "@zwave-js/cc";
// src/lib/driver/Driver.ts:5777:5 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/lib/driver/Driver.ts:5913:5 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/lib/driver/ZWaveOptions.ts:270:120 - (tsdoc-escape-greater-than) The ">" character should be escaped using a backslash to avoid confusion with an HTML tag
// src/lib/node/Node.ts:1028:2 - (ae-missing-getter) The property "deviceConfigHash" has a setter but no getter.
// src/lib/node/Node.ts:3003:5 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/lib/node/Node.ts:1032:2 - (ae-missing-getter) The property "deviceConfigHash" has a setter but no getter.
// src/lib/node/Node.ts:3018:5 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/lib/zniffer/Zniffer.ts:620:5 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen
// src/lib/zniffer/Zniffer.ts:621:5 - (tsdoc-param-tag-missing-hyphen) The @param block should be followed by a parameter name and then a hyphen

Expand Down

0 comments on commit 4ca1b85

Please sign in to comment.