@codingame/monaco-vscode-api 1.81.5 → 1.81.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/monaco.d.ts CHANGED
@@ -7,11 +7,14 @@ export { DisposableStore } from './vscode/vs/base/common/lifecycle.js';
7
7
  export { Registry } from './vscode/vs/platform/registry/common/platform.js';
8
8
  export { IJSONContributionRegistry } from './vscode/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
9
9
  export { CommandsRegistry } from './vscode/vs/platform/commands/common/commands.js';
10
+ export { MenuId, MenuRegistry } from './vscode/vs/platform/actions/common/actions.js';
11
+ export { KeybindingsRegistry } from './vscode/vs/platform/keybinding/common/keybindingsRegistry.js';
10
12
  export { IJSONSchema } from './vscode/vs/base/common/jsonSchema.js';
11
13
  export { registerColor } from './vscode/vs/platform/theme/common/colorRegistry.js';
12
14
  import { URI } from './vscode/vs/base/common/uri.js';
13
15
  import { IFileDeleteOptions } from './vscode/vs/platform/files/common/files.js';
14
16
  import { ITextFileEditorModel } from './vscode/vs/workbench/services/textfile/common/textfiles.js';
17
+ export { ContextKeyExpr, RawContextKey } from './vscode/vs/platform/contextkey/common/contextkey.js';
15
18
  import { IKeybindingService } from './vscode/vs/platform/keybinding/common/keybinding.js';
16
19
  import { KeybindingResolver } from './vscode/vs/platform/keybinding/common/keybindingResolver.js';
17
20
  import { ResolvedKeybindingItem } from './vscode/vs/platform/keybinding/common/resolvedKeybindingItem.js';
