vscode.proposed.d.ts 19.2 KB
Newer Older
1 2 3 4 5 6 7 8 9
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

// This is the place for API experiments and proposal.

declare module 'vscode' {

J
Johannes Rieken 已提交
10 11 12 13
	export namespace window {
		export function sampleFunction(): Thenable<any>;
	}

14
	//#region Joh: file system provider (OLD)
J
Johannes Rieken 已提交
15

16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
	export enum FileChangeType {
		Updated = 0,
		Added = 1,
		Deleted = 2
	}

	export interface FileChange {
		type: FileChangeType;
		resource: Uri;
	}

	export enum FileType {
		File = 0,
		Dir = 1,
		Symlink = 2
	}

	export interface FileStat {
34
		id: number | string;
35
		mtime: number;
J
Johannes Rieken 已提交
36
		// atime: number;
37 38 39 40
		size: number;
		type: FileType;
	}

J
Johannes Rieken 已提交
41
	// todo@joh discover files etc
J
Johannes Rieken 已提交
42
	// todo@joh CancellationToken everywhere
J
Johannes Rieken 已提交
43
	// todo@joh add open/close calls?
J
Johannes Rieken 已提交
44
	export interface FileSystemProvider {
D
Dirk Baeumer 已提交
45

J
Johannes Rieken 已提交
46
		readonly onDidChange?: Event<FileChange[]>;
47 48

		// more...
49
		// @deprecated - will go away
J
Johannes Rieken 已提交
50
		utimes(resource: Uri, mtime: number, atime: number): Thenable<FileStat>;
51

52
		stat(resource: Uri): Thenable<FileStat>;
53

54
		read(resource: Uri, offset: number, length: number, progress: Progress<Uint8Array>): Thenable<number>;
55

J
Johannes Rieken 已提交
56
		// todo@joh - have an option to create iff not exist
57 58 59 60
		// todo@remote
		// offset - byte offset to start
		// count - number of bytes to write
		// Thenable<number> - number of bytes actually written
61
		write(resource: Uri, content: Uint8Array): Thenable<void>;
62 63 64

		// todo@remote
		// Thenable<FileStat>
65 66 67 68 69
		move(resource: Uri, target: Uri): Thenable<FileStat>;

		// todo@remote
		// helps with performance bigly
		// copy?(from: Uri, to: Uri): Thenable<void>;
70 71 72

		// todo@remote
		// Thenable<FileStat>
73
		mkdir(resource: Uri): Thenable<FileStat>;
74

75 76 77 78 79
		readdir(resource: Uri): Thenable<[Uri, FileStat][]>;

		// todo@remote
		// ? merge both
		// ? recursive del
80
		rmdir(resource: Uri): Thenable<void>;
81 82 83 84
		unlink(resource: Uri): Thenable<void>;

		// todo@remote
		// create(resource: Uri): Thenable<FileStat>;
85 86
	}

87 88 89 90 91 92 93 94
	export type DeprecatedFileChangeType = FileChangeType;
	export type DeprecatedFileType = FileType;
	export type DeprecatedFileChange = FileChange;
	export type DeprecatedFileStat = FileStat;
	export type DeprecatedFileSystemProvider = FileSystemProvider;

	export namespace workspace {
		export function registerDeprecatedFileSystemProvider(scheme: string, provider: DeprecatedFileSystemProvider): Disposable;
95
		export function registerFileSystemProvider(scheme: string, provider: FileSystemProvider, newProvider?: FileSystemProvider2): Disposable;
96 97 98 99 100 101
	}

	//#endregion

	//#region Joh: file system provider (new)

J
Johannes Rieken 已提交
102
	/**
J
Johannes Rieken 已提交
103
	 * A type that filesystem providers should use to signal errors.
104
	 *
J
Johannes Rieken 已提交
105 106
	 * This class has factory methods for common error-cases, like `EntryNotFound` when
	 * a file or folder doesn't exist. Use them like so `throw vscode.FileSystemError.EntryNotFound(uri);`
J
Johannes Rieken 已提交
107
	 */
108
	export class FileSystemError extends Error {
109

J
Johannes Rieken 已提交
110 111 112 113 114 115 116 117 118 119 120 121
		/**
		 * Create an error to signal that a file or folder wasn't found.
		 * @param messageOrUri Message or uri.
		 */
		static EntryNotFound(messageOrUri?: string | Uri): FileSystemError;

