An identity type.

You can't do:

interface Foo extends typeof Bar {}

But you can do:

interface Foo extends Identity<typeof Bar> {}

Without this type you'd have to do:

interface FooType = typeof Bar;
interface Foo extends FooType {};

We have to do this a lot because we generate complex objects with detailed type information. When exported, TS (as of 5.2) inlines the type of these objects in declarations which makes our declarations massive. To avoid this we create an interface from the type then cast to the interface for export.

interface RootEndpoint {
    behaviors: {
        parts: typeof PartsBehavior;
    } & {
        index: typeof IndexBehavior;
    } & {
        basicInformation: typeof BasicInformationServer;
    } & {
        accessControl: typeof AccessControlServer;
    } & {
        groupKeyManagement: typeof GroupKeyManagementServer;
    } & {
        generalCommissioning: typeof GeneralCommissioningServer;
    } & {
        administratorCommissioning: typeof AdministratorCommissioningServer;
    } & {
        operationalCredentials: typeof OperationalCredentialsServer;
    } & {
        generalDiagnostics: typeof GeneralDiagnosticsServer;
    } & Omit<{
        parts: typeof PartsBehavior;
    } & {
        index: typeof IndexBehavior;
    } & {
        basicInformation: typeof BasicInformationServer;
    } & {
        accessControl: typeof AccessControlServer;
    } & {
        groupKeyManagement: typeof GroupKeyManagementServer;
    } & {
        generalCommissioning: typeof GeneralCommissioningServer;
    } & {
        administratorCommissioning: typeof AdministratorCommissioningServer;
    } & {
        operationalCredentials: typeof OperationalCredentialsServer;
    } & {
        generalDiagnostics: typeof GeneralDiagnosticsServer;
    },
        | "commissioning"
        | "controller"
        | "network"
        | "productDescription"
        | "sessions"> & {
        commissioning: typeof CommissioningServer;
    } & {
        network: typeof NetworkServer;
    } & {
        productDescription: typeof ProductDescriptionServer;
    } & {
        sessions: typeof SessionsBehavior;
    } & {
        controller: typeof ControllerBehavior;
    };
    defaults: StateOf<With<{
        parts: typeof PartsBehavior;
    } & {
        index: typeof IndexBehavior;
    } & {
        basicInformation: typeof BasicInformationServer;
    } & {
        accessControl: typeof AccessControlServer;
    } & {
        groupKeyManagement: typeof GroupKeyManagementServer;
    } & {
        generalCommissioning: typeof GeneralCommissioningServer;
    } & {
        administratorCommissioning: typeof AdministratorCommissioningServer;
    } & {
        operationalCredentials: typeof OperationalCredentialsServer;
    } & {
        generalDiagnostics: typeof GeneralDiagnosticsServer;
    }, readonly [typeof CommissioningServer, typeof NetworkServer, typeof ProductDescriptionServer, typeof SessionsBehavior, typeof ControllerBehavior]>>;
    deviceClass: DeviceClassification;
    deviceRevision: number;
    deviceType: DeviceTypeId;
    name: "RootNode";
    requirements: typeof RootRequirements;
    set(defaults: InputStateOf<With<{
        parts: typeof PartsBehavior;
    } & {
        index: typeof IndexBehavior;
    } & {
        basicInformation: typeof BasicInformationServer;
    } & {
        accessControl: typeof AccessControlServer;
    } & {
        groupKeyManagement: typeof GroupKeyManagementServer;
    } & {
        generalCommissioning: typeof GeneralCommissioningServer;
    } & {
        administratorCommissioning: typeof AdministratorCommissioningServer;
    } & {
        operationalCredentials: typeof OperationalCredentialsServer;
    } & {
        generalDiagnostics: typeof GeneralDiagnosticsServer;
    }, readonly [typeof CommissioningServer, typeof NetworkServer, typeof ProductDescriptionServer, typeof SessionsBehavior, typeof ControllerBehavior]>>): With<For<{
        behaviors: {
            parts: typeof PartsBehavior;
        } & {
            index: typeof IndexBehavior;
        } & {
            basicInformation: typeof BasicInformationServer;
        } & {
            accessControl: typeof AccessControlServer;
        } & {
            groupKeyManagement: typeof GroupKeyManagementServer;
        } & {
            generalCommissioning: typeof GeneralCommissioningServer;
        } & {
            administratorCommissioning: typeof AdministratorCommissioningServer;
        } & {
            operationalCredentials: typeof OperationalCredentialsServer;
        } & {
            generalDiagnostics: typeof GeneralDiagnosticsServer;
        };
        deviceClass: Node;
        deviceRevision: 2;
        deviceType: 22;
        name: "RootNode";
        requirements: typeof RootRequirements;
    }>, With<{
        parts: typeof PartsBehavior;
    } & {
        index: typeof IndexBehavior;
    } & {
        basicInformation: typeof BasicInformationServer;
    } & {
        accessControl: typeof AccessControlServer;
    } & {
        groupKeyManagement: typeof GroupKeyManagementServer;
    } & {
        generalCommissioning: typeof GeneralCommissioningServer;
    } & {
        administratorCommissioning: typeof AdministratorCommissioningServer;
    } & {
        operationalCredentials: typeof OperationalCredentialsServer;
    } & {
        generalDiagnostics: typeof GeneralDiagnosticsServer;
    }, readonly [typeof CommissioningServer, typeof NetworkServer, typeof ProductDescriptionServer, typeof SessionsBehavior, typeof ControllerBehavior]>>;
    with<const BL>(...behaviors: BL): With<For<{
        behaviors: {
            parts: typeof PartsBehavior;
        } & {
            index: typeof IndexBehavior;
        } & {
            basicInformation: typeof BasicInformationServer;
        } & {
            accessControl: typeof AccessControlServer;
        } & {
            groupKeyManagement: typeof GroupKeyManagementServer;
        } & {
            generalCommissioning: typeof GeneralCommissioningServer;
        } & {
            administratorCommissioning: typeof AdministratorCommissioningServer;
        } & {
            operationalCredentials: typeof OperationalCredentialsServer;
        } & {
            generalDiagnostics: typeof GeneralDiagnosticsServer;
        };
        deviceClass: Node;
        deviceRevision: 2;
        deviceType: 22;
        name: "RootNode";
        requirements: typeof RootRequirements;
    }>, With<With<{
        parts: typeof PartsBehavior;
    } & {
        index: typeof IndexBehavior;
    } & {
        basicInformation: typeof BasicInformationServer;
    } & {
        accessControl: typeof AccessControlServer;
    } & {
        groupKeyManagement: typeof GroupKeyManagementServer;
    } & {
        generalCommissioning: typeof GeneralCommissioningServer;
    } & {
        administratorCommissioning: typeof AdministratorCommissioningServer;
    } & {
        operationalCredentials: typeof OperationalCredentialsServer;
    } & {
        generalDiagnostics: typeof GeneralDiagnosticsServer;
    }, readonly [typeof CommissioningServer, typeof NetworkServer, typeof ProductDescriptionServer, typeof SessionsBehavior, typeof ControllerBehavior]>, BL>>;
}

