Files
Aiq-Lite-UI/src/utils/types.ts

156 lines
3.1 KiB
TypeScript
Raw Normal View History

export type SightingType = {
ref: number;
SaFID: string;
overviewUrl: string;
plateUrlInfrared: string;
plateUrlColour: string;
vrm: string;
vrmSecondary: string;
countryCode: string;
timeStamp: string;
detailsUrl: string;
overviewPlateRect?: [number, number, number, number];
plateTrack?: [number, number, number, number][];
make: string;
model: string;
color: string;
category: string;
charHeight: string;
seenCount: string;
timeStampMillis: number;
motion: string;
debug: string;
srcCam: number;
locationName: string;
laneID: string;
plateSize: string;
overviewSize: string;
radarSpeed: string;
trackSpeed: string;
metadata?: Metadata;
};
export type Metadata = {
npedJSON: NpedJSON;
"hotlist-matches": HotlistMatches;
hotlistMatches: HotlistMatches;
};
export type HotlistMatches = {
Hotlist0: boolean;
Hotlist1: boolean;
Hotlist2: boolean;
};
export type NpedJSON = {
status_code: number;
reason_phrase: string;
"NPED CATEGORY": "A" | "B" | "C" | "D";
"MOT STATUS": boolean;
"TAX STATUS": boolean;
vrm: string;
"INSURANCE STATUS": string;
};
export type Region = {
name: string;
brushColour: string;
};
export type PaintedCell = {
colour: string;
region: Region;
};
export type CameraSettings = {
cameraMode: number;
mode: number;
imageSize: { width: number; height: number };
cameraControls: {
cameraControlMode: "auto" | "manual" | "shutter priority";
auto: {
minShutter: string;
maxShutter: string;
maxGain: string;
exposureCompensation: string;
};
manual: {
fixShutter: string;
fixGain: string;
fixIris: string;
};
shutterPriority: {
fixShutter: string;
maxGain: string;
exposureCompensation: string;
};
};
regionPainter: {
brushSize: number;
paintMode: "painter" | "eraser";
paintedCells: Map<string, PaintedCell>;
regions: Region[];
selectedRegionIndex: number;
};
};
export type CameraSettingsAction =
| {
type: "SET_MODE";
payload: number;
}
| {
type: "SET_IMAGE_SIZE";
payload: { width: number; height: number };
}
| {
type: "SET_CAMERA_MODE";
payload: number;
}
| {
type: "SET_REGION_PAINTMODE";
payload: "painter" | "eraser";
}
| { type: "SET_SELECTED_REGION_INDEX"; payload: number }
| {
type: "SET_CAMERA_CONTROLS";
payload: CameraSettings["cameraControls"];
}
| {
type: "SET_BRUSH_SIZE";
payload: number;
}
| {
type: "RESET_REGION_PAINTER";
};
export type CameraStatus = {
id: string;
groupID: string;
tags: string[];
};
export type SystemHealth = {
UptimeHumane: string;
StartTimeHumane: string;
Status: CameraStatus[];
};
export type StoreData = {
totalPending: number;
totalActive: number;
totalSent: number;
totalReceived: number;
totalLost: number;
sanityCheck: boolean;
sanityCheckFormula: string;
};
export type ColourData = {
id: string | number;
cells: number[][];
};
export type ColourDetectionPayload = {
regions: ColourData[];
};