@battle-racing/br-common-lib
Version:
Common library for all Battle Racing Repositorios
23 lines (17 loc) • 722 B
text/typescript
import { z } from 'zod';
import { LIGHTS_EFFECT, LIGHTS_ACTION_COMMAND } from './Lights.const';
export const lightsActionCommandSchema = z.enum(LIGHTS_ACTION_COMMAND);
export const lightsEffectSchema = z.enum(LIGHTS_EFFECT);
export const showLightsColorParamsSchema = z.object({
address: z.union([z.array(z.number()), z.literal('all')]),
timeDuration: z.number().min(1).max(25),
color: z.string(), // Hex RGB
});
export const showLightsEffectParamsSchema = z.object({
addresses: z.union([z.array(z.number()), z.literal('all')]),
effect: lightsEffectSchema,
timeDuration: z.number().min(1).max(25),
});
export const lightsModuleStatusSchema = z.object({
currentEffect: lightsEffectSchema.nullable(),
});