Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/editor/common/services/editorBaseApi.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { CancellationTokenSource } from '../../../base/common/cancellation.js';
7
import { Emitter } from '../../../base/common/event.js';
8
import { KeyChord, KeyMod as ConstKeyMod } from '../../../base/common/keyCodes.js';
9
import { URI } from '../../../base/common/uri.js';
10
import { Position } from '../core/position.js';
11
import { Range } from '../core/range.js';
12
import { Selection } from '../core/selection.js';
13
import { Token } from '../languages.js';
14
import * as standaloneEnums from '../standalone/standaloneEnums.js';
15
16
export class KeyMod {
17
public static readonly CtrlCmd: number = ConstKeyMod.CtrlCmd;
18
public static readonly Shift: number = ConstKeyMod.Shift;
19
public static readonly Alt: number = ConstKeyMod.Alt;
20
public static readonly WinCtrl: number = ConstKeyMod.WinCtrl;
21
22
public static chord(firstPart: number, secondPart: number): number {
23
return KeyChord(firstPart, secondPart);
24
}
25
}
26
27
export function createMonacoBaseAPI(): typeof monaco {
28
return {
29
editor: undefined!, // undefined override expected here
30
languages: undefined!, // undefined override expected here
31
CancellationTokenSource: CancellationTokenSource,
32
Emitter: Emitter,
33
KeyCode: standaloneEnums.KeyCode,
34
KeyMod: KeyMod,
35
Position: Position,
36
Range: Range,
37
Selection: <any>Selection,
38
SelectionDirection: standaloneEnums.SelectionDirection,
39
MarkerSeverity: standaloneEnums.MarkerSeverity,
40
MarkerTag: standaloneEnums.MarkerTag,
41
Uri: <any>URI,
42
Token: Token
43
};
44
}
45
46