import * as jsonc from '@sqs/jsonc-parser'; import * as monaco from 'monaco-editor'; import * as React from 'react'; export interface Props { id?: string; value: string | undefined; onChange?: (newValue: string) => void; readOnly?: boolean | undefined; height?: number; /** * The JSON Schema that describes the document. */ jsonSchema: { $id: string; }; monacoRef?: (monacoValue: typeof monaco | null) => void; isLightTheme: boolean; /** * Called when the user presses the key binding for "save" (Ctrl+S/Cmd+S). */ onDidSave?: () => void; } interface State { } /** * A JSON settings editor using the Monaco editor. */ export declare class MonacoSettingsEditor extends React.PureComponent { state: State; private monaco; private editor; private componentUpdates; private subscriptions; private disposables; componentDidMount(): void; componentWillReceiveProps(newProps: Props): void; componentWillUnmount(): void; render(): JSX.Element | null; private editorWillMount; private onDidEditorMount; private onDidCreateEditor; private onDidCreateModel; } export declare function isStandaloneCodeEditor(editor: monaco.editor.ICodeEditor): editor is monaco.editor.IStandaloneCodeEditor; export declare function toMonacoEdits(model: monaco.editor.IModel, edits: jsonc.Edit[]): monaco.editor.IIdentifiedSingleEditOperation[]; /** * A helper function that modifies site configuration to configure specific * common things, such as syncing GitHub repositories. */ export declare type ConfigInsertionFunction = (configJSON: string) => { /** The edits to make to the input configuration to insert the new configuration. */ edits: jsonc.Edit[]; /** Select text in inserted JSON. */ selectText?: string; /** * If set, the selection is an empty selection that begins at the left-hand match of selectText plus this * offset. For example, if selectText is "foo" and cursorOffset is 2, then the final selection will be a cursor * "|" positioned as "fo|o". */ cursorOffset?: number; }; export declare function addEditorAction(inputEditor: monaco.editor.IStandaloneCodeEditor, model: monaco.editor.IModel, label: string, id: string, run: ConfigInsertionFunction): void; export {}; //# sourceMappingURL=MonacoSettingsEditor.d.ts.map