Hierarchy (view full)

Properties

behaviors: {
    parts: typeof PartsBehavior;
} & {
    index: typeof IndexBehavior;
} & {
    basicInformation: typeof BasicInformationServer;
} & {
    accessControl: typeof AccessControlServer;
} & {
    groupKeyManagement: typeof GroupKeyManagementServer;
} & {
    generalCommissioning: typeof GeneralCommissioningServer;
} & {
    administratorCommissioning: typeof AdministratorCommissioningServer;
} & {
    operationalCredentials: typeof OperationalCredentialsServer;
} & {
    generalDiagnostics: typeof GeneralDiagnosticsServer;
} & Omit<{
    parts: typeof PartsBehavior;
} & {
    index: typeof IndexBehavior;
} & {
    basicInformation: typeof BasicInformationServer;
} & {
    accessControl: typeof AccessControlServer;
} & {
    groupKeyManagement: typeof GroupKeyManagementServer;
} & {
    generalCommissioning: typeof GeneralCommissioningServer;
} & {
    administratorCommissioning: typeof AdministratorCommissioningServer;
} & {
    operationalCredentials: typeof OperationalCredentialsServer;
} & {
    generalDiagnostics: typeof GeneralDiagnosticsServer;
},
    | "commissioning"
    | "controller"
    | "network"
    | "productDescription"
    | "sessions"> & {
    commissioning: typeof CommissioningServer;
} & {
    network: typeof NetworkServer;
} & {
    productDescription: typeof ProductDescriptionServer;
} & {
    sessions: typeof SessionsBehavior;
} & {
    controller: typeof ControllerBehavior;
}
defaults: StateOf<With<{
    parts: typeof PartsBehavior;
} & {
    index: typeof IndexBehavior;
} & {
    basicInformation: typeof BasicInformationServer;
} & {
    accessControl: typeof AccessControlServer;
} & {
    groupKeyManagement: typeof GroupKeyManagementServer;
} & {
    generalCommissioning: typeof GeneralCommissioningServer;
} & {
    administratorCommissioning: typeof AdministratorCommissioningServer;
} & {
    operationalCredentials: typeof OperationalCredentialsServer;
} & {
    generalDiagnostics: typeof GeneralDiagnosticsServer;
}, readonly [typeof CommissioningServer, typeof NetworkServer, typeof ProductDescriptionServer, typeof SessionsBehavior, typeof ControllerBehavior]>>