		/**
		 * Create an error to signal that a file or folder already exists, e.g. when
		 * creating but not overwriting a file.
		 * @param messageOrUri Message or uri.
		 */
		static EntryExists(messageOrUri?: string | Uri): FileSystemError;
122

J
Johannes Rieken 已提交
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
		/**
		 * Create an error to signal that a file is not a folder.
		 * @param messageOrUri Message or uri.
		 */
		static EntryNotADirectory(messageOrUri?: string | Uri): FileSystemError;

		/**
		 * Create an error to signal that a file is a folder.
		 * @param messageOrUri Message or uri.
		 */
		static EntryIsADirectory(messageOrUri?: string | Uri): FileSystemError;

		/**
		 * Creates a new filesystem error.
		 *
		 * @param messageOrUri Message or uri.
		 */
		constructor(messageOrUri?: string | Uri);
J
Johannes Rieken 已提交
141
	}
142

143 144 145 146 147 148
	export enum FileChangeType2 {
		Changed = 1,
		Created = 2,
		Deleted = 3,
	}

J
Johannes Rieken 已提交
149 150 151 152
	/**
	 * The event filesystem providers must use to signal a file change.
	 */
	export interface FileChangeEvent {
J
Johannes Rieken 已提交
153 154 155 156

		/**
		 *
		 */
157
		type: FileChangeType2;
J
Johannes Rieken 已提交
158 159 160 161

		/**
		 * The uri of the file that has changed.
		 */
162
		uri: Uri;
163 164
	}

J
Johannes Rieken 已提交
165
	/**
J
Johannes Rieken 已提交
166
	 * The `FileStat`-type represents metadata about a file.
J
Johannes Rieken 已提交
167
	 */
168
	export interface FileStat2 {
J
Johannes Rieken 已提交
169 170 171
		/**
		 * The file is a regular file.
		 */
172
		isFile: boolean;
J
Johannes Rieken 已提交
173 174 175 176

		/**
		 * The file is a directory.
		 */
177
		isDirectory: boolean;
J
Johannes Rieken 已提交
178 179 180 181

		/**
		 * The file is symbolic link to another file.
		 */
182
		isSymbolicLink: boolean;
J
Johannes Rieken 已提交
183 184 185 186

		/**
		 * The modification timestamp in milliseconds.
		 */
187
		mtime: number;
J
Johannes Rieken 已提交
188 189 190 191

		/**
		 * The size in bytes.
		 */
192 193 194
		size: number;
	}

195
	/**
J
Johannes Rieken 已提交
196
	 * Commonly used options when reading, writing, or stat'ing files or folders.
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
	 */
	export interface FileOptions {

		/**
		 * Create a file when it doesn't exists
		 */
		create?: boolean;

		/**
		 * In combination with [`create`](FileOptions.create) but
		 * the operation should fail when a file already exists.
		 */
		exclusive?: boolean;

		/**
		 * Open a file for reading.
		 */
		read?: boolean;

		/**
		 * Open a file for writing.
		 */
		write?: boolean;
220
	}
221

222
	/**
J
Johannes Rieken 已提交
223 224 225 226 227
	 * loose notes:
	 * -activation event `onFileSystem:foo`,
	 * -paths are hierarchical and the identifier of a file
	 * -use posix-path-math
	 * -etc...
228
	 */
229 230
	export interface FileSystemProvider2 {

231
		_version: 9;
232

J
Johannes Rieken 已提交
233
		/**
234 235 236
		 * An event to signal that a resource has been created, changed, or deleted. This
		 * event should fire for resources that are being [watched](#FileSystemProvider2.watch)
		 * by clients of this provider.
J
Johannes Rieken 已提交
237
		 */
J
Johannes Rieken 已提交
238
		readonly onDidChangeFile: Event<FileChangeEvent[]>;
239 240

