@ampcode/plugin 0.0.0-20260912001654-gd95a615 → 0.0.0-20260912230015-gda72aa6

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/index.d.ts +25 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1280,6 +1280,26 @@ declare module '@ampcode/plugin' {
1280
1280
  confirmButtonText?: string
1281
1281
  }
1282
1282
 
1283
+ /** An editable, required text field in a confirmation dialog. */
1284
+ export interface PluginConfirmField {
1285
+ /** Stable key used in the returned record */
1286
+ name: string
1287
+
1288
+ /** Label shown above the field */
1289
+ label: string
1290
+
1291
+ /** Initial field value */
1292
+ value: string
1293
+
1294
+ /** Allow the field to span multiple lines */
1295
+ multiline?: boolean
1296
+ }
1297
+
1298
+ /** Options for a confirmation dialog that returns edited field values. */
1299
+ export interface PluginEditableConfirmOptions extends PluginConfirmOptions {
1300
+ fields: PluginConfirmField[]
1301
+ }
1302
+
1283
1303
  /**
1284
1304
  * Options for the select dialog.
1285
1305
  */
@@ -1315,6 +1335,11 @@ declare module '@ampcode/plugin' {
1315
1335
  */
1316
1336
  input(options: PluginInputOptions): Promise<string | undefined>
1317
1337
 
1338
+ /**
1339
+ * Show required editable fields in a confirmation dialog.
1340
+ * @returns The edited values by field name, or undefined if cancelled.
1341
+ */
1342
+ confirm(options: PluginEditableConfirmOptions): Promise<Record<string, string> | undefined>
1318
1343
  /**
1319
1344
  * Show a confirmation dialog with Yes/No options.
1320
1345
  * @returns true if the user confirmed, false if they cancelled.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampcode/plugin",
3
- "version": "0.0.0-20260912001654-gd95a615",
3
+ "version": "0.0.0-20260912230015-gda72aa6",
4
4
  "description": "Amp Plugin API",
5
5
  "homepage": "https://ampcode.com/docs/plugin-api",
6
6
  "author": {