@ampcode/plugin 0.0.0-20260428002917-g0d37d54 → 0.0.0-20260430003013-g03bdb0e
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/index.d.ts +21 -3
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -387,6 +387,20 @@ declare module '@ampcode/plugin' {
|
|
|
387
387
|
confirmButtonText?: string
|
|
388
388
|
}
|
|
389
389
|
|
|
390
|
+
/**
|
|
391
|
+
* Options for the select dialog.
|
|
392
|
+
*/
|
|
393
|
+
export interface PluginSelectOptions {
|
|
394
|
+
/** Dialog title */
|
|
395
|
+
title: string
|
|
396
|
+
|
|
397
|
+
/** Message body shown below the title */
|
|
398
|
+
message?: string
|
|
399
|
+
|
|
400
|
+
/** Entries to display as choices */
|
|
401
|
+
options: string[]
|
|
402
|
+
}
|
|
403
|
+
|
|
390
404
|
/**
|
|
391
405
|
* UI capabilities provided to plugins.
|
|
392
406
|
*/
|
|
@@ -404,6 +418,12 @@ declare module '@ampcode/plugin' {
|
|
|
404
418
|
* @returns true if the user confirmed, false if they cancelled.
|
|
405
419
|
*/
|
|
406
420
|
confirm(options: PluginConfirmOptions): Promise<boolean>
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* Show a select dialog with user provided options.
|
|
424
|
+
* @returns the selected value, undefined if they cancelled
|
|
425
|
+
*/
|
|
426
|
+
select(options: PluginSelectOptions): Promise<string | undefined>
|
|
407
427
|
}
|
|
408
428
|
|
|
409
429
|
/**
|
|
@@ -727,9 +747,7 @@ declare module '@ampcode/plugin' {
|
|
|
727
747
|
$: ShellFunction
|
|
728
748
|
|
|
729
749
|
/** Current thread context if a thread is active, undefined otherwise */
|
|
730
|
-
thread?:
|
|
731
|
-
id: ThreadID
|
|
732
|
-
}
|
|
750
|
+
thread?: PluginThread
|
|
733
751
|
}
|
|
734
752
|
|
|
735
753
|
/**
|