mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-14 10:35:11 +00:00
30 lines
1.2 KiB
TypeScript
30 lines
1.2 KiB
TypeScript
// SPDX-License-Identifier: MIT
|
|
// Copyright (c) 2022 The Pybricks Authors
|
|
|
|
// exposes some monaco editor internal functions
|
|
|
|
import {} from 'react-monaco-editor';
|
|
|
|
declare module 'react-monaco-editor' {
|
|
export namespace monaco {
|
|
export namespace editor {
|
|
export interface ITextModel {
|
|
// https://github.com/microsoft/vscode/blob/d54c705f6567958a732ac88b1c3ec4d2303fb026/src/vs/editor/common/model.ts#L1135
|
|
canUndo: () => boolean;
|
|
// https://github.com/microsoft/vscode/blob/d54c705f6567958a732ac88b1c3ec4d2303fb026/src/vs/editor/common/model.ts#L1148
|
|
canRedo: () => boolean;
|
|
}
|
|
|
|
export interface ICodeEditor {
|
|
// null is allowed:
|
|
// https://github.com/microsoft/vscode/blob/b57db0fc49ee5777a4e02e8936f5b8cb9fb6182d/src/vs/editor/browser/widget/codeEditorWidget.ts#L995
|
|
// TODO: can be removed when https://github.com/microsoft/vscode/pull/146866 is merged
|
|
/**
|
|
* Restores the view state of the editor from a serializable object generated by `saveViewState`.
|
|
*/
|
|
restoreViewState(state: ICodeEditorViewState | null): void;
|
|
}
|
|
}
|
|
}
|
|
}
|