Expose EditorZoom in the monaco API

This commit is contained in:
Sebastian Pahnke 2023-03-14 10:02:19 +01:00
parent bbe8e872dc
commit 107a4809df
3 changed files with 11 additions and 0 deletions

View file

@ -85,6 +85,7 @@ export interface ICommandHandler {
#include(vs/editor/browser/config/editorConfiguration): IEditorConstructionOptions
#includeAll(vs/editor/browser/editorBrowser;editorCommon.=>):
#include(vs/editor/common/config/fontInfo): FontInfo, BareFontInfo
#include(vs/editor/common/config/editorZoom): EditorZoom, IEditorZoom
//compatibility:
export type IReadOnlyModel = ITextModel;

View file

@ -36,6 +36,7 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { PLAINTEXT_LANGUAGE_ID } from 'vs/editor/common/languages/modesRegistry';
import { LineRangeMapping, RangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
import { LineRange } from 'vs/editor/common/core/lineRange';
import { EditorZoom } from 'vs/editor/common/config/editorZoom';
/**
* Create a new editor under `domElement`.
@ -508,6 +509,7 @@ export function createMonacoEditorAPI(): typeof monaco.editor {
LineRange: <any>LineRange,
LineRangeMapping: <any>LineRangeMapping,
RangeMapping: <any>RangeMapping,
EditorZoom: <any>EditorZoom,
// vars
EditorType: EditorType,

8
src/vs/monaco.d.ts vendored
View file

@ -5834,6 +5834,14 @@ declare namespace monaco.editor {
readonly letterSpacing: number;
}
export const EditorZoom: IEditorZoom;
export interface IEditorZoom {
onDidChangeZoomLevel: IEvent<number>;
getZoomLevel(): number;
setZoomLevel(zoomLevel: number): void;
}
//compatibility:
export type IReadOnlyModel = ITextModel;
export type IModel = ITextModel;