multyx-client
Version:
Framework designed to simplify the creation of multiplayer browser games by addressing the complexities of managing server-client communication, shared state, and input handling
22 lines (21 loc) • 534 B
TypeScript
export type RawObject<V = any> = {
[key: string | number | symbol]: V;
};
export type Value = string | number | boolean;
export type Constraint = (n: Value) => Value | null;
export type EditUpdate = {
instruction: 'edit';
path: string[];
value: any;
};
export type InputUpdate = {
instruction: 'input';
input: string;
data?: RawObject<Value>;
};
export type ResponseUpdate = {
instruction: 'resp';
name: string;
response: any;
};
export type Update = EditUpdate | InputUpdate | ResponseUpdate;