@4players/odin-common
Version:
A collection of commonly used type definitions and utility functions across ODIN web projects
1,299 lines (1,298 loc) • 64.3 kB
TypeScript
import * as z from 'zod';
export type Notifications = Record<string, z.ZodTypeAny>;
export declare const MainNotificationSchema: z.ZodObject<{
name: z.ZodLiteral<"WebRtcUpdate">;
properties: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
kind: z.ZodLiteral<"Sdp">;
type: z.ZodEnum<["Answer", "Offer"]>;
sdp: z.ZodString;
media_map: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodString], null>, "many">;
}, "strip", z.ZodTypeAny, {
type: "Answer" | "Offer";
kind: "Sdp";
sdp: string;
media_map: [number, string][];
}, {
type: "Answer" | "Offer";
kind: "Sdp";
sdp: string;
media_map: [number, string][];
}>, z.ZodObject<{
kind: z.ZodLiteral<"Trickle">;
candidate: z.ZodString;
spd_mid: z.ZodOptional<z.ZodString>;
spd_mline_index: z.ZodOptional<z.ZodNumber>;
username_fragment: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
}, "strip", z.ZodTypeAny, {
candidate: string;
kind: "Trickle";
spd_mid?: string | undefined;
spd_mline_index?: number | undefined;
username_fragment?: string | null | undefined;
}, {
candidate: string;
kind: "Trickle";
spd_mid?: string | undefined;
spd_mline_index?: number | undefined;
username_fragment?: string | null | undefined;
}>, z.ZodObject<{
kind: z.ZodLiteral<"TrickleFinished">;
}, "strip", z.ZodTypeAny, {
kind: "TrickleFinished";
}, {
kind: "TrickleFinished";
}>]>;
}, "strip", z.ZodTypeAny, {
name: "WebRtcUpdate";
properties: {
type: "Answer" | "Offer";
kind: "Sdp";
sdp: string;
media_map: [number, string][];
} | {
candidate: string;
kind: "Trickle";
spd_mid?: string | undefined;
spd_mline_index?: number | undefined;
username_fragment?: string | null | undefined;
} | {
kind: "TrickleFinished";
};
}, {
name: "WebRtcUpdate";
properties: {
type: "Answer" | "Offer";
kind: "Sdp";
sdp: string;
media_map: [number, string][];
} | {
candidate: string;
kind: "Trickle";
spd_mid?: string | undefined;
spd_mline_index?: number | undefined;
username_fragment?: string | null | undefined;
} | {
kind: "TrickleFinished";
};
}>;
export type MainNotification = z.infer<typeof MainNotificationSchema>;
export declare const MainNotificationsRpc: {
WebRtcUpdate: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
kind: z.ZodLiteral<"Sdp">;
type: z.ZodEnum<["Answer", "Offer"]>;
sdp: z.ZodString;
media_map: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodString], null>, "many">;
}, "strip", z.ZodTypeAny, {
type: "Answer" | "Offer";
kind: "Sdp";
sdp: string;
media_map: [number, string][];
}, {
type: "Answer" | "Offer";
kind: "Sdp";
sdp: string;
media_map: [number, string][];
}>, z.ZodObject<{
kind: z.ZodLiteral<"Trickle">;
candidate: z.ZodString;
spd_mid: z.ZodOptional<z.ZodString>;
spd_mline_index: z.ZodOptional<z.ZodNumber>;
username_fragment: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNull]>>;
}, "strip", z.ZodTypeAny, {
candidate: string;
kind: "Trickle";
spd_mid?: string | undefined;
spd_mline_index?: number | undefined;
username_fragment?: string | null | undefined;
}, {
candidate: string;
kind: "Trickle";
spd_mid?: string | undefined;
spd_mline_index?: number | undefined;
username_fragment?: string | null | undefined;
}>, z.ZodObject<{
kind: z.ZodLiteral<"TrickleFinished">;
}, "strip", z.ZodTypeAny, {
kind: "TrickleFinished";
}, {
kind: "TrickleFinished";
}>]>;
};
export type MainNotifications = typeof MainNotificationsRpc;
export declare const RoomNotificationSchema: z.ZodUnion<[z.ZodObject<{
name: z.ZodLiteral<"RoomStatusChanged">;
properties: 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;
}>;
}, "strip", z.ZodTypeAny, {
name: "RoomStatusChanged";
properties: {
status: "Joined" | "Joining" | "Closed";
message?: string | undefined;
};
}, {
name: "RoomStatusChanged";
properties: {
status: "Joined" | "Joining" | "Closed";
message?: string | undefined;
};
}>, z.ZodObject<{
name: z.ZodLiteral<"RoomUpdated">;
properties: 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;
})[];
}>;
}, "strip", z.ZodTypeAny, {
name: "RoomUpdated";
properties: {
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;
})[];
};
}, {
name: "RoomUpdated";
properties: {
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;
})[];
};
}>, z.ZodObject<{
name: z.ZodLiteral<"PeerUpdated">;
properties: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
kind: z.ZodLiteral<"UserDataChanged">;
peer_id: z.ZodNumber;
user_data: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
}, "strip", z.ZodTypeAny, {
kind: "UserDataChanged";
user_data: Uint8Array;
peer_id: number;
}, {
kind: "UserDataChanged";
user_data: Uint8Array;
peer_id: number;
}>, z.ZodObject<{
kind: z.ZodLiteral<"MediaStarted">;
peer_id: z.ZodNumber;
media: 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;
};
}>;
}, "strip", z.ZodTypeAny, {
media: {
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: "MediaStarted";
peer_id: number;
}, {
media: {
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: "MediaStarted";
peer_id: number;
}>, z.ZodObject<{
kind: z.ZodLiteral<"MediaStopped">;
peer_id: z.ZodNumber;
media_id: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
kind: "MediaStopped";
peer_id: number;
media_id: number;
}, {
kind: "MediaStopped";
peer_id: number;
media_id: number;
}>]>;
}, "strip", z.ZodTypeAny, {
name: "PeerUpdated";
properties: {
kind: "UserDataChanged";
user_data: Uint8Array;
peer_id: number;
} | {
media: {
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: "MediaStarted";
peer_id: number;
} | {
kind: "MediaStopped";
peer_id: number;
media_id: number;
};
}, {
name: "PeerUpdated";
properties: {
kind: "UserDataChanged";
user_data: Uint8Array;
peer_id: number;
} | {
media: {
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: "MediaStarted";
peer_id: number;
} | {
kind: "MediaStopped";
peer_id: number;
media_id: number;
};
}>, z.ZodObject<{
name: z.ZodLiteral<"MessageReceived">;
properties: z.ZodObject<{
sender_peer_id: z.ZodNumber;
message: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>;
}, "strip", z.ZodTypeAny, {
message: Uint8Array;
sender_peer_id: number;
}, {
message: Uint8Array;
sender_peer_id: number;
}>;
}, "strip", z.ZodTypeAny, {
name: "MessageReceived";
properties: {
message: Uint8Array;
sender_peer_id: number;
};
}, {
name: "MessageReceived";
properties: {
message: Uint8Array;
sender_peer_id: number;
};
}>]>;
export type RoomNotification = z.infer<typeof RoomNotificationSchema>;
export declare const RoomNotificationsRpc: {
RoomStatusChanged: 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;
}>;
RoomUpdated: 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;