Path: blob/main/src/vs/editor/common/services/editorBaseApi.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { CancellationTokenSource } from '../../../base/common/cancellation.js';6import { Emitter } from '../../../base/common/event.js';7import { KeyChord, KeyMod as ConstKeyMod } from '../../../base/common/keyCodes.js';8import { URI } from '../../../base/common/uri.js';9import { Position } from '../core/position.js';10import { Range } from '../core/range.js';11import { Selection } from '../core/selection.js';12import { Token } from '../languages.js';13import * as standaloneEnums from '../standalone/standaloneEnums.js';1415export class KeyMod {16public static readonly CtrlCmd: number = ConstKeyMod.CtrlCmd;17public static readonly Shift: number = ConstKeyMod.Shift;18public static readonly Alt: number = ConstKeyMod.Alt;19public static readonly WinCtrl: number = ConstKeyMod.WinCtrl;2021public static chord(firstPart: number, secondPart: number): number {22return KeyChord(firstPart, secondPart);23}24}2526export function createMonacoBaseAPI(): typeof monaco {27return {28editor: undefined!, // undefined override expected here29languages: undefined!, // undefined override expected here30CancellationTokenSource: CancellationTokenSource,31Emitter: Emitter,32KeyCode: standaloneEnums.KeyCode,33KeyMod: KeyMod,34Position: Position,35Range: Range,36Selection: <any>Selection,37SelectionDirection: standaloneEnums.SelectionDirection,38MarkerSeverity: standaloneEnums.MarkerSeverity,39MarkerTag: standaloneEnums.MarkerTag,40Uri: <any>URI,41Token: Token42};43}444546