-
Notifications
You must be signed in to change notification settings - Fork 30.3k
/
Copy pathvscode.proposed.extensionsAny.d.ts
41 lines (33 loc) · 1.51 KB
/
vscode.proposed.extensionsAny.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
// https://github.com/microsoft/vscode/issues/145307 @alexdima
export interface Extension<T> {
/**
* `true` when the extension is associated to another extension host.
*
* *Note* that an extension from another extension host cannot export
* API, e.g {@link Extension.exports its exports} are always `undefined`.
*/
readonly isFromDifferentExtensionHost: boolean;
}
export namespace extensions {
/**
* Get an extension by its full identifier in the form of: `publisher.name`.
*
* @param extensionId An extension identifier.
* @param includeDifferentExtensionHosts Include extensions from different extension host
* @return An extension or `undefined`.
*/
export function getExtension<T = any>(extensionId: string, includeDifferentExtensionHosts: boolean): Extension<T> | undefined;
export function getExtension<T = any>(extensionId: string, includeDifferentExtensionHosts: true): Extension<T | undefined> | undefined;
/**
* All extensions across all extension hosts.
*
* @see {@link Extension.isFromDifferentExtensionHost}
*/
export const allAcrossExtensionHosts: readonly Extension<void>[];
}
}