@theia/plugin 1.33.0-next.9 → 1.34.0-next.7

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 +3 -3
  2. package/src/theia.d.ts +1926 -5
package/src/theia.d.ts CHANGED
@@ -3768,6 +3768,14 @@ export module '@theia/plugin' {
3768
3768
  */
3769
3769
  readonly enableScripts?: boolean;
3770
3770
 
3771
+ /**
3772
+ * Controls whether forms are enabled in the webview content or not.
3773
+ *
3774
+ * Defaults to true if {@link WebviewOptions.enableScripts scripts are enabled}. Otherwise defaults to false.
3775
+ * Explicitly setting this property to either true or false overrides the default.
3776
+ */
3777
+ readonly enableForms?: boolean;
3778
+
3771
3779
  /**
3772
3780
  * Controls whether command uris are enabled in webview content or not.
3773
3781
  *
@@ -4546,6 +4554,11 @@ export module '@theia/plugin' {
4546
4554
  */
4547
4555
  export namespace window {
4548
4556
 
4557
+ /**
4558
+ * Represents the grid widget within the main editor area
4559
+ */
4560
+ export const tabGroups: TabGroups;
4561
+
4549
4562
  /**
4550
4563
  * The currently active terminal or undefined. The active terminal is the one
4551
4564
  * that currently has focus or most recently had focus.
@@ -4642,6 +4655,60 @@ export module '@theia/plugin' {
4642
4655
  */
4643
4656
  export function showTextDocument(uri: Uri, options?: TextDocumentShowOptions): Thenable<TextEditor>;
4644
4657
 
4658
+ /**
4659
+ * The currently visible {@link NotebookEditor notebook editors} or an empty array.
4660
+ * @stubbed
4661
+ */
4662
+ export const visibleNotebookEditors: readonly NotebookEditor[];
4663
+
4664
+ /**
4665
+ * An {@link Event} which fires when the {@link window.visibleNotebookEditors visible notebook editors}
4666
+ * has changed.
4667
+ * @stubbed
4668
+ */
4669
+ export const onDidChangeVisibleNotebookEditors: Event<readonly NotebookEditor[]>;
4670
+
4671
+ /**
4672
+ * The currently active {@link NotebookEditor notebook editor} or `undefined`. The active editor is the one
4673
+ * that currently has focus or, when none has focus, the one that has changed
4674
+ * input most recently.
4675
+ * @stubbed
4676
+ */
4677
+ export const activeNotebookEditor: NotebookEditor | undefined;
4678
+
4679
+ /**
4680
+ * An {@link Event} which fires when the {@link window.activeNotebookEditor active notebook editor}
4681
+ * has changed. *Note* that the event also fires when the active editor changes
4682
+ * to `undefined`.
4683
+ * @stubbed
4684
+ */
4685
+ export const onDidChangeActiveNotebookEditor: Event<NotebookEditor | undefined>;
4686
+
4687
+ /**
4688
+ * An {@link Event} which fires when the {@link NotebookEditor.selections notebook editor selections}
4689
+ * have changed.
4690
+ * @stubbed
4691
+ */
4692
+ export const onDidChangeNotebookEditorSelection: Event<NotebookEditorSelectionChangeEvent>;
4693
+
4694
+ /**
4695
+ * An {@link Event} which fires when the {@link NotebookEditor.visibleRanges notebook editor visible ranges}
4696
+ * have changed.
4697
+ * @stubbed
4698
+ */
4699
+ export const onDidChangeNotebookEditorVisibleRanges: Event<NotebookEditorVisibleRangesChangeEvent>;
4700
+
4701
+ /**
4702
+ * Show the given {@link NotebookDocument} in a {@link NotebookEditor notebook editor}.
4703
+ *
4704
+ * @param document A text document to be shown.
4705
+ * @param options {@link NotebookDocumentShowOptions Editor options} to configure the behavior of showing the {@link NotebookEditor notebook editor}.
4706
+ *
4707
+ * @return A promise that resolves to an {@link NotebookEditor notebook editor}.
4708
+ * @stubbed
4709
+ */
4710
+ export function showNotebookDocument(document: NotebookDocument, options?: NotebookDocumentShowOptions): Thenable<NotebookEditor>;
4711
+
4645
4712
  /**
4646
4713
  * Shows a selection list.
4647
4714
  *
@@ -5184,7 +5251,8 @@ export module '@theia/plugin' {
5184
5251
  export enum ColorThemeKind {
5185
5252
  Light = 1,
5186
5253
  Dark = 2,
5187
- HighContrast = 3
5254
+ HighContrast = 3,
5255
+ HighContrastLight = 4
5188
5256
  }
5189
5257
 
5190
5258
  /**
@@ -5192,7 +5260,7 @@ export module '@theia/plugin' {
5192
5260
  */
5193
5261
  export interface ColorTheme {
5194
5262
  /**
5195
- * The kind of this color theme: light, dark or high contrast.
5263
+ * The kind of this color theme: light, dark, high contrast dark and high contrast light.
5196
5264
  */
5197
5265
  readonly kind: ColorThemeKind;
5198
5266
  }
@@ -5961,6 +6029,18 @@ export module '@theia/plugin' {
5961
6029
  SymbolicLink = 64
5962
6030
  }
5963
6031
 
6032
+ export enum FilePermission {
6033
+ /**
6034
+ * The file is readonly.
6035
+ *
6036
+ * *Note:* All `FileStat` from a `FileSystemProvider` that is registered with
6037
+ * the option `isReadonly: true` will be implicitly handled as if `FilePermission.Readonly`
6038
+ * is set. As a consequence, it is not possible to have a readonly file system provider
6039
+ * registered where some `FileStat` are not readonly.
6040
+ */
6041
+ Readonly = 1
6042
+ }
6043
+
5964
6044
  /**
5965
6045
  * The `FileStat`-type represents metadata about a file
5966
6046
  */
@@ -5992,6 +6072,12 @@ export module '@theia/plugin' {
5992
6072
  * example.
5993
6073
  */
5994
6074
  size: number;
6075
+ /**
6076
+ * The permissions of the file, e.g. whether the file is readonly.
6077
+ *
6078
+ * *Note:* This value might be a bitmask, e.g. `FilePermission.Readonly | FilePermission.Other`.
6079
+ */
6080
+ permissions?: FilePermission;
5995
6081
  }
5996
6082
 
5997
6083
  /**
@@ -6301,6 +6387,21 @@ export module '@theia/plugin' {
6301
6387
  * @param options Defines if existing files should be overwritten.
6302
6388
  */
6303
6389
  copy(source: Uri, target: Uri, options?: { overwrite?: boolean }): Thenable<void>;
6390
+
6391
+ /**
6392
+ * Check if a given file system supports writing files.
6393
+ *
6394
+ * Keep in mind that just because a file system supports writing, that does
6395
+ * not mean that writes will always succeed. There may be permissions issues
6396
+ * or other errors that prevent writing a file.
6397
+ *
6398
+ * @param scheme The scheme of the filesystem, for example `file` or `git`.
6399
+ *
6400
+ * @return `true` if the file system supports writing, `false` if it does not
6401
+ * support writing (i.e. it is readonly), and `undefined` if the editor does not
6402
+ * know about the filesystem.
6403
+ */
6404
+ isWritableFileSystem(scheme: string): boolean | undefined;
6304
6405
  }
6305
6406
 
6306
6407
  /**
@@ -6376,6 +6477,14 @@ export module '@theia/plugin' {
6376
6477
  */
6377
6478
  export let textDocuments: readonly TextDocument[];
6378
6479
 
6480
+ /**
6481
+ * All notebook documents currently known to the editor.
6482
+ *
6483
+ * @readonly
6484
+ * @stubbed
6485
+ */
6486
+ export let notebookDocuments: readonly NotebookDocument[];
6487
+
6379
6488
  /**
6380
6489
  * Register a text document content provider.
6381
6490
  *
@@ -6387,6 +6496,40 @@ export module '@theia/plugin' {
6387
6496
  */
6388
6497
  export function registerTextDocumentContentProvider(scheme: string, provider: TextDocumentContentProvider): Disposable;
6389
6498
 
6499
+ /**
6500
+ * An event that is emitted when a {@link NotebookDocument notebook} is opened.
6501
+ * @stubbed
6502
+ */
6503
+ export const onDidOpenNotebookDocument: Event<NotebookDocument>;
6504
+
6505
+ /**
6506
+ * An event that is emitted when a notebook is disposed.
6507
+ *
6508
+ * Note 1: There is no guarantee that this event fires when an editor tab is closed.
6509
+ *
6510
+ * Note 2: A notebook can be open but not shown in an editor which means this event can fire for a notebook that has not been shown in an editor.
6511
+ * @stubbed
6512
+ */
6513
+ export const onDidCloseNotebookDocument: Event<NotebookDocument>;
6514
+
6515
+ /**
6516
+ * An event that is emitted when a {@link NotebookDocument notebook} is saved.
6517
+ * @stubbed
6518
+ */
6519
+ export const onDidSaveNotebookDocument: Event<NotebookDocument>;
6520
+
6521
+ /**
6522
+ * Register a notebook serializer.
6523
+ *
6524
+ * A notebook serializer must be contributed through the notebooks extension point. When opening a notebook file, the editor will send the onNotebook:<notebookType> activation event, and extensions must register their serializer in return.
6525
+ * @param notebookType a notebook.
6526
+ * @param serializer a notebook serializer.
6527
+ * @param options Optional context options that define what parts of a notebook should be persisted
6528
+ * @return A {@link Disposable disposable} that unregisters this serializer when being disposed.
6529
+ * @stubbed
6530
+ */
6531
+ export function registerNotebookSerializer(notebookType: string, serializer: NotebookSerializer, options?: NotebookDocumentContentOptions): Disposable;
6532
+
6390
6533
  /**
6391
6534
  * An event that is emitted when a {@link TextDocument text document} is opened.
6392
6535
  *
@@ -6396,10 +6539,14 @@ export module '@theia/plugin' {
6396
6539
  * - The event is emitted before the {@link TextDocument document} is updated in the
6397
6540
  * {@link window.activeTextEditor active text editor}
6398
6541
  * - When a {@link TextDocument text document} is already open (e.g.: open in another {@link window.visibleTextEditors visible text editor}) this event is not emitted
6399
- *
6400
6542
  */
6401
6543
  export const onDidOpenTextDocument: Event<TextDocument>;
6402
6544
 
6545
+ /**
6546
+ * An event that is emitted when a {@link TextDocument text document} is saved to disk.
6547
+ */
6548
+ export const onDidSaveTextDocument: Event<TextDocument>;
6549
+
6403
6550
  /**
6404
6551
  * An event that is emitted when a {@link TextDocument text document} is disposed.
6405
6552
  *
@@ -6432,9 +6579,10 @@ export module '@theia/plugin' {
6432
6579
  export const onWillSaveTextDocument: Event<TextDocumentWillSaveEvent>;
6433
6580
 
6434
6581
  /**
6435
- * An event that is emitted when a {@link TextDocument text document} is saved to disk.
6582
+ * An event that is emitted when a {@link Notebook notebook} has changed.
6583
+ * @stubbed
6436
6584
  */
6437
- export const onDidSaveTextDocument: Event<TextDocument>;
6585
+ export const onDidChangeNotebookDocument: Event<NotebookDocumentChangeEvent>;
6438
6586
 
6439
6587
  /**
6440
6588
  * An event that is emitted when files are being created.
@@ -6544,6 +6692,31 @@ export module '@theia/plugin' {
6544
6692
  */
6545
6693
  export function openTextDocument(options?: { language?: string; content?: string; }): Thenable<TextDocument | undefined>;
6546
6694
 
6695
+ /**
6696
+ * Open a notebook. Will return early if this notebook is already {@link NotebookDocument loaded}.
6697
+ * Otherwise the notebook is loaded and the {@link onDidOpenNotebookDocument onDidOpenNotebookDocument}-event fires.
6698
+ *
6699
+ * Note that the lifecycle of the returned notebook is owned by the editor and not by the extension.
6700
+ * That means an {@link onDidCloseNotebookDocument onDidCloseNotebookDocument}-event can occur at any time after.
6701
+ * Note that opening a notebook does not show a notebook editor. This function only returns a notebook document
6702
+ * which can be shown in a notebook editor but it can also be used for other things.
6703
+ *
6704
+ * @param uri The resource to open.
6705
+ * @return A promise that resolves to a {@link NotebookDocument notebook}.
6706
+ * @stubbed
6707
+ */
6708
+ export function openNotebookDocument(uri: Uri): Thenable<NotebookDocument> | undefined;
6709
+
6710
+ /**
6711
+ * Open an untitled notebook. The editor will prompt the user for a file path when the document is to be saved.
6712
+ *
6713
+ * @param notebookType The notebook type that should be used.
6714
+ * @param content The initial contents of the notebook.
6715
+ * @return A promise that resolves to a {@link NotebookDocument notebook}.
6716
+ * @stubbed
6717
+ */
6718
+ export function openNotebookDocument(notebookType: string, content?: NotebookData): Thenable<NotebookDocument> | undefined;
6719
+
6547
6720
  /**
6548
6721
  * Get a workspace configuration object.
6549
6722
  *
@@ -6968,6 +7141,19 @@ export module '@theia/plugin' {
6968
7141
  * to filter documents to a {@link WorkspaceFolder workspace folder}.
6969
7142
  */
6970
7143
  readonly pattern?: GlobPattern;
7144
+
7145
+ /**
7146
+ * The {@link NotebookDocument.notebookType type} of a notebook, like `jupyter-notebook`. This allows
7147
+ * to narrow down on the type of a notebook that a {@link NotebookCell.document cell document} belongs to.
7148
+ *
7149
+ * *Note* that setting the `notebookType`-property changes how `scheme` and `pattern` are interpreted. When set
7150
+ * they are evaluated against the {@link NotebookDocument.uri notebook uri}, not the document uri.
7151
+ *
7152
+ * @example <caption>Match python document inside jupyter notebook that aren't stored yet (`untitled`)</caption>
7153
+ * { language: 'python', notebookType: 'jupyter-notebook', scheme: 'untitled' }
7154
+ * @stubbed
7155
+ */
7156
+ readonly notebookType?: string;
6971
7157
  }
