摄像规则类型定义

This commit is contained in:
龚皓 2024-11-22 17:56:27 +08:00
parent 60f2a7f196
commit 9c5122f143
2 changed files with 39 additions and 0 deletions

21
src/types/CameraData.ts Normal file
View File

@ -0,0 +1,21 @@
import type { RuleData } from '@/types/RuleData';
export interface CameraData {
id?: number;
name?: string;
// uri?: string;
mode?: "on" | "off";
// status?: string;
// detect_params?: object;
// default_params?: object;
// should_push?: boolean;
// config_params?: object;
// sampling?: boolean;
// note?: object;
// snapshot?: string;
// remote_id?: number;
// raw_address?: string;
// ip?: string;
// port?: number;
rules?: RuleData[] | {};
}

18
src/types/RuleData.ts Normal file
View File

@ -0,0 +1,18 @@
export interface RuleData {
id: number;
camera: number;
name?: string;
// mode?: string;
mode?: 'on' | 'off' | 'schedule';
// algo?: string;
// params?: object;
// params_base?: string;
// unique_id?: string;
// event_types?: Record<string, string>;
schedule?: {
type: string;
time_slots?: Array<[number, number]>;
// week_day?: string;
} | {};
}