@theia/plugin 1.33.0 → 1.34.0-next.19

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/theia.d.ts +416 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.33.0",
3
+ "version": "1.34.0-next.19+911c0ca21",
4
4
  "description": "Theia - Plugin API",
5
5
  "types": "./src/theia.d.ts",
6
6
  "publishConfig": {
@@ -32,5 +32,5 @@
32
32
  "nyc": {
33
33
  "extends": "../../configs/nyc.json"
34
34
  },
35
- "gitHead": "d66562f95639027021574e130d20bb9459d89534"
35
+ "gitHead": "911c0ca21ad2e591d4d7497708b365894bec4d7a"
36
36
  }
package/src/theia.d.ts CHANGED
@@ -3001,6 +3001,17 @@ export module '@theia/plugin' {
3001
3001
  */
3002
3002
  message?: string;
3003
3003
 
3004
+ /**
3005
+ * The {@link TerminalLocation} or {@link TerminalEditorLocationOptions} or {@link TerminalSplitLocationOptions} for the terminal.
3006
+ */
3007
+ location?: TerminalLocation | TerminalEditorLocationOptions | TerminalSplitLocationOptions;
3008
+
3009
+ /**
3010
+ * Opt-out of the default terminal persistence on restart and reload.
3011
+ * This will only take effect when `terminal.integrated.enablePersistentSessions` is enabled.
3012
+ */
3013
+ isTransient?: boolean;
3014
+
3004
3015
  /**
3005
3016
  * Terminal attributes. Can be useful to apply some implementation specific information.
3006
3017
  */
@@ -3067,6 +3078,17 @@ export module '@theia/plugin' {
3067
3078
  * control it.
3068
3079
  */
3069
3080
  pty: Pseudoterminal;
3081
+
3082
+ /**
3083
+ * The {@link TerminalLocation} or {@link TerminalEditorLocationOptions} or {@link TerminalSplitLocationOptions} for the terminal.
3084
+ */
3085
+ location?: TerminalLocation | TerminalEditorLocationOptions | TerminalSplitLocationOptions;
3086
+
3087
+ /**
3088
+ * Opt-out of the default terminal persistence on restart and reload.
3089
+ * This will only take effect when `terminal.integrated.enablePersistentSessions` is enabled.
3090
+ */
3091
+ isTransient?: boolean;
3070
3092
  }
3071
3093
 
3072
3094
  /**
@@ -3207,6 +3229,50 @@ export module '@theia/plugin' {
3207
3229
  constructor(startIndex: number, length: number, tooltip?: string);
3208
3230
  }
3209
3231
 
3232
+ /**
3233
+ * The location of the {@link Terminal}.
3234
+ */
3235
+ export enum TerminalLocation {
3236
+ /**
3237
+ * In the terminal view
3238
+ */
3239
+ Panel = 1,
3240
+ /**
3241
+ * In the editor area
3242
+ */
3243
+ Editor = 2,
3244
+ }
3245
+
3246
+ /**
3247
+ * Assumes a {@link TerminalLocation} of editor and allows specifying a {@link ViewColumn} and
3248
+ * {@link TerminalEditorLocationOptions.preserveFocus preserveFocus } property
3249
+ */
3250
+ export interface TerminalEditorLocationOptions {
3251
+ /**
3252
+ * A view column in which the {@link Terminal terminal} should be shown in the editor area.
3253
+ * Use {@link ViewColumn.Active active} to open in the active editor group, other values are
3254
+ * adjusted to be `Min(column, columnCount + 1)`, the
3255
+ * {@link ViewColumn.Active active}-column is not adjusted. Use
3256
+ * {@linkcode ViewColumn.Beside} to open the editor to the side of the currently active one.
3257
+ */
3258
+ viewColumn: ViewColumn;
3259
+ /**
3260
+ * An optional flag that when `true` will stop the {@link Terminal} from taking focus.
3261
+ */
3262
+ preserveFocus?: boolean;
3263
+ }
3264
+
3265
+ /**
3266
+ * Uses the parent {@link Terminal}'s location for the terminal
3267
+ */
3268
+ export interface TerminalSplitLocationOptions {
3269
+ /**
3270
+ * The parent terminal to split this terminal beside. This works whether the parent terminal
3271
+ * is in the panel or the editor area.
3272
+ */
3273
+ parentTerminal: Terminal;
3274
+ }
3275
+
3210
3276
  /**
3211
3277
  * A file decoration represents metadata that can be rendered with a file.
3212
3278
  */
@@ -4554,6 +4620,11 @@ export module '@theia/plugin' {
4554
4620
  */
4555
4621
  export namespace window {
4556
4622
 
4623
+ /**
4624
+ * Represents the grid widget within the main editor area
4625
+ */
4626
+ export const tabGroups: TabGroups;
4627
+
4557
4628
  /**
4558
4629
  * The currently active terminal or undefined. The active terminal is the one
4559
4630
  * that currently has focus or most recently had focus.
@@ -9179,6 +9250,17 @@ export module '@theia/plugin' {
9179
9250
  */
9180
9251
  static readonly RefactorInline: CodeActionKind;
9181
9252
 
9253
+ /**
9254
+ * Base kind for refactoring inline actions: `refactor.move`
9255
+ *
9256
+ * Example move actions:
9257
+ *
9258
+ * - Move a function to a new file
9259
+ * - Move a property between classes
9260
+ * - Move method to base class
9261
+ */
9262
+ static readonly RefactorMove: CodeActionKind;
9263
+
9182
9264
  /**
9183
9265
  * Base kind for refactoring rewrite actions: `refactor.rewrite`
9184
9266
  *
@@ -12415,6 +12497,11 @@ export module '@theia/plugin' {
12415
12497
  * Label will be rendered next to authorName if exists.
12416
12498
  */
12417
12499
  label?: string;
12500
+
12501
+ /**
12502
+ * Optional timestamp.
12503
+ */
12504
+ timestamp?: Date;
12418
12505
  }
12419
12506
 
12420
12507
  /**
@@ -13114,6 +13201,335 @@ export module '@theia/plugin' {
13114
13201
  export function registerAuthenticationProvider(id: string, label: string, provider: AuthenticationProvider, options?: AuthenticationProviderOptions): Disposable;
13115
13202
  }
13116
13203
 
13204
+ /**
13205
+ * The tab represents a single text based resource.
13206
+ */
13207
+ export class TabInputText {
13208
+ /**
13209
+ * The uri represented by the tab.
13210
+ * @stubbed
13211
+ */
13212
+ readonly uri: Uri;
13213
+ /**
13214
+ * Constructs a text tab input with the given URI.
13215
+ * @param uri The URI of the tab.
13216
+ * @stubbed
13217
+ */
13218
+ constructor(uri: Uri);
13219
+ }
13220
+
13221
+ /**
13222
+ * The tab represents two text based resources
13223
+ * being rendered as a diff.
13224
+ */
13225
+ export class TabInputTextDiff {
13226
+ /**
13227
+ * The uri of the original text resource.
13228
+ * @stubbed
13229
+ */
13230
+ readonly original: Uri;
13231
+ /**
13232
+ * The uri of the modified text resource.
13233
+ * @stubbed
13234
+ */
13235
+ readonly modified: Uri;
13236
+ /**
13237
+ * Constructs a new text diff tab input with the given URIs.
13238
+ * @param original The uri of the original text resource.
13239
+ * @param modified The uri of the modified text resource.
13240
+ * @stubbed
13241
+ */
13242
+ constructor(original: Uri, modified: Uri);
13243
+ }
13244
+
13245
+ /**
13246
+ * The tab represents a custom editor.
13247
+ */
13248
+ export class TabInputCustom {
13249
+ /**
13250
+ * The uri that the tab is representing.
13251
+ * @stubbed
13252
+ */
13253
+ readonly uri: Uri;
13254
+ /**
13255
+ * The type of custom editor.
13256
+ * @stubbed
13257
+ */
13258
+ readonly viewType: string;
13259
+ /**
13260
+ * Constructs a custom editor tab input.
13261
+ * @param uri The uri of the tab.
13262
+ * @param viewType The viewtype of the custom editor.
13263
+ * @stubbed
13264
+ */
13265
+ constructor(uri: Uri, viewType: string);
13266
+ }
13267
+
13268
+ /**
13269
+ * The tab represents a webview.
13270
+ */
13271
+ export class TabInputWebview {
13272
+ /**
13273
+ * The type of webview. Maps to WebviewPanel's viewType
13274
+ * @stubbed
13275
+ */
13276
+ readonly viewType: string;
13277
+ /**
13278
+ * Constructs a webview tab input with the given view type.
13279
+ * @param viewType The type of webview. Maps to WebviewPanel's viewType
13280
+ * @stubbed
13281
+ */
13282
+ constructor(viewType: string);
13283
+ }
13284
+
13285
+ /**
13286
+ * The tab represents a notebook.
13287
+ */
13288
+ export class TabInputNotebook {
13289
+ /**
13290
+ * The uri that the tab is representing.
13291
+ * @stubbed
13292
+ */
13293
+ readonly uri: Uri;
13294
+ /**
13295
+ * The type of notebook. Maps to NotebookDocuments's notebookType
13296
+ * @stubbed
13297
+ */
13298
+ readonly notebookType: string;
13299
+ /**
13300
+ * Constructs a new tab input for a notebook.
13301
+ * @param uri The uri of the notebook.
13302
+ * @param notebookType The type of notebook. Maps to NotebookDocuments's notebookType
13303
+ * @stubbed
13304
+ */
13305
+ constructor(uri: Uri, notebookType: string);
13306
+ }
13307
+
13308
+ /**
13309
+ * The tabs represents two notebooks in a diff configuration.
13310
+ */
13311
+ export class TabInputNotebookDiff {
13312
+ /**
13313
+ * The uri of the original notebook.
13314
+ * @stubbed
13315
+ */
13316
+ readonly original: Uri;
13317
+ /**
13318
+ * The uri of the modified notebook.
13319
+ * @stubbed
13320
+ */
13321
+ readonly modified: Uri;
13322
+ /**
13323
+ * The type of notebook. Maps to NotebookDocuments's notebookType
13324
+ * @stubbed
13325
+ */
13326
+ readonly notebookType: string;
13327
+ /**
13328
+ * Constructs a notebook diff tab input.
13329
+ * @param original The uri of the original unmodified notebook.
13330
+ * @param modified The uri of the modified notebook.
13331
+ * @param notebookType The type of notebook. Maps to NotebookDocuments's notebookType
13332
+ * @stubbed
13333
+ */
13334
+ constructor(original: Uri, modified: Uri, notebookType: string);
13335
+ }
13336
+
13337
+ /**
13338
+ * The tab represents a terminal in the editor area.
13339
+ */
13340
+ export class TabInputTerminal {
13341
+ /**
13342
+ * Constructs a terminal tab input.
13343
+ * @stubbed
13344
+ */
13345
+ constructor();
13346
+ }
13347
+
13348
+ /**
13349
+ * Represents a tab within a {@link TabGroup group of tabs}.
13350
+ * Tabs are merely the graphical representation within the editor area.
13351
+ * A backing editor is not a guarantee.
13352
+ */
13353
+ export interface Tab {
13354
+
13355
+ /**
13356
+ * The text displayed on the tab.
13357
+ * @stubbed
13358
+ */
13359
+ readonly label: string;
13360
+
13361
+ /**
13362
+ * The group which the tab belongs to.
13363
+ * @stubbed
13364
+ */
13365
+ readonly group: TabGroup;
13366
+
13367
+ /**
13368
+ * Defines the structure of the tab i.e. text, notebook, custom, etc.
13369
+ * Resource and other useful properties are defined on the tab kind.
13370
+ * @stubbed
13371
+ */
13372
+ readonly input: TabInputText | TabInputTextDiff | TabInputCustom | TabInputWebview | TabInputNotebook | TabInputNotebookDiff | TabInputTerminal | unknown;
13373
+
13374
+ /**
13375
+ * Whether or not the tab is currently active.
13376
+ * This is dictated by being the selected tab in the group.
13377
+ * @stubbed
13378
+ */
13379
+ readonly isActive: boolean;
13380
+
13381
+ /**
13382
+ * Whether or not the dirty indicator is present on the tab.
13383
+ * @stubbed
13384
+ */
13385
+ readonly isDirty: boolean;
13386
+
13387
+ /**
13388
+ * Whether or not the tab is pinned (pin icon is present).
13389
+ * @stubbed
13390
+ */
13391
+ readonly isPinned: boolean;
13392
+
13393
+ /**
13394
+ * Whether or not the tab is in preview mode.
13395
+ * @stubbed
13396
+ */
13397
+ readonly isPreview: boolean;
13398
+ }
13399
+
13400
+ /**
13401
+ * An event describing change to tabs.
13402
+ */
13403
+ export interface TabChangeEvent {
13404
+ /**
13405
+ * The tabs that have been opened.
13406
+ * @stubbed
13407
+ */
13408
+ readonly opened: readonly Tab[];
13409
+ /**
13410
+ * The tabs that have been closed.
13411
+ * @stubbed
13412
+ */
13413
+ readonly closed: readonly Tab[];
13414
+ /**
13415
+ * Tabs that have changed, e.g have changed
13416
+ * their {@link Tab.isActive active} state.
13417
+ * @stubbed
13418
+ */
13419
+ readonly changed: readonly Tab[];
13420
+ }
13421
+
13422
+ /**
13423
+ * An event describing changes to tab groups.
13424
+ */
13425
+ export interface TabGroupChangeEvent {
13426
+ /**
13427
+ * Tab groups that have been opened.
13428
+ * @stubbed
13429
+ */
13430
+ readonly opened: readonly TabGroup[];
13431
+ /**
13432
+ * Tab groups that have been closed.
13433
+ * @stubbed
13434
+ */
13435
+ readonly closed: readonly TabGroup[];
13436
+ /**
13437
+ * Tab groups that have changed, e.g have changed
13438
+ * their {@link TabGroup.isActive active} state.
13439
+ * @stubbed
13440
+ */
13441
+ readonly changed: readonly TabGroup[];
13442
+ }
13443
+
13444
+ /**
13445
+ * Represents a group of tabs. A tab group itself consists of multiple tabs.
13446
+ */
13447
+ export interface TabGroup {
13448
+ /**
13449
+ * Whether or not the group is currently active.
13450
+ *
13451
+ * *Note* that only one tab group is active at a time, but that multiple tab
13452
+ * groups can have an {@link TabGroup.aciveTab active tab}.
13453
+ *
13454
+ * @see {@link Tab.isActive}
13455
+ * @stubbed
13456
+ */
13457
+ readonly isActive: boolean;
13458
+
13459
+ /**
13460
+ * The view column of the group.
13461
+ * @stubbed
13462
+ */
13463
+ readonly viewColumn: ViewColumn;
13464
+
13465
+ /**
13466
+ * The active {@link Tab tab} in the group. This is the tab whose contents are currently
13467
+ * being rendered.
13468
+ *
13469
+ * *Note* that there can be one active tab per group but there can only be one {@link TabGroups.activeTabGroup active group}.
13470
+ * @stubbed
13471
+ */
13472
+ readonly activeTab: Tab | undefined;
13473
+
13474
+ /**
13475
+ * The list of tabs contained within the group.
13476
+ * This can be empty if the group has no tabs open.
13477
+ * @stubbed
13478
+ */
13479
+ readonly tabs: readonly Tab[];
13480
+ }
13481
+
13482
+ /**
13483
+ * Represents the main editor area which consists of multple groups which contain tabs.
13484
+ */
13485
+ export interface TabGroups {
13486
+ /**
13487
+ * All the groups within the group container.
13488
+ * @stubbed
13489
+ */
13490
+ readonly all: readonly TabGroup[];
13491
+
13492
+ /**
13493
+ * The currently active group.
13494
+ * @stubbed
13495
+ */
13496
+ readonly activeTabGroup: TabGroup;
13497
+
13498
+ /**
13499
+ * An {@link Event event} which fires when {@link TabGroup tab groups} have changed.
13500
+ * @stubbed
13501
+ */
13502
+ readonly onDidChangeTabGroups: Event<TabGroupChangeEvent>;
13503
+
13504
+ /**
13505
+ * An {@link Event event} which fires when {@link Tab tabs} have changed.
13506
+ * @stubbed
13507
+ */
13508
+ readonly onDidChangeTabs: Event<TabChangeEvent>;
13509
+
13510
+ /**
13511
+ * Closes the tab. This makes the tab object invalid and the tab
13512
+ * should no longer be used for further actions.
13513
+ * Note: In the case of a dirty tab, a confirmation dialog will be shown which may be cancelled. If cancelled the tab is still valid
13514
+ *
13515
+ * @param tab The tab to close.
13516
+ * @param preserveFocus When `true` focus will remain in its current position. If `false` it will jump to the next tab.
13517
+ * @returns A promise that resolves to `true` when all tabs have been closed.
13518
+ * @stubbed
13519
+ */
13520
+ close(tab: Tab | readonly Tab[], preserveFocus?: boolean): Thenable<boolean>;
13521
+
13522
+ /**
13523
+ * Closes the tab group. This makes the tab group object invalid and the tab group
13524
+ * should no longer be used for further actions.
13525
+ * @param tabGroup The tab group to close.
13526
+ * @param preserveFocus When `true` focus will remain in its current position.
13527
+ * @returns A promise that resolves to `true` when all tab groups have been closed.
13528
+ * @stubbed
13529
+ */
13530
+ close(tabGroup: TabGroup | readonly TabGroup[], preserveFocus?: boolean): Thenable<boolean>;
13531
+ }
13532
+
13117
13533
  /**
13118
13534
  * Represents a notebook editor that is attached to a {@link NotebookDocument notebook}.
13119
13535
  */