UNPKG

camstreamerlib

Version:

Helper library for CamStreamer ACAP applications.

283 lines (282 loc) 7.01 kB
import { z } from 'zod'; declare const csEventsDataSchema: 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<"StreamState">; streamID: z.ZodNumber; isStreaming: z.ZodBoolean; active: z.ZodBoolean; enabled: z.ZodBoolean; }, "strip", z.ZodTypeAny, { type: "StreamState"; enabled: boolean; active: boolean; streamID: number; isStreaming: boolean; }, { type: "StreamState"; enabled: boolean; active: boolean; streamID: number; isStreaming: boolean; }>, z.ZodObject<{ type: z.ZodLiteral<"CS_API_SUCCESS">; apiCall: z.ZodString; message: z.ZodString; streamID: z.ZodNumber; }, "strip", z.ZodTypeAny, { message: string; type: "CS_API_SUCCESS"; streamID: number; apiCall: string; }, { message: string; type: "CS_API_SUCCESS"; streamID: number; apiCall: string; }>, z.ZodObject<{ type: z.ZodLiteral<"CS_API_ERROR">; apiCall: z.ZodString; message: z.ZodString; streamID: z.ZodNumber; code: z.ZodString; }, "strip", z.ZodTypeAny, { code: string; message: string; type: "CS_API_ERROR"; streamID: number; apiCall: string; }, { code: string; message: string; type: "CS_API_ERROR"; streamID: number; apiCall: string; }>, z.ZodObject<{ type: z.ZodLiteral<"PortChanged">; port: z.ZodNumber; value: z.ZodBoolean; }, "strip", z.ZodTypeAny, { value: boolean; type: "PortChanged"; port: number; }, { value: boolean; type: "PortChanged"; port: number; }>]>; export declare const csEventsSchema: 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<"StreamState">; streamID: z.ZodNumber; isStreaming: z.ZodBoolean; active: z.ZodBoolean; enabled: z.ZodBoolean; }, "strip", z.ZodTypeAny, { type: "StreamState"; enabled: boolean; active: boolean; streamID: number; isStreaming: boolean; }, { type: "StreamState"; enabled: boolean; active: boolean; streamID: number; isStreaming: boolean; }>, z.ZodObject<{ type: z.ZodLiteral<"CS_API_SUCCESS">; apiCall: z.ZodString; message: z.ZodString; streamID: z.ZodNumber; }, "strip", z.ZodTypeAny, { message: string; type: "CS_API_SUCCESS"; streamID: number; apiCall: string; }, { message: string; type: "CS_API_SUCCESS"; streamID: number; apiCall: string; }>, z.ZodObject<{ type: z.ZodLiteral<"CS_API_ERROR">; apiCall: z.ZodString; message: z.ZodString; streamID: z.ZodNumber; code: z.ZodString; }, "strip", z.ZodTypeAny, { code: string; message: string; type: "CS_API_ERROR"; streamID: number; apiCall: string; }, { code: string; message: string; type: "CS_API_ERROR"; streamID: number; apiCall: string; }>, z.ZodObject<{ type: z.ZodLiteral<"PortChanged">; port: z.ZodNumber; value: z.ZodBoolean; }, "strip", z.ZodTypeAny, { value: boolean; type: "PortChanged"; port: number; }, { value: boolean; type: "PortChanged"; port: number; }>]>; }, "strip", z.ZodTypeAny, { type: "init"; data: { type: "authorization"; state: string; } | { type: "StreamState"; enabled: boolean; active: boolean; streamID: number; isStreaming: boolean; } | { message: string; type: "CS_API_SUCCESS"; streamID: number; apiCall: string; } | { code: string; message: string; type: "CS_API_ERROR"; streamID: number; apiCall: string; } | { value: boolean; type: "PortChanged"; port: number; }; }, { type: "init"; data: { type: "authorization"; state: string; } | { type: "StreamState"; enabled: boolean; active: boolean; streamID: number; isStreaming: boolean; } | { message: string; type: "CS_API_SUCCESS"; streamID: number; apiCall: string; } | { code: string; message: string; type: "CS_API_ERROR"; streamID: number; apiCall: string; } | { value: boolean; type: "PortChanged"; port: number; }; }>, 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<"StreamState">; streamID: z.ZodNumber; isStreaming: z.ZodBoolean; active: z.ZodBoolean; enabled: z.ZodBoolean; }, "strip", z.ZodTypeAny, { type: "StreamState"; enabled: boolean; active: boolean; streamID: number; isStreaming: boolean; }, { type: "StreamState"; enabled: boolean; active: boolean; streamID: number; isStreaming: boolean; }>, z.ZodObject<{ type: z.ZodLiteral<"CS_API_SUCCESS">; apiCall: z.ZodString; message: z.ZodString; streamID: z.ZodNumber; }, "strip", z.ZodTypeAny, { message: string; type: "CS_API_SUCCESS"; streamID: number; apiCall: string; }, { message: string; type: "CS_API_SUCCESS"; streamID: number; apiCall: string; }>, z.ZodObject<{ type: z.ZodLiteral<"CS_API_ERROR">; apiCall: z.ZodString; message: z.ZodString; streamID: z.ZodNumber; code: z.ZodString; }, "strip", z.ZodTypeAny, { code: string; message: string; type: "CS_API_ERROR"; streamID: number; apiCall: string; }, { code: string; message: string; type: "CS_API_ERROR"; streamID: number; apiCall: string; }>, z.ZodObject<{ type: z.ZodLiteral<"PortChanged">; port: z.ZodNumber; value: z.ZodBoolean; }, "strip", z.ZodTypeAny, { value: boolean; type: "PortChanged"; port: number; }, { value: boolean; type: "PortChanged"; port: number; }>]>; export type TCamStreamerEvent = z.infer<typeof csEventsDataSchema>; export type TCamStreamerEventType = TCamStreamerEvent['type']; export type TCamStreamerEventOfType<T extends TCamStreamerEventType> = Extract<TCamStreamerEvent, { type: T; }>; export {};