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 Aug 13, 2024
1 parent 9a805f2 commit 2309848
Show file tree
Hide file tree
Showing 4 changed files with 243 additions and 33 deletions.
33 changes: 29 additions & 4 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 @@ -3848,7 +3849,7 @@ export interface ColorSwitchCCGetOptions extends CCCommandOptions {
//
// @public (undocumented)
export class ColorSwitchCCReport extends ColorSwitchCC {
constructor(host: ZWaveHost_2, options: CommandClassDeserializationOptions);
constructor(host: ZWaveHost_2, options: CommandClassDeserializationOptions | (ColorSwitchCCReportOptions & CCCommandOptions));
// (undocumented)
readonly colorComponent: ColorComponent;
// (undocumented)
Expand All @@ -3858,11 +3859,24 @@ export class ColorSwitchCCReport extends ColorSwitchCC {
// (undocumented)
persistValues(applHost: ZWaveApplicationHost_2): boolean;
// (undocumented)
serialize(): Buffer;
// (undocumented)
readonly targetValue: number | undefined;
// (undocumented)
toLogEntry(host?: ZWaveValueHost_2): MessageOrCCLogEntry;
}

// Warning: (ae-missing-release-tag) "ColorSwitchCCReportOptions" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export type ColorSwitchCCReportOptions = {
colorComponent: ColorComponent;
currentValue: number;
} & AllOrNone<{
targetValue: number;
duration: Duration_2 | string;
}>;

// Warning: (ae-missing-release-tag) "ColorSwitchCCSet" 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 @@ -3955,13 +3969,23 @@ export class ColorSwitchCCSupportedGet extends ColorSwitchCC {
//
// @public (undocumented)
export class ColorSwitchCCSupportedReport extends ColorSwitchCC {
constructor(host: ZWaveHost_2, options: CommandClassDeserializationOptions);
constructor(host: ZWaveHost_2, options: CommandClassDeserializationOptions | (ColorSwitchCCSupportedReportOptions & CCCommandOptions));
// (undocumented)
serialize(): Buffer;
// (undocumented)
readonly supportedColorComponents: readonly ColorComponent[];
// (undocumented)
toLogEntry(host?: ZWaveValueHost_2): MessageOrCCLogEntry;
}

// Warning: (ae-missing-release-tag) "ColorSwitchCCSupportedReportOptions" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface ColorSwitchCCSupportedReportOptions {
// (undocumented)
supportedColorComponents: readonly ColorComponent[];
}

// Warning: (ae-missing-release-tag) "ColorSwitchCCValues" 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 @@ -15953,6 +15977,8 @@ export class Security2CCKEXSet extends Security2CC {
// (undocumented)
permitCSA: boolean;
// (undocumented)
readonly _reserved: number;
// (undocumented)
selectedECDHProfile: ECDHProfiles;
// (undocumented)
selectedKEXScheme: KEXSchemes;
Expand Down Expand Up @@ -22016,7 +22042,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
74 changes: 71 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 @@ -358,6 +358,8 @@ export enum CommandClasses {
// (undocumented)
"User Code" = 99,
// (undocumented)
"User Credential" = 131,
// (undocumented)
"Wake Up" = 132,
// (undocumented)
"Window Covering" = 106,
Expand Down Expand Up @@ -1050,6 +1052,19 @@ export interface GenericDeviceClass {
readonly zwavePlusDeviceType?: string;
}

// Warning: (ae-missing-release-tag) "GenericDeviceClassWithSpecific" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface GenericDeviceClassWithSpecific extends GenericDeviceClass {
// (undocumented)
readonly specific: SpecificDeviceClass[];
}

// Warning: (ae-missing-release-tag) "getAllDeviceClasses" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export function getAllDeviceClasses(): readonly GenericDeviceClassWithSpecific[];

// Warning: (ae-missing-release-tag) "getAllIndicatorProperties" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
Expand Down Expand Up @@ -4126,6 +4141,58 @@ export enum ZnifferRegion {
"USA" = 1
}

// Warning: (ae-missing-release-tag) "ZnifferRegionLegacy" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export enum ZnifferRegionLegacy {
// (undocumented)
ANZ = 2,
// (undocumented)
CN = 29,
// (undocumented)
EU = 0,
// (undocumented)
HK = 3,
// (undocumented)
IL = 27,
// (undocumented)
IN = 9,
// (undocumented)
JP = 10,
// (undocumented)
KR = 28,
// (undocumented)
MY = 8,
// (undocumented)
RU = 26,
// (undocumented)
TF_835_3CH = 24,
// (undocumented)
TF_840_3CH = 16,
// (undocumented)
TF_850_3CH = 17,
// (undocumented)
TF_866 = 4,
// (undocumented)
TF_870 = 5,
// (undocumented)
TF_878 = 11,
// (undocumented)
TF_882 = 12,
// (undocumented)
TF_886 = 13,
// (undocumented)
TF_906 = 6,
// (undocumented)
TF_910 = 7,
// (undocumented)
TF_932_3CH = 14,
// (undocumented)
TF_940_3CH = 15,
// (undocumented)
US = 1
}

