@battle-racing/br-common-lib
Version:
Common library for all Battle Racing Repositorios
400 lines (399 loc) • 16.8 kB
TypeScript
import { z } from 'zod';
export declare const socketGameTrackClientToServerEventsParamsSchema: z.ZodObject<{
'game-track:init': z.ZodObject<{
macAddress: z.ZodString;
}, z.core.$strip>;
'game-track:emergency:buttonPressed': z.ZodObject<{
macAddress: z.ZodString;
}, z.core.$strip>;
'game-track:emergency:buttonReleased': z.ZodObject<{
macAddress: z.ZodString;
}, z.core.$strip>;
}, z.core.$strip>;
export declare const socketKartClientToServerEventsParamsSchema: z.ZodObject<{
'kart:init': z.ZodObject<{
macAddress: z.ZodString;
hostname: z.ZodString;
}, z.core.$strip>;
'kart:checkpoint': z.ZodObject<{
macAddress: z.ZodString;
checkpointAddress: z.ZodNumber;
checkpointType: z.ZodEnum<{
readonly START: "Start";
readonly CHECKPOINT: "Checkpoint";
readonly FINISH: "Finish";
readonly VIRTUAL_CHECKPOINT: "Virtual Checkpoint";
}>;
shouldRequestPowerUp: z.ZodBoolean;
originTimestampISO: z.ZodString;
}, z.core.$strip>;
'kart:damage:sent': z.ZodObject<{
macAddress: z.ZodString;
damageName: z.ZodEnum<{
readonly GENERIC: "Generic";
readonly TRAP_HIT: "Trap Hit";
readonly PULSE_HIT: "Pulse Hit";
readonly STAR_HIT_LEFT: "Star Hit Left";
readonly STAR_HIT_RIGHT: "Star Hit Right";
readonly SHOT_HIT: "Shot Hit";
readonly SHORTCUT: "Shortcut";
readonly BLUE_SHOT_HIT: "Blue Shot Hit";
}>;
}, z.core.$strip>;
'kart:damage:received': z.ZodObject<{
macAddress: z.ZodString;
damageName: z.ZodEnum<{
readonly GENERIC: "Generic";
readonly TRAP_HIT: "Trap Hit";
readonly PULSE_HIT: "Pulse Hit";
readonly STAR_HIT_LEFT: "Star Hit Left";
readonly STAR_HIT_RIGHT: "Star Hit Right";
readonly SHOT_HIT: "Shot Hit";
readonly SHORTCUT: "Shortcut";
readonly BLUE_SHOT_HIT: "Blue Shot Hit";
}>;
}, z.core.$strip>;
'kart:data:changed': z.ZodObject<{
macAddress: z.ZodString;
kart: z.ZodObject<{
guid: z.ZodString;
id: z.ZodNumber;
mac: z.ZodString;
hostname: z.ZodString;
isConnected: z.ZodBoolean;
status: z.ZodEnum<{
readonly STAND_BY: "standBy";
readonly IN_GAME: "in-game";
readonly YELLOW_FLAG: "yellow-flag";
readonly EMERGENCY: "emergency";
readonly PITS: "pits";
readonly ELIMINATED: "eliminated";
}>;
shield: z.ZodObject<{
isActive: z.ZodBoolean;
duration: z.ZodNumber;
}, z.core.$strip>;
gameTrackId: z.ZodString;
color: z.ZodEnum<{
readonly Black: "Black";
readonly Red: "Red";
readonly Blue: "Blue";
readonly Green: "Green";
readonly Yellow: "Yellow";
readonly Violet: "Violet";
readonly Cyan: "Cyan";
readonly Magenta: "Magenta";
readonly Orange: "Orange";
readonly White: "White";
readonly GreenYellow: "GreenYellow";
readonly SaddleBrown: "SaddleBrown";
}>;
number: z.ZodNumber;
currentGame: z.ZodOptional<z.ZodNullable<z.ZodObject<{
id: z.ZodNumber;
type: z.ZodEnum<{
readonly Race: "Race";
readonly Battle: "Battle";
}>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
isSubscribedToHardwareStatus: z.ZodBoolean;
hardwareState: z.ZodOptional<z.ZodNullable<z.ZodObject<{
speed: z.ZodNullable<z.ZodObject<{
status: z.ZodEnum<{
readonly ACTIVATED: "Activated";
readonly DEACTIVATED: "Deactivated";
readonly UNKNOWN: "Unknown";
readonly ERROR: "Error";
readonly STANDBY: "Standby";
readonly CHANGING_SPEED: "Changing Speed";
readonly IN_EMERGENCY: "In Emergency";
}>;
current: z.ZodNumber;
configured: z.ZodNumber;
}, z.core.$strip>>;
rgb: z.ZodNullable<z.ZodEnum<{
readonly SHOWING_COLOR: "Showing Color";
readonly NOT_CONFIGURED: "Not Configured";
readonly CONFIGURING_RGB: "Configuring RGB";
readonly SHOWING_EFFECT: "Showing Effect";
readonly UNKNOWN: "Unknown";
readonly ERROR: "Error";
}>>;
flag: z.ZodNullable<z.ZodObject<{
status: z.ZodEnum<{
readonly ACTIVATED: "Activated";
readonly DEACTIVATED: "Deactivated";
readonly UNKNOWN: "Unknown";
readonly ERROR: "Error";
readonly STANDBY: "Standby";
readonly HIT: "Hit";
readonly SHOWING_IMAGE: "Showing Image";
readonly SHOWING_ANIMATION: "Showing Animation";
}>;
checkpointType: z.ZodNullable<z.ZodEnum<{
readonly START: "Start";
readonly CHECKPOINT: "Checkpoint";
readonly FINISH: "Finish";
readonly VIRTUAL_CHECKPOINT: "Virtual Checkpoint";
}>>;
checkpointAddress: z.ZodNullable<z.ZodNumber>;
}, z.core.$strip>>;
screen: z.ZodNullable<z.ZodEnum<{
readonly ACTIVATED: "Activated";
readonly DEACTIVATED: "Deactivated";
readonly UNKNOWN: "Unknown";
readonly ERROR: "Error";
readonly DEBUG: "Debug";
}>>;
isConnectedToServer: z.ZodBoolean;
isSteeringWheelPressed: z.ZodBoolean;
}, z.core.$strip>>>;
currentPowerUp: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
readonly BATTLE_GOD: "Battle God";
readonly BATTLE_STAR: "Battle Star";
readonly BATTLE_SHOT: "Battle Shot";
readonly BATTLE_NITRO: "Battle Nitro";
readonly BATTLE_PULSE: "Battle Pulse";
readonly BATTLE_TRAP: "Battle Trap";
readonly BATTLE_SHIELD: "Battle Shield";
readonly BATTLE_TURBO: "Battle Turbo";
readonly BATTLE_BLUE_SHOT: "Battle Blue Shot";
}>>>;
currentDamage: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
readonly GENERIC: "Generic";
readonly TRAP_HIT: "Trap Hit";
readonly PULSE_HIT: "Pulse Hit";
readonly STAR_HIT_LEFT: "Star Hit Left";
readonly STAR_HIT_RIGHT: "Star Hit Right";
readonly SHOT_HIT: "Shot Hit";
readonly SHORTCUT: "Shortcut";
readonly BLUE_SHOT_HIT: "Blue Shot Hit";
}>>>;
}, z.core.$strip>;
}, z.core.$strip>;
}, z.core.$strip>;
export declare const socketWebAppClientToServerEventsParamsSchema: z.ZodObject<{
'karts:authenticate': z.ZodObject<{
authToken: z.ZodString;
}, z.core.$strip>;
'karts:list': z.ZodUndefined;
'karts:tracking:subscribe': z.ZodObject<{
kartGuid: z.ZodString;
}, z.core.$strip>;
'karts:tracking:unsubscribe': z.ZodObject<{
kartGuid: z.ZodString;
}, z.core.$strip>;
'game-changed:subscribe': z.ZodObject<{
gameId: z.ZodString;
gameType: z.ZodEnum<{
readonly Race: "Race";
readonly Battle: "Battle";
}>;
}, z.core.$strip>;
'game-changed:unsubscribe': z.ZodObject<{
gameId: z.ZodString;
gameType: z.ZodEnum<{
readonly Race: "Race";
readonly Battle: "Battle";
}>;
}, z.core.$strip>;
'game-tracks:list': z.ZodUndefined;
}, z.core.$strip>;
export declare const socketClientToServerEventsParamsSchema: z.ZodObject<{
'game-track:init': z.ZodObject<{
macAddress: z.ZodString;
}, z.core.$strip>;
'game-track:emergency:buttonPressed': z.ZodObject<{
macAddress: z.ZodString;
}, z.core.$strip>;
'game-track:emergency:buttonReleased': z.ZodObject<{
macAddress: z.ZodString;
}, z.core.$strip>;
'kart:init': z.ZodObject<{
macAddress: z.ZodString;
hostname: z.ZodString;
}, z.core.$strip>;
'kart:checkpoint': z.ZodObject<{
macAddress: z.ZodString;
checkpointAddress: z.ZodNumber;
checkpointType: z.ZodEnum<{
readonly START: "Start";
readonly CHECKPOINT: "Checkpoint";
readonly FINISH: "Finish";
readonly VIRTUAL_CHECKPOINT: "Virtual Checkpoint";
}>;
shouldRequestPowerUp: z.ZodBoolean;
originTimestampISO: z.ZodString;
}, z.core.$strip>;
'kart:damage:sent': z.ZodObject<{
macAddress: z.ZodString;
damageName: z.ZodEnum<{
readonly GENERIC: "Generic";
readonly TRAP_HIT: "Trap Hit";
readonly PULSE_HIT: "Pulse Hit";
readonly STAR_HIT_LEFT: "Star Hit Left";
readonly STAR_HIT_RIGHT: "Star Hit Right";
readonly SHOT_HIT: "Shot Hit";
readonly SHORTCUT: "Shortcut";
readonly BLUE_SHOT_HIT: "Blue Shot Hit";
}>;
}, z.core.$strip>;
'kart:damage:received': z.ZodObject<{
macAddress: z.ZodString;
damageName: z.ZodEnum<{
readonly GENERIC: "Generic";
readonly TRAP_HIT: "Trap Hit";
readonly PULSE_HIT: "Pulse Hit";
readonly STAR_HIT_LEFT: "Star Hit Left";
readonly STAR_HIT_RIGHT: "Star Hit Right";
readonly SHOT_HIT: "Shot Hit";
readonly SHORTCUT: "Shortcut";
readonly BLUE_SHOT_HIT: "Blue Shot Hit";
}>;
}, z.core.$strip>;
'kart:data:changed': z.ZodObject<{
macAddress: z.ZodString;
kart: z.ZodObject<{
guid: z.ZodString;
id: z.ZodNumber;
mac: z.ZodString;
hostname: z.ZodString;
isConnected: z.ZodBoolean;
status: z.ZodEnum<{
readonly STAND_BY: "standBy";
readonly IN_GAME: "in-game";
readonly YELLOW_FLAG: "yellow-flag";
readonly EMERGENCY: "emergency";
readonly PITS: "pits";
readonly ELIMINATED: "eliminated";
}>;
shield: z.ZodObject<{
isActive: z.ZodBoolean;
duration: z.ZodNumber;
}, z.core.$strip>;
gameTrackId: z.ZodString;
color: z.ZodEnum<{
readonly Black: "Black";
readonly Red: "Red";
readonly Blue: "Blue";
readonly Green: "Green";
readonly Yellow: "Yellow";
readonly Violet: "Violet";
readonly Cyan: "Cyan";
readonly Magenta: "Magenta";
readonly Orange: "Orange";
readonly White: "White";
readonly GreenYellow: "GreenYellow";
readonly SaddleBrown: "SaddleBrown";
}>;
number: z.ZodNumber;
currentGame: z.ZodOptional<z.ZodNullable<z.ZodObject<{
id: z.ZodNumber;
type: z.ZodEnum<{
readonly Race: "Race";
readonly Battle: "Battle";
}>;
}, z.core.$strip>>>;
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
isSubscribedToHardwareStatus: z.ZodBoolean;
hardwareState: z.ZodOptional<z.ZodNullable<z.ZodObject<{
speed: z.ZodNullable<z.ZodObject<{
status: z.ZodEnum<{
readonly ACTIVATED: "Activated";
readonly DEACTIVATED: "Deactivated";
readonly UNKNOWN: "Unknown";
readonly ERROR: "Error";
readonly STANDBY: "Standby";
readonly CHANGING_SPEED: "Changing Speed";
readonly IN_EMERGENCY: "In Emergency";
}>;
current: z.ZodNumber;
configured: z.ZodNumber;
}, z.core.$strip>>;
rgb: z.ZodNullable<z.ZodEnum<{
readonly SHOWING_COLOR: "Showing Color";
readonly NOT_CONFIGURED: "Not Configured";
readonly CONFIGURING_RGB: "Configuring RGB";
readonly SHOWING_EFFECT: "Showing Effect";
readonly UNKNOWN: "Unknown";
readonly ERROR: "Error";
}>>;
flag: z.ZodNullable<z.ZodObject<{
status: z.ZodEnum<{
readonly ACTIVATED: "Activated";
readonly DEACTIVATED: "Deactivated";
readonly UNKNOWN: "Unknown";
readonly ERROR: "Error";
readonly STANDBY: "Standby";
readonly HIT: "Hit";
readonly SHOWING_IMAGE: "Showing Image";
readonly SHOWING_ANIMATION: "Showing Animation";
}>;
checkpointType: z.ZodNullable<z.ZodEnum<{
readonly START: "Start";
readonly CHECKPOINT: "Checkpoint";
readonly FINISH: "Finish";
readonly VIRTUAL_CHECKPOINT: "Virtual Checkpoint";
}>>;
checkpointAddress: z.ZodNullable<z.ZodNumber>;
}, z.core.$strip>>;
screen: z.ZodNullable<z.ZodEnum<{
readonly ACTIVATED: "Activated";
readonly DEACTIVATED: "Deactivated";
readonly UNKNOWN: "Unknown";
readonly ERROR: "Error";
readonly DEBUG: "Debug";
}>>;
isConnectedToServer: z.ZodBoolean;
isSteeringWheelPressed: z.ZodBoolean;
}, z.core.$strip>>>;
currentPowerUp: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
readonly BATTLE_GOD: "Battle God";
readonly BATTLE_STAR: "Battle Star";
readonly BATTLE_SHOT: "Battle Shot";
readonly BATTLE_NITRO: "Battle Nitro";
readonly BATTLE_PULSE: "Battle Pulse";
readonly BATTLE_TRAP: "Battle Trap";
readonly BATTLE_SHIELD: "Battle Shield";
readonly BATTLE_TURBO: "Battle Turbo";
readonly BATTLE_BLUE_SHOT: "Battle Blue Shot";
}>>>;
currentDamage: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
readonly GENERIC: "Generic";
readonly TRAP_HIT: "Trap Hit";
readonly PULSE_HIT: "Pulse Hit";
readonly STAR_HIT_LEFT: "Star Hit Left";
readonly STAR_HIT_RIGHT: "Star Hit Right";
readonly SHOT_HIT: "Shot Hit";
readonly SHORTCUT: "Shortcut";
readonly BLUE_SHOT_HIT: "Blue Shot Hit";
}>>>;
}, z.core.$strip>;
}, z.core.$strip>;
'karts:authenticate': z.ZodObject<{
authToken: z.ZodString;
}, z.core.$strip>;
'karts:list': z.ZodUndefined;
'karts:tracking:subscribe': z.ZodObject<{
kartGuid: z.ZodString;
}, z.core.$strip>;
'karts:tracking:unsubscribe': z.ZodObject<{
kartGuid: z.ZodString;
}, z.core.$strip>;
'game-changed:subscribe': z.ZodObject<{
gameId: z.ZodString;
gameType: z.ZodEnum<{
readonly Race: "Race";
readonly Battle: "Battle";
}>;
}, z.core.$strip>;
'game-changed:unsubscribe': z.ZodObject<{
gameId: z.ZodString;
gameType: z.ZodEnum<{
readonly Race: "Race";
readonly Battle: "Battle";
}>;
}, z.core.$strip>;
'game-tracks:list': z.ZodUndefined;
}, z.core.$strip>;