/** * Lazy loader for Monaco Editor via CDN (no bundler configuration required). * * Uses the AMD/RequireJS loader shipped with Monaco to load the editor and * language-specific features on demand. The loaded instance is cached so * subsequent calls return immediately. * * @module */ import type * as MonacoTypes from 'monaco-editor'; /** * Loads the core Monaco Editor API from CDN and returns the fully * initialised `monaco` namespace. The result is cached so subsequent * calls resolve immediately. * * Workers are configured automatically before the first load. * * @returns The Monaco Editor API namespace. * * @example * ```ts * const monaco = await loadMonacoCore() * const editor = monaco.editor.create(container, { language: 'typescript' }) * ``` */ export declare function loadMonacoCore(): Promise; /** * Loads and configures language-specific features (validation, diagnostics, * schemas) for the given language in Monaco. * * The core Monaco API is loaded first if not already available. Language * loading promises are cached so each language is configured at most once. * * @param language - The Monaco language identifier (e.g. `'json'`, `'typescript'`, `'yaml'`). * * @example * ```ts * await loadLanguageFeatures('json') * ``` */ export declare function loadLanguageFeatures(language: string): Promise; /** * Loads the Monaco Editor API **and** the language-specific features for the * given language in parallel, returning the fully initialised `monaco` * namespace. * * This is the recommended loader for most use cases since it ensures both * the core editor and language support are ready before the editor is created. * * @param language - The Monaco language identifier (e.g. `'json'`, `'typescript'`). * @returns The Monaco Editor API namespace. * * @example * ```ts * const monaco = await loadMonacoWithLanguage('json') * const editor = monaco.editor.create(el, { value: '{}', language: 'json' }) * ``` */ export declare function loadMonacoWithLanguage(language: string): Promise; /** * Configures the Monaco worker environment. * * Call this before creating any editor instances if you need custom web * workers (e.g. bundled workers instead of CDN workers). When called without * arguments, the default CDN-based worker environment is set up. * * This function is a no-op in non-browser environments (SSR). * * @param getWorkerFn - Optional factory that returns a `Worker` for a given * `workerId` and `label`. When omitted, the default AMD/CDN worker setup * is used. * * @example * ```ts * // Use default CDN workers * configureMonacoEnvironment() * * // Use custom bundled workers * configureMonacoEnvironment((workerId, label) => { * return new Worker(new URL('./my-worker.js', import.meta.url)) * }) * ``` */ export declare function configureMonacoEnvironment(getWorkerFn?: (workerId: string, label: string) => Worker): void;