import React from 'react'; import type * as monacoApi from 'monaco-editor'; import { basicLanguagePlugins } from '../monaco'; import { pluginMap } from '../plugins'; declare global { interface Window { monaco: typeof monacoApi; } } declare type Monaco = typeof monacoApi; export declare type MonacoProp = { monaco?: Monaco | undefined | null; }; declare type PromiseOrNot = Promise | T; export interface UseMonacoOptions extends Partial> { onLoad?: (monaco: typeof monacoApi) => PromiseOrNot; themes?: any; defaultEditorOptions?: monacoApi.editor.IEditorOptions; plugins?: (keyof typeof pluginMap | [keyof typeof pluginMap, any] | monacoApi.plugin.IPlugin)[]; languages?: (keyof typeof basicLanguagePlugins | [keyof typeof basicLanguagePlugins, any] | monacoApi.plugin.IPlugin)[]; onThemeChange?: (theme: any, monaco: typeof monacoApi) => PromiseOrNot; theme?: string | monacoApi.editor.IStandaloneThemeData | (() => PromiseOrNot); } declare const MonacoProvider: React.FC>; export { MonacoProvider }; export declare function useMonacoContext(): { useMonacoEffect: (effect: (obj: typeof monacoApi) => void, deps: any[]) => void; monaco: typeof monacoApi; isLoading: boolean; defaultEditorOptions?: monacoApi.editor.IEditorOptions; }; export declare const useMonaco: ({ themes, onThemeChange, onLoad, defaultEditorOptions, theme, plugins, languages, ...loaderOptions }?: UseMonacoOptions) => { useMonacoEffect: (effect: (obj: Monaco) => void, deps: any[]) => void; monaco: Monaco; isLoading: boolean; defaultEditorOptions?: monacoApi.editor.IEditorOptions; }; export declare function useRefWithEffect(initialValue: T): [ React.MutableRefObject, (effect: (obj: T) => void, deps: any[]) => void ];