import { CesiumMapType } from './Cesium.types'
import { OpenLayersMapType } from './OpenLayers.types'
export type SuperMapType = OpenLayersMapType | CesiumMapType
export type WMSLayerOption = {
  id?: string
  type: 'WMS'
  url: string
  layerName: string
  style?: string
  format?: string
}
export type WMTSLayerOption = {
  id?: string
  type: 'WMTS'
  url: string
  layerName: string
  matrixSet: string
  origin: number[]
  lods: {
    level: number
    resolution: number
    scale?: number
  }[]
  style?: string
  format?: string
}
export type TDTLayerOption = {
  id?: string
  type: 'TDT'
  layerName: 'img' | 'img_label' | 'vec' | 'vec_label' | 'ter' | 'ter_label'
  token?: string
}
export type SuperMapLayerOption = {
  id?: string
  type: 'TileSuperMap' | 'ImageSuperMapRest'
  url: string
  layerName?: string
  prjCoordSys?: {
    epsgCode: number
  }
}
export type S3MSceneLayerOption = {
  id?: string
  type: 'S3MScene'
  url: string
  view?: {
    destination?: Cesium.Cartesian3 | Cesium.Rectangle
    orientation?: Object
    endTransform?: Cesium.Matrix4
  }
}
export type S3MScpLayerOption = {
  id?: string
  type: 'S3MScp'
  url: string
  view?: {
    destination?: Cesium.Cartesian3 | Cesium.Rectangle
    orientation?: Object
    endTransform?: Cesium.Matrix4
  }
}
export type ThreeTilesLayerOption = {
  id?: string
  type: '3DTiles'
  url: string
  isSuperMapiServer?: boolean
}
export type TerrainLayerOption = {
  id?: string
  type: 'Terrain'
  url: string
  isSct?: boolean
  invisibility?: boolean
}
export type LayerOption =
  | WMSLayerOption
  | WMTSLayerOption
  | TDTLayerOption
  | SuperMapLayerOption
  | S3MSceneLayerOption
  | S3MScpLayerOption
  | ThreeTilesLayerOption
  | TerrainLayerOption
export type DrawingMode =
  | 'Point'
  | 'Polyline'
  | 'Rectangle'
  | 'Circle'
  | 'Polygon'
  | 'Clear'
export type DrawOptions = {
  continueDraw?: boolean
  removeLast?: boolean
}