		/**
241 242 243
		 * Subscribe to events in the file or folder denoted by `uri`.
		 * @param uri
		 * @param options
244 245
		 */
		watch(uri: Uri, options: { recursive?: boolean; excludes?: string[] }): Disposable;
246

J
Johannes Rieken 已提交
247
		/**
248 249
		 * Retrieve metadata about a file. Throw an [`EntryNotFound`](#FileError.EntryNotFound)-error
		 * in case the file does not exist.
J
Johannes Rieken 已提交
250 251 252
		 *
		 * @param uri The uri of the file to retrieve meta data about.
		 * @param token A cancellation token.
J
Johannes Rieken 已提交
253
		 * @return The file metadata about the file.
J
Johannes Rieken 已提交
254
		 */
255
		stat(uri: Uri, options: { /*future: followSymlinks*/ }, token: CancellationToken): FileStat2 | Thenable<FileStat2>;
256

J
Johannes Rieken 已提交
257 258 259 260 261
		/**
		 * Retrieve the meta data of all entries of a [directory](#FileType2.Directory)
		 *
		 * @param uri The uri of the folder.
		 * @param token A cancellation token.
262
		 * @return A thenable that resolves to an array of tuples of file names and files stats.
J
Johannes Rieken 已提交
263
		 */
264
		readDirectory(uri: Uri, options: { /*future: onlyType?*/ }, token: CancellationToken): [string, FileStat2][] | Thenable<[string, FileStat2][]>;
265

266 267
		/**
		 * Create a new directory. *Note* that new files are created via `write`-calls.
268
		 *
269 270 271
		 * @param uri The uri of the *new* folder.
		 * @param token A cancellation token.
		 */
272
		createDirectory(uri: Uri, options: { /*future: permissions?*/ }, token: CancellationToken): FileStat2 | Thenable<FileStat2>;
273

J
Johannes Rieken 已提交
274 275 276 277 278 279 280
		/**
		 * Read the entire contents of a file.
		 *
		 * @param uri The uri of the file.
		 * @param token A cancellation token.
		 * @return A thenable that resolves to an array of bytes.
		 */
281
		readFile(uri: Uri, options: FileOptions, token: CancellationToken): Uint8Array | Thenable<Uint8Array>;
282

J
Johannes Rieken 已提交
283 284 285 286 287 288 289
		/**
		 * Write data to a file, replacing its entire contents.
		 *
		 * @param uri The uri of the file.
		 * @param content The new content of the file.
		 * @param token A cancellation token.
		 */
290
		writeFile(uri: Uri, content: Uint8Array, options: FileOptions, token: CancellationToken): void | Thenable<void>;
291

292
		/**
293 294
		 * Delete a file or folder from the underlying storage.
		 *
295 296 297 298 299 300
		 * @param uri The resource that is to be deleted
		 * @param options Options bag for future use
		 * @param token A cancellation token.
		 */
		delete(uri: Uri, options: { /*future: useTrash?, followSymlinks?*/ }, token: CancellationToken): void | Thenable<void>;

J
Johannes Rieken 已提交
301 302 303
		/**
		 * Rename a file or folder.
		 *
304 305
		 * @param oldUri The existing file or folder.
		 * @param newUri The target location.
J
Johannes Rieken 已提交
306 307
		 * @param token A cancellation token.
		 */
308
		rename(oldUri: Uri, newUri: Uri, options: FileOptions, token: CancellationToken): FileStat2 | Thenable<FileStat2>;
309

310 311 312 313 314 315 316 317
		/**
		 * Copy files or folders. Implementing this function is optional but it will speedup
		 * the copy operation.
		 *
		 * @param uri The existing file or folder.
		 * @param target The target location.
		 * @param token A cancellation token.
		 */
318
		copy?(uri: Uri, target: Uri, options: FileOptions, token: CancellationToken): FileStat2 | Thenable<FileStat2>;
319 320
	}

321
	export namespace workspace {
322
		export function registerFileSystemProvider2(scheme: string, provider: FileSystemProvider2, options: { isCaseSensitive?: boolean }): Disposable;
323
	}
J
Johannes Rieken 已提交
324

325 326 327 328 329 330
	//#endregion

	//#region Joh: remote, search provider

	export interface TextSearchQuery {
		pattern: string;
331
		isRegExp?: boolean;
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348
		isCaseSensitive?: boolean;
		isWordMatch?: boolean;
	}

	export interface TextSearchOptions {
		includes: GlobPattern[];
		excludes: GlobPattern[];
	}

	export interface TextSearchResult {
		uri: Uri;
		range: Range;
		preview: { leading: string, matching: string, trailing: string };
	}

