Skip to content

Commit

Permalink
fix: export all types used in public methods of CC classes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone committed Oct 20, 2023
1 parent 89ce786 commit febdb7e
Show file tree
Hide file tree
Showing 61 changed files with 759 additions and 170 deletions.
3 changes: 2 additions & 1 deletion packages/cc/src/cc/AlarmSensorCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ function testResponseForAlarmSensorGet(
);
}

interface AlarmSensorCCGetOptions extends CCCommandOptions {
// @publicAPI
export interface AlarmSensorCCGetOptions extends CCCommandOptions {
sensorType?: AlarmSensorType;
}

Expand Down
11 changes: 8 additions & 3 deletions packages/cc/src/cc/AssociationCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,8 @@ currently assigned nodes: ${group.nodeIds.map(String).join(", ")}`;
}
}

interface AssociationCCSetOptions extends CCCommandOptions {
// @publicAPI
export interface AssociationCCSetOptions extends CCCommandOptions {
groupId: number;
nodeIds: number[];
}
Expand Down Expand Up @@ -487,7 +488,8 @@ export class AssociationCCSet extends AssociationCC {
}
}

interface AssociationCCRemoveOptions {
// @publicAPI
export interface AssociationCCRemoveOptions {
/** The group from which to remove the nodes. If none is specified, the nodes will be removed from all nodes. */
groupId?: number;
/** The nodes to remove. If none are specified, ALL nodes will be removed. */
Expand Down Expand Up @@ -559,6 +561,7 @@ export class AssociationCCRemove extends AssociationCC {
}
}

// @publicAPI
export interface AssociationCCReportSpecificOptions {
groupId: number;
maxNodes: number;
Expand Down Expand Up @@ -648,7 +651,8 @@ export class AssociationCCReport extends AssociationCC {
}
}

interface AssociationCCGetOptions extends CCCommandOptions {
// @publicAPI
export interface AssociationCCGetOptions extends CCCommandOptions {
groupId: number;
}

Expand Down Expand Up @@ -689,6 +693,7 @@ export class AssociationCCGet extends AssociationCC {
}
}

// @publicAPI
export interface AssociationCCSupportedGroupingsReportOptions
extends CCCommandOptions
{
Expand Down
14 changes: 11 additions & 3 deletions packages/cc/src/cc/AssociationGroupInfoCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ profile: ${
}
}

// @publicAPI
export interface AssociationGroupInfoCCNameReportOptions
extends CCCommandOptions
{
Expand Down Expand Up @@ -521,7 +522,8 @@ export class AssociationGroupInfoCCNameReport extends AssociationGroupInfoCC {
}
}

interface AssociationGroupInfoCCNameGetOptions extends CCCommandOptions {
// @publicAPI
export interface AssociationGroupInfoCCNameGetOptions extends CCCommandOptions {
groupId: number;
}

Expand Down Expand Up @@ -565,6 +567,7 @@ export interface AssociationGroupInfo {
eventCode: number;
}

// @publicAPI
export interface AssociationGroupInfoCCInfoReportSpecificOptions {
isListMode: boolean;
hasDynamicInfo: boolean;
Expand Down Expand Up @@ -675,7 +678,8 @@ export class AssociationGroupInfoCCInfoReport extends AssociationGroupInfoCC {
}
}

type AssociationGroupInfoCCInfoGetOptions =
// @publicAPI
export type AssociationGroupInfoCCInfoGetOptions =
& CCCommandOptions
& {
refreshCache: boolean;
Expand Down Expand Up @@ -745,6 +749,7 @@ export class AssociationGroupInfoCCInfoGet extends AssociationGroupInfoCC {
}
}

// @publicAPI
export interface AssociationGroupInfoCCCommandListReportOptions
extends CCCommandOptions
{
Expand Down Expand Up @@ -836,7 +841,10 @@ export class AssociationGroupInfoCCCommandListReport
}
}

interface AssociationGroupInfoCCCommandListGetOptions extends CCCommandOptions {
// @publicAPI
export interface AssociationGroupInfoCCCommandListGetOptions
extends CCCommandOptions
{
allowCache: boolean;
groupId: number;
}
Expand Down
13 changes: 10 additions & 3 deletions packages/cc/src/cc/BarrierOperatorCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,8 @@ export class BarrierOperatorCC extends CommandClass {
}
}

interface BarrierOperatorCCSetOptions extends CCCommandOptions {
// @publicAPI
export interface BarrierOperatorCCSetOptions extends CCCommandOptions {
targetState: BarrierState.Open | BarrierState.Closed;
}

Expand Down Expand Up @@ -646,7 +647,10 @@ export class BarrierOperatorCCSignalingCapabilitiesGet
extends BarrierOperatorCC
{}

interface BarrierOperatorCCEventSignalingSetOptions extends CCCommandOptions {
// @publicAPI
export interface BarrierOperatorCCEventSignalingSetOptions
extends CCCommandOptions
{
subsystemType: SubsystemType;
subsystemState: SubsystemState;
}
Expand Down Expand Up @@ -743,7 +747,10 @@ export class BarrierOperatorCCEventSignalingReport extends BarrierOperatorCC {
}
}

interface BarrierOperatorCCEventSignalingGetOptions extends CCCommandOptions {
// @publicAPI
export interface BarrierOperatorCCEventSignalingGetOptions
extends CCCommandOptions
{
subsystemType: SubsystemType;
}

Expand Down
6 changes: 4 additions & 2 deletions packages/cc/src/cc/BasicCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ remaining duration: ${basicResponse.duration?.toString() ?? "undefined"}`;
}
}

