lumiverse-spindle-types 0.4.4 → 0.4.11

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": "lumiverse-spindle-types",
3
- "version": "0.4.4",
3
+ "version": "0.4.11",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
package/src/api.ts CHANGED
@@ -984,6 +984,7 @@ export type WorkerToHost =
984
984
  | { type: "text_editor_open"; requestId: string; title?: string; value?: string; placeholder?: string; userId?: string }
985
985
  // ─── Modal (free tier) ────────────────────────────────────────────
986
986
  | { type: "modal_open"; requestId: string; title: string; items: SpindleModalItemDTO[]; width?: number; maxHeight?: number; persistent?: boolean; userId?: string }
987
+ | { type: "modal_close"; requestId: string; openRequestId: string; userId?: string }
987
988
  | { type: "confirm_open"; requestId: string; title: string; message: string; variant?: "info" | "warning" | "danger" | "success"; confirmLabel?: string; cancelLabel?: string; userId?: string }
988
989
  | { type: "input_prompt_open"; requestId: string; title: string; message?: string; placeholder?: string; defaultValue?: string; submitLabel?: string; cancelLabel?: string; multiline?: boolean; userId?: string }
989
990
  // ─── Macro Resolution (free tier) ──────────────────────────────────
@@ -727,9 +727,16 @@ export interface SpindleAPI {
727
727
  /** For operator-scoped extensions only. */
728
728
  userId?: string;
729
729
  }): Promise<{
730
+ openRequestId: string;
730
731
  /** How the modal was dismissed. */
731
732
  dismissedBy: "user" | "extension" | "cleanup";
732
733
  }>;
734
+ /**
735
+ * Programmatically close a modal that was opened with `spindle.modal.open()`.
736
+ * `openRequestId` is the request ID returned alongside the modal handle.
737
+ * Resolves immediately after the dismiss event is emitted.
738
+ */
739
+ close(openRequestId: string, userId?: string): Promise<void>;
733
740
  /**
734
741
  * Show a confirmation modal and wait for the user's response.
735
742
  * The host renders a themed dialog with a message, variant-colored