Access default state values.

deviceRevision: number
deviceType: DeviceTypeId
name
requirements: typeof RootRequirements

Methods

  • Define an endpoint like this one with different defaults. Only updates values present in the input object.

    Parameters

    • defaults: InputStateOf<With<{
          parts: typeof PartsBehavior;
      } & {
          index: typeof IndexBehavior;
      } & {
          basicInformation: typeof BasicInformationServer;
      } & {
          accessControl: typeof AccessControlServer;
      } & {
          groupKeyManagement: typeof GroupKeyManagementServer;
      } & {
          generalCommissioning: typeof GeneralCommissioningServer;
      } & {
          administratorCommissioning: typeof AdministratorCommissioningServer;
      } & {
          operationalCredentials: typeof OperationalCredentialsServer;
      } & {
          generalDiagnostics: typeof GeneralDiagnosticsServer;
      }, readonly [typeof CommissioningServer, typeof NetworkServer, typeof ProductDescriptionServer, typeof SessionsBehavior, typeof ControllerBehavior]>>

    Returns With<For<{
        behaviors: {
            parts: typeof PartsBehavior;
        } & {
            index: typeof IndexBehavior;
        } & {
            basicInformation: typeof BasicInformationServer;
        } & {
            accessControl: typeof AccessControlServer;
        } & {
            groupKeyManagement: typeof GroupKeyManagementServer;
        } & {
            generalCommissioning: typeof GeneralCommissioningServer;
        } & {
            administratorCommissioning: typeof AdministratorCommissioningServer;
        } & {
            operationalCredentials: typeof OperationalCredentialsServer;
        } & {
            generalDiagnostics: typeof GeneralDiagnosticsServer;
        };
        deviceClass: Node;
        deviceRevision: 2;
        deviceType: 22;
        name: "RootNode";
        requirements: typeof RootRequirements;
    }>, With<{
        parts: typeof PartsBehavior;
    } & {
        index: typeof IndexBehavior;
    } & {
        basicInformation: typeof BasicInformationServer;
    } & {
        accessControl: typeof AccessControlServer;
    } & {
        groupKeyManagement: typeof GroupKeyManagementServer;
    } & {
        generalCommissioning: typeof GeneralCommissioningServer;
    } & {
        administratorCommissioning: typeof AdministratorCommissioningServer;
    } & {
        operationalCredentials: typeof OperationalCredentialsServer;
    } & {
        generalDiagnostics: typeof GeneralDiagnosticsServer;
    }, readonly [typeof CommissioningServer, typeof NetworkServer, typeof ProductDescriptionServer, typeof SessionsBehavior, typeof ControllerBehavior]>>

  • Define an endpoint like this one with additional and/or replacement server behaviors.

    Type Parameters

    • const BL extends List

    Parameters

    • Rest...behaviors: BL

    Returns With<For<{
        behaviors: {
            parts: typeof PartsBehavior;
        } & {
            index: typeof IndexBehavior;
        } & {
            basicInformation: typeof BasicInformationServer;
        } & {
            accessControl: typeof AccessControlServer;
        } & {
            groupKeyManagement: typeof GroupKeyManagementServer;
        } & {
            generalCommissioning: typeof GeneralCommissioningServer;
        } & {
            administratorCommissioning: typeof AdministratorCommissioningServer;
        } & {
            operationalCredentials: typeof OperationalCredentialsServer;
        } & {
            generalDiagnostics: typeof GeneralDiagnosticsServer;
        };
        deviceClass: Node;
        deviceRevision: 2;
        deviceType: 22;
        name: "RootNode";
        requirements: typeof RootRequirements;
    }>, With<With<{
        parts: typeof PartsBehavior;
    } & {
        index: typeof IndexBehavior;
    } & {
        basicInformation: typeof BasicInformationServer;
    } & {
        accessControl: typeof AccessControlServer;
    } & {
        groupKeyManagement: typeof GroupKeyManagementServer;
    } & {
        generalCommissioning: typeof GeneralCommissioningServer;
    } & {
        administratorCommissioning: typeof AdministratorCommissioningServer;
    } & {
        operationalCredentials: typeof OperationalCredentialsServer;
    } & {
        generalDiagnostics: typeof GeneralDiagnosticsServer;
    }, readonly [typeof CommissioningServer, typeof NetworkServer, typeof ProductDescriptionServer, typeof SessionsBehavior, typeof ControllerBehavior]>, BL>>