import type { Feature, GeoJsonProperties, Geometry } from 'geojson'
import type { Method } from './const'

export interface WorkerRequest {
  requestId?: number
  method: (typeof Method)[keyof typeof Method]
  params: unknown[]
}

export type WorkerResponse =
  | {
      requestId: number
      ok: true
      result: unknown
    }
  | {
      requestId: number
      ok: false
      error: string
    }

// export type FeatureData = Record<string, unknown>
export type FeatureData = Feature<Geometry, GeoJsonProperties>