interface BasicCCSetOptions extends CCCommandOptions {
// @publicAPI
export interface BasicCCSetOptions extends CCCommandOptions {
targetValue: number;
}

Expand Down Expand Up @@ -354,7 +355,8 @@ export class BasicCCSet extends BasicCC {
}
}

type BasicCCReportOptions =
// @publicAPI
export type BasicCCReportOptions =
& CCCommandOptions
& {
currentValue: number;
Expand Down
1 change: 1 addition & 0 deletions packages/cc/src/cc/BatteryCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ temperature: ${batteryHealth.temperature} °C`;
}
}

// @publicAPI
export type BatteryCCReportOptions =
& CCCommandOptions
& (
Expand Down
4 changes: 3 additions & 1 deletion packages/cc/src/cc/BinarySensorCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ export class BinarySensorCC extends CommandClass {
}
}

// @publicAPI
export interface BinarySensorCCReportOptions extends CCCommandOptions {
type?: BinarySensorType;
value: boolean;
Expand Down Expand Up @@ -356,7 +357,8 @@ function testResponseForBinarySensorGet(
);
}

interface BinarySensorCCGetOptions extends CCCommandOptions {
// @publicAPI
export interface BinarySensorCCGetOptions extends CCCommandOptions {
sensorType?: BinarySensorType;
}

Expand Down
4 changes: 3 additions & 1 deletion packages/cc/src/cc/BinarySwitchCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ remaining duration: ${resp.duration?.toString() ?? "undefined"}`;
}
}

interface BinarySwitchCCSetOptions extends CCCommandOptions {
// @publicAPI
export interface BinarySwitchCCSetOptions extends CCCommandOptions {
targetValue: boolean;
duration?: Duration | string;
}
Expand Down Expand Up @@ -345,6 +346,7 @@ export class BinarySwitchCCSet extends BinarySwitchCC {
}
}

// @publicAPI
export type BinarySwitchCCReportOptions =
& CCCommandOptions
& {
Expand Down
3 changes: 2 additions & 1 deletion packages/cc/src/cc/CRC16CC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ export class CRC16CC extends CommandClass {
}
}