	export interface SearchProvider {
		provideFileSearchResults?(query: string, progress: Progress<Uri>, token: CancellationToken): Thenable<void>;
349
		provideTextSearchResults?(query: TextSearchQuery, options: TextSearchOptions, progress: Progress<TextSearchResult>, token: CancellationToken): Thenable<void>;
350 351
	}

352
	export namespace workspace {
353
		export function registerSearchProvider(scheme: string, provider: SearchProvider): Disposable;
354 355
	}

J
Johannes Rieken 已提交
356
	//#endregion
357

J
Johannes Rieken 已提交
358
	//#region Joao: diff command
P
Pine Wu 已提交
359

J
Joao Moreno 已提交
360 361 362
	/**
	 * The contiguous set of modified lines in a diff.
	 */
J
Joao Moreno 已提交
363 364 365 366 367 368 369
	export interface LineChange {
		readonly originalStartLineNumber: number;
		readonly originalEndLineNumber: number;
		readonly modifiedStartLineNumber: number;
		readonly modifiedEndLineNumber: number;
	}

370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
	export namespace commands {

		/**
		 * Registers a diff information command that can be invoked via a keyboard shortcut,
		 * a menu item, an action, or directly.
		 *
		 * Diff information commands are different from ordinary [commands](#commands.registerCommand) as
		 * they only execute when there is an active diff editor when the command is called, and the diff
		 * information has been computed. Also, the command handler of an editor command has access to
		 * the diff information.
		 *
		 * @param command A unique identifier for the command.
		 * @param callback A command handler function with access to the [diff information](#LineChange).
		 * @param thisArg The `this` context used when invoking the handler function.
		 * @return Disposable which unregisters this command on disposal.
		 */
		export function registerDiffInformationCommand(command: string, callback: (diff: LineChange[], ...args: any[]) => any, thisArg?: any): Disposable;
	}
388

J
Johannes Rieken 已提交
389 390 391
	//#endregion

	//#region Joh: decorations
392 393 394 395 396

	//todo@joh -> make class
	export interface DecorationData {
		priority?: number;
		title?: string;
397
		bubble?: boolean;
398 399
		abbreviation?: string;
		color?: ThemeColor;
400
		source?: string;
401 402
	}

403 404 405 406 407 408
	export interface SourceControlResourceDecorations {
		source?: string;
		letter?: string;
		color?: ThemeColor;
	}

409
	export interface DecorationProvider {
410
		onDidChangeDecorations: Event<undefined | Uri | Uri[]>;
411 412 413 414
		provideDecoration(uri: Uri, token: CancellationToken): ProviderResult<DecorationData>;
	}

	export namespace window {
415
		export function registerDecorationProvider(provider: DecorationProvider): Disposable;
416 417 418
	}

	//#endregion
419

J
Johannes Rieken 已提交
420 421
	//#region André: debug

422 423 424 425 426 427
	/**
	 * Represents a debug adapter executable and optional arguments passed to it.
	 */
	export class DebugAdapterExecutable {
		/**
		 * The command path of the debug adapter executable.
A
Andre Weinand 已提交
428
		 * A command must be either an absolute path or the name of an executable looked up via the PATH environment variable.
429 430 431 432 433
		 * The special value 'node' will be mapped to VS Code's built-in node runtime.
		 */
		readonly command: string;

		/**
A
Andre Weinand 已提交
434
		 * Optional arguments passed to the debug adapter executable.
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454
		 */
		readonly args: string[];

		/**
		 * Create a new debug adapter specification.
		 */
		constructor(command: string, args?: string[]);
	}

	export interface DebugConfigurationProvider {
		/**
		 * This optional method is called just before a debug adapter is started to determine its excutable path and arguments.
		 * Registering more than one debugAdapterExecutable for a type results in an error.
		 * @param folder The workspace folder from which the configuration originates from or undefined for a folderless setup.
		 * @param token A cancellation token.
		 * @return a [debug adapter's executable and optional arguments](#DebugAdapterExecutable) or undefined.
		 */
		debugAdapterExecutable?(folder: WorkspaceFolder | undefined, token?: CancellationToken): ProviderResult<DebugAdapterExecutable>;
	}

J
Johannes Rieken 已提交
455 456 457 458
	//#endregion

	//#region Rob, Matt: logging

459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485
	/**
	 * The severity level of a log message
	 */
	export enum LogLevel {
		Trace = 1,
		Debug = 2,
		Info = 3,
		Warning = 4,
		Error = 5,
		Critical = 6,
		Off = 7
	}

