rework Menu Bar / Rework socketioStore
This commit is contained in:
@@ -1,8 +1,201 @@
|
||||
export interface Todo {
|
||||
id: number;
|
||||
content: string;
|
||||
|
||||
export type SimulationCommands = "start" | "pause" | "resume" | "clear" | "end" | "add";
|
||||
|
||||
export type DeviceCommands= "start_tunnel" | "stop_tunnel" | "shutdown";
|
||||
|
||||
export interface CtrlAttrs {
|
||||
[key: string]: CtrlAttr;
|
||||
}
|
||||
|
||||
export interface CtrlAttr {
|
||||
name: string;
|
||||
cmd: string;
|
||||
cmdClass: string;
|
||||
icon: string;
|
||||
cnfrm: boolean;
|
||||
delay: number;
|
||||
}
|
||||
|
||||
export interface LocationQueue {
|
||||
[key: string]: LocationMark
|
||||
}
|
||||
|
||||
interface LocationMark {
|
||||
loc_id: string;
|
||||
latitude: number | undefined | null;
|
||||
longitude: number | undefined | null;
|
||||
delay?: number | undefined | null;
|
||||
start_time: string | undefined | null;
|
||||
end_time?: string | undefined | null ;
|
||||
}
|
||||
|
||||
export interface SimulationControlResponse {
|
||||
status: string;
|
||||
command: SimulationCommands;
|
||||
loc_id: string;
|
||||
message?: string | undefined;
|
||||
latitude?: number | undefined | null;
|
||||
longitude?: number | undefined | null;
|
||||
delay?: number | undefined | null;
|
||||
start_time?: string | undefined | null;
|
||||
end_time?: string | undefined | null;
|
||||
}
|
||||
|
||||
interface DeviceControlResponse {
|
||||
status: string;
|
||||
command: DeviceCommands;
|
||||
delay?: number;
|
||||
}
|
||||
|
||||
interface StatusUpdate {
|
||||
simulation_active: boolean;
|
||||
set_location_enabled: boolean;
|
||||
queue: number,
|
||||
latitude: number | undefined | null;
|
||||
longitude: number | undefined | null;
|
||||
next_move?: number | undefined | null;
|
||||
queue_list: LocationQueue[]
|
||||
queue_state: string | undefined | null;
|
||||
queue_status: boolean;
|
||||
simulation_task: string | undefined | null;
|
||||
test_mode: boolean
|
||||
tunnel: string | undefined | null;
|
||||
device_count?: number | undefined | null;
|
||||
udid?: string | null;
|
||||
device_name?: string | null | undefined;
|
||||
product_version?: string | null | undefined;
|
||||
phone_number?: string | null | undefined;
|
||||
developer_mode_enabled?: boolean | undefined | null;
|
||||
ddi_mounted?: boolean ;
|
||||
rsd_address?: string | null | undefined;
|
||||
rsd_port?: number | undefined | null;
|
||||
lockdown_trusted_port?: number | undefined | null;
|
||||
lockdown_untrusted_port?: number | undefined | null;
|
||||
lockdown_trusted_reachable?: boolean | undefined | null;
|
||||
lockdown_untrusted_reachable?: boolean | undefined | null;
|
||||
dtservicehub_reachable?: boolean | undefined | null
|
||||
}
|
||||
|
||||
export interface ServerToClientEvents {
|
||||
noArg: () => void;
|
||||
withAck: (a: string, callback: (b: number) => void) => void;
|
||||
simulationStatus: (c: SimulationStatus) => void;
|
||||
status: (d: StatusUpdate) => void;
|
||||
device_status: (d: DeviceStatus) => void;
|
||||
error: (data: ErrorFull) => void;
|
||||
message: (e: string) => void;
|
||||
}
|
||||
|
||||
export interface ClientToServerEvents {
|
||||
message: (e: string, callback: (b: boolean, r: string) => void) => void;
|
||||
simulation_control: (
|
||||
args: {
|
||||
command: SimulationCommands,
|
||||
latitude?: number | null | undefined,
|
||||
longitude?: number | null | undefined,
|
||||
delay?: number | undefined
|
||||
},
|
||||
callback: (response: SimulationControlResponse) => void
|
||||
) => void;
|
||||
device_control: (
|
||||
args: {
|
||||
command: DeviceCommands,
|
||||
delay?: number
|
||||
},
|
||||
callback?: (response: DeviceControlResponse) => void
|
||||
) => void;
|
||||
}
|
||||
|
||||
interface SimulationStatus {
|
||||
status: boolean;
|
||||
data: {
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
start: string;
|
||||
end?: string;
|
||||
next_move?: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface Meta {
|
||||
totalCount: number;
|
||||
}
|
||||
|
||||
|
||||
interface DeviceStatus {
|
||||
device_connected: boolean;
|
||||
device_count: number;
|
||||
udid?: string | null;
|
||||
device_name?: string | null;
|
||||
product_version?: string | null;
|
||||
phone_number?: string | null;
|
||||
developer_mode_enabled?: boolean;
|
||||
ddi_mounted?: boolean;
|
||||
rsd_address?: string | null;
|
||||
rsd_port?: number;
|
||||
lockdown_trusted_port?: number;
|
||||
lockdown_untrusted_port?: number;
|
||||
lockdown_trusted_reachable?: boolean;
|
||||
lockdown_untrusted_reachable?: boolean;
|
||||
dtservicehub_reachable?: boolean;
|
||||
}
|
||||
|
||||
export type Control = DeviceControl | SimulationControl;
|
||||
|
||||
export interface DeviceControl {
|
||||
id: number;
|
||||
name: string;
|
||||
cmd: DeviceCommands
|
||||
cmdClass: "device_control"
|
||||
icon: string;
|
||||
confirm: boolean;
|
||||
}
|
||||
|
||||
export interface SimulationControl {
|
||||
id: number;
|
||||
name: string;
|
||||
cmd: SimulationCommands;
|
||||
cmdClass: 'simulation_control';
|
||||
icon: string;
|
||||
confirm: boolean;
|
||||
}
|
||||
|
||||
export interface coords {
|
||||
lat: number;
|
||||
lng: number;
|
||||
}
|
||||
|
||||
import type { OpenStreetMapProvider } from 'leaflet-geosearch';
|
||||
export interface SearchControlProps {
|
||||
provider: OpenStreetMapProvider;
|
||||
showMarker: boolean;
|
||||
autoClose: boolean;
|
||||
updateMap: boolean;
|
||||
showPopup: boolean;
|
||||
style: 'button' | 'bar';
|
||||
acceptAutoLoad: boolean;
|
||||
autoComplete: boolean;
|
||||
autoCompleteDelay: number;
|
||||
retainZoomLevel: boolean;
|
||||
animateZoom: boolean;
|
||||
keepResult: boolean;
|
||||
}
|
||||
|
||||
export interface CurrentLocation {
|
||||
loc_id: string;
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
next_move?: number | null
|
||||
}
|
||||
|
||||
export interface NextLocation {
|
||||
loc_id: string;
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
time_at_location?: number | null;
|
||||
}
|
||||
|
||||
export interface ErrorFull {
|
||||
type: string;
|
||||
error: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user