package/dist/monaco.js CHANGED
@@ -14,6 +14,8 @@ export { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform
14
14
  import { Extensions as Extensions$2 } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
15
15
  import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
16
16
  export { CommandsRegistry } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
17
+ export { MenuId, MenuRegistry } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
18
+ export { KeybindingsRegistry } from 'monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js';
17
19
  import { Extensions as Extensions$3 } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
18
20
  import { EditorOptionsUtil } from './vscode/vs/editor/browser/config/editorConfiguration.js';
19
21
  export { registerColor } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
@@ -28,6 +30,7 @@ import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/com
28
30
  import { StandaloneQuickInputService } from 'monaco-editor/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js';
29
31
  import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
30
32
  import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
33
+ export { ContextKeyExpr, RawContextKey } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
31
34
  import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
32
35
  import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
33
36
  import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
@@ -6,6 +6,14 @@ import { ICommandAction, ICommandActionTitle, Icon } from '../../action/common/a
6
6
  import { ICommandService } from '../../commands/common/commands.js';
7
7
  import { IContextKeyService, ContextKeyExpression } from '../../contextkey/common/contextkey.js';
8
8
 
9
+ interface IMenuItem {
10
+ command: ICommandAction;
11
+ alt?: ICommandAction;
12
+ when?: ContextKeyExpression;
13
+ group?: 'navigation' | string;
14
+ order?: number;
15
+ isHiddenByDefault?: boolean;
16
+ }
9
17
  interface ISubmenuItem {
10
18
  title: string | ICommandActionTitle;
11
19
  submenu: MenuId;
@@ -207,6 +215,27 @@ interface IMenuService {
207
215
  */
208
216
  resetHiddenStates(menuIds: readonly MenuId[] | undefined): void;
209
217
  }
218
+ type ICommandsMap = Map<string, ICommandAction>;
219
+ interface IMenuRegistryChangeEvent {
220
+ has(id: MenuId): boolean;
221
+ }
222
+ interface IMenuRegistry {
223
+ readonly onDidChangeMenu: Event<IMenuRegistryChangeEvent>;
224
+ addCommand(userCommand: ICommandAction): IDisposable;
225
+ getCommand(id: string): ICommandAction | undefined;
226
+ getCommands(): ICommandsMap;
227
+ /**
228
+ * @deprecated Use `appendMenuItem` or most likely use `registerAction2` instead. There should be no strong
229
+ * reason to use this directly.
230
+ */
231
+ appendMenuItems(items: Iterable<{
232
+ id: MenuId;
233
+ item: IMenuItem | ISubmenuItem;
234
+ }>): IDisposable;
235
+ appendMenuItem(menu: MenuId, item: IMenuItem | ISubmenuItem): IDisposable;
236
+ getMenuItems(loc: MenuId): Array<IMenuItem | ISubmenuItem>;
237
+ }
238
+ declare const MenuRegistry: IMenuRegistry;
210
239
  declare class SubmenuItemAction extends SubmenuAction {
211
240
  readonly item: ISubmenuItem;
212
241
  readonly hideActions: IMenuItemHide | undefined;
@@ -234,4 +263,4 @@ declare class MenuItemAction implements IAction {
234
263
  run(...args: any[]): Promise<void>;
235
264
  }
236
265
 
237
- export { IMenu, IMenuActionOptions, IMenuChangeEvent, IMenuCreateOptions, IMenuItemHide, IMenuService, ISubmenuItem, MenuId, MenuItemAction, SubmenuItemAction };
266
+ export { IMenu, IMenuActionOptions, IMenuChangeEvent, IMenuCreateOptions, IMenuItem, IMenuItemHide, IMenuRegistry, IMenuRegistryChangeEvent, IMenuService, ISubmenuItem, MenuId, MenuItemAction, MenuRegistry, SubmenuItemAction };
@@ -44,6 +44,25 @@ interface IContextKeyExpression {
44
44
  negate(): ContextKeyExpression;
45
45
  }
46
46
  type ContextKeyExpression = (ContextKeyFalseExpr | ContextKeyTrueExpr | ContextKeyDefinedExpr | ContextKeyNotExpr | ContextKeyEqualsExpr | ContextKeyNotEqualsExpr | ContextKeyRegexExpr | ContextKeyNotRegexExpr | ContextKeyAndExpr | ContextKeyOrExpr | ContextKeyInExpr | ContextKeyNotInExpr | ContextKeyGreaterExpr | ContextKeyGreaterEqualsExpr | ContextKeySmallerExpr | ContextKeySmallerEqualsExpr);
47
+ declare abstract class ContextKeyExpr {
48
+ static false(): ContextKeyExpression;
49
+ static true(): ContextKeyExpression;
50
+ static has(key: string): ContextKeyExpression;
51
+ static equals(key: string, value: any): ContextKeyExpression;
52
+ static notEquals(key: string, value: any): ContextKeyExpression;
53
+ static regex(key: string, value: RegExp): ContextKeyExpression;
54
+ static in(key: string, value: string): ContextKeyExpression;
55
+ static notIn(key: string, value: string): ContextKeyExpression;
56
+ static not(key: string): ContextKeyExpression;
57
+ static and(...expr: Array<ContextKeyExpression | undefined | null>): ContextKeyExpression | undefined;
58
+ static or(...expr: Array<ContextKeyExpression | undefined | null>): ContextKeyExpression | undefined;
59
+ static greater(key: string, value: number): ContextKeyExpression;
60
+ static greaterEquals(key: string, value: number): ContextKeyExpression;
61
+ static smaller(key: string, value: number): ContextKeyExpression;
62
+ static smallerEquals(key: string, value: number): ContextKeyExpression;
63
+ private static _parser;
64
+ static deserialize(serialized: string | null | undefined): ContextKeyExpression | undefined;
65
+ }
47
66
  declare class ContextKeyFalseExpr implements IContextKeyExpression {
48
67
  static INSTANCE: ContextKeyFalseExpr;
49
68
  readonly type = ContextKeyExprType.False;
@@ -290,6 +309,25 @@ declare class ContextKeyOrExpr implements IContextKeyExpression {
290
309
  map(mapFnc: IContextKeyExprMapper): ContextKeyExpression;
291
310
  negate(): ContextKeyExpression;
292
311
  }
312
+ interface ContextKeyInfo {
313
+ readonly key: string;
314
+ readonly type?: string;
315
+ readonly description?: string;
316
+ }
317
+ declare class RawContextKey<T extends ContextKeyValue> extends ContextKeyDefinedExpr {
318
+ private static _info;
319
+ static all(): IterableIterator<ContextKeyInfo>;
320
+ private readonly _defaultValue;
321
+ constructor(key: string, defaultValue: T | undefined, metaOrHide?: string | true | {
322
+ type: string;
323
+ description: string;
324
+ });
325
+ bindTo(target: IContextKeyService): IContextKey<T>;
326
+ getValue(target: IContextKeyService): T | undefined;
327
+ toNegated(): ContextKeyExpression;
328
+ isEqualTo(value: any): ContextKeyExpression;
329
+ notEqualsTo(value: any): ContextKeyExpression;
330
+ }
293
331
  type ContextKeyValue = null | undefined | boolean | number | string | Array<null | undefined | boolean | number | string> | Record<string, null | undefined | boolean | number | string>;
294
332
  interface IContext {
295
333
  getValue<T extends ContextKeyValue = ContextKeyValue>(key: string): T | undefined;
@@ -328,4 +366,4 @@ interface IContextKeyService {
328
366
  updateParent(parentContextKeyService: IContextKeyService): void;
329
367
  }
330
368
 
331
- export { ContextKeyAndExpr, ContextKeyDefinedExpr, ContextKeyEqualsExpr, ContextKeyExprType, ContextKeyExpression, ContextKeyFalseExpr, ContextKeyGreaterEqualsExpr, ContextKeyGreaterExpr, ContextKeyInExpr, ContextKeyNotEqualsExpr, ContextKeyNotExpr, ContextKeyNotInExpr, ContextKeyNotRegexExpr, ContextKeyOrExpr, ContextKeyRegexExpr, ContextKeySmallerEqualsExpr, ContextKeySmallerExpr, ContextKeyTrueExpr, ContextKeyValue, IContext, IContextKey, IContextKeyChangeEvent, IContextKeyExprMapper, IContextKeyExpression, IContextKeyService, IContextKeyServiceTarget, IReadableSet, IScopedContextKeyService };
369
+ export { ContextKeyAndExpr, ContextKeyDefinedExpr, ContextKeyEqualsExpr, ContextKeyExpr, ContextKeyExprType, ContextKeyExpression, ContextKeyFalseExpr, ContextKeyGreaterEqualsExpr, ContextKeyGreaterExpr, ContextKeyInExpr, ContextKeyInfo, ContextKeyNotEqualsExpr, ContextKeyNotExpr, ContextKeyNotInExpr, ContextKeyNotRegexExpr, ContextKeyOrExpr, ContextKeyRegexExpr, ContextKeySmallerEqualsExpr, ContextKeySmallerExpr, ContextKeyTrueExpr, ContextKeyValue, IContext, IContextKey, IContextKeyChangeEvent, IContextKeyExprMapper, IContextKeyExpression, IContextKeyService, IContextKeyServiceTarget, IReadableSet, IScopedContextKeyService, RawContextKey };
@@ -1,3 +1,18 @@
1
+ import { Keybinding } from '../../../base/common/keybindings.js';
2
+ import { ICommandHandler, ICommandHandlerDescription } from '../../commands/common/commands.js';
3
+ import { ContextKeyExpression } from '../../contextkey/common/contextkey.js';
4
+ import { IDisposable } from '../../../base/common/lifecycle.js';
5
+
6
+ interface IKeybindingItem {
7
+ keybinding: Keybinding | null;
8
+ command: string | null;
9
+ commandArgs?: any;
10
+ when: ContextKeyExpression | null | undefined;
11
+ weight1: number;
12
+ weight2: number;
13
+ extensionId: string | null;
14
+ isBuiltinExtension: boolean;
15
+ }
1
16
  interface IKeybindings {
2
17
  primary?: number;
3
18
  secondary?: number[];
@@ -14,5 +29,31 @@ interface IKeybindings {
14
29
  secondary?: number[];
15
30
  };
16
31
  }
32
+ interface IKeybindingRule extends IKeybindings {
33
+ id: string;
34
+ weight: number;
35
+ args?: any;
36
+ when?: ContextKeyExpression | null | undefined;
37
+ }
38
+ interface IExtensionKeybindingRule {
39
+ keybinding: Keybinding | null;
40
+ id: string;
41
+ args?: any;
42
+ weight: number;
43
+ when: ContextKeyExpression | undefined;
44
+ extensionId?: string;
45
+ isBuiltinExtension?: boolean;
46
+ }
47
+ interface ICommandAndKeybindingRule extends IKeybindingRule {
48
+ handler: ICommandHandler;
49
+ description?: ICommandHandlerDescription | null;
50
+ }
51
+ interface IKeybindingsRegistry {
52
+ registerKeybindingRule(rule: IKeybindingRule): IDisposable;
53
+ setExtensionKeybindings(rules: IExtensionKeybindingRule[]): void;
54
+ registerCommandAndKeybindingRule(desc: ICommandAndKeybindingRule): IDisposable;
55
+ getDefaultKeybindings(): IKeybindingItem[];
56
+ }
57
+ declare const KeybindingsRegistry: IKeybindingsRegistry;
17
58
 
18
- export { IKeybindings };
59
+ export { ICommandAndKeybindingRule, IExtensionKeybindingRule, IKeybindingItem, IKeybindingRule, IKeybindings, IKeybindingsRegistry, KeybindingsRegistry };