@4players/odin-common
Version:
A collection of commonly used type definitions and utility functions across ODIN web projects
1,247 lines • 67.6 kB
TypeScript
import * as z from 'zod';
export declare namespace RoomV1 {
const RoomIdSchema: z.ZodString;
type RoomId = z.infer<typeof RoomIdSchema>;
const RoomSchema: z.ZodObject<{
id: z.ZodString;
customer: z.ZodString;
user_data: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
peers: z.ZodArray<z.ZodObject<{
id: z.ZodNumber;
user_id: z.ZodString;
user_data: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
medias: z.ZodArray<z.ZodObject<{
id: z.ZodNumber;
properties: z.ZodUnion<[z.ZodObject<{
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
uid: z.ZodOptional<z.ZodString>;
customType: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
}, {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
}>, z.ZodObject<{
kind: z.ZodOptional<z.ZodLiteral<"video">>;
codec: z.ZodOptional<z.ZodString>;
uid: z.ZodOptional<z.ZodString>;
customType: z.ZodOptional<z.ZodString>;
id: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
}, {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
}>]>;
paused: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}, {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}>, "many">;
}, "strip", z.ZodTypeAny, {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}, {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}>, "many">;
}, "strip", z.ZodTypeAny, {
id: string;
user_data: Uint8Array;
customer: string;
peers: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}[];
}, {
id: string;
user_data: Uint8Array;
customer: string;
peers: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}[];
}>;
type Room = z.infer<typeof RoomSchema>;
const RoomUpdateSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
kind: z.ZodLiteral<"Joined">;
room: z.ZodObject<{
id: z.ZodString;
customer: z.ZodString;
user_data: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
peers: z.ZodArray<z.ZodObject<{
id: z.ZodNumber;
user_id: z.ZodString;
user_data: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
medias: z.ZodArray<z.ZodObject<{
id: z.ZodNumber;
properties: z.ZodUnion<[z.ZodObject<{
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
uid: z.ZodOptional<z.ZodString>;
customType: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
}, {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
}>, z.ZodObject<{
kind: z.ZodOptional<z.ZodLiteral<"video">>;
codec: z.ZodOptional<z.ZodString>;
uid: z.ZodOptional<z.ZodString>;
customType: z.ZodOptional<z.ZodString>;
id: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
}, {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
}>]>;
paused: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}, {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}>, "many">;
}, "strip", z.ZodTypeAny, {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}, {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}>, "many">;
}, "strip", z.ZodTypeAny, {
id: string;
user_data: Uint8Array;
customer: string;
peers: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}[];
}, {
id: string;
user_data: Uint8Array;
customer: string;
peers: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}[];
}>;
media_ids: z.ZodArray<z.ZodNumber, "many">;
own_peer_id: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
kind: "Joined";
room: {
id: string;
user_data: Uint8Array;
customer: string;
peers: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}[];
};
media_ids: number[];
own_peer_id: number;
}, {
kind: "Joined";
room: {
id: string;
user_data: Uint8Array;
customer: string;
peers: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}[];
};
media_ids: number[];
own_peer_id: number;
}>, z.ZodObject<{
kind: z.ZodLiteral<"Left">;
reason: z.ZodEnum<["RoomClosing", "ServerClosing", "PeerKicked"]>;
}, "strip", z.ZodTypeAny, {
reason: "RoomClosing" | "ServerClosing" | "PeerKicked";
kind: "Left";
}, {
reason: "RoomClosing" | "ServerClosing" | "PeerKicked";
kind: "Left";
}>, z.ZodObject<{
kind: z.ZodLiteral<"UserDataChanged">;
user_data: z.ZodOptional<z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>>;
}, "strip", z.ZodTypeAny, {
kind: "UserDataChanged";
user_data?: Uint8Array | undefined;
}, {
kind: "UserDataChanged";
user_data?: Uint8Array | undefined;
}>, z.ZodObject<{
kind: z.ZodLiteral<"PeerJoined">;
peer: z.ZodObject<{
id: z.ZodNumber;
user_id: z.ZodString;
user_data: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
medias: z.ZodArray<z.ZodObject<{
id: z.ZodNumber;
properties: z.ZodUnion<[z.ZodObject<{
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
uid: z.ZodOptional<z.ZodString>;
customType: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
}, {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
}>, z.ZodObject<{
kind: z.ZodOptional<z.ZodLiteral<"video">>;
codec: z.ZodOptional<z.ZodString>;
uid: z.ZodOptional<z.ZodString>;
customType: z.ZodOptional<z.ZodString>;
id: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
}, {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
}>]>;
paused: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}, {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}>, "many">;
}, "strip", z.ZodTypeAny, {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}, {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}>;
}, "strip", z.ZodTypeAny, {
kind: "PeerJoined";
peer: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
};
}, {
kind: "PeerJoined";
peer: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
};
}>, z.ZodObject<{
kind: z.ZodLiteral<"PeerLeft">;
peer_id: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
kind: "PeerLeft";
peer_id: number;
}, {
kind: "PeerLeft";
peer_id: number;
}>]>;
type RoomUpdate = z.infer<typeof RoomUpdateSchema>;
const RoomUpdatesSchema: z.ZodObject<{
updates: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
kind: z.ZodLiteral<"Joined">;
room: z.ZodObject<{
id: z.ZodString;
customer: z.ZodString;
user_data: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
peers: z.ZodArray<z.ZodObject<{
id: z.ZodNumber;
user_id: z.ZodString;
user_data: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
medias: z.ZodArray<z.ZodObject<{
id: z.ZodNumber;
properties: z.ZodUnion<[z.ZodObject<{
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
uid: z.ZodOptional<z.ZodString>;
customType: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
}, {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
}>, z.ZodObject<{
kind: z.ZodOptional<z.ZodLiteral<"video">>;
codec: z.ZodOptional<z.ZodString>;
uid: z.ZodOptional<z.ZodString>;
customType: z.ZodOptional<z.ZodString>;
id: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
}, {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
}>]>;
paused: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}, {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}>, "many">;
}, "strip", z.ZodTypeAny, {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}, {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}>, "many">;
}, "strip", z.ZodTypeAny, {
id: string;
user_data: Uint8Array;
customer: string;
peers: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}[];
}, {
id: string;
user_data: Uint8Array;
customer: string;
peers: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}[];
}>;
media_ids: z.ZodArray<z.ZodNumber, "many">;
own_peer_id: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
kind: "Joined";
room: {
id: string;
user_data: Uint8Array;
customer: string;
peers: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}[];
};
media_ids: number[];
own_peer_id: number;
}, {
kind: "Joined";
room: {
id: string;
user_data: Uint8Array;
customer: string;
peers: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}[];
};
media_ids: number[];
own_peer_id: number;
}>, z.ZodObject<{
kind: z.ZodLiteral<"Left">;
reason: z.ZodEnum<["RoomClosing", "ServerClosing", "PeerKicked"]>;
}, "strip", z.ZodTypeAny, {
reason: "RoomClosing" | "ServerClosing" | "PeerKicked";
kind: "Left";
}, {
reason: "RoomClosing" | "ServerClosing" | "PeerKicked";
kind: "Left";
}>, z.ZodObject<{
kind: z.ZodLiteral<"UserDataChanged">;
user_data: z.ZodOptional<z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>>;
}, "strip", z.ZodTypeAny, {
kind: "UserDataChanged";
user_data?: Uint8Array | undefined;
}, {
kind: "UserDataChanged";
user_data?: Uint8Array | undefined;
}>, z.ZodObject<{
kind: z.ZodLiteral<"PeerJoined">;
peer: z.ZodObject<{
id: z.ZodNumber;
user_id: z.ZodString;
user_data: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
medias: z.ZodArray<z.ZodObject<{
id: z.ZodNumber;
properties: z.ZodUnion<[z.ZodObject<{
kind: z.ZodOptional<z.ZodLiteral<"audio">>;
uid: z.ZodOptional<z.ZodString>;
customType: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
}, {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
}>, z.ZodObject<{
kind: z.ZodOptional<z.ZodLiteral<"video">>;
codec: z.ZodOptional<z.ZodString>;
uid: z.ZodOptional<z.ZodString>;
customType: z.ZodOptional<z.ZodString>;
id: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
}, {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
}>]>;
paused: z.ZodBoolean;
}, "strip", z.ZodTypeAny, {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}, {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}>, "many">;
}, "strip", z.ZodTypeAny, {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}, {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}>;
}, "strip", z.ZodTypeAny, {
kind: "PeerJoined";
peer: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
};
}, {
kind: "PeerJoined";
peer: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
};
}>, z.ZodObject<{
kind: z.ZodLiteral<"PeerLeft">;
peer_id: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
kind: "PeerLeft";
peer_id: number;
}, {
kind: "PeerLeft";
peer_id: number;
}>]>, "many">;
}, "strip", z.ZodTypeAny, {
updates: ({
kind: "Joined";
room: {
id: string;
user_data: Uint8Array;
customer: string;
peers: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}[];
};
media_ids: number[];
own_peer_id: number;
} | {
reason: "RoomClosing" | "ServerClosing" | "PeerKicked";
kind: "Left";
} | {
kind: "UserDataChanged";
user_data?: Uint8Array | undefined;
} | {
kind: "PeerJoined";
peer: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
};
} | {
kind: "PeerLeft";
peer_id: number;
})[];
}, {
updates: ({
kind: "Joined";
room: {
id: string;
user_data: Uint8Array;
customer: string;
peers: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
}[];
};
media_ids: number[];
own_peer_id: number;
} | {
reason: "RoomClosing" | "ServerClosing" | "PeerKicked";
kind: "Left";
} | {
kind: "UserDataChanged";
user_data?: Uint8Array | undefined;
} | {
kind: "PeerJoined";
peer: {
id: number;
user_id: string;
user_data: Uint8Array;
medias: {
id: number;
paused: boolean;
properties: {
uid?: string | undefined;
kind?: "audio" | undefined;
customType?: string | undefined;
} | {
id?: string | undefined;
codec?: string | undefined;
uid?: string | undefined;
kind?: "video" | undefined;
customType?: string | undefined;
};
}[];
};
} | {
kind: "PeerLeft";
peer_id: number;
})[];
}>;
type RoomUpdates = z.infer<typeof RoomUpdatesSchema>;
const RoomStatusSchema: z.ZodEnum<["Joining", "Joined", "Closed"]>;
type RoomStatus = z.infer<typeof RoomStatusSchema>;
const RoomStatusChangedSchema: z.ZodObject<{
status: z.ZodEnum<["Joining", "Joined", "Closed"]>;
message: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
status: "Joined" | "Joining" | "Closed";
message?: string | undefined;
}, {
status: "Joined" | "Joining" | "Closed";
message?: string | undefined;
}>;
type RoomStatusChanged = z.infer<typeof RoomStatusChangedSchema>;
}
export declare namespace RoomV2 {
const ParametersSchema: z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, z.ZodTypeDef, import("./serialization.ts").JsonValue>>;
const PeerProperties: z.ZodObject<{
user_data: z.ZodOptional<z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>>;
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, z.ZodTypeDef, import("./serialization.ts").JsonValue>>>;
video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, z.ZodTypeDef, import("./serialization.ts").JsonValue>>>;
}, "strip", z.ZodTypeAny, {
user_data?: Uint8Array | undefined;
tags?: string[] | undefined;
audio_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
video_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
}, {
user_data?: Uint8Array | undefined;
tags?: string[] | undefined;
audio_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
video_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
}>;
const PingSchema: z.ZodObject<{
Ping: z.ZodObject<{
id: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
id: number;
}, {
id: number;
}>;
}, "strip", z.ZodTypeAny, {
Ping: {
id: number;
};
}, {
Ping: {
id: number;
};
}>;
const ChangeSelfSchema: z.ZodObject<{
ChangeSelf: z.ZodObject<Omit<{
user_data: z.ZodOptional<z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>>;
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, z.ZodTypeDef, import("./serialization.ts").JsonValue>>>;
video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, z.ZodTypeDef, import("./serialization.ts").JsonValue>>>;
}, "tags">, "strip", z.ZodTypeAny, {
user_data?: Uint8Array | undefined;
audio_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
video_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
}, {
user_data?: Uint8Array | undefined;
audio_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
video_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
}>;
}, "strip", z.ZodTypeAny, {
ChangeSelf: {
user_data?: Uint8Array | undefined;
audio_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
video_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
};
}, {
ChangeSelf: {
user_data?: Uint8Array | undefined;
audio_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
video_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
};
}>;
const SetAudioMaskSchema: z.ZodObject<{
SetAudioMask: z.ZodObject<{
peer_id: z.ZodNumber;
mask: z.ZodEffects<z.ZodBigInt, import("./channels.ts").ChannelSet, bigint>;
}, "strip", z.ZodTypeAny, {
mask: import("./channels.ts").ChannelSet;
peer_id: number;
}, {
mask: bigint;
peer_id: number;
}>;
}, "strip", z.ZodTypeAny, {
SetAudioMask: {
mask: import("./channels.ts").ChannelSet;
peer_id: number;
};
}, {
SetAudioMask: {
mask: bigint;
peer_id: number;
};
}>;
const SendMessageSchema: z.ZodObject<{
SendMessage: z.ZodObject<{
peer_ids: z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>;
message: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
}, "strip", z.ZodTypeAny, {
message: Uint8Array;
peer_ids: number[];
}, {
message: Uint8Array;
peer_ids?: number[] | undefined;
}>;
}, "strip", z.ZodTypeAny, {
SendMessage: {
message: Uint8Array;
peer_ids: number[];
};
}, {
SendMessage: {
message: Uint8Array;
peer_ids?: number[] | undefined;
};
}>;
const CallSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
Ping: z.ZodObject<{
id: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
id: number;
}, {
id: number;
}>;
}, "strip", z.ZodTypeAny, {
Ping: {
id: number;
};
}, {
Ping: {
id: number;
};
}>, z.ZodObject<{
ChangeSelf: z.ZodObject<Omit<{
user_data: z.ZodOptional<z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>>;
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
audio_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, z.ZodTypeDef, import("./serialization.ts").JsonValue>>>;
video_parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./serialization.ts").JsonValue, z.ZodTypeDef, import("./serialization.ts").JsonValue>>>;
}, "tags">, "strip", z.ZodTypeAny, {
user_data?: Uint8Array | undefined;
audio_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
video_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
}, {
user_data?: Uint8Array | undefined;
audio_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
video_parameters?: Record<string, import("./serialization.ts").JsonValue> | undefined;
}>;
}, "strip"