/** * Public types for the Monaco entry. * * Type-only imports of monaco-editor are safe here: they are erased at compile * time and never produce a runtime import. */ import type * as Monaco from 'monaco-editor/editor/editor.api'; export type MonacoApi = typeof Monaco; /** * What an externally-supplied language module must export. * * The design system never learns which package a language came from: the * consumer's dynamic import resolves it, and this is the only contract. * Bundles emit token NAMES; colours come from the design system's theme. */ export interface MonacoLanguageModule { register: (monaco: MonacoApi) => void | Promise; } /** A language to make available: a built-in key, or an external loader. */ export type LanguageInput = TBuiltin | { id: string; load: () => Promise; };