standaloneBase.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. import { CancellationTokenSource } from '../../../base/common/cancellation.js';
  6. import { Emitter } from '../../../base/common/event.js';
  7. import { KeyChord } from '../../../base/common/keyCodes.js';
  8. import { URI } from '../../../base/common/uri.js';
  9. import { Position } from '../core/position.js';
  10. import { Range } from '../core/range.js';
  11. import { Selection } from '../core/selection.js';
  12. import { Token } from '../core/token.js';
  13. import * as standaloneEnums from './standaloneEnums.js';
  14. export class KeyMod {
  15. static chord(firstPart, secondPart) {
  16. return KeyChord(firstPart, secondPart);
  17. }
  18. }
  19. KeyMod.CtrlCmd = 2048 /* CtrlCmd */;
  20. KeyMod.Shift = 1024 /* Shift */;
  21. KeyMod.Alt = 512 /* Alt */;
  22. KeyMod.WinCtrl = 256 /* WinCtrl */;
  23. export function createMonacoBaseAPI() {
  24. return {
  25. editor: undefined,
  26. languages: undefined,
  27. CancellationTokenSource: CancellationTokenSource,
  28. Emitter: Emitter,
  29. KeyCode: standaloneEnums.KeyCode,
  30. KeyMod: KeyMod,
  31. Position: Position,
  32. Range: Range,
  33. Selection: Selection,
  34. SelectionDirection: standaloneEnums.SelectionDirection,
  35. MarkerSeverity: standaloneEnums.MarkerSeverity,
  36. MarkerTag: standaloneEnums.MarkerTag,
  37. Uri: URI,
  38. Token: Token
  39. };
  40. }