@theia/plugin 1.29.0-next.9 → 1.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.29.0-next.9+7b29ac6f2d1",
3
+ "version": "1.29.0",
4
4
  "description": "Theia - Plugin API",
5
5
  "types": "./src/theia.d.ts",
6
6
  "publishConfig": {
@@ -27,10 +27,10 @@
27
27
  "watch": "theiaext watch"
28
28
  },
29
29
  "devDependencies": {
30
- "@theia/ext-scripts": "1.28.0"
30
+ "@theia/ext-scripts": "1.29.0"
31
31
  },
32
32
  "nyc": {
33
33
  "extends": "../../configs/nyc.json"
34
34
  },
35
- "gitHead": "7b29ac6f2d1a75b44b5c5d37ec7ae0200e0c3e99"
35
+ "gitHead": "054a575b92bd689505dcb74c1573b96483cc687c"
36
36
  }
@@ -21,130 +21,6 @@
21
21
  * These API are NOT stable and subject to change. Use it on own risk.
22
22
  */
23
23
  export module '@theia/plugin' {
24
- // #region auth provider
25
-
26
- /**
27
- * An [event](#Event) which fires when an [AuthenticationProvider](#AuthenticationProvider) is added or removed.
28
- */
29
- export interface AuthenticationProvidersChangeEvent {
30
- /**
31
- * The ids of the [authenticationProvider](#AuthenticationProvider)s that have been added.
32
- */
33
- readonly added: ReadonlyArray<AuthenticationProviderInformation>;
34
-
35
- /**
36
- * The ids of the [authenticationProvider](#AuthenticationProvider)s that have been removed.
37
- */
38
- readonly removed: ReadonlyArray<AuthenticationProviderInformation>;
39
- }
40
-
41
- /**
42
- * An [event](#Event) which fires when an [AuthenticationSession](#AuthenticationSession) is added, removed, or changed.
43
- */
44
- export interface AuthenticationProviderAuthenticationSessionsChangeEvent {
45
- /**
46
- * The ids of the [AuthenticationSession](#AuthenticationSession)s that have been added.
47
- */
48
- readonly added: ReadonlyArray<string>;
49
-
50
- /**
51
- * The ids of the [AuthenticationSession](#AuthenticationSession)s that have been removed.
52
- */
53
- readonly removed: ReadonlyArray<string>;
54
-
55
- /**
56
- * The ids of the [AuthenticationSession](#AuthenticationSession)s that have been changed.
57
- */
58
- readonly changed: ReadonlyArray<string>;
59
- }
60
-
61
- /**
62
- * **WARNING** When writing an AuthenticationProvider, `id` should be treated as part of your extension's
63
- * API, changing it is a breaking change for all extensions relying on the provider. The id is
64
- * treated case-sensitively.
65
- */
66
- export interface AuthenticationProvider {
67
- /**
68
- * Used as an identifier for extensions trying to work with a particular
69
- * provider: 'microsoft', 'github', etc. id must be unique, registering
70
- * another provider with the same id will fail.
71
- */
72
- readonly id: string;
73
-
74
- /**
75
- * The human-readable name of the provider.
76
- */
77
- readonly label: string;
78
-
79
- /**
80
- * Whether it is possible to be signed into multiple accounts at once with this provider
81
- */
82
- readonly supportsMultipleAccounts: boolean;
83
-
84
- /**
85
- * Returns an array of current sessions.
86
- */
87
- getSessions(): Thenable<ReadonlyArray<AuthenticationSession>>;
88
-
89
- /**
90
- * Prompts a user to login.
91
- */
92
- login(scopes: string[]): Thenable<AuthenticationSession>;
93
-
94
- /**
95
- * Removes the session corresponding to session id.
96
- * @param sessionId The session id to log out of
97
- */
98
- logout(sessionId: string): Thenable<void>;
99
- }
100
-
101
- export namespace authentication {
102
- /**
103
- * Register an authentication provider.
104
- *
105
- * There can only be one provider per id and an error is being thrown when an id
106
- * has already been used by another provider.
107
- *
108
- * @param provider The authentication provider provider.
109
- * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
110
- */
111
- export function registerAuthenticationProvider(provider: AuthenticationProvider): Disposable;
112
-
113
- /**
114
- * Fires with the provider id that was registered or unregistered.
115
- */
116
- export const onDidChangeAuthenticationProviders: Event<AuthenticationProvidersChangeEvent>;
117
-
118
- /**
119
- * @deprecated
120
- * The ids of the currently registered authentication providers.
121
- * @returns An array of the ids of authentication providers that are currently registered.
122
- */
123
- export function getProviderIds(): Thenable<ReadonlyArray<string>>;
124
-
125
- /**
126
- * @deprecated
127
- * An array of the ids of authentication providers that are currently registered.
128
- */
129
- export const providerIds: ReadonlyArray<string>;
130
-
131
- /**
132
- * An array of the information of authentication providers that are currently registered.
133
- */
134
- export const providers: ReadonlyArray<AuthenticationProviderInformation>;
135
-
136
- /**
137
- * @deprecated
138
- * Logout of a specific session.
139
- * @param providerId The id of the provider to use
140
- * @param sessionId The session id to remove
141
- * provider
142
- */
143
- export function logout(providerId: string, sessionId: string): Thenable<void>;
144
- }
145
-
146
- // #endregion
147
-
148
24
  /**
149
25
  * The contiguous set of modified lines in a diff.
150
26
  */
package/src/theia.d.ts CHANGED
@@ -2353,6 +2353,32 @@ export module '@theia/plugin' {
2353
2353
  ignoreFocusOut?: boolean;
2354
2354
  }
2355
2355
 
2356
+ /**
2357
+ * Impacts the behavior and appearance of the validation message.
2358
+ */
2359
+ export enum InputBoxValidationSeverity {
2360
+ Info = 1,
2361
+ Warning = 2,
2362
+ Error = 3
2363
+ }
2364
+
2365
+ /**
2366
+ * Object to configure the behavior of the validation message.
2367
+ */
2368
+ export interface InputBoxValidationMessage {
2369
+ /**
2370
+ * The validation message to display.
2371
+ */
2372
+ readonly message: string;
2373
+
2374
+ /**
2375
+ * The severity of the validation message.
2376
+ * NOTE: When using `InputBoxValidationSeverity.Error`, the user will not be allowed to accept (hit ENTER) the input.
2377
+ * `Info` and `Warning` will still allow the InputBox to accept the input.
2378
+ */
2379
+ readonly severity: InputBoxValidationSeverity;
2380
+ }
2381
+
2356
2382
  /**
2357
2383
  * Options to configure the behavior of the input box UI.
2358
2384
  */
@@ -2401,10 +2427,10 @@ export module '@theia/plugin' {
2401
2427
  * to the user.
2402
2428
  *
2403
2429
  * @param value The current value of the input box.
2404
- * @return A human readable string which is presented as diagnostic message.
2405
- * Return `undefined`, or the empty string when 'value' is valid.
2430
+ * @return Either a human-readable string which is presented as an error message or an {@link InputBoxValidationMessage}
2431
+ * which can provide a specific message severity. Return `undefined`, `null`, or the empty string when 'value' is valid.
2406
2432
  */
2407
- validateInput?: (input: string) => Promise<string | null | undefined> | undefined;
2433
+ validateInput?: (input: string) => Promise<string | InputBoxValidationMessage | null | undefined> | undefined;
2408
2434
 
2409
2435
  /**
2410
2436
  * An optional function that will be called on Enter key.
@@ -4465,7 +4491,7 @@ export module '@theia/plugin' {
4465
4491
  * @param token A token that can be used to signal cancellation.
4466
4492
  * @return A promise that resolves to the selection or `undefined`.
4467
4493
  */
4468
- export function showQuickPick(readonly items: string[] | Thenable<readonly string[]>, options: QuickPickOptions, token?: CancellationToken): Thenable<string | undefined>;
4494
+ export function showQuickPick(items: readonly string[] | Thenable<readonly string[]>, options?: QuickPickOptions, token?: CancellationToken): Thenable<string | undefined>;
4469
4495
 
4470
4496
  /**
4471
4497
  * Shows a selection list allowing multiple selections.
@@ -4475,7 +4501,7 @@ export module '@theia/plugin' {
4475
4501
  * @param token A token that can be used to signal cancellation.
4476
4502
  * @return A promise that resolves to the selected items or `undefined`.
4477
4503
  */
4478
- export function showQuickPick(readonly items: string[] | Thenable<readonly string[]>, options: QuickPickOptions & { canPickMany: true }, token?: CancellationToken): Thenable<string[] | undefined>;
4504
+ export function showQuickPick(items: readonly string[] | Thenable<readonly string[]>, options: QuickPickOptions & { canPickMany: true }, token?: CancellationToken): Thenable<string[] | undefined>;
4479
4505
 
4480
4506
  /**
4481
4507
  * Shows a selection list.
@@ -4485,7 +4511,7 @@ export module '@theia/plugin' {
4485
4511
  * @param token A token that can be used to signal cancellation.
4486
4512
  * @return A promise that resolves to the selected item or `undefined`.
4487
4513
  */
4488
- export function showQuickPick<T extends QuickPickItem>(items: readonly T[] | Thenable<readonly T[]>, options: QuickPickOptions, token?: CancellationToken): Thenable<T | undefined>;
4514
+ export function showQuickPick<T extends QuickPickItem>(items: readonly T[] | Thenable<readonly T[]>, options?: QuickPickOptions, token?: CancellationToken): Thenable<T | undefined>;
4489
4515
 
4490
4516
  /**
4491
4517
  * Shows a selection list allowing multiple selections.
@@ -5065,8 +5091,10 @@ export module '@theia/plugin' {
5065
5091
 
5066
5092
  /**
5067
5093
  * An optional validation message indicating a problem with the current input value.
5094
+ * By returning a string, the InputBox will use a default {@link InputBoxValidationSeverity} of Error.
5095
+ * Returning undefined clears the validation message.
5068
5096
  */
5069
- validationMessage: string | undefined;
5097
+ validationMessage: string | InputBoxValidationMessage | undefined;
5070
5098
  }
5071
5099
 
5072
5100
  /**
@@ -11815,7 +11843,7 @@ export module '@theia/plugin' {
11815
11843
  * The permissions granted by the session's access token. Available scopes
11816
11844
  * are defined by the [AuthenticationProvider](#AuthenticationProvider).
11817
11845
  */
11818
- readonly scopes: ReadonlyArray<string>;
11846
+ readonly scopes: readonly string[];
11819
11847
  }
11820
11848
 
11821
11849
  /**
@@ -12050,12 +12078,6 @@ export module '@theia/plugin' {
12050
12078
  * @return A {@link Disposable} that unregisters this provider when being disposed.
12051
12079
  */
12052
12080
  export function registerAuthenticationProvider(id: string, label: string, provider: AuthenticationProvider, options?: AuthenticationProviderOptions): Disposable;
12053
-
12054
- /**
12055
- * @deprecated Use {@link getSession()} {@link AuthenticationGetSessionOptions.silent} instead.
12056
- */
12057
- export function hasSession(providerId: string, scopes: readonly string[]): Thenable<boolean>;
12058
-
12059
12081
  }
12060
12082
  }
12061
12083