UNPKG

@promptbook/website-crawler

Version:

Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action

49 lines (48 loc) 1.78 kB
import type { editor } from 'monaco-editor'; import type { BookEditorTheme } from './BookEditorTheme'; /** * Type describing monaco editor. */ type MonacoEditor = typeof import('monaco-editor'); /** * Props for use book editor monaco language. */ type UseBookEditorMonacoLanguageProps = { readonly monaco: MonacoEditor | null; readonly theme: BookEditorTheme; }; /** * Ensures the BookEditor Monaco language, tokenizer, links and completion providers are * registered exactly once per Monaco instance, while always re-applying the Book theme. * * @private function of BookEditorMonaco */ export declare function ensureBookEditorMonacoLanguage(monaco: MonacoEditor, theme?: BookEditorTheme): void; /** * Props required to enforce Book Monaco language/theme on one mounted editor. * * @private function of BookEditorMonaco */ type EnsureBookEditorMonacoLanguageForEditorProps = { readonly monaco: MonacoEditor; readonly monacoEditor: editor.IStandaloneCodeEditor; readonly theme?: BookEditorTheme; }; /** * Ensures the mounted Monaco editor model uses Book language and Book theme. * * This is resilient when a shared Monaco runtime/theme is changed by another page and the * Book editor tree is restored from App Router cache without a full remount. * * @param props - Monaco runtime and mounted editor instance. * * @private function of BookEditorMonaco */ export declare function ensureBookEditorMonacoLanguageForEditor(props: EnsureBookEditorMonacoLanguageForEditorProps): void; /** * Registers the language helpers that power Monaco inside `BookEditorMonaco`. * * @private function of BookEditorMonaco */ export declare function useBookEditorMonacoLanguage({ monaco, theme }: UseBookEditorMonacoLanguageProps): void; export {};