import type { AllSources } from './types'

export const clientID = 'ps'

/**
 * Runtime list of every supported source `type` discriminant. Kept coherent
 * with the {@link AllSources} union at compile time: `satisfies` rejects typos
 * or invalid/extra entries, and the `_AllListed` guard below fails to compile
 * if the union gains a member that's missing here.
 */
export const SOURCE_TYPES = [
  'query',
  'query+h3',
  'query+quadbin',
  'query+boundary',
  'query+tileset',
  'query+tileset+h3',
  'query+tileset+quadbin',
  'table',
  'table+h3',
  'table+quadbin',
  'table+boundary',
  'table+tileset',
  'table+tileset+h3',
  'table+tileset+quadbin',
  'tileset',
  'tileset+h3',
  'tileset+quadbin',
  'raster',
  'geojson',
] as const satisfies readonly AllSources['type'][]

export type SourceType = (typeof SOURCE_TYPES)[number]
