@battle-racing/br-common-lib
Version:
Common library for all Battle Racing Repositorios
21 lines (20 loc) • 1.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.lightsModuleStatusSchema = exports.showLightsEffectParamsSchema = exports.showLightsColorParamsSchema = exports.lightsEffectSchema = exports.lightsActionCommandSchema = void 0;
const zod_1 = require("zod");
const Lights_const_1 = require("./Lights.const");
exports.lightsActionCommandSchema = zod_1.z.enum(Lights_const_1.LIGHTS_ACTION_COMMAND);
exports.lightsEffectSchema = zod_1.z.enum(Lights_const_1.LIGHTS_EFFECT);
exports.showLightsColorParamsSchema = zod_1.z.object({
address: zod_1.z.union([zod_1.z.array(zod_1.z.number()), zod_1.z.literal('all')]),
timeDuration: zod_1.z.number().min(1).max(25),
color: zod_1.z.string(), // Hex RGB
});
exports.showLightsEffectParamsSchema = zod_1.z.object({
addresses: zod_1.z.union([zod_1.z.array(zod_1.z.number()), zod_1.z.literal('all')]),
effect: exports.lightsEffectSchema,
timeDuration: zod_1.z.number().min(1).max(25),
});
exports.lightsModuleStatusSchema = zod_1.z.object({
currentEffect: exports.lightsEffectSchema.nullable(),
});