6972
7158
 
6973
7159
  /**
@@ -8292,6 +8478,143 @@ export module '@theia/plugin' {
8292
8478
  resolveCompletionItem?(item: T, token: CancellationToken): ProviderResult<T>;
8293
8479
  }
8294
8480
 
8481
+ /**
8482
+ * The inline completion item provider interface defines the contract between extensions and
8483
+ * the inline completion feature.
8484
+ *
8485
+ * Providers are asked for completions either explicitly by a user gesture or implicitly when typing.
8486
+ */
8487
+ export interface InlineCompletionItemProvider {
8488
+
8489
+ /**
8490
+ * Provides inline completion items for the given position and document.
8491
+ * If inline completions are enabled, this method will be called whenever the user stopped typing.
8492
+ * It will also be called when the user explicitly triggers inline completions or explicitly asks for the next or previous inline completion.
8493
+ * In that case, all available inline completions should be returned.
8494
+ * `context.triggerKind` can be used to distinguish between these scenarios.
8495
+ *
8496
+ * @param document The document inline completions are requested for.
8497
+ * @param position The position inline completions are requested for.
8498
+ * @param context A context object with additional information.
8499
+ * @param token A cancellation token.
8500
+ * @return An array of completion items or a thenable that resolves to an array of completion items.
8501
+ */
8502
+ provideInlineCompletionItems(document: TextDocument, position: Position, context: InlineCompletionContext, token: CancellationToken): ProviderResult<InlineCompletionItem[] | InlineCompletionList>;
8503
+ }
8504
+
8505
+ /**
8506
+ * Represents a collection of {@link InlineCompletionItem inline completion items} to be presented
8507
+ * in the editor.
8508
+ */
8509
+ export class InlineCompletionList {
8510
+ /**
8511
+ * The inline completion items.
8512
+ */
8513
+ items: InlineCompletionItem[];
8514
+
8515
+ /**
8516
+ * Creates a new list of inline completion items.
8517
+ */
8518
+ constructor(items: InlineCompletionItem[]);
8519
+ }
8520
+
8521
+ /**
8522
+ * Provides information about the context in which an inline completion was requested.
8523
+ */
8524
+ export interface InlineCompletionContext {
8525
+ /**
8526
+ * Describes how the inline completion was triggered.
8527
+ */
8528
+ readonly triggerKind: InlineCompletionTriggerKind;
8529
+
8530
+ /**
8531
+ * Provides information about the currently selected item in the autocomplete widget if it is visible.
8532
+ *
8533
+ * If set, provided inline completions must extend the text of the selected item
8534
+ * and use the same range, otherwise they are not shown as preview.
8535
+ * As an example, if the document text is `console.` and the selected item is `.log` replacing the `.` in the document,
8536
+ * the inline completion must also replace `.` and start with `.log`, for example `.log()`.
8537
+ *
8538
+ * Inline completion providers are requested again whenever the selected item changes.
8539
+ */
8540
+ readonly selectedCompletionInfo: SelectedCompletionInfo | undefined;
8541
+ }
8542
+
8543
+ /**
8544
+ * Describes the currently selected completion item.
8545
+ */
8546
+ export interface SelectedCompletionInfo {
8547
+ /**
8548
+ * The range that will be replaced if this completion item is accepted.
8549
+ */
8550
+ readonly range: Range;
8551
+
8552
+ /**
8553
+ * The text the range will be replaced with if this completion is accepted.
8554
+ */
8555
+ readonly text: string;
8556
+ }
8557
+
8558
+ /**
8559
+ * Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.
8560
+ */
8561
+ export enum InlineCompletionTriggerKind {
8562
+ /**
8563
+ * Completion was triggered explicitly by a user gesture.
8564
+ * Return multiple completion items to enable cycling through them.
8565
+ */
8566
+ Invoke = 0,
8567
+
8568
+ /**
8569
+ * Completion was triggered automatically while editing.
8570
+ * It is sufficient to return a single completion item in this case.
8571
+ */
8572
+ Automatic = 1,
8573
+ }
8574
+
8575
+ /**
8576
+ * An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.
8577
+ *
8578
+ * @see {@link InlineCompletionItemProvider.provideInlineCompletionItems}
8579
+ */
8580
+ export class InlineCompletionItem {
8581
+ /**
8582
+ * The text to replace the range with. Must be set.
8583
+ * Is used both for the preview and the accept operation.
8584
+ */
8585
+ insertText: string | SnippetString;
8586
+
8587
+ /**
8588
+ * A text that is used to decide if this inline completion should be shown. When `falsy`
8589
+ * the {@link InlineCompletionItem.insertText} is used.
8590
+ *
8591
+ * An inline completion is shown if the text to replace is a prefix of the filter text.
8592
+ */
8593
+ filterText?: string;
8594
+
8595
+ /**
8596
+ * The range to replace.
8597
+ * Must begin and end on the same line.
8598
+ *
8599
+ * Prefer replacements over insertions to provide a better experience when the user deletes typed text.
8600
+ */
8601
+ range?: Range;
8602
+
8603
+ /**
8604
+ * An optional {@link Command} that is executed *after* inserting this completion.
8605
+ */
8606
+ command?: Command;
8607
+
8608
+ /**
8609
+ * Creates a new inline completion item.
8610
+ *
8611
+ * @param insertText The text to replace the range with.
8612
+ * @param range The range to replace. If not set, the word at the requested position will be used.
8613
+ * @param command An optional {@link Command} that is executed *after* inserting this completion.
8614
+ */
8615
+ constructor(insertText: string | SnippetString, range?: Range, command?: Command);
8616
+ }
8617
+
8295
8618
  /**
8296
8619
  * Represents a location inside a resource, such as a line
8297
8620
  * inside a text file.
@@ -8861,6 +9184,17 @@ export module '@theia/plugin' {
8861
9184
  */
8862
9185
  static readonly RefactorInline: CodeActionKind;
8863
9186
 
9187
+ /**
9188
+ * Base kind for refactoring inline actions: `refactor.move`
9189
+ *
9190
+ * Example move actions:
9191
+ *
9192
+ * - Move a function to a new file
9193
+ * - Move a property between classes
9194
+ * - Move method to base class
9195
+ */
9196
+ static readonly RefactorMove: CodeActionKind;
9197
+
8864
9198
  /**
8865
9199
  * Base kind for refactoring rewrite actions: `refactor.rewrite`
8866
9200
  *
@@ -9659,6 +9993,19 @@ export module '@theia/plugin' {
9659
9993
  */
