import type { Feature, FeatureCollection, Polygon } from 'geojson';

export type PartyId = 'A' | 'B' | 'C';

export type DrawMode = 'freehand' | 'polygon' | 'select';

export interface PartyConfig {
  id: PartyId;
  name: string;
  fillColor: string;
  outlineColor: string;
}

export interface PartyFeatureProperties {
  party: PartyId;
  createdAt: number;
  /** Set true when this polygon was generated by snapping to the PI boundary. */
  autoCompleted?: boolean;
  /** Mirror of the top-level feature id so Mapbox `promoteId` can read it. */
  id?: string | number;
}

export type PartyFeature = Feature<Polygon, PartyFeatureProperties>;

export type PartyFeatureCollection = FeatureCollection<Polygon, PartyFeatureProperties>;
