import BaseLayer from 'ol/layer/Base';
import { BaseMap } from './components/BaseMap';

// export interface VietNamMapProps {
//   style?: React.CSSProperties;
//   onFeatureClick?: (feature: any) => void;
//   onFeatureSelect?: (feature: any) => void;
//   onFeaturesClick?: (features: any[]) => void;
//   onError?: (error: Error) => void;
//   mapManager?: MapManager;
//   isMapInitialized?: boolean;
// }

export interface MapManagerConfig {
  onFeatureClick?: (feature: any) => void;
  onFeatureSelect?: (feature: any, pixel: any) => void;
  onFeaturesClick?: (features: any[]) => void;
  onError?: (error: string[]) => void;
}
export interface AnimationConfig {
  duration?: number;
  maxRadius?: number;
  strokeColor?: string;
  strokeWidthBase?: number;
}

export interface StyleConfig {
  icon?: string; // URL của icon
  font?: string; // font chữ cho text
  textColor?: string; // màu chữ
  textStrokeColor?: string; // màu viền chữ
  textOffsetY?: number; // độ lệch theo trục Y
  strokeColor?: string; // màu đường kẻ cho LineString
  strokeWidth?: number; // độ dày đường kẻ cho LineString
  fillColor?: string; // màu fill cho Polygon
  borderColor?: string; // màu viền cho Polygon
  borderWidth?: number; // độ dày viền cho Polygon
  minScale?: number; // tỷ lệ nhỏ nhất
  maxScale?: number; // tỷ lệ lớn nhất
}

// export Interface for feature data
export interface FeatureData {
  id?: string | number;
  bearing?: number;
  text?: string;
}

export interface MapLayer {
  name: string;
  layer: BaseLayer | null;
  visible: boolean;
  mandatory: boolean;
}

export type TagStateCallbackPayload = {
  isNormal: boolean;
  isWarning: boolean;
  isCritical: boolean;
  isSos: boolean;
  isDisconnected: boolean; // giữ đúng theo yêu cầu (1 'n')
};

export type PointData = {
  thing?: SgwModel.SgwThing;
  description?: string;
  type: 'main-point' | 'sos-point' | 'default';
};
export type ZoneData = {
  zone?: SgwModel.Banzone;
  message?: string;
  type: 'warning' | 'alarm' | 'default';
};

export interface GPSParseResult {
  lat: number;
  lon: number;
  s: number;
  h: number;
  fishing: boolean;
}

export interface ShipDetailData {
  ship: SgwModel.ShipDetail;
  owner: MasterModel.UserResponse | null;
  gps: GPSParseResult | null;
  trip_id?: string;
  zone_entered_alarm_list: ZoneAlarmParse[];
  zone_approaching_alarm_list: ZoneAlarmParse[];
}

export interface ZoneAlarmParse {
  zone_type?: number;
  zone_id?: string;
  zone_name?: string;
  message?: string;
  alarm_type?: number;
  lat?: number;
  lon?: number;
  s?: number;
  h?: number;
  fishing?: boolean;
  gps_time?: number;
}
export const DATA_LAYER = 'data-layer';
export const TEMPORARY_LAYER = 'temporary-layer';

// Export BaseMap for external use
export { BaseMap };
