UNPKG

camstreamerlib

Version:

Helper library for CamStreamer ACAP applications.

82 lines (81 loc) 2.51 kB
/// <reference types="node" /> import { HttpOptions, IClient } from './internal/common'; export type CamSwitcherAPIOptions = HttpOptions; export type TStreamInfo = { id: string; isTimeoutCustom: boolean; ptz_preset_pos_name: string; repeat: number; timeout: number; video: Record<string, string>; audio: Record<string, string>; }; export type TPlaylistInfo = { channel: string; isFavourite: false; keyboard: object; loop: boolean; niceName: string; sortIndexFavourite: number; sortIndexOverview: number; stream_list: TStreamInfo[]; }; export type TPlaylistList = Record<string, TPlaylistInfo>; export type TClipInfo = { niceName: string; channel: string; keyboard: object; sortIndexOverview: number; }; export type TClipList = Record<string, TClipInfo>; export type TApiClipType = 'audio' | 'video'; export type TClipStorage = 'SD_DISK' | 'FLASH'; export type TPlaylistQueue = { playlist_queue_list: string[]; }; export type TOutputInfo = { rtsp_url: string; ws: string; ws_initial_message: string; }; export type TSilenceChannel = 'mono' | 'stereo'; export type TAvailableCameraList = { camera_list: { name: string; ip: string; }[]; }; export type TStorageInfo = { storage: TClipStorage; writable: boolean; size: number; available: number; }; declare const cgiNames: { camera: string; audio: string; playlist: string; clip: string; tracker: string; }; export type TSourceType = keyof typeof cgiNames; export declare class CamSwitcherAPI { private client; constructor(options?: CamSwitcherAPIOptions | IClient); generateSilence(sampleRate: number, channels: TSilenceChannel): Promise<void>; getIpListFromNetworkCheck(): Promise<TAvailableCameraList>; getMaxFps(source: number): Promise<number>; getStorageInfo(): Promise<TStorageInfo[]>; getOutputInfo(): Promise<TOutputInfo>; getPlaylistList(): Promise<TPlaylistList>; playlistSwitch(playlistName: string): Promise<void>; playlistQueuePush(playlistName: string): Promise<void>; playlistQueueClear(): Promise<void>; playlistQueueList(): Promise<TPlaylistQueue>; playlistQueuePlayNext(): Promise<void>; getClipList(): Promise<TClipList>; addNewClip(file: Buffer, clipType: TApiClipType, storage: TClipStorage, id: string, fileName: string): Promise<void>; removeClip(id: string, storage: TClipStorage): Promise<{}>; private get; } export {};