fixed formatting
This commit is contained in:
1 parent
2c8373adcf
commit
30c97bf9aa
3 files changed
+20
-14
No files matched your search
@@ -33,11 +33,13 @@ export const ethercatDevicesSchema = z.object({
|
||||
});
|
||||
|
||||
// Update the EthercatDevicesEventData schema
|
||||
export const ethercatDevicesEventDataSchema = z.object({
|
||||
Initializing: z.boolean(),
|
||||
Done: ethercatDevicesSchema,
|
||||
Error: z.string(),
|
||||
}).check(rustEnum);
|
||||
export const ethercatDevicesEventDataSchema = z
|
||||
.object({
|
||||
Initializing: z.boolean(),
|
||||
Done: ethercatDevicesSchema,
|
||||
Error: z.string(),
|
||||
})
|
||||
.check(rustEnum);
|
||||
|
||||
export type EthercatDevicesEventData = z.infer<
|
||||
typeof ethercatDevicesEventDataSchema
|
||||
@@ -66,10 +68,12 @@ export const machinesEventSchema = eventSchema(machinesEventDataSchema);
|
||||
export type MachinesEvent = z.infer<typeof machinesEventSchema>;
|
||||
|
||||
// Keep the EthercatInterfaceDiscovery event
|
||||
export const ethercatInterfaceDiscoveryEventDataSchema = z.object({
|
||||
Discovering: z.boolean(),
|
||||
Done: z.string(),
|
||||
}).check(rustEnum);
|
||||
export const ethercatInterfaceDiscoveryEventDataSchema = z
|
||||
.object({
|
||||
Discovering: z.boolean(),
|
||||
Done: z.string(),
|
||||
})
|
||||
.check(rustEnum);
|
||||
|
||||
export type EthercatInterfaceDiscoveryEventData = z.infer<
|
||||
typeof ethercatInterfaceDiscoveryEventDataSchema
|
||||
|
||||
@@ -12,6 +12,6 @@ export const rustEnum: z.core.CheckFn<object> = (ctx) => {
|
||||
ctx.issues.push({
|
||||
code: "custom",
|
||||
message: "Exactly one property must be defined",
|
||||
input: definedKeys
|
||||
input: definedKeys,
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -62,9 +62,11 @@ export type DeviceHardwareIdentificationEthercat = z.infer<
|
||||
typeof deviceHardwareIdentificationEthercatSchema
|
||||
>;
|
||||
|
||||
export const deviceHardwareIdentificationSchema = z.object({
|
||||
Ethercat: deviceHardwareIdentificationEthercatSchema,
|
||||
}).check(rustEnum);
|
||||
export const deviceHardwareIdentificationSchema = z
|
||||
.object({
|
||||
Ethercat: deviceHardwareIdentificationEthercatSchema,
|
||||
})
|
||||
.check(rustEnum);
|
||||
|
||||
export type DeviceHardwareIdentification = z.infer<
|
||||
typeof deviceHardwareIdentificationSchema
|
||||
|
||||
Reference in new issue
Block a user