9660
9994
  export function registerCompletionItemProvider(selector: DocumentSelector, provider: CompletionItemProvider, ...triggerCharacters: string[]): Disposable;
9661
9995
 
9996
+ /**
9997
+ * Registers an inline completion provider.
9998
+ *
9999
+ * Multiple providers can be registered for a language. In that case providers are asked in
10000
+ * parallel and the results are merged. A failing provider (rejected promise or exception) will
10001
+ * not cause a failure of the whole operation.
10002
+ *
10003
+ * @param selector A selector that defines the documents this provider is applicable to.
10004
+ * @param provider An inline completion provider.
10005
+ * @return A {@link Disposable} that unregisters this provider when being disposed.
10006
+ */
10007
+ export function registerInlineCompletionItemProvider(selector: DocumentSelector, provider: InlineCompletionItemProvider): Disposable;
10008
+
9662
10009
  /**
9663
10010
  * Register a definition provider.
9664
10011
  *
@@ -12084,6 +12431,11 @@ export module '@theia/plugin' {
12084
12431
  * Label will be rendered next to authorName if exists.
12085
12432
  */
12086
12433
  label?: string;
12434
+
12435
+ /**
12436
+ * Optional timestamp.
12437
+ */
12438
+ timestamp?: Date;
12087
12439
  }
12088
12440
 
12089
12441
  /**
@@ -12782,6 +13134,1575 @@ export module '@theia/plugin' {
12782
13134
  */
12783
13135
  export function registerAuthenticationProvider(id: string, label: string, provider: AuthenticationProvider, options?: AuthenticationProviderOptions): Disposable;
12784
13136
  }
