@theia/plugin 1.29.0-next.31 → 1.29.0-next.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/theia.d.ts +35 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.29.0-next.31+fa4a9cfb490",
3
+ "version": "1.29.0-next.35+3e664e7adce",
4
4
  "description": "Theia - Plugin API",
5
5
  "types": "./src/theia.d.ts",
6
6
  "publishConfig": {
@@ -32,5 +32,5 @@
32
32
  "nyc": {
33
33
  "extends": "../../configs/nyc.json"
34
34
  },
35
- "gitHead": "fa4a9cfb4909710854f6962b64b7f3384790e856"
35
+ "gitHead": "3e664e7adcef4e19321ddfe209ec17796fa96bf4"
36
36
  }
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
  /**