@fleet-frontend/mower-maps
Version:
a mower maps in google maps
145 lines • 4.11 kB
TypeScript
import React from 'react';
import { PathData } from './path';
import { MapData } from './map';
import { RobotStatus } from '../config';
import { RealTimeLocationType, RealTimePartitionType, RealTimeProcessType, RealTimeStatusType } from './realTime';
import { UnitsType } from './utils';
export interface DragState {
x?: number;
y?: number;
rotation?: number;
isDragging?: boolean;
isRotating?: boolean;
}
export interface DragCallbacks {
onDragStart?: (state: DragState) => void;
onDragMove?: (state: DragState) => void;
onDragEnd?: (state: DragState) => void;
}
export interface BaseConfig {
lineWidth?: number;
lineColor?: string;
fillColor?: string;
opacity?: number;
}
export interface BoundaryStyle extends BaseConfig {
mowingLineColor?: string;
}
export interface ObstacleStyle extends BaseConfig {
}
export interface VisionOffStyle extends BaseConfig {
}
export interface DoodleStyle extends BaseConfig {
}
export interface AntennaStyle extends BaseConfig {
radius?: number;
}
export interface ChargingPileStyle extends BaseConfig {
radius?: number;
}
export interface ChannelStyle extends BaseConfig {
bottomLineWidth?: number;
bottomLineColor?: string;
bottomLineOpacity?: number;
}
/**
* 元素样式类型定义
*/
export interface PathStyle extends BaseConfig {
edgeLineColor?: string;
transLineColor?: string;
mowingLineColor?: string;
mowedLineColor?: string;
}
export interface MapConfig {
boundary?: BoundaryStyle;
visionOffArea?: VisionOffStyle;
obstacle?: ObstacleStyle;
chargingPile?: ChargingPileStyle;
doodle?: DoodleStyle;
path?: PathStyle;
channel?: ChannelStyle;
antenna?: AntennaStyle;
}
export interface RendererPathConfig {
lineWidth?: number;
showEdgePaths?: boolean;
showTransPaths?: boolean;
showMowingPaths?: boolean;
edgePathColor?: string;
transPathColor?: string;
mowingPathColor?: string;
edgePathOpacity?: number;
transPathOpacity?: number;
mowingPathOpacity?: number;
}
export interface AntennaConfig {
id: number;
location_x: number;
location_y: number;
pn: string;
status: number;
timestamp: string;
type: number;
valid: number;
version: string;
}
export interface MowerPositionConfig {
postureTheta: number;
postureX: number;
postureY: number;
lastPostureTheta?: number;
lastPostureX?: number;
lastPostureY?: number;
vehicleState?: RobotStatus;
}
export interface MowerPartitionInfo {
partitionIds: number[];
time: number;
}
export type RealTimeData = RealTimeLocationType | RealTimeProcessType | RealTimePartitionType | RealTimeStatusType;
export interface MowerMapRendererProps {
edger?: boolean;
unitType?: UnitsType;
language?: string;
mapConfig?: MapConfig;
modelType: string;
mapRef?: google.maps.Map;
mapJson?: MapData;
pathJson?: PathData;
realTimeData?: RealTimeData[];
antennaConfig?: AntennaConfig[];
onMapLoad?: (elementCount: number) => void;
onPathLoad?: (elementCount: number) => void;
onZoomChange?: (zoomLevel: number) => void;
onError?: (error: string) => void;
className?: string;
style?: React.CSSProperties;
googleMapInstance?: any;
isEditMode?: boolean;
dragCallbacks?: DragCallbacks;
defaultTransform?: {
x?: number;
y?: number;
rotation?: number;
};
debug?: boolean;
}
export interface MowerMapRendererRef {
setZoom?: (zoom: number) => void;
getZoom?: () => number;
resetView?: () => void;
clear?: () => void;
getSvgElement?: () => SVGSVGElement | null;
fitToView?: () => void;
getOverlay?: () => any;
toggleOverlay?: (visible: boolean) => void;
setEditMode?: (enabled: boolean) => void;
getEditMode?: () => boolean;
getCurrentDragState?: () => DragState | null;
getElementCount?: () => number;
getPathCount?: () => number;
isGoogleMapsReady?: () => boolean;
resetToDefaultTransform?: () => void;
}
//# sourceMappingURL=renderer.d.ts.map