	/**
	 * A logger for writing to an extension's log file, and accessing its dedicated log directory.
	 */
	export interface Logger {
		trace(message: string, ...args: any[]): void;
		debug(message: string, ...args: any[]): void;
		info(message: string, ...args: any[]): void;
		warn(message: string, ...args: any[]): void;
		error(message: string | Error, ...args: any[]): void;
		critical(message: string | Error, ...args: any[]): void;
	}

	export interface ExtensionContext {
		/**
R
Rob Lourens 已提交
486
		 * This extension's logger
487 488
		 */
		logger: Logger;
489 490 491 492 493 494 495

		/**
		 * Path where an extension can write log files.
		 *
		 * Extensions must create this directory before writing to it. The parent directory will always exist.
		 */
		readonly logDirectory: string;
496
	}
497

M
Matt Bierner 已提交
498 499 500 501 502 503 504 505 506
	export namespace env {
		/**
		 * Current logging level.
		 *
		 * @readonly
		 */
		export const logLevel: LogLevel;
	}

J
Johannes Rieken 已提交
507 508 509
	//#endregion

	//#region Joao: SCM validation
510

J
Joao Moreno 已提交
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555
	/**
	 * Represents the validation type of the Source Control input.
	 */
	export enum SourceControlInputBoxValidationType {

		/**
		 * Something not allowed by the rules of a language or other means.
		 */
		Error = 0,

		/**
		 * Something suspicious but allowed.
		 */
		Warning = 1,

		/**
		 * Something to inform about but not a problem.
		 */
		Information = 2
	}

	export interface SourceControlInputBoxValidation {

		/**
		 * The validation message to display.
		 */
		readonly message: string;

		/**
		 * The validation type.
		 */
		readonly type: SourceControlInputBoxValidationType;
	}

	/**
	 * Represents the input box in the Source Control viewlet.
	 */
	export interface SourceControlInputBox {

		/**
		 * A validation function for the input box. It's possible to change
		 * the validation provider simply by setting this property to a different function.
		 */
		validateInput?(value: string, cursorPosition: number): ProviderResult<SourceControlInputBoxValidation | undefined | null>;
	}
M
Matt Bierner 已提交
556

J
Johannes Rieken 已提交
557 558
	//#endregion

559
	//#region Matt: WebView Serializer
560

561
	/**
562
	 * Save and restore webview panels that have been persisted when vscode shuts down.
563
	 */
564
	interface WebviewPanelSerializer {
565
		/**
566
		 * Save a webview panel's `state`.
567
		 *
568 569
		 * Called before shutdown. Extensions have a 250ms timeframe to return a state. If serialization
		 * takes longer than 250ms, the panel will not be serialized.
570
		 *
571
		 * @param webviewPanel webview Panel to serialize. May or may not be visible.
572 573 574
		 *
		 * @returns JSON serializable state blob.
		 */
575
		serializeWebviewPanel(webviewPanel: WebviewPanel): Thenable<any>;
576 577

		/**
578
		 * Restore a webview panel from its seriailzed `state`.
579
		 *
580
		 * Called when a serialized webview first becomes visible.
581
		 *
582
		 * @param webviewPanel Webview panel to restore. The serializer should take ownership of this panel.
583
		 * @param state Persisted state.
584 585
		 *
		 * @return Thanble indicating that the webview has been fully restored.
586
		 */
587
		deserializeWebviewPanel(webviewPanel: WebviewPanel, state: any): Thenable<void>;
588 589
	}

M
Matt Bierner 已提交
590
	namespace window {
591
		/**
592
		 * Registers a webview panel serializer.
593 594
		 *
		 * Extensions that support reviving should have an `"onView:viewType"` activation method and
595
		 * make sure that [registerWebviewPanelSerializer](#registerWebviewPanelSerializer) is called during activation.
596 597 598
		 *
		 * Only a single serializer may be registered at a time for a given `viewType`.
		 *
599
		 * @param viewType Type of the webview panel that can be serialized.
600 601
		 * @param reviver Webview serializer.
		 */
602
		export function registerWebviewPanelSerializer(viewType: string, reviver: WebviewPanelSerializer): Disposable;
M
Matt Bierner 已提交
603
	}
S
Sandeep Somavarapu 已提交
604

J
Johannes Rieken 已提交
605 606
	//#endregion

607 608 609
	//#region Tasks

