@typefox/monaco-editor-react
Version:
React component for Monaco-Editor and Monaco Languageclient
50 lines • 2.04 kB
TypeScript
import { LogLevel } from '@codingame/monaco-vscode-api';
import { EditorApp, type EditorAppConfig, type TextContents } from 'monaco-languageclient/editorApp';
import { type LanguageClientConfig, LanguageClientManager } from 'monaco-languageclient/lcwrapper';
import { type MonacoVscodeApiConfig, MonacoVscodeApiWrapper } from 'monaco-languageclient/vscodeApiWrapper';
import React, { type CSSProperties } from 'react';
export type ResolveFc = (value: void | PromiseLike<void>) => void;
export type ConfigProcessedResult = {
textUpdated: boolean;
modelUpdated: boolean;
editorApp?: EditorApp;
};
export type MonacoEditorProps = {
style?: CSSProperties;
className?: string;
vscodeApiConfig?: MonacoVscodeApiConfig;
editorAppConfig?: EditorAppConfig;
languageClientConfig?: LanguageClientConfig;
onVscodeApiInitDone?: (monacoVscodeApiManager: MonacoVscodeApiWrapper) => void;
onEditorStartDone?: (editorApp?: EditorApp) => void;
onLanguageClientsStartDone?: (lcsManager: LanguageClientManager) => void;
/**
* Called when the text in the editor has changed
*/
onTextChanged?: (textChanges: TextContents) => void;
/**
* Called when an error occurred within the component
*/
onError?: (error: Error) => void;
onDisposeEditor?: () => void;
onDisposeLanguageClient?: () => void;
/**
* Trigger reprocessing oft the editorAppConfig to update code/models or editor options.
* This is performed once and only repeated if the value is increased again.
*/
triggerReprocessConfig?: number;
/**
* Always called after the config was re-processed.
*/
onConfigProcessed?: (result: ConfigProcessedResult) => void;
/**
* Enforce disposal of the language client
*/
enforceLanguageClientDispose?: boolean;
/**
* Set the log level for the internal logger
*/
logLevel?: LogLevel | number;
};
export declare const MonacoEditorReactComp: React.FC<MonacoEditorProps>;
//# sourceMappingURL=index.d.ts.map