import { Geometry, GeometryCollection } from '@turf/helpers/dist/js/lib/geojson'; import { Feature, LineString, Point, Polygon } from '@turf/turf'; export interface IBaseProperties { id: string; isDraw?: boolean; isActive?: boolean; multiIndex?: number; [key: string]: any; } export interface IBaseFeature extends Feature { type: 'Feature'; geometry: G; properties: P; } export interface IPointProperties extends IBaseProperties { isHover?: boolean; isDrag?: boolean; createTime: number; } export type IPointFeature = IBaseFeature; export interface ILineProperties extends IBaseProperties { nodes: IPointFeature[]; isHover?: boolean; isDrag?: boolean; createTime: number; } export type ILineFeature = IBaseFeature; export interface IPolygonProperties extends IBaseProperties { nodes: IPointFeature[]; line: ILineFeature; isHover?: boolean; isDrag?: boolean; createTime: number; } export type IPolygonFeature = IBaseFeature; export interface IMidPointProperties extends IBaseProperties { startId: string; endId: string; } export type IMidPointFeature = IBaseFeature; export type IDashLineFeature = IBaseFeature; export interface ITextProperties extends IBaseProperties { type: 'distance' | 'totalDistance' | 'dash' | 'area'; text: string; meters: number; } export type ITextFeature = IBaseFeature; export type FeatureUpdater = F[] | ((newFeatures: F[]) => F[]);