13137
+
13138
+ /**
13139
+ * The tab represents a single text based resource.
13140
+ */
13141
+ export class TabInputText {
13142
+ /**
13143
+ * The uri represented by the tab.
13144
+ * @stubbed
13145
+ */
13146
+ readonly uri: Uri;
13147
+ /**
13148
+ * Constructs a text tab input with the given URI.
13149
+ * @param uri The URI of the tab.
13150
+ * @stubbed
13151
+ */
13152
+ constructor(uri: Uri);
13153
+ }
13154
+
13155
+ /**
13156
+ * The tab represents two text based resources
13157
+ * being rendered as a diff.
13158
+ */
13159
+ export class TabInputTextDiff {
13160
+ /**
13161
+ * The uri of the original text resource.
13162
+ * @stubbed
13163
+ */
13164
+ readonly original: Uri;
13165
+ /**
13166
+ * The uri of the modified text resource.
13167
+ * @stubbed
13168
+ */
13169
+ readonly modified: Uri;
13170
+ /**
13171
+ * Constructs a new text diff tab input with the given URIs.
13172
+ * @param original The uri of the original text resource.
13173
+ * @param modified The uri of the modified text resource.
13174
+ * @stubbed
13175
+ */
13176
+ constructor(original: Uri, modified: Uri);
13177
+ }
13178
+
13179
+ /**
13180
+ * The tab represents a custom editor.
13181
+ */
13182
+ export class TabInputCustom {
13183
+ /**
13184
+ * The uri that the tab is representing.
13185
+ * @stubbed
13186
+ */
13187
+ readonly uri: Uri;
13188
+ /**
13189
+ * The type of custom editor.
13190
+ * @stubbed
13191
+ */
13192
+ readonly viewType: string;
13193
+ /**
13194
+ * Constructs a custom editor tab input.
13195
+ * @param uri The uri of the tab.
13196
+ * @param viewType The viewtype of the custom editor.
13197
+ * @stubbed
13198
+ */
13199
+ constructor(uri: Uri, viewType: string);
13200
+ }
13201
+
13202
+ /**
13203
+ * The tab represents a webview.
13204
+ */
13205
+ export class TabInputWebview {
13206
+ /**
13207
+ * The type of webview. Maps to WebviewPanel's viewType
13208
+ * @stubbed
13209
+ */
13210
+ readonly viewType: string;
13211
+ /**
13212
+ * Constructs a webview tab input with the given view type.
13213
+ * @param viewType The type of webview. Maps to WebviewPanel's viewType
13214
+ * @stubbed
13215
+ */
13216
+ constructor(viewType: string);
13217
+ }
13218
+
13219
+ /**
13220
+ * The tab represents a notebook.
13221
+ */
13222
+ export class TabInputNotebook {
13223
+ /**
13224
+ * The uri that the tab is representing.
13225
+ * @stubbed
13226
+ */
13227
+ readonly uri: Uri;
13228
+ /**
13229
+ * The type of notebook. Maps to NotebookDocuments's notebookType
13230
+ * @stubbed
13231
+ */
13232
+ readonly notebookType: string;
13233
+ /**
13234
+ * Constructs a new tab input for a notebook.
13235
+ * @param uri The uri of the notebook.
13236
+ * @param notebookType The type of notebook. Maps to NotebookDocuments's notebookType
13237
+ * @stubbed
13238
+ */
13239
+ constructor(uri: Uri, notebookType: string);
13240
+ }
13241
+
13242
+ /**
13243
+ * The tabs represents two notebooks in a diff configuration.
13244
+ */
13245
+ export class TabInputNotebookDiff {
13246
+ /**
13247
+ * The uri of the original notebook.
13248
+ * @stubbed
13249
+ */
13250
+ readonly original: Uri;
13251
+ /**
13252
+ * The uri of the modified notebook.
13253
+ * @stubbed
13254
+ */
13255
+ readonly modified: Uri;
13256
+ /**
13257
+ * The type of notebook. Maps to NotebookDocuments's notebookType
13258
+ * @stubbed
13259
+ */
13260
+ readonly notebookType: string;
13261
+ /**
13262
+ * Constructs a notebook diff tab input.
13263
+ * @param original The uri of the original unmodified notebook.
13264
+ * @param modified The uri of the modified notebook.
13265
+ * @param notebookType The type of notebook. Maps to NotebookDocuments's notebookType
13266
+ * @stubbed
13267
+ */
13268
+ constructor(original: Uri, modified: Uri, notebookType: string);
13269
+ }
13270
+
13271
+ /**
13272
+ * The tab represents a terminal in the editor area.
13273
+ */
13274
+ export class TabInputTerminal {
13275
+ /**
13276
+ * Constructs a terminal tab input.
13277
+ * @stubbed
13278
+ */
13279
+ constructor();
13280
+ }
13281
+
13282
+ /**
13283
+ * Represents a tab within a {@link TabGroup group of tabs}.
13284
+ * Tabs are merely the graphical representation within the editor area.
13285
+ * A backing editor is not a guarantee.
13286
+ */
13287
+ export interface Tab {
13288
+
13289
+ /**
13290
+ * The text displayed on the tab.
13291
+ * @stubbed
13292
+ */
13293
+ readonly label: string;
13294
+
13295
+ /**
13296
+ * The group which the tab belongs to.
13297
+ * @stubbed
13298
+ */
13299
+ readonly group: TabGroup;
13300
+
13301
+ /**
13302
+ * Defines the structure of the tab i.e. text, notebook, custom, etc.
13303
+ * Resource and other useful properties are defined on the tab kind.
13304
+ * @stubbed
13305
+ */
13306
+ readonly input: TabInputText | TabInputTextDiff | TabInputCustom | TabInputWebview | TabInputNotebook | TabInputNotebookDiff | TabInputTerminal | unknown;
13307
+
13308
+ /**
13309
+ * Whether or not the tab is currently active.
13310
+ * This is dictated by being the selected tab in the group.
13311
+ * @stubbed
13312
+ */
13313
+ readonly isActive: boolean;
13314
+
13315
+ /**
13316
+ * Whether or not the dirty indicator is present on the tab.
13317
+ * @stubbed
13318
+ */
13319
+ readonly isDirty: boolean;
13320
+
13321
+ /**
13322
+ * Whether or not the tab is pinned (pin icon is present).
13323
+ * @stubbed
13324
+ */
13325
+ readonly isPinned: boolean;
13326
+
13327
+ /**
13328
+ * Whether or not the tab is in preview mode.
13329
+ * @stubbed
13330
+ */
13331
+ readonly isPreview: boolean;
13332
+ }
13333
+
13334
+ /**
13335
+ * An event describing change to tabs.
13336
+ */
13337
+ export interface TabChangeEvent {
13338
+ /**
13339
+ * The tabs that have been opened.
13340
+ * @stubbed
13341
+ */
13342
+ readonly opened: readonly Tab[];
13343
+ /**
13344
+ * The tabs that have been closed.
13345
+ * @stubbed
13346
+ */
13347
+ readonly closed: readonly Tab[];
13348
+ /**
13349
+ * Tabs that have changed, e.g have changed
13350
+ * their {@link Tab.isActive active} state.
13351
+ * @stubbed
13352
+ */
13353
+ readonly changed: readonly Tab[];
13354
+ }
13355
+
13356
+ /**
13357
+ * An event describing changes to tab groups.
13358
+ */
13359
+ export interface TabGroupChangeEvent {
13360
+ /**
13361
+ * Tab groups that have been opened.
13362
+ * @stubbed
13363
+ */
13364
+ readonly opened: readonly TabGroup[];
13365
+ /**
13366
+ * Tab groups that have been closed.
13367
+ * @stubbed
13368
+ */
13369
+ readonly closed: readonly TabGroup[];
13370
+ /**
13371
+ * Tab groups that have changed, e.g have changed
13372
+ * their {@link TabGroup.isActive active} state.
13373
+ * @stubbed
13374
+ */
13375
+ readonly changed: readonly TabGroup[];
13376
+ }
13377
+
13378
+ /**
13379
+ * Represents a group of tabs. A tab group itself consists of multiple tabs.
13380
+ */
13381
+ export interface TabGroup {
13382
+ /**
13383
+ * Whether or not the group is currently active.
13384
+ *
13385
+ * *Note* that only one tab group is active at a time, but that multiple tab
13386
+ * groups can have an {@link TabGroup.aciveTab active tab}.
13387
+ *
13388
+ * @see {@link Tab.isActive}
13389
+ * @stubbed
13390
+ */
13391
+ readonly isActive: boolean;
13392
+
13393
+ /**
13394
+ * The view column of the group.
13395
+ * @stubbed
13396
+ */
13397
+ readonly viewColumn: ViewColumn;
13398
+
13399
+ /**
13400
+ * The active {@link Tab tab} in the group. This is the tab whose contents are currently
13401
+ * being rendered.
13402
+ *
13403
+ * *Note* that there can be one active tab per group but there can only be one {@link TabGroups.activeTabGroup active group}.
13404
+ * @stubbed
13405
+ */
13406
+ readonly activeTab: Tab | undefined;
13407
+
13408
+ /**
13409
+ * The list of tabs contained within the group.
13410
+ * This can be empty if the group has no tabs open.
13411
+ * @stubbed
13412
+ */
13413
+ readonly tabs: readonly Tab[];
13414
+ }
13415
+
13416
+ /**
13417
+ * Represents the main editor area which consists of multple groups which contain tabs.
13418
+ */
13419
+ export interface TabGroups {
13420
+ /**
13421
+ * All the groups within the group container.
13422
+ * @stubbed
13423
+ */
13424
+ readonly all: readonly TabGroup[];
13425
+
13426
+ /**
13427
+ * The currently active group.
13428
+ * @stubbed
13429
+ */
13430
+ readonly activeTabGroup: TabGroup;
13431
+
13432
+ /**
13433
+ * An {@link Event event} which fires when {@link TabGroup tab groups} have changed.
13434
+ * @stubbed
13435
+ */
13436
+ readonly onDidChangeTabGroups: Event<TabGroupChangeEvent>;
13437
+
13438
+ /**
13439
+ * An {@link Event event} which fires when {@link Tab tabs} have changed.
13440
+ * @stubbed
13441
+ */
13442
+ readonly onDidChangeTabs: Event<TabChangeEvent>;
13443
+
13444
+ /**
13445
+ * Closes the tab. This makes the tab object invalid and the tab
13446
+ * should no longer be used for further actions.
13447
+ * 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
13448
+ *
13449
+ * @param tab The tab to close.
13450
+ * @param preserveFocus When `true` focus will remain in its current position. If `false` it will jump to the next tab.
13451
+ * @returns A promise that resolves to `true` when all tabs have been closed.
13452
+ * @stubbed
13453
+ */
13454
+ close(tab: Tab | readonly Tab[], preserveFocus?: boolean): Thenable<boolean>;
13455
+
13456
+ /**
13457
+ * Closes the tab group. This makes the tab group object invalid and the tab group
13458
+ * should no longer be used for further actions.
13459
+ * @param tabGroup The tab group to close.
13460
+ * @param preserveFocus When `true` focus will remain in its current position.
13461
+ * @returns A promise that resolves to `true` when all tab groups have been closed.
13462
+ * @stubbed
13463
+ */
13464
+ close(tabGroup: TabGroup | readonly TabGroup[], preserveFocus?: boolean): Thenable<boolean>;
13465
+ }
13466
+
13467
+ /**
13468
+ * Represents a notebook editor that is attached to a {@link NotebookDocument notebook}.
13469
+ */
13470
+ export enum NotebookEditorRevealType {
13471
+ /**
13472
+ * The range will be revealed with as little scrolling as possible.
13473
+ */
13474
+ Default = 0,
13475
+
13476
+ /**
13477
+ * The range will always be revealed in the center of the viewport.
13478
+ */
13479
+ InCenter = 1,
13480
+
13481
+ /**
13482
+ * If the range is outside the viewport, it will be revealed in the center of the viewport.
13483
+ * Otherwise, it will be revealed with as little scrolling as possible.
13484
+ */
13485
+ InCenterIfOutsideViewport = 2,
13486
+
13487
+ /**
13488
+ * The range will always be revealed at the top of the viewport.
13489
+ */
13490
+ AtTop = 3
13491
+ }
13492
+
13493
+ /**
13494
+ * Represents a notebook editor that is attached to a {@link NotebookDocument notebook}.
13495
+ * Additional properties of the NotebookEditor are available in the proposed
13496
+ * API, which will be finalized later.
13497
+ */
13498
+ export interface NotebookEditor {
13499
+
13500
+ /**
13501
+ * The {@link NotebookDocument notebook document} associated with this notebook editor.
13502
+ * @stubbed
13503
+ */
13504
+ readonly notebook: NotebookDocument;
13505
+
13506
+ /**
13507
+ * The primary selection in this notebook editor.
13508
+ * @stubbed
13509
+ */
13510
+ selection: NotebookRange;
13511
+
13512
+ /**
13513
+ * All selections in this notebook editor.
13514
+ *
13515
+ * The primary selection (or focused range) is `selections[0]`. When the document has no cells, the primary selection is empty `{ start: 0, end: 0 }`;
13516
+ * @stubbed
13517
+ */
13518
+ selections: readonly NotebookRange[];
13519
+
13520
+ /**
13521
+ * The current visible ranges in the editor (vertically).
13522
+ * @stubbed
13523
+ */
13524
+ readonly visibleRanges: readonly NotebookRange[];
13525
+
13526
+ /**
13527
+ * The column in which this editor shows.
13528
+ * @stubbed
13529
+ */
13530
+ readonly viewColumn?: ViewColumn;
13531
+
13532
+ /**
13533
+ * Scroll as indicated by `revealType` in order to reveal the given range.
13534
+ *
13535
+ * @param range A range.
13536
+ * @param revealType The scrolling strategy for revealing `range`.
13537
+ * @stubbed
13538
+ */
13539
+ revealRange(range: NotebookRange, revealType?: NotebookEditorRevealType): void;
13540
+ }
13541
+
13542
+ /**
13543
+ * Renderer messaging is used to communicate with a single renderer. It's returned from {@link notebooks.createRendererMessaging}.
13544
+ */
13545
+ export interface NotebookRendererMessaging {
13546
+ /**
13547
+ * An event that fires when a message is received from a renderer.
13548
+ * @stubbed
13549
+ */
13550
+ readonly onDidReceiveMessage: Event<{
13551
+ readonly editor: NotebookEditor;
13552
+ readonly message: any;
13553
+ }>;
13554
+
13555
+ /**
13556
+ * Send a message to one or all renderer.
13557
+ *
13558
+ * @param message Message to send
13559
+ * @param editor Editor to target with the message. If not provided, the
13560
+ * message is sent to all renderers.
13561
+ * @returns a boolean indicating whether the message was successfully
13562
+ * delivered to any renderer.
13563
+ * @stubbed
13564
+ */
13565
+ postMessage(message: any, editor?: NotebookEditor): Thenable<boolean>;
13566
+ }
13567
+
13568
+ /**
13569
+ * A notebook cell kind.
13570
+ */
13571
+ export enum NotebookCellKind {
13572
+
13573
+ /**
13574
+ * A markup-cell is formatted source that is used for display.
13575
+ */
13576
+ Markup = 1,
13577
+
13578
+ /**
13579
+ * A code-cell is source that can be {@link NotebookController executed} and that
13580
+ * produces {@link NotebookCellOutput output}.
13581
+ */
13582
+ Code = 2
13583
+ }
13584
+
13585
+ /**
13586
+ * Represents a cell of a {@link NotebookDocument notebook}, either a {@link NotebookCellKind.Code code}-cell
13587
+ * or {@link NotebookCellKind.Markup markup}-cell.
13588
+ *
13589
+ * NotebookCell instances are immutable and are kept in sync for as long as they are part of their notebook.
13590
+ */
13591
+ export interface NotebookCell {
13592
+
13593
+ /**
13594
+ * The index of this cell in its {@link NotebookDocument.cellAt containing notebook}. The
13595
+ * index is updated when a cell is moved within its notebook. The index is `-1`
13596
+ * when the cell has been removed from its notebook.
13597
+ * @stubbed
13598
+ */
13599
+ readonly index: number;
13600
+
13601
+ /**
13602
+ * The {@link NotebookDocument notebook} that contains this cell.
13603
+ * @stubbed
13604
+ */
13605
+ readonly notebook: NotebookDocument;
13606
+
13607
+ /**
13608
+ * The kind of this cell.
13609
+ * @stubbed
13610
+ */
13611
+ readonly kind: NotebookCellKind;
13612
+
13613
+ /**
13614
+ * The {@link TextDocument text} of this cell, represented as text document.
13615
+ * @stubbed
13616
+ */
13617
+ readonly document: TextDocument;
13618
+
13619
+ /**
13620
+ * The metadata of this cell. Can be anything but must be JSON-stringifyable.
13621
+ * @stubbed
13622
+ */
13623
+ readonly metadata: { readonly [key: string]: any };
13624
+
13625
+ /**
13626
+ * The outputs of this cell.
13627
+ * @stubbed
13628
+ */
13629
+ readonly outputs: readonly NotebookCellOutput[];
13630
+
13631
+ /**
13632
+ * The most recent {@link NotebookCellExecutionSummary execution summary} for this cell.
13633
+ * @stubbed
13634
+ */
13635
+ readonly executionSummary: NotebookCellExecutionSummary | undefined;
13636
+ }
13637
+
13638
+ /**
13639
+ * Represents a notebook which itself is a sequence of {@link NotebookCell code or markup cells}. Notebook documents are
13640
+ * created from {@link NotebookData notebook data}.
13641
+ */
13642
+ export interface NotebookDocument {
13643
+
13644
+ /**
13645
+ * The associated uri for this notebook.
13646
+ *
13647
+ * *Note* that most notebooks use the `file`-scheme, which means they are files on disk. However, **not** all notebooks are
13648
+ * saved on disk and therefore the `scheme` must be checked before trying to access the underlying file or siblings on disk.
13649
+ * @stubbed
13650
+ *
13651
+ * @see {@link FileSystemProvider}
13652
+ */
13653
+ readonly uri: Uri;
13654
+
13655
+ /**
13656
+ * The type of notebook.
13657
+ * @stubbed
13658
+ */
13659
+ readonly notebookType: string;
13660
+
13661
+ /**
13662
+ * The version number of this notebook (it will strictly increase after each
13663
+ * change, including undo/redo).
13664
+ * @stubbed
13665
+ */
13666
+ readonly version: number;
13667
+
13668
+ /**
13669
+ * `true` if there are unpersisted changes.
13670
+ * @stubbed
13671
+ */
13672
+ readonly isDirty: boolean;
13673
+
13674
+ /**
13675
+ * Is this notebook representing an untitled file which has not been saved yet.
13676
+ * @stubbed
13677
+ */
13678
+ readonly isUntitled: boolean;
13679
+
13680
+ /**
13681
+ * `true` if the notebook has been closed. A closed notebook isn't synchronized anymore
13682
+ * and won't be re-used when the same resource is opened again.
13683
+ * @stubbed
13684
+ */
13685
+ readonly isClosed: boolean;
13686
+
13687
+ /**
13688
+ * Arbitrary metadata for this notebook. Can be anything but must be JSON-stringifyable.
13689
+ * @stubbed
13690
+ */
13691
+ readonly metadata: { [key: string]: any };
13692
+
13693
+ /**
13694
+ * The number of cells in the notebook.
13695
+ * @stubbed
13696
+ */
13697
+ readonly cellCount: number;
13698
+
13699
+ /**
13700
+ * Return the cell at the specified index. The index will be adjusted to the notebook.
13701
+ *
13702
+ * @param index - The index of the cell to retrieve.
13703
+ * @return A {@link NotebookCell cell}.
13704
+ * @stubbed
13705
+ */
13706
+ cellAt(index: number): NotebookCell;
13707
+
13708
+ /**
13709
+ * Get the cells of this notebook. A subset can be retrieved by providing
13710
+ * a range. The range will be adjusted to the notebook.
13711
+ *
13712
+ * @param range A notebook range.
13713
+ * @returns The cells contained by the range or all cells.
13714
+ * @stubbed
13715
+ */
13716
+ getCells(range?: NotebookRange): NotebookCell[];
13717
+
13718
+ /**
13719
+ * Save the document. The saving will be handled by the corresponding {@link NotebookSerializer serializer}.
13720
+ *
13721
+ * @return A promise that will resolve to true when the document
13722
+ * has been saved. Will return false if the file was not dirty or when save failed.
13723
+ * @stubbed
13724
+ */
13725
+ save(): Thenable<boolean>;
13726
+ }
13727
+
13728
+ /**
13729
+ * Describes a change to a notebook cell.
13730
+ *
13731
+ * @see {@link NotebookDocumentChangeEvent}
13732
+ */
13733
+ export interface NotebookDocumentCellChange {
13734
+
13735
+ /**
13736
+ * The affected cell.
13737
+ * @stubbed
13738
+ */
13739
+ readonly cell: NotebookCell;
13740
+
13741
+ /**
13742
+ * The document of the cell or `undefined` when it did not change.
13743
+ *
13744
+ * *Note* that you should use the {@link workspace.onDidChangeTextDocument onDidChangeTextDocument}-event
13745
+ * for detailed change information, like what edits have been performed.
13746
+ * @stubbed
13747
+ */
13748
+ readonly document: TextDocument | undefined;
13749
+
13750
+ /**
13751
+ * The new metadata of the cell or `undefined` when it did not change.
13752
+ * @stubbed
13753
+ */
13754
+ readonly metadata: { [key: string]: any } | undefined;
13755
+
13756
+ /**
13757
+ * The new outputs of the cell or `undefined` when they did not change.
13758
+ * @stubbed
13759
+ */
13760
+ readonly outputs: readonly NotebookCellOutput[] | undefined;
13761
+
13762
+ /**
13763
+ * The new execution summary of the cell or `undefined` when it did not change.
13764
+ * @stubbed
13765
+ */
13766
+ readonly executionSummary: NotebookCellExecutionSummary | undefined;
13767
+ }
13768
+
13769
+ /**
13770
+ * Describes a structural change to a notebook document, e.g newly added and removed cells.
13771
+ *
13772
+ * @see {@link NotebookDocumentChangeEvent}
13773
+ */
13774
+ export interface NotebookDocumentContentChange {
13775
+
13776
+ /**
13777
+ * The range at which cells have been either added or removed.
13778
+ *
13779
+ * Note that no cells have been {@link NotebookDocumentContentChange.removedCells removed}
13780
+ * when this range is {@link NotebookRange.isEmpty empty}.
13781
+ * @stubbed
13782
+ */
13783
+ readonly range: NotebookRange;
13784
+
13785
+ /**
13786
+ * Cells that have been added to the document.
13787
+ * @stubbed
13788
+ */
13789
+ readonly addedCells: readonly NotebookCell[];
13790
+
13791
+ /**
13792
+ * Cells that have been removed from the document.
13793
+ * @stubbed
13794
+ */
13795
+ readonly removedCells: readonly NotebookCell[];
13796
+ }
13797
+
13798
+ /**
13799
+ * An event describing a transactional {@link NotebookDocument notebook} change.
13800
+ */
13801
+ export interface NotebookDocumentChangeEvent {
13802
+
13803
+ /**
13804
+ * The affected notebook.
13805
+ * @stubbed
13806
+ */
13807
+ readonly notebook: NotebookDocument;
13808
+
13809
+ /**
13810
+ * The new metadata of the notebook or `undefined` when it did not change.
13811
+ * @stubbed
13812
+ */
13813
+ readonly metadata: { [key: string]: any } | undefined;
13814
+
13815
+ /**
13816
+ * An array of content changes describing added or removed {@link NotebookCell cells}.
13817
+ * @stubbed
13818
+ */
13819
+ readonly contentChanges: readonly NotebookDocumentContentChange[];
13820
+
13821
+ /**
13822
+ * An array of {@link NotebookDocumentCellChange cell changes}.
13823
+ * @stubbed
13824
+ */
13825
+ readonly cellChanges: readonly NotebookDocumentCellChange[];
13826
+ }
13827
+
13828
+ /**
13829
+ * The summary of a notebook cell execution.
13830
+ */
13831
+ export interface NotebookCellExecutionSummary {
13832
+
13833
+ /**
13834
+ * The order in which the execution happened.
13835
+ * @stubbed
13836
+ */
13837
+ readonly executionOrder?: number;
13838
+
13839
+ /**
13840
+ * If the execution finished successfully.
13841
+ * @stubbed
13842
+ */
13843
+ readonly success?: boolean;
13844
+
13845
+ /**
13846
+ * The times at which execution started and ended, as unix timestamps
13847
+ * @stubbed
13848
+ */
13849
+ readonly timing?: { readonly startTime: number; readonly endTime: number };
13850
+ }
13851
+
13852
+ /**
13853
+ * A notebook range represents an ordered pair of two cell indices.
13854
+ * It is guaranteed that start is less than or equal to end.
13855
+ */
13856
+ export class NotebookRange {
13857
+
13858
+ /**
13859
+ * The zero-based start index of this range.
13860
+ * @stubbed
13861
+ */
13862
+ readonly start: number;
13863
+
13864
+ /**
13865
+ * The exclusive end index of this range (zero-based).
13866
+ * @stubbed
13867
+ */
13868
+ readonly end: number;
13869
+
13870
+ /**
13871
+ * `true` if `start` and `end` are equal.
13872
+ * @stubbed
13873
+ */
13874
+ readonly isEmpty: boolean;
13875
+
13876
+ /**
13877
+ * Create a new notebook range. If `start` is not
13878
+ * before or equal to `end`, the values will be swapped.
13879
+ *
13880
+ * @param start start index
13881
+ * @param end end index.
13882
+ * @stubbed
13883
+ */
13884
+ constructor(start: number, end: number);
13885
+
13886
+ /**
13887
+ * Derive a new range for this range.
13888
+ *
13889
+ * @param change An object that describes a change to this range.
13890
+ * @return A range that reflects the given change. Will return `this` range if the change
13891
+ * is not changing anything.
13892
+ * @stubbed
13893
+ */
13894
+ with(change: { start?: number; end?: number }): NotebookRange;
13895
+ }
13896
+
13897
+ /**
13898
+ * One representation of a {@link NotebookCellOutput notebook output}, defined by MIME type and data.
13899
+ */
13900
+ export class NotebookCellOutputItem {
13901
+
13902
+ /**
13903
+ * Factory function to create a `NotebookCellOutputItem` from a string.
13904
+ *
13905
+ * *Note* that an UTF-8 encoder is used to create bytes for the string.
13906
+ *
13907
+ * @param value A string.
13908
+ * @param mime Optional MIME type, defaults to `text/plain`.
13909
+ * @returns A new output item object.
13910
+ */
13911
+ static text(value: string, mime?: string): NotebookCellOutputItem;
13912
+
13913
+ /**
13914
+ * Factory function to create a `NotebookCellOutputItem` from
13915
+ * a JSON object.
13916
+ *
13917
+ * *Note* that this function is not expecting "stringified JSON" but
13918
+ * an object that can be stringified. This function will throw an error
13919
+ * when the passed value cannot be JSON-stringified.
13920
+ *
13921
+ * @param value A JSON-stringifyable value.
13922
+ * @param mime Optional MIME type, defaults to `application/json`
13923
+ * @returns A new output item object.
13924
+ */
13925
+ static json(value: any, mime?: string): NotebookCellOutputItem;
13926
+
13927
+ /**
13928
+ * Factory function to create a `NotebookCellOutputItem` that uses
13929
+ * uses the `application/vnd.code.notebook.stdout` mime type.
13930
+ *
13931
+ * @param value A string.
13932
+ * @returns A new output item object.
13933
+ */
13934
+ static stdout(value: string): NotebookCellOutputItem;
13935
+
13936
+ /**
13937
+ * Factory function to create a `NotebookCellOutputItem` that uses
13938
+ * uses the `application/vnd.code.notebook.stderr` mime type.
13939
+ *
13940
+ * @param value A string.
13941
+ * @returns A new output item object.
13942
+ */
13943
+ static stderr(value: string): NotebookCellOutputItem;
13944
+
13945
+ /**
13946
+ * Factory function to create a `NotebookCellOutputItem` that uses
13947
+ * uses the `application/vnd.code.notebook.error` mime type.
13948
+ *
13949
+ * @param value An error object.
13950
+ * @returns A new output item object.
13951
+ */
13952
+ static error(value: Error): NotebookCellOutputItem;
13953
+
13954
+ /**
13955
+ * The mime type which determines how the {@linkcode NotebookCellOutputItem.data data}-property
13956
+ * is interpreted.
13957
+ *
13958
+ * Notebooks have built-in support for certain mime-types, extensions can add support for new
13959
+ * types and override existing types.
13960
+ */
13961
+ mime: string;
13962
+
13963
+ /**
13964
+ * The data of this output item. Must always be an array of unsigned 8-bit integers.
13965
+ */
13966
+ data: Uint8Array;
13967
+
13968
+ /**
13969
+ * Create a new notebook cell output item.
13970
+ *
13971
+ * @param data The value of the output item.
13972
+ * @param mime The mime type of the output item.
13973
+ */
13974
+ constructor(data: Uint8Array, mime: string);
13975
+ }
13976
+
13977
+ /**
13978
+ * Notebook cell output represents a result of executing a cell. It is a container type for multiple
13979
+ * {@link NotebookCellOutputItem output items} where contained items represent the same result but
13980
+ * use different MIME types.
13981
+ */
13982
+ export class NotebookCellOutput {
13983
+
13984
+ /**
13985
+ * The output items of this output. Each item must represent the same result. _Note_ that repeated
13986
+ * MIME types per output is invalid and that the editor will just pick one of them.
13987
+ *
13988
+ * ```ts
13989
+ * new vscode.NotebookCellOutput([
13990
+ * vscode.NotebookCellOutputItem.text('Hello', 'text/plain'),
13991
+ * vscode.NotebookCellOutputItem.text('<i>Hello</i>', 'text/html'),
13992
+ * vscode.NotebookCellOutputItem.text('_Hello_', 'text/markdown'),
13993
+ * vscode.NotebookCellOutputItem.text('Hey', 'text/plain'), // INVALID: repeated type, editor will pick just one
13994
+ * ])
13995
+ * ```
13996
+ * @stubbed
13997
+ */
13998
+ items: NotebookCellOutputItem[];
13999
+
14000
+ /**
14001
+ * Arbitrary metadata for this cell output. Can be anything but must be JSON-stringifyable.
14002
+ * @stubbed
14003
+ */
14004
+ metadata?: { [key: string]: any };
14005
+
14006
+ /**
14007
+ * Create new notebook output.
14008
+ *
14009
+ * @param items Notebook output items.
14010
+ * @param metadata Optional metadata.
14011
+ * @stubbed
14012
+ */
14013
+ constructor(items: NotebookCellOutputItem[], metadata?: { [key: string]: any });
14014
+ }
14015
+
14016
+ /**
14017
+ * NotebookCellData is the raw representation of notebook cells. Its is part of {@linkcode NotebookData}.
14018
+ */
14019
+ export class NotebookCellData {
14020
+
14021
+ /**
14022
+ * The {@link NotebookCellKind kind} of this cell data.
14023
+ * @stubbed
14024
+ */
14025
+ kind: NotebookCellKind;
14026
+
14027
+ /**
14028
+ * The source value of this cell data - either source code or formatted text.
14029
+ * @stubbed
14030
+ */
14031
+ value: string;
14032
+
14033
+ /**
14034
+ * The language identifier of the source value of this cell data. Any value from
14035
+ * {@linkcode languages.getLanguages getLanguages} is possible.
14036
+ * @stubbed
14037
+ */
14038
+ languageId: string;
14039
+
14040
+ /**
14041
+ * The outputs of this cell data.
14042
+ * @stubbed
14043
+ */
14044
+ outputs?: NotebookCellOutput[];
14045
+
14046
+ /**
14047
+ * Arbitrary metadata of this cell data. Can be anything but must be JSON-stringifyable.
14048
+ */
14049
+ metadata?: { [key: string]: any };
14050
+
14051
+ /**
14052
+ * The execution summary of this cell data.
14053
+ * @stubbed
14054
+ */
14055
+ executionSummary?: NotebookCellExecutionSummary;
14056
+
14057
+ /**
14058
+ * Create new cell data. Minimal cell data specifies its kind, its source value, and the
14059
+ * language identifier of its source.
14060
+ *
14061
+ * @param kind The kind.
14062
+ * @param value The source value.
14063
+ * @param languageId The language identifier of the source value.
14064
+ * @stubbed
14065
+ */
14066
+ constructor(kind: NotebookCellKind, value: string, languageId: string);
14067
+ }
14068
+
14069
+ /**
14070
+ * Raw representation of a notebook.
14071
+ *
14072
+ * Extensions are responsible for creating {@linkcode NotebookData} so that the editor
14073
+ * can create a {@linkcode NotebookDocument}.
14074
+ *
14075
+ * @see {@link NotebookSerializer}
14076
+ */
14077
+ export class NotebookData {
14078
+ /**
14079
+ * The cell data of this notebook data.
14080
+ * @stubbed
14081
+ */
14082
+ cells: NotebookCellData[];
14083
+
14084
+ /**
14085
+ * Arbitrary metadata of notebook data.
14086
+ * @stubbed
14087
+ */
14088
+ metadata?: { [key: string]: any };
14089
+
14090
+ /**
14091
+ * Create new notebook data.
14092
+ *
14093
+ * @param cells An array of cell data.
14094
+ * @stubbed
14095
+ */
14096
+ constructor(cells: NotebookCellData[]);
14097
+ }
14098
+
14099
+ /**
14100
+ * The notebook serializer enables the editor to open notebook files.
14101
+ *
14102
+ * At its core the editor only knows a {@link NotebookData notebook data structure} but not
14103
+ * how that data structure is written to a file, nor how it is read from a file. The
14104
+ * notebook serializer bridges this gap by deserializing bytes into notebook data and
14105
+ * vice versa.
14106
+ */
14107
+ export interface NotebookSerializer {
14108
+
14109
+ /**
14110
+ * Deserialize contents of a notebook file into the notebook data structure.
14111
+ *
14112
+ * @param content Contents of a notebook file.
14113
+ * @param token A cancellation token.
14114
+ * @return Notebook data or a thenable that resolves to such.
14115
+ * @stubbed
14116
+ */
14117
+ deserializeNotebook(content: Uint8Array, token: CancellationToken): NotebookData | Thenable<NotebookData>;
14118
+
14119
+ /**
14120
+ * Serialize notebook data into file contents.
14121
+ *
14122
+ * @param data A notebook data structure.
14123
+ * @param token A cancellation token.
14124
+ * @returns An array of bytes or a thenable that resolves to such.
14125
+ * @stubbed
14126
+ */
14127
+ serializeNotebook(data: NotebookData, token: CancellationToken): Uint8Array | Thenable<Uint8Array>;
14128
+ }
14129
+
14130
+ /**
14131
+ * Notebook content options define what parts of a notebook are persisted. Note
14132
+ *
14133
+ * For instance, a notebook serializer can opt-out of saving outputs and in that case the editor doesn't mark a
14134
+ * notebooks as {@link NotebookDocument.isDirty dirty} when its output has changed.
14135
+ */
14136
+ export interface NotebookDocumentContentOptions {
14137
+ /**
14138
+ * Controls if output change events will trigger notebook document content change events and
14139
+ * if it will be used in the diff editor, defaults to false. If the content provider doesn't
14140
+ * persist the outputs in the file document, this should be set to true.
14141
+ * @stubbed
14142
+ */
14143
+ transientOutputs?: boolean;
14144
+
14145
+ /**
14146
+ * Controls if a cell metadata property change event will trigger notebook document content
14147
+ * change events and if it will be used in the diff editor, defaults to false. If the
14148
+ * content provider doesn't persist a metadata property in the file document, it should be
14149
+ * set to true.
14150
+ * @stubbed
14151
+ */
14152
+ transientCellMetadata?: { [key: string]: boolean | undefined };
14153
+
14154
+ /**
14155
+ * Controls if a document metadata property change event will trigger notebook document
14156
+ * content change event and if it will be used in the diff editor, defaults to false. If the
14157
+ * content provider doesn't persist a metadata property in the file document, it should be
14158
+ * set to true.
14159
+ * @stubbed
14160
+ */
14161
+ transientDocumentMetadata?: { [key: string]: boolean | undefined };
14162
+ }
14163
+
14164
+ /**
14165
+ * Represents options to configure the behavior of showing a {@link NotebookDocument notebook document} in an {@link NotebookEditor notebook editor}.
14166
+ */
14167
+ export interface NotebookDocumentShowOptions {
14168
+ /**
14169
+ * An optional view column in which the {@link NotebookEditor notebook editor} should be shown.
14170
+ * The default is the {@link ViewColumn.Active active}. Columns that do not exist
14171
+ * will be created as needed up to the maximum of {@linkcode ViewColumn.Nine}.
14172
+ * Use {@linkcode ViewColumn.Beside} to open the editor to the side of the currently
14173
+ * active one.
14174
+ * @stubbed
14175
+ */
14176
+ readonly viewColumn?: ViewColumn;
14177
+
14178
+ /**
14179
+ * An optional flag that when `true` will stop the {@link NotebookEditor notebook editor} from taking focus.
14180
+ * @stubbed
14181
+ */
14182
+ readonly preserveFocus?: boolean;
14183
+
14184
+ /**
14185
+ * An optional flag that controls if an {@link NotebookEditor notebook editor}-tab shows as preview. Preview tabs will
14186
+ * be replaced and reused until set to stay - either explicitly or through editing. The default behaviour depends
14187
+ * on the `workbench.editor.enablePreview`-setting.
14188
+ * @stubbed
14189
+ */
14190
+ readonly preview?: boolean;
14191
+
14192
+ /**
14193
+ * An optional selection to apply for the document in the {@link NotebookEditor notebook editor}.
14194
+ * @stubbed
14195
+ */
14196
+ readonly selections?: readonly NotebookRange[];
14197
+ }
14198
+
14199
+ /**
14200
+ * A notebook edit represents edits that should be applied to the contents of a notebook.
14201
+ */
14202
+ export class NotebookEdit {
14203
+
14204
+ /**
14205
+ * Utility to create a edit that replaces cells in a notebook.
14206
+ *
14207
+ * @param range The range of cells to replace
14208
+ * @param newCells The new notebook cells.
14209
+ * @stubbed
14210
+ */
14211
+ static replaceCells(range: NotebookRange, newCells: NotebookCellData[]): NotebookEdit;
14212
+
14213
+ /**
14214
+ * Utility to create an edit that replaces cells in a notebook.
14215
+ *
14216
+ * @param index The index to insert cells at.
14217
+ * @param newCells The new notebook cells.
14218
+ * @stubbed
14219
+ */
14220
+ static insertCells(index: number, newCells: NotebookCellData[]): NotebookEdit;
14221
+
14222
+ /**
14223
+ * Utility to create an edit that deletes cells in a notebook.
14224
+ *
14225
+ * @param range The range of cells to delete.
14226
+ * @stubbed
14227
+ */
14228
+ static deleteCells(range: NotebookRange): NotebookEdit;
14229
+
14230
+ /**
14231
+ * Utility to create an edit that update a cell's metadata.
14232
+ *
14233
+ * @param index The index of the cell to update.
14234
+ * @param newCellMetadata The new metadata for the cell.
14235
+ * @stubbed
14236
+ */
14237
+ static updateCellMetadata(index: number, newCellMetadata: { [key: string]: any }): NotebookEdit;
14238
+
14239
+ /**
14240
+ * Utility to create an edit that updates the notebook's metadata.
14241
+ *
14242
+ * @param newNotebookMetadata The new metadata for the notebook.
14243
+ * @stubbed
14244
+ */
14245
+ static updateNotebookMetadata(newNotebookMetadata: { [key: string]: any }): NotebookEdit;
14246
+
14247
+ /**
14248
+ * Range of the cells being edited. May be empty.
14249
+ * @stubbed
14250
+ */
14251
+ range: NotebookRange;
14252
+
14253
+ /**
14254
+ * New cells being inserted. May be empty.
14255
+ * @stubbed
14256
+ */
14257
+ newCells: NotebookCellData[];
14258
+
14259
+ /**
14260
+ * Optional new metadata for the cells.
14261
+ * @stubbed
14262
+ */
14263
+ newCellMetadata?: { [key: string]: any };
14264
+
14265
+ /**
14266
+ * Optional new metadata for the notebook.
14267
+ * @stubbed
14268
+ */
14269
+ newNotebookMetadata?: { [key: string]: any };
14270
+
14271
+ constructor(range: NotebookRange, newCells: NotebookCellData[]);
14272
+ }
14273
+
14274
+ /**
14275
+ * Represents an event describing the change in a {@link NotebookEditor.selections notebook editor's selections}.
14276
+ */
14277
+ export interface NotebookEditorSelectionChangeEvent {
14278
+ /**
14279
+ * The {@link NotebookEditor notebook editor} for which the selections have changed.
14280
+ * @stubbed
14281
+ */
14282
+ readonly notebookEditor: NotebookEditor;
14283
+
14284
+ /**
14285
+ * The new value for the {@link NotebookEditor.selections notebook editor's selections}.
14286
+ * @stubbed
14287
+ */
14288
+ readonly selections: readonly NotebookRange[];
14289
+ }
14290
+
14291
+ /**
14292
+ * Represents an event describing the change in a {@link NotebookEditor.visibleRanges notebook editor's visibleRanges}.
14293
+ */
14294
+ export interface NotebookEditorVisibleRangesChangeEvent {
14295
+ /**
14296
+ * The {@link NotebookEditor notebook editor} for which the visible ranges have changed.
14297
+ * @stubbed
14298
+ */
14299
+ readonly notebookEditor: NotebookEditor;
14300
+
14301
+ /**
14302
+ * The new value for the {@link NotebookEditor.visibleRanges notebook editor's visibleRanges}.
14303
+ * @stubbed
14304
+ */
14305
+ readonly visibleRanges: readonly NotebookRange[];
14306
+ }
14307
+
14308
+ /**
14309
+ * Notebook controller affinity for notebook documents.
14310
+ *
14311
+ * @see {@link NotebookController.updateNotebookAffinity}
14312
+ */
14313
+ export enum NotebookControllerAffinity {
14314
+ /**
14315
+ * Default affinity.
14316
+ */
14317
+ Default = 1,
14318
+ /**
14319
+ * A controller is preferred for a notebook.
14320
+ */
14321
+ Preferred = 2
14322
+ }
14323
+
14324
+ /**
14325
+ * A notebook controller represents an entity that can execute notebook cells. This is often referred to as a kernel.
14326
+ *
14327
+ * There can be multiple controllers and the editor will let users choose which controller to use for a certain notebook. The
14328
+ * {@linkcode NotebookController.notebookType notebookType}-property defines for what kind of notebooks a controller is for and
14329
+ * the {@linkcode NotebookController.updateNotebookAffinity updateNotebookAffinity}-function allows controllers to set a preference
14330
+ * for specific notebook documents. When a controller has been selected its
14331
+ * {@link NotebookController.onDidChangeSelectedNotebooks onDidChangeSelectedNotebooks}-event fires.
14332
+ *
14333
+ * When a cell is being run the editor will invoke the {@linkcode NotebookController.executeHandler executeHandler} and a controller
14334
+ * is expected to create and finalize a {@link NotebookCellExecution notebook cell execution}. However, controllers are also free
14335
+ * to create executions by themselves.
14336
+ */
14337
+ export interface NotebookController {
14338
+
14339
+ /**
14340
+ * The identifier of this notebook controller.
14341
+ *
14342
+ * _Note_ that controllers are remembered by their identifier and that extensions should use
14343
+ * stable identifiers across sessions.
14344
+ * @stubbed
14345
+ */
14346
+ readonly id: string;
14347
+
14348
+ /**
14349
+ * The notebook type this controller is for.
14350
+ * @stubbed
14351
+ */
14352
+ readonly notebookType: string;
14353
+
14354
+ /**
14355
+ * An array of language identifiers that are supported by this
14356
+ * controller. Any language identifier from {@linkcode languages.getLanguages getLanguages}
14357
+ * is possible. When falsy all languages are supported.
14358
+ *
14359
+ * Samples:
14360
+ * ```js
14361
+ * // support JavaScript and TypeScript
14362
+ * myController.supportedLanguages = ['javascript', 'typescript']
14363
+ *
14364
+ * // support all languages
14365
+ * myController.supportedLanguages = undefined; // falsy
14366
+ * myController.supportedLanguages = []; // falsy
14367
+ * ```
14368
+ * @stubbed
14369
+ */
14370
+ supportedLanguages?: string[];
14371
+
14372
+ /**
14373
+ * The human-readable label of this notebook controller.
14374
+ * @stubbed
14375
+ */
14376
+ label: string;
14377
+
14378
+ /**
14379
+ * The human-readable description which is rendered less prominent.
14380
+ * @stubbed
14381
+ */
14382
+ description?: string;
14383
+
14384
+ /**
14385
+ * The human-readable detail which is rendered less prominent.
14386
+ * @stubbed
14387
+ */
14388
+ detail?: string;
14389
+
14390
+ /**
14391
+ * Whether this controller supports execution order so that the
14392
+ * editor can render placeholders for them.
14393
+ * @stubbed
14394
+ */
14395
+ supportsExecutionOrder?: boolean;
14396
+
14397
+ /**
14398
+ * Create a cell execution task.
14399
+ *
14400
+ * _Note_ that there can only be one execution per cell at a time and that an error is thrown if
14401
+ * a cell execution is created while another is still active.
14402
+ *
14403
+ * This should be used in response to the {@link NotebookController.executeHandler execution handler}
14404
+ * being called or when cell execution has been started else, e.g when a cell was already
14405
+ * executing or when cell execution was triggered from another source.
14406
+ *
14407
+ * @param cell The notebook cell for which to create the execution.
14408
+ * @returns A notebook cell execution.
14409
+ * @stubbed
14410
+ */
14411
+ createNotebookCellExecution(cell: NotebookCell): NotebookCellExecution;
14412
+
14413
+ /**
14414
+ * The execute handler is invoked when the run gestures in the UI are selected, e.g Run Cell, Run All,
14415
+ * Run Selection etc. The execute handler is responsible for creating and managing {@link NotebookCellExecution execution}-objects.
14416
+ * @stubbed
14417
+ */
14418
+ executeHandler: (cells: NotebookCell[], notebook: NotebookDocument, controller: NotebookController) => void | Thenable<void>;
14419
+
14420
+ /**
14421
+ * Optional interrupt handler.
14422
+ *
14423
+ * By default cell execution is canceled via {@link NotebookCellExecution.token tokens}. Cancellation
14424
+ * tokens require that a controller can keep track of its execution so that it can cancel a specific execution at a later
14425
+ * point. Not all scenarios allow for that, eg. REPL-style controllers often work by interrupting whatever is currently
14426
+ * running. For those cases the interrupt handler exists - it can be thought of as the equivalent of `SIGINT`
14427
+ * or `Control+C` in terminals.
14428
+ *
14429
+ * _Note_ that supporting {@link NotebookCellExecution.token cancellation tokens} is preferred and that interrupt handlers should
14430
+ * only be used when tokens cannot be supported.
14431
+ * @stubbed
14432
+ */
14433
+ interruptHandler?: (notebook: NotebookDocument) => void | Thenable<void>;
14434
+
14435
+ /**
14436
+ * An event that fires whenever a controller has been selected or un-selected for a notebook document.
14437
+ *
14438
+ * There can be multiple controllers for a notebook and in that case a controllers needs to be _selected_. This is a user gesture
14439
+ * and happens either explicitly or implicitly when interacting with a notebook for which a controller was _suggested_. When possible,
14440
+ * the editor _suggests_ a controller that is most likely to be _selected_.
14441
+ *
14442
+ * _Note_ that controller selection is persisted (by the controllers {@link NotebookController.id id}) and restored as soon as a
14443
+ * controller is re-created or as a notebook is {@link workspace.onDidOpenNotebookDocument opened}.
14444
+ * @stubbed
14445
+ */
14446
+ readonly onDidChangeSelectedNotebooks: Event<{ readonly notebook: NotebookDocument; readonly selected: boolean }>;
14447
+
14448
+ /**
14449
+ * A controller can set affinities for specific notebook documents. This allows a controller
14450
+ * to be presented more prominent for some notebooks.
14451
+ *
14452
+ * @param notebook The notebook for which a priority is set.
14453
+ * @param affinity A controller affinity
14454
+ * @stubbed
14455
+ */
14456
+ updateNotebookAffinity(notebook: NotebookDocument, affinity: NotebookControllerAffinity): void;
14457
+
14458
+ /**
14459
+ * Dispose and free associated resources.
14460
+ * @stubbed
14461
+ */
14462
+ dispose(): void;
14463
+ }
14464
+
14465
+ /**
14466
+ * A NotebookCellExecution is how {@link NotebookController notebook controller} modify a notebook cell as
14467
+ * it is executing.
14468
+ *
14469
+ * When a cell execution object is created, the cell enters the {@linkcode NotebookCellExecutionState.Pending Pending} state.
14470
+ * When {@linkcode NotebookCellExecution.start start(...)} is called on the execution task, it enters the {@linkcode NotebookCellExecutionState.Executing Executing} state. When
14471
+ * {@linkcode NotebookCellExecution.end end(...)} is called, it enters the {@linkcode NotebookCellExecutionState.Idle Idle} state.
14472
+ */
14473
+ export interface NotebookCellExecution {
14474
+
14475
+ /**
14476
+ * The {@link NotebookCell cell} for which this execution has been created.
14477
+ * @stubbed
14478
+ */
14479
+ readonly cell: NotebookCell;
14480
+
14481
+ /**
14482
+ * A cancellation token which will be triggered when the cell execution is canceled
14483
+ * from the UI.
14484
+ *
14485
+ * _Note_ that the cancellation token will not be triggered when the {@link NotebookController controller}
14486
+ * that created this execution uses an {@link NotebookController.interruptHandler interrupt-handler}.
14487
+ * @stubbed
14488
+ */
14489
+ readonly token: CancellationToken;
14490
+
14491
+ /**
14492
+ * Set and unset the order of this cell execution.
14493
+ * @stubbed
14494
+ */
14495
+ executionOrder: number | undefined;
14496
+
14497
+ /**
14498
+ * Signal that the execution has begun.
14499
+ *
14500
+ * @param startTime The time that execution began, in milliseconds in the Unix epoch. Used to drive the clock
14501
+ * that shows for how long a cell has been running. If not given, the clock won't be shown.
14502
+ * @stubbed
14503
+ */
14504
+ start(startTime?: number): void;
14505
+
14506
+ /**
14507
+ * Signal that execution has ended.
14508
+ *
14509
+ * @param success If true, a green check is shown on the cell status bar.
14510
+ * If false, a red X is shown.
14511
+ * If undefined, no check or X icon is shown.
14512
+ * @param endTime The time that execution finished, in milliseconds in the Unix epoch.
14513
+ * @stubbed
14514
+ */
14515
+ end(success: boolean | undefined, endTime?: number): void;
14516
+
14517
+ /**
14518
+ * Clears the output of the cell that is executing or of another cell that is affected by this execution.
14519
+ *
14520
+ * @param cell Cell for which output is cleared. Defaults to the {@link NotebookCellExecution.cell cell} of
14521
+ * this execution.
14522
+ * @return A thenable that resolves when the operation finished.
14523
+ * @stubbed
14524
+ */
14525
+ clearOutput(cell?: NotebookCell): Thenable<void>;
14526
+
14527
+ /**
14528
+ * Replace the output of the cell that is executing or of another cell that is affected by this execution.
14529
+ *
14530
+ * @param out Output that replaces the current output.
14531
+ * @param cell Cell for which output is cleared. Defaults to the {@link NotebookCellExecution.cell cell} of
14532
+ * this execution.
14533
+ * @return A thenable that resolves when the operation finished.
14534
+ * @stubbed
14535
+ */
14536
+ replaceOutput(out: NotebookCellOutput | readonly NotebookCellOutput[], cell?: NotebookCell): Thenable<void>;
14537
+
14538
+ /**
14539
+ * Append to the output of the cell that is executing or to another cell that is affected by this execution.
14540
+ *
14541
+ * @param out Output that is appended to the current output.
14542
+ * @param cell Cell for which output is cleared. Defaults to the {@link NotebookCellExecution.cell cell} of
14543
+ * this execution.
14544
+ * @return A thenable that resolves when the operation finished.
14545
+ * @stubbed
14546
+ */
14547
+ appendOutput(out: NotebookCellOutput | readonly NotebookCellOutput[], cell?: NotebookCell): Thenable<void>;
14548
+
14549
+ /**
14550
+ * Replace all output items of existing cell output.
14551
+ *
14552
+ * @param items Output items that replace the items of existing output.
14553
+ * @param output Output object that already exists.
14554
+ * @return A thenable that resolves when the operation finished.
14555
+ * @stubbed
14556
+ */
14557
+ replaceOutputItems(items: NotebookCellOutputItem | readonly NotebookCellOutputItem[], output: NotebookCellOutput): Thenable<void>;
14558
+
14559
+ /**
14560
+ * Append output items to existing cell output.
14561
+ *
14562
+ * @param items Output items that are append to existing output.
14563
+ * @param output Output object that already exists.
14564
+ * @return A thenable that resolves when the operation finished.
14565
+ * @stubbed
14566
+ */
14567
+ appendOutputItems(items: NotebookCellOutputItem | readonly NotebookCellOutputItem[], output: NotebookCellOutput): Thenable<void>;
14568
+ }
14569
+
14570
+ /**
14571
+ * Represents the alignment of status bar items.
14572
+ */
14573
+ export enum NotebookCellStatusBarAlignment {
14574
+
14575
+ /**
14576
+ * Aligned to the left side.
14577
+ */
14578
+ Left = 1,
14579
+
14580
+ /**
14581
+ * Aligned to the right side.
14582
+ */
14583
+ Right = 2
14584
+ }
14585
+
14586
+ /**
14587
+ * A contribution to a cell's status bar
14588
+ */
14589
+ export class NotebookCellStatusBarItem {
14590
+ /**
14591
+ * The text to show for the item.
14592
+ * @stubbed
14593
+ */
14594
+ text: string;
14595
+
14596
+ /**
14597
+ * Whether the item is aligned to the left or right.
14598
+ * @stubbed
14599
+ */
14600
+ alignment: NotebookCellStatusBarAlignment;
14601
+
14602
+ /**
14603
+ * An optional {@linkcode Command} or identifier of a command to run on click.
14604
+ *
14605
+ * The command must be {@link commands.getCommands known}.
14606
+ *
14607
+ * Note that if this is a {@linkcode Command} object, only the {@linkcode Command.command command} and {@linkcode Command.arguments arguments}
14608
+ * are used by the editor.
14609
+ * @stubbed
14610
+ */
14611
+ command?: string | Command;
14612
+
14613
+ /**
14614
+ * A tooltip to show when the item is hovered.
14615
+ * @stubbed
14616
+ */
14617
+ tooltip?: string;
14618
+
14619
+ /**
14620
+ * The priority of the item. A higher value item will be shown more to the left.
14621
+ * @stubbed
14622
+ */
14623
+ priority?: number;
14624
+
14625
+ /**
14626
+ * Accessibility information used when a screen reader interacts with this item.
14627
+ * @stubbed
14628
+ */
14629
+ accessibilityInformation?: AccessibilityInformation;
14630
+
14631
+ /**
14632
+ * Creates a new NotebookCellStatusBarItem.
14633
+ * @param text The text to show for the item.
14634
+ * @param alignment Whether the item is aligned to the left or right.
14635
+ * @stubbed
14636
+ */
14637
+ constructor(text: string, alignment: NotebookCellStatusBarAlignment);
14638
+ }
14639
+
14640
+ /**
14641
+ * A provider that can contribute items to the status bar that appears below a cell's editor.
14642
+ */
14643
+ export interface NotebookCellStatusBarItemProvider {
14644
+ /**
14645
+ * An optional event to signal that statusbar items have changed. The provide method will be called again.
14646
+ * @stubbed
14647
+ */
14648
+ onDidChangeCellStatusBarItems?: Event<void>;
14649
+
14650
+ /**
14651
+ * The provider will be called when the cell scrolls into view, when its content, outputs, language, or metadata change, and when it changes execution state.
14652
+ * @param cell The cell for which to return items.
14653
+ * @param token A token triggered if this request should be cancelled.
14654
+ * @return One or more {@link NotebookCellStatusBarItem cell statusbar items}
14655
+ * @stubbed
14656
+ */
14657
+ provideCellStatusBarItems(cell: NotebookCell, token: CancellationToken): ProviderResult<NotebookCellStatusBarItem | NotebookCellStatusBarItem[]>;
14658
+ }
14659
+
14660
+ /**
14661
+ * Namespace for notebooks.
14662
+ * The notebooks functionality is composed of three loosely coupled components:
14663
+ * -{@link NotebookSerializer} enable the editor to open, show, and save notebooks
14664
+ * -{@link NotebookController} own the execution of notebooks, e.g they create output from code cells.
14665
+ * -{@link NotebookRenderer} present notebook output in the editor. They run in a separate context.
14666
+ *
14667
+ */
14668
+ export namespace notebooks {
14669
+
14670
+ /**
14671
+ * Creates a new notebook controller.
14672
+ * @param id Identifier of the controller. Must be unique per extension.
14673
+ * @param notebookType A notebook type for which this controller is for.
14674
+ * @param label The label of the controller.
14675
+ * @param handler The execute-handler of the controller.
14676
+ * @returns a new instance of {@link NotebookController}
14677
+ * @stubbed
14678
+ */
14679
+ export function createNotebookController(
14680
+ id: string,
14681
+ notebookType: string,
14682
+ label: string,
14683
+ handler?: (cells: NotebookCell[],
14684
+ notebook: NotebookDocument,
14685
+ controller: NotebookController) => void | Thenable<void>): NotebookController;
14686
+
14687
+ /**
14688
+ * Creates a new messaging instance used to communicate with a specific renderer.
14689
+ * - Note 1: Extensions can only create renderer that they have defined in their package.json - file
14690
+ * - Note 2: A renderer only has access to messaging if requiresMessaging is set to always or optional in its notebookRenderer contribution.
14691
+ * @param rendererId The renderer ID to communicate with
14692
+ * @returns A new notebook renderer messaging object.
14693
+ * @stubbed
14694
+ */
14695
+ export function createRendererMessaging(rendererId: string): NotebookRendererMessaging;
14696
+
14697
+ /**
14698
+ * Register a cell statusbar item provider for the given notebook type.
14699
+ * @param notebookType The notebook type to register for.
14700
+ * @param provider A cell status bar provider.
14701
+ * @returns A Disposable that unregisters this provider when being disposed.
14702
+ * @stubbed
14703
+ */
14704
+ export function registerNotebookCellStatusBarItemProvider(notebookType: string, provider: NotebookCellStatusBarItemProvider): Disposable;
14705
+ }
12785
14706
  }
12786
14707
 
12787
14708
  /**