/// <reference types="vite/client" />
/// <reference types="vite-plugin-pwa/client" />

declare const __APP_VERSION__: string;

declare module '*.module.css' {
  const classes: { readonly [key: string]: string };
  export default classes;
}

// The bundled Vega-Lite JSON schema is ~1.5 MB. Declaring it as a generic object
// stops `tsc` from inferring a giant literal type (slow/memory-heavy) on import.
declare module 'vega-lite/vega-lite-schema.json' {
  const schema: Record<string, unknown>;
  export default schema;
}

// `edcore.main` (full editor features, no bundled languages) ships no types of
// its own; at runtime it re-exports the editor API, so map its types there.
// This also re-pulls monaco's global `MonacoEnvironment` augmentation.
declare module 'monaco-editor/esm/vs/editor/edcore.main' {
  export * from 'monaco-editor/esm/vs/editor/editor.api';
}

// vega-scale ships types at `index.d.ts` but its package.json `exports` maps
// only `default` (no `types`), so `bundler` resolution can't find them. Declare
// the one symbol core uses: `scheme(name)` returns a categorical color array, a
// continuous interpolator, or undefined for an unknown name.
declare module 'vega-scale' {
  export function scheme(name: string): string[] | ((t: number) => string) | undefined;
}