	/**
610 611
	 * An object representing an executed Task. It can be used
	 * to terminate a task.
D
Dirk Baeumer 已提交
612 613
	 *
	 * This interface is not intended to be implemented.
614
	 */
615
	export interface TaskExecution {
D
Dirk Baeumer 已提交
616 617 618 619 620 621 622 623 624
		/**
		 * The task that got started.
		 */
		task: Task;

		/**
		 * Terminates the task execution.
		 */
		terminate(): void;
625 626 627 628
	}

	/**
	 * An event signaling the start of a task execution.
D
Dirk Baeumer 已提交
629 630
	 *
	 * This interface is not intended to be implemented.
631 632 633 634 635 636 637 638 639 640
	 */
	interface TaskStartEvent {
		/**
		 * The task item representing the task that got started.
		 */
		execution: TaskExecution;
	}

	/**
	 * An event signaling the end of an executed task.
D
Dirk Baeumer 已提交
641 642
	 *
	 * This interface is not intended to be implemented.
643 644 645 646 647 648 649 650
	 */
	interface TaskEndEvent {
		/**
		 * The task item representing the task that finished.
		 */
		execution: TaskExecution;
	}

651 652 653 654 655 656 657 658 659 660 661 662 663
	export interface TaskFilter {
		/**
		 * The task version as used in the tasks.json file.
		 * The string support the package.json semver notation.
		 */
		version?: string;

		/**
		 * The task type to return;
		 */
		type?: string;
	}

664
	export namespace workspace {
665 666

		/**
667
		 * Fetches all task available in the systems. Thisweweb includes tasks
668 669
		 * from `tasks.json` files as well as tasks from task providers
		 * contributed through extensions.
670 671
		 *
		 * @param filter a filter to filter the return tasks.
672
		 */
673
		export function fetchTasks(filter?: TaskFilter): Thenable<Task[]>;
674 675

		/**
676 677 678 679
		 * Executes a task that is managed by VS Code. The returned
		 * task execution can be used to terminate the task.
		 *
		 * @param task the task to execute
680
		 */
681
		export function executeTask(task: Task): Thenable<TaskExecution>;
D
Dirk Baeumer 已提交
682

683 684 685 686 687 688 689
		/**
		 * The currently active task executions or an empty array.
		 *
		 * @readonly
		 */
		export let taskExecutions: TaskExecution[];

D
Dirk Baeumer 已提交
690
		/**
691 692 693 694
		 * Fires when a task starts.
		 */
		export const onDidStartTask: Event<TaskStartEvent>;

695
		/**
696
		 * Fires when a task ends.
697
		 */
698
		export const onDidEndTask: Event<TaskEndEvent>;
699 700 701
	}

	//#endregion
702 703 704

	//#region Terminal

D
Daniel Imms 已提交
705 706 707 708
	export interface Terminal {
		onData: Event<string>;
	}

709
	export namespace window {
D
Daniel Imms 已提交
710
		/**
D
jsdoc  
Daniel Imms 已提交
711 712
		 * The currently active terminals or an empty array.
		 *
D
Daniel Imms 已提交
713 714 715 716
		 * @readonly
		 */
		export let terminals: Terminal[];

D
jsdoc  
Daniel Imms 已提交
717 718 719 720
		/**
		 * An [event](#Event) which fires when a terminal has been created, either through the
		 * [createTerminal](#window.createTerminal) API or commands.
		 */
721 722 723 724
		export const onDidOpenTerminal: Event<Terminal>;
	}

	//#endregion
J
Joao Moreno 已提交
725 726 727

	//#region URLs

J
Joao Moreno 已提交
728 729
	export interface ProtocolHandler {
		handleUri(uri: Uri): void;
J
Joao Moreno 已提交
730 731 732 733 734
	}

	export namespace window {

		/**
J
Joao Moreno 已提交
735
		 * Registers a protocol handler capable of handling system-wide URIs.
J
Joao Moreno 已提交
736
		 */
J
Joao Moreno 已提交
737
		export function registerProtocolHandler(handler: ProtocolHandler): Disposable;
J
Joao Moreno 已提交
738 739 740
	}

	//#endregion
J
Johannes Rieken 已提交
741
}