UNPKG

camstreamerlib

Version:

Helper library for CamStreamer ACAP applications.

329 lines (328 loc) 11.6 kB
import { HttpOptions } from '../internal/types'; import { z } from 'zod'; import { widgetListSchema, widgetsSchema } from '../models/CamOverlayAPI/widgetsSchema'; import { fileListSchema, fileSchema, storageSchema } from '../models/CamOverlayAPI/fileSchema'; import { customGraphicsSchema, fieldSchema } from '../models/CamOverlayAPI/customGraphicsSchema'; import { infoTickerSchema, accuweatherSchema, ptzCompassSchema, imagesSchema, ptzSchema, pipSchema, screenSharingSchema, webCameraSharingSchema } from '../models/CamOverlayAPI'; export type CamOverlayOptions = HttpOptions; export type TFileType = 'image' | 'font'; export type TCoordinates = 'top_left' | 'top_right' | 'top' | 'bottom_left' | 'bottom_right' | 'bottom' | 'left' | 'right' | 'center' | ''; export type TWidget = z.infer<typeof widgetsSchema>; export type TWidgetList = z.infer<typeof widgetListSchema>; export type TField = z.infer<typeof fieldSchema>; export type TFile = z.infer<typeof fileSchema>; export type TFileList = z.infer<typeof fileListSchema>; export declare enum ImageType { PNG = 0, JPEG = 1 } export type TStorage = z.infer<typeof storageSchema>; export type TInfoticker = z.infer<typeof infoTickerSchema>; export type TAccuweather = z.infer<typeof accuweatherSchema>; export type TPtzCompass = z.infer<typeof ptzCompassSchema>; export type TImages = z.infer<typeof imagesSchema>; export type TPtz = z.infer<typeof ptzSchema>; export type TPip = z.infer<typeof pipSchema>; export type TCustomGraphics = z.infer<typeof customGraphicsSchema>; export type TScreenSharing = z.infer<typeof screenSharingSchema>; export type TWebCameraSharing = z.infer<typeof webCameraSharingSchema>; export declare const isInfoticker: (widget: TWidget) => widget is { name: "infoticker"; enabled: 0 | 1; id: number; width: number; height: number; source: string; automationType: "time" | "manual" | "schedule" | `input${number}`; cameraList: number[]; customName: string; coordSystem: "top" | "bottom"; pos_y: number; textColor: string; font: string; fontSize: number; switchingTime: number; clockType: "12h" | "24h"; showClock: 0 | 1; bgColor: string; weatherLocation: string; weatherLocationName: string; weatherLang: "en-us" | "fr-fr" | "ja-jp" | "pt-pt" | "es-es" | "de-de" | "ko-kr" | "zh-hk" | "zh-cn" | "nl-nl" | "cs-cz" | "ru-ru" | "sv-se"; weatherUnits: "Metric" | "Imperial"; numberOfLines: number; crawlLeft: boolean; crawlSpeed: number; sourceType: "url" | "text"; schedule?: string | undefined; invertInput?: boolean | undefined; camera?: number | undefined; zIndex?: number | undefined; }; export declare const isAccuweather: (widget: TWidget) => widget is { name: "accuweather"; enabled: 0 | 1; id: number; width: number; height: number; automationType: "time" | "manual" | "schedule" | `input${number}`; cameraList: number[]; customName: string; coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right"; pos_x: number; pos_y: number; scale: number; font: string; location: string; locationName: string; title: string; bgStartColor: "237,143,73,0.93" | "0,0,0,0.75" | "31,32,73,0.9" | "76,94,127,0.95"; bgEndColor: "0,0,0,0.75" | "234,181,89,0.93" | "73,96,213,0.9" | "140,150,168,0.95"; clockType: "12h" | "24h"; lang: "en-us" | "fr-fr" | "ja-jp" | "pt-pt" | "es-es" | "de-de" | "ko-kr" | "zh-hk" | "zh-cn" | "nl-nl" | "cs-cz" | "ru-ru" | "sv-se"; units: "Metric" | "Imperial"; layout: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13"; schedule?: string | undefined; invertInput?: boolean | undefined; camera?: number | undefined; zIndex?: number | undefined; }; export declare const isPtzCompass: (widget: TWidget) => widget is { type: "map" | "image" | "compass"; name: "ptzCompass"; enabled: 0 | 1; id: number; width: number; height: number; automationType: "time" | "manual" | "schedule" | `input${number}`; cameraList: number[]; customName: string; coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right"; pos_x: number; pos_y: number; scale: number; image: string; northPan: number; cameraPosX: number; cameraPosY: number; colorScheme: "black" | "white" | "orange"; schedule?: string | undefined; invertInput?: boolean | undefined; camera?: number | undefined; zIndex?: number | undefined; generalLng?: number | undefined; generalLat?: number | undefined; generalZoom?: number | undefined; generalMapType?: string | undefined; generalIframeWidth?: number | undefined; generalIframeHeight?: number | undefined; generalAddress?: string | undefined; }; export declare const isImages: (widget: TWidget) => widget is { name: "images"; enabled: 0 | 1; id: number; width: number; height: number; automationType: "time" | "manual" | "schedule" | `input${number}`; cameraList: number[]; customName: string; overlayList: { duration: number; active: boolean; coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right"; pos_x: number; pos_y: number; imgPath: string; imgName: string; scale: number; fps?: number | undefined; }[]; schedule?: string | undefined; invertInput?: boolean | undefined; camera?: number | undefined; zIndex?: number | undefined; }; export declare const isPtz: (widget: TWidget) => widget is { name: "ptz"; enabled: 0 | 1; id: number; width: number; height: number; automationType: "time" | "manual" | "schedule" | `input${number}`; cameraList: number[]; customName: string; ptz_positions: Record<string, { loop: boolean; overlayList: { duration: number; coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right"; pos_x: number; pos_y: number; imgPath: string; imgName: string; scale: number; }[]; }>; schedule?: string | undefined; invertInput?: boolean | undefined; camera?: number | undefined; zIndex?: number | undefined; }; export declare const isPip: (widget: TWidget) => widget is { name: "pip"; enabled: 0 | 1; id: number; width: number; height: number; fps: number; automationType: "time" | "manual" | "schedule" | `input${number}`; cameraList: number[]; customName: string; coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right"; pos_x: number; pos_y: number; scale: number; screenSize: number; compression: number; source_type: "axis_camera" | "mjpeg_url"; mjpeg_url: string; camera_ip: string; camera_port: number; camera_user: string; camera_pass: string; camera_width: number; camera_height: number; camera_view_area: string; camera_overlay_params: "overlays=off" | "overlays=all" | "overlays=text" | "overlays=image" | "overlays=application"; rotate: 0 | 90 | 180 | 270; dewarping: { enabled: boolean; rectangle: [number, number][]; aspectRatioCorrection: number; }; borderColor: string; borderWidth: number; schedule?: string | undefined; invertInput?: boolean | undefined; camera?: number | undefined; zIndex?: number | undefined; }; export declare const isCustomGraphics: (widget: TWidget) => widget is { name: "customGraphics"; enabled: 0 | 1; id: number; width: number; height: number; automationType: "time" | "manual" | "schedule" | `input${number}`; cameraList: number[]; customName: string; coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right"; pos_x: number; pos_y: number; clockFormat: "12h" | "24h"; background: "custom" | "image"; image: string; customAreaColor: string; customAreaWidth: number; customAreaHeight: number; customAreaCorners: "sharp" | "rounded"; mappingZones: ({ type: "plain"; name: string; pos_x: number; pos_y: number; wrapText: boolean; textLines: number; textWidth: number; textAlign: "A_LEFT" | "A_CENTER" | "A_RIGHT"; textVerticalAlign: "VA_TOP" | "VA_CENTER" | "VA_BOTTOM"; textColor: string; font: string; fontSize: number; switchingTime: number; text?: { source: string; active: boolean; }[] | undefined; } | { type: "countdown"; name: string; pos_x: number; pos_y: number; wrapText: boolean; textLines: number; textWidth: number; textAlign: "A_LEFT" | "A_CENTER" | "A_RIGHT"; textVerticalAlign: "VA_TOP" | "VA_CENTER" | "VA_BOTTOM"; textColor: string; font: string; fontSize: number; switchingTime: number; settings: { startDate: number; targetDate: number; countdown: boolean; countup: boolean; displayDay: boolean; displayHour: boolean; displayMinute: boolean; displaySeconds: boolean; idleText: string; hideZeros: boolean; delimiter: "colon" | "letters"; suffixSeconds: string; suffixMinute: string; suffixHour: string; suffixDay: string; loop: boolean; loopPeriod: number; waitingPeriod: number; }; text?: { source: string; active: boolean; }[] | undefined; })[]; schedule?: string | undefined; invertInput?: boolean | undefined; camera?: number | undefined; zIndex?: number | undefined; }; export declare const isScreenSharing: (widget: TWidget) => widget is { name: "screenSharing"; enabled: 0 | 1; id: number; width: number; height: number; fps: number; automationType: "time" | "manual" | "schedule" | `input${number}`; cameraList: number[]; customName: string; coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right"; pos_x: number; pos_y: number; screenSize: number; schedule?: string | undefined; invertInput?: boolean | undefined; camera?: number | undefined; zIndex?: number | undefined; }; export declare const isWebCameraSharing: (widget: TWidget) => widget is { name: "web_camera"; enabled: 0 | 1; id: number; width: number; height: number; fps: number; automationType: "time" | "manual" | "schedule" | `input${number}`; cameraList: number[]; customName: string; coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right"; pos_x: number; pos_y: number; screenSize: number; schedule?: string | undefined; invertInput?: boolean | undefined; camera?: number | undefined; zIndex?: number | undefined; };