interface CRC16CCCommandEncapsulationOptions extends CCCommandOptions {
// @publicAPI
export interface CRC16CCCommandEncapsulationOptions extends CCCommandOptions {
encapsulated: CommandClass;
}

Expand Down
5 changes: 4 additions & 1 deletion packages/cc/src/cc/CentralSceneCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,10 @@ export class CentralSceneCCConfigurationReport extends CentralSceneCC {
@expectedCCResponse(CentralSceneCCConfigurationReport)
export class CentralSceneCCConfigurationGet extends CentralSceneCC {}

interface CentralSceneCCConfigurationSetOptions extends CCCommandOptions {
// @publicAPI
export interface CentralSceneCCConfigurationSetOptions
extends CCCommandOptions
{
slowRefresh: boolean;
}

Expand Down
11 changes: 8 additions & 3 deletions packages/cc/src/cc/ClimateControlScheduleCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ export class ClimateControlScheduleCC extends CommandClass {
declare ccCommand: ClimateControlScheduleCommand;
}

interface ClimateControlScheduleCCSetOptions extends CCCommandOptions {
// @publicAPI
export interface ClimateControlScheduleCCSetOptions extends CCCommandOptions {
weekday: Weekday;
switchPoints: Switchpoint[];
}
Expand Down Expand Up @@ -334,7 +335,8 @@ export class ClimateControlScheduleCCReport extends ClimateControlScheduleCC {
}
}

interface ClimateControlScheduleCCGetOptions extends CCCommandOptions {
// @publicAPI
export interface ClimateControlScheduleCCGetOptions extends CCCommandOptions {
weekday: Weekday;
}

Expand Down Expand Up @@ -445,7 +447,10 @@ export class ClimateControlScheduleCCOverrideGet
extends ClimateControlScheduleCC
{}

interface ClimateControlScheduleCCOverrideSetOptions extends CCCommandOptions {
// @publicAPI
export interface ClimateControlScheduleCCOverrideSetOptions
extends CCCommandOptions
{
overrideType: ScheduleOverrideType;
overrideState: SetbackState;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/cc/src/cc/ClockCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ export class ClockCC extends CommandClass {
}
}

interface ClockCCSetOptions extends CCCommandOptions {
// @publicAPI
export interface ClockCCSetOptions extends CCCommandOptions {
weekday: Weekday;
hour: number;
minute: number;
Expand Down
8 changes: 6 additions & 2 deletions packages/cc/src/cc/ColorSwitchCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,8 @@ export class ColorSwitchCCReport extends ColorSwitchCC {
}
}

interface ColorSwitchCCGetOptions extends CCCommandOptions {
// @publicAPI
export interface ColorSwitchCCGetOptions extends CCCommandOptions {
colorComponent: ColorComponent;
}

Expand Down Expand Up @@ -882,6 +883,7 @@ export class ColorSwitchCCGet extends ColorSwitchCC {
}
}

// @publicAPI
export type ColorSwitchCCSetOptions = (ColorTable | { hexColor: string }) & {
duration?: Duration | string;
};
Expand Down Expand Up @@ -966,7 +968,8 @@ export class ColorSwitchCCSet extends ColorSwitchCC {
}
}

type ColorSwitchCCStartLevelChangeOptions =
// @publicAPI
export type ColorSwitchCCStartLevelChangeOptions =
& {
colorComponent: ColorComponent;
direction: keyof typeof LevelChangeDirection;
Expand Down Expand Up @@ -1050,6 +1053,7 @@ export class ColorSwitchCCStartLevelChange extends ColorSwitchCC {
}
}

// @publicAPI
export interface ColorSwitchCCStopLevelChangeOptions extends CCCommandOptions {
colorComponent: ColorComponent;
}
Expand Down
12 changes: 8 additions & 4 deletions packages/cc/src/cc/ConfigurationCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,8 @@ function testResponseForConfigurationGet(
);
}

interface ConfigurationCCGetOptions extends CCCommandOptions {
// @publicAPI
export interface ConfigurationCCGetOptions extends CCCommandOptions {
parameter: number;
/**
* If this is `true`, responses with different parameters than expected are accepted
Expand Down Expand Up @@ -1805,7 +1806,8 @@ export class ConfigurationCCGet extends ConfigurationCC {
}
}

type ConfigurationCCSetOptions =
// @publicAPI
export type ConfigurationCCSetOptions =
& CCCommandOptions
& (
| {
Expand Down Expand Up @@ -1944,7 +1946,8 @@ export class ConfigurationCCSet extends ConfigurationCC {
}
}

type ConfigurationCCBulkSetOptions =
// @publicAPI
export type ConfigurationCCBulkSetOptions =
& CCCommandOptions
& {
parameters: number[];
Expand Down Expand Up @@ -2233,7 +2236,8 @@ export class ConfigurationCCBulkReport extends ConfigurationCC {
}
}

interface ConfigurationCCBulkGetOptions extends CCCommandOptions {
// @publicAPI
export interface ConfigurationCCBulkGetOptions extends CCCommandOptions {
parameters: number[];
}

Expand Down
6 changes: 4 additions & 2 deletions packages/cc/src/cc/DoorLockCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,8 @@ latch status: ${status.latchStatus}`;
}
}

interface DoorLockCCOperationSetOptions extends CCCommandOptions {
// @publicAPI
export interface DoorLockCCOperationSetOptions extends CCCommandOptions {
mode: DoorLockMode;
}

Expand Down Expand Up @@ -1153,7 +1154,8 @@ export class DoorLockCCConfigurationReport extends DoorLockCC {
@expectedCCResponse(DoorLockCCConfigurationReport)
export class DoorLockCCConfigurationGet extends DoorLockCC {}

type DoorLockCCConfigurationSetOptions =
// @publicAPI
export type DoorLockCCConfigurationSetOptions =
& (
| {
operationType: DoorLockOperationType.Timed;
Expand Down
3 changes: 2 additions & 1 deletion packages/cc/src/cc/DoorLockLoggingCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ export class DoorLockLoggingCCRecordReport extends DoorLockLoggingCC {
}
}

interface DoorLockLoggingCCRecordGetOptions extends CCCommandOptions {
// @publicAPI
export interface DoorLockLoggingCCRecordGetOptions extends CCCommandOptions {
recordNumber: number;
}

Expand Down
4 changes: 3 additions & 1 deletion packages/cc/src/cc/EnergyProductionCC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export class EnergyProductionCC extends CommandClass {
}
}

// @publicAPI
export interface EnergyProductionCCReportOptions extends CCCommandOptions {
parameter: EnergyProductionParameter;
scale: EnergyProductionScale;
Expand Down Expand Up @@ -253,7 +254,8 @@ export class EnergyProductionCCReport extends EnergyProductionCC {
}
}

interface EnergyProductionCCGetOptions extends CCCommandOptions {
// @publicAPI
export interface EnergyProductionCCGetOptions extends CCCommandOptions {
parameter: EnergyProductionParameter;
}

Expand Down
Loading

0 comments on commit febdb7e

Please sign in to comment.