UNPKG

camstreamerlib

Version:

Helper library for CamStreamer ACAP applications.

569 lines (568 loc) 17.5 kB
import { z } from 'zod'; declare const cswEventsDataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"authorization">; state: z.ZodString; }, "strip", z.ZodTypeAny, { type: "authorization"; state: string; }, { type: "authorization"; state: string; }>, z.ZodObject<{ type: z.ZodLiteral<"PlaylistSwitch">; playlist_name: z.ZodString; }, "strip", z.ZodTypeAny, { type: "PlaylistSwitch"; playlist_name: string; }, { type: "PlaylistSwitch"; playlist_name: string; }>, z.ZodObject<{ type: z.ZodLiteral<"StreamAvailable">; stream_name: z.ZodString; state: z.ZodBoolean; }, "strip", z.ZodTypeAny, { type: "StreamAvailable"; stream_name: string; state: boolean; }, { type: "StreamAvailable"; stream_name: string; state: boolean; }>, z.ZodObject<{ type: z.ZodLiteral<"StreamSwitchAudio">; stream_name: z.ZodOptional<z.ZodString>; clip_name: z.ZodOptional<z.ZodString>; master_audio: z.ZodBoolean; }, "strip", z.ZodTypeAny, { type: "StreamSwitchAudio"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; }, { type: "StreamSwitchAudio"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"StreamSwitchVideoError">; playlist_name: z.ZodString; playlist_active_stream: z.ZodNumber; stream_name: z.ZodOptional<z.ZodString>; clip_name: z.ZodOptional<z.ZodString>; info: z.ZodString; }, "strip", z.ZodTypeAny, { type: "StreamSwitchVideoError"; playlist_name: string; playlist_active_stream: number; info: string; stream_name?: string | undefined; clip_name?: string | undefined; }, { type: "StreamSwitchVideoError"; playlist_name: string; playlist_active_stream: number; info: string; stream_name?: string | undefined; clip_name?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"StreamSwitchAudioError">; stream_name: z.ZodOptional<z.ZodString>; clip_name: z.ZodOptional<z.ZodString>; master_audio: z.ZodBoolean; }, "strip", z.ZodTypeAny, { type: "StreamSwitchAudioError"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; }, { type: "StreamSwitchAudioError"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"StreamSwitchVideo">; playlist_active_stream: z.ZodNumber; stream_name: z.ZodOptional<z.ZodString>; playlist_name: z.ZodOptional<z.ZodString>; clip_name: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: "StreamSwitchVideo"; playlist_active_stream: number; stream_name?: string | undefined; clip_name?: string | undefined; playlist_name?: string | undefined; }, { type: "StreamSwitchVideo"; playlist_active_stream: number; stream_name?: string | undefined; clip_name?: string | undefined; playlist_name?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"PlaylistQueueChange">; queue: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { type: "PlaylistQueueChange"; queue: string[]; }, { type: "PlaylistQueueChange"; queue: string[]; }>, z.ZodObject<{ type: z.ZodLiteral<"ClipUpload">; clip_name: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: "ClipUpload"; clip_name?: string | undefined; }, { type: "ClipUpload"; clip_name?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"SwitcherStop">; default_playlist_id: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: "SwitcherStop"; default_playlist_id?: string | undefined; }, { type: "SwitcherStop"; default_playlist_id?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"SwitcherStart">; default_playlist_id: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: "SwitcherStart"; default_playlist_id?: string | undefined; }, { type: "SwitcherStart"; default_playlist_id?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"MediaServerStarted">; }, "strip", z.ZodTypeAny, { type: "MediaServerStarted"; }, { type: "MediaServerStarted"; }>, z.ZodObject<{ type: z.ZodLiteral<"ClipRemove">; clip_name: z.ZodString; }, "strip", z.ZodTypeAny, { type: "ClipRemove"; clip_name: string; }, { type: "ClipRemove"; clip_name: string; }>]>; export declare const cswEventsSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"init">; data: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"authorization">; state: z.ZodString; }, "strip", z.ZodTypeAny, { type: "authorization"; state: string; }, { type: "authorization"; state: string; }>, z.ZodObject<{ type: z.ZodLiteral<"PlaylistSwitch">; playlist_name: z.ZodString; }, "strip", z.ZodTypeAny, { type: "PlaylistSwitch"; playlist_name: string; }, { type: "PlaylistSwitch"; playlist_name: string; }>, z.ZodObject<{ type: z.ZodLiteral<"StreamAvailable">; stream_name: z.ZodString; state: z.ZodBoolean; }, "strip", z.ZodTypeAny, { type: "StreamAvailable"; stream_name: string; state: boolean; }, { type: "StreamAvailable"; stream_name: string; state: boolean; }>, z.ZodObject<{ type: z.ZodLiteral<"StreamSwitchAudio">; stream_name: z.ZodOptional<z.ZodString>; clip_name: z.ZodOptional<z.ZodString>; master_audio: z.ZodBoolean; }, "strip", z.ZodTypeAny, { type: "StreamSwitchAudio"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; }, { type: "StreamSwitchAudio"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"StreamSwitchVideoError">; playlist_name: z.ZodString; playlist_active_stream: z.ZodNumber; stream_name: z.ZodOptional<z.ZodString>; clip_name: z.ZodOptional<z.ZodString>; info: z.ZodString; }, "strip", z.ZodTypeAny, { type: "StreamSwitchVideoError"; playlist_name: string; playlist_active_stream: number; info: string; stream_name?: string | undefined; clip_name?: string | undefined; }, { type: "StreamSwitchVideoError"; playlist_name: string; playlist_active_stream: number; info: string; stream_name?: string | undefined; clip_name?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"StreamSwitchAudioError">; stream_name: z.ZodOptional<z.ZodString>; clip_name: z.ZodOptional<z.ZodString>; master_audio: z.ZodBoolean; }, "strip", z.ZodTypeAny, { type: "StreamSwitchAudioError"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; }, { type: "StreamSwitchAudioError"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"StreamSwitchVideo">; playlist_active_stream: z.ZodNumber; stream_name: z.ZodOptional<z.ZodString>; playlist_name: z.ZodOptional<z.ZodString>; clip_name: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: "StreamSwitchVideo"; playlist_active_stream: number; stream_name?: string | undefined; clip_name?: string | undefined; playlist_name?: string | undefined; }, { type: "StreamSwitchVideo"; playlist_active_stream: number; stream_name?: string | undefined; clip_name?: string | undefined; playlist_name?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"PlaylistQueueChange">; queue: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { type: "PlaylistQueueChange"; queue: string[]; }, { type: "PlaylistQueueChange"; queue: string[]; }>, z.ZodObject<{ type: z.ZodLiteral<"ClipUpload">; clip_name: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: "ClipUpload"; clip_name?: string | undefined; }, { type: "ClipUpload"; clip_name?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"SwitcherStop">; default_playlist_id: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: "SwitcherStop"; default_playlist_id?: string | undefined; }, { type: "SwitcherStop"; default_playlist_id?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"SwitcherStart">; default_playlist_id: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: "SwitcherStart"; default_playlist_id?: string | undefined; }, { type: "SwitcherStart"; default_playlist_id?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"MediaServerStarted">; }, "strip", z.ZodTypeAny, { type: "MediaServerStarted"; }, { type: "MediaServerStarted"; }>, z.ZodObject<{ type: z.ZodLiteral<"ClipRemove">; clip_name: z.ZodString; }, "strip", z.ZodTypeAny, { type: "ClipRemove"; clip_name: string; }, { type: "ClipRemove"; clip_name: string; }>]>; }, "strip", z.ZodTypeAny, { type: "init"; data: { type: "authorization"; state: string; } | { type: "PlaylistSwitch"; playlist_name: string; } | { type: "StreamAvailable"; stream_name: string; state: boolean; } | { type: "StreamSwitchAudio"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; } | { type: "StreamSwitchVideoError"; playlist_name: string; playlist_active_stream: number; info: string; stream_name?: string | undefined; clip_name?: string | undefined; } | { type: "StreamSwitchAudioError"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; } | { type: "StreamSwitchVideo"; playlist_active_stream: number; stream_name?: string | undefined; clip_name?: string | undefined; playlist_name?: string | undefined; } | { type: "PlaylistQueueChange"; queue: string[]; } | { type: "ClipUpload"; clip_name?: string | undefined; } | { type: "SwitcherStop"; default_playlist_id?: string | undefined; } | { type: "SwitcherStart"; default_playlist_id?: string | undefined; } | { type: "MediaServerStarted"; } | { type: "ClipRemove"; clip_name: string; }; }, { type: "init"; data: { type: "authorization"; state: string; } | { type: "PlaylistSwitch"; playlist_name: string; } | { type: "StreamAvailable"; stream_name: string; state: boolean; } | { type: "StreamSwitchAudio"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; } | { type: "StreamSwitchVideoError"; playlist_name: string; playlist_active_stream: number; info: string; stream_name?: string | undefined; clip_name?: string | undefined; } | { type: "StreamSwitchAudioError"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; } | { type: "StreamSwitchVideo"; playlist_active_stream: number; stream_name?: string | undefined; clip_name?: string | undefined; playlist_name?: string | undefined; } | { type: "PlaylistQueueChange"; queue: string[]; } | { type: "ClipUpload"; clip_name?: string | undefined; } | { type: "SwitcherStop"; default_playlist_id?: string | undefined; } | { type: "SwitcherStart"; default_playlist_id?: string | undefined; } | { type: "MediaServerStarted"; } | { type: "ClipRemove"; clip_name: string; }; }>, z.ZodObject<{ type: z.ZodLiteral<"authorization">; state: z.ZodString; }, "strip", z.ZodTypeAny, { type: "authorization"; state: string; }, { type: "authorization"; state: string; }>, z.ZodObject<{ type: z.ZodLiteral<"PlaylistSwitch">; playlist_name: z.ZodString; }, "strip", z.ZodTypeAny, { type: "PlaylistSwitch"; playlist_name: string; }, { type: "PlaylistSwitch"; playlist_name: string; }>, z.ZodObject<{ type: z.ZodLiteral<"StreamAvailable">; stream_name: z.ZodString; state: z.ZodBoolean; }, "strip", z.ZodTypeAny, { type: "StreamAvailable"; stream_name: string; state: boolean; }, { type: "StreamAvailable"; stream_name: string; state: boolean; }>, z.ZodObject<{ type: z.ZodLiteral<"StreamSwitchAudio">; stream_name: z.ZodOptional<z.ZodString>; clip_name: z.ZodOptional<z.ZodString>; master_audio: z.ZodBoolean; }, "strip", z.ZodTypeAny, { type: "StreamSwitchAudio"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; }, { type: "StreamSwitchAudio"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"StreamSwitchVideoError">; playlist_name: z.ZodString; playlist_active_stream: z.ZodNumber; stream_name: z.ZodOptional<z.ZodString>; clip_name: z.ZodOptional<z.ZodString>; info: z.ZodString; }, "strip", z.ZodTypeAny, { type: "StreamSwitchVideoError"; playlist_name: string; playlist_active_stream: number; info: string; stream_name?: string | undefined; clip_name?: string | undefined; }, { type: "StreamSwitchVideoError"; playlist_name: string; playlist_active_stream: number; info: string; stream_name?: string | undefined; clip_name?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"StreamSwitchAudioError">; stream_name: z.ZodOptional<z.ZodString>; clip_name: z.ZodOptional<z.ZodString>; master_audio: z.ZodBoolean; }, "strip", z.ZodTypeAny, { type: "StreamSwitchAudioError"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; }, { type: "StreamSwitchAudioError"; master_audio: boolean; stream_name?: string | undefined; clip_name?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"StreamSwitchVideo">; playlist_active_stream: z.ZodNumber; stream_name: z.ZodOptional<z.ZodString>; playlist_name: z.ZodOptional<z.ZodString>; clip_name: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: "StreamSwitchVideo"; playlist_active_stream: number; stream_name?: string | undefined; clip_name?: string | undefined; playlist_name?: string | undefined; }, { type: "StreamSwitchVideo"; playlist_active_stream: number; stream_name?: string | undefined; clip_name?: string | undefined; playlist_name?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"PlaylistQueueChange">; queue: z.ZodArray<z.ZodString, "many">; }, "strip", z.ZodTypeAny, { type: "PlaylistQueueChange"; queue: string[]; }, { type: "PlaylistQueueChange"; queue: string[]; }>, z.ZodObject<{ type: z.ZodLiteral<"ClipUpload">; clip_name: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: "ClipUpload"; clip_name?: string | undefined; }, { type: "ClipUpload"; clip_name?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"SwitcherStop">; default_playlist_id: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: "SwitcherStop"; default_playlist_id?: string | undefined; }, { type: "SwitcherStop"; default_playlist_id?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"SwitcherStart">; default_playlist_id: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { type: "SwitcherStart"; default_playlist_id?: string | undefined; }, { type: "SwitcherStart"; default_playlist_id?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"MediaServerStarted">; }, "strip", z.ZodTypeAny, { type: "MediaServerStarted"; }, { type: "MediaServerStarted"; }>, z.ZodObject<{ type: z.ZodLiteral<"ClipRemove">; clip_name: z.ZodString; }, "strip", z.ZodTypeAny, { type: "ClipRemove"; clip_name: string; }, { type: "ClipRemove"; clip_name: string; }>]>; export type TCamSwitcherEvent = z.infer<typeof cswEventsDataSchema>; export type TCamSwitcherEventType = TCamSwitcherEvent['type']; export type TCamSwitcherEventOfType<T extends TCamSwitcherEventType> = Extract<TCamSwitcherEvent, { type: T; }>; export {};