behaviors 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 ; } , | "network" | "commissioning" | "controller" | "productDescription" | "sessions" > & { commissioning : typeof CommissioningServer ; } & { network : typeof NetworkServer ; } & { productDescription : typeof ProductDescriptionServer ; } & { sessions : typeof SessionsBehavior ; } & { controller : typeof ControllerBehavior ; }
An identity type.
You can't do:
But you can do:
Without this type you'd have to do:
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.