camstreamerlib
Version:
Helper library for CamStreamer ACAP applications.
99 lines (98 loc) • 3.29 kB
TypeScript
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import { WritableStream } from 'node:stream/web';
import { HttpOptions, IClient } from './internal/common';
export type CameraVapixOptions = HttpOptions;
export type TApplicationList = {
reply: {
$: {
result: string;
};
application: {
$: TApplication;
}[];
};
};
export type TApplication = {
Name: string;
NiceName: string;
Vendor: string;
Version: string;
ApplicationID?: string;
License: string;
Status: string;
ConfigurationPage?: string;
VendorHomePage?: string;
LicenseName?: string;
};
export type TGuardTour = {
id: string;
camNbr: unknown;
name: string;
randomEnabled: unknown;
running: string;
timeBetweenSequences: unknown;
tour: {
moveSpeed: unknown;
position: unknown;
presetNbr: unknown;
waitTime: unknown;
waitTimeViewType: unknown;
}[];
};
export type TAudioSampleRates = {
sampleRate: number;
bitRates: number[];
};
export type TSDCardInfo = {
available: boolean;
totalSize: number;
freeSize: number;
};
export type TPtzOverview = Record<number, {
id: number;
name: string;
}[]>;
export type TCameraPTZItem = {
name: string;
id: number;
data: TCameraPTZItemData;
};
export type TCameraPTZItemData = {
pan?: number;
tilt?: number;
zoom?: number;
};
export declare class CameraVapix {
private client;
constructor(options?: CameraVapixOptions | IClient);
vapixGet(path: string, parameters?: Record<string, string>): Promise<Response>;
vapixPost(path: string, data: string | Buffer | FormData, contentType?: string): Promise<Response>;
getCameraImage(camera: string, compression: string, resolution: string, outputStream: WritableStream): Promise<WritableStream<any>>;
getEventDeclarations(): Promise<string>;
getSupportedAudioSampleRate(): Promise<TAudioSampleRates[]>;
checkSdCard(): Promise<TSDCardInfo>;
downloadCameraReport(): Promise<Response>;
getMaxFps(channel: number): Promise<number>;
getTimezone(): Promise<string>;
getHeaders(): Promise<Record<string, string>>;
setHeaders(headers: Record<string, string>): Promise<Response>;
private parseParameters;
getParameterGroup(groupNames: string): Promise<Record<string, string>>;
setParameter(params: Record<string, string>): Promise<Response>;
getGuardTourList(): Promise<TGuardTour[]>;
setGuardTourEnabled(guardTourID: string, enable: boolean): Promise<Response>;
private parsePtz;
private parseCameraPtzResponse;
getPTZPresetList(channel: number): Promise<string[]>;
listPtzVideoSourceOverview(): Promise<TPtzOverview>;
goToPreset(channel: number, presetName: string): Promise<Response>;
getPtzPosition(camera: number): Promise<TCameraPTZItemData>;
getInputState(port: number): Promise<boolean>;
setOutputState(port: number, active: boolean): Promise<Response>;
getApplicationList(): Promise<TApplication[]>;
startApplication(applicationID: string): Promise<void>;
restartApplication(applicationID: string): Promise<void>;
stopApplication(applicationID: string): Promise<void>;
}