// Warning: (ae-missing-release-tag) "ZWaveApiVersion" 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 @@ -4262,6 +4329,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 +4454,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
74 changes: 61 additions & 13 deletions packages/testing/testing.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@

```ts

import type { ColorComponent } from '@zwave-js/cc';
import { CommandClass } from '@zwave-js/cc';
import { CommandClasses } from '@zwave-js/core';
import { CommandClassInfo } from '@zwave-js/core';
import { ConfigValue } from '@zwave-js/core';
import { ConfigValueFormat } from '@zwave-js/core';
import type { ConfigValue } from '@zwave-js/core';
import type { ConfigValueFormat } from '@zwave-js/core';
import { FunctionType } from '@zwave-js/serial/safe';
import { ICommandClass } from '@zwave-js/core';
import type { KeypadMode } from '@zwave-js/cc';
import { Message } from '@zwave-js/serial';
import type { MockPortBinding } from '@zwave-js/serial/mock';
import { NodeProtocolInfoAndDeviceClass } from '@zwave-js/core';
import type { ThermostatMode } from '@zwave-js/cc';
import type { ThermostatSetpointType } from '@zwave-js/cc';
import type { UserIDStatus } from '@zwave-js/cc';
import type { WindowCoveringParameter } from '@zwave-js/cc';
import { ZWaveApiVersion } from '@zwave-js/core/safe';
import type { ZWaveHost } from '@zwave-js/host';
import { ZWaveLibraryTypes } from '@zwave-js/core/safe';
Expand Down Expand Up @@ -45,6 +52,7 @@ export type CCSpecificCapabilities = {
[CommandClasses.Notification]: NotificationCCCapabilities;
[48]: BinarySensorCCCapabilities;
[49]: MultilevelSensorCCCapabilities;
[51]: ColorSwitchCCCapabilities;
[121]: SoundSwitchCCCapabilities;
[106]: WindowCoveringCCCapabilities;
[144]: EnergyProductionCCCapabilities;
Expand All @@ -55,6 +63,13 @@ export type CCSpecificCapabilities = {
[CommandClasses.Meter]: MeterCCCapabilities;
};

// Warning: (ae-missing-release-tag) "ColorSwitchCCCapabilities" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface ColorSwitchCCCapabilities {
colorComponents: Partial<Record<ColorComponent, number | undefined>>;
}

// Warning: (ae-missing-release-tag) "ConfigurationCCCapabilities" 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 @@ -85,7 +100,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 +157,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 +348,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 +370,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 +418,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 @@ -451,20 +485,20 @@ export interface SoundSwitchCCCapabilities {
// @public (undocumented)
export interface ThermostatModeCCCapabilities {
// (undocumented)
supportedModes: number[];
supportedModes: ThermostatMode[];
}

// Warning: (ae-missing-release-tag) "ThermostatSetpointCCCapabilities" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface ThermostatSetpointCCCapabilities {
// (undocumented)
setpoints: Record<number, {
setpoints: Partial<Record<ThermostatSetpointType, {
minValue: number;
maxValue: number;
defaultValue?: number;
scale: "°C" | "°F";
}>;
}>>;
}

// Warning: (ae-missing-release-tag) "unlazyMockZWaveFrame" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
Expand All @@ -481,9 +515,9 @@ export interface UserCodeCCCapabilities {
// (undocumented)
supportedASCIIChars?: string;
// (undocumented)
supportedKeypadModes?: number[];
supportedKeypadModes?: KeypadMode[];
// (undocumented)
supportedUserIDStatuses?: number[];
supportedUserIDStatuses?: UserIDStatus[];
// (undocumented)
supportsAdminCode?: boolean;
// (undocumented)
Expand All @@ -497,12 +531,26 @@ export interface UserCodeCCCapabilities {
// @public (undocumented)
export interface WindowCoveringCCCapabilities {
// (undocumented)
supportedParameters: number[];
supportedParameters: WindowCoveringParameter[];
}

// 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:478: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
Loading

0 comments on commit 2309848

Please sign in to comment.