lumiverse-spindle-types 0.4.51 → 0.4.53

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.51",
3
+ "version": "0.4.53",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
package/src/api.ts CHANGED
@@ -278,6 +278,9 @@ export interface RequestInitDTO {
278
278
  method?: string;
279
279
  headers?: Record<string, string>;
280
280
  body?: string;
281
+ /** When `"arraybuffer"`, the response body is returned as a base64-encoded string
282
+ * with `encoding: "base64"`. Used by the sandboxed-widget transparent proxy. */
283
+ responseType?: "text" | "arraybuffer";
281
284
  }
282
285
 
283
286
  /**
package/src/dom.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import type { RequestInitDTO } from "./api";
2
+
1
3
  /** DOM helper API provided to frontend extension modules. */
2
4
  export interface SpindleDOMHelper {
3
5
  /** Inject sanitized HTML into the host document at the given target. */
@@ -188,6 +190,15 @@ export interface SpindleSandboxFrameHandle {
188
190
  destroy(): void;
189
191
  }
190
192
 
193
+ /** API exposed inside the sandboxed iframe as `window.spindleSandbox`. */
194
+ export interface SpindleSandboxAPI {
195
+ postMessage(payload: unknown): void;
196
+ onMessage(handler: (payload: unknown) => void): () => void;
197
+ requestResize(height?: number): void;
198
+ /** Fetch a URL through the extension's CORS proxy. Requires the `cors_proxy` permission. */
199
+ corsProxy(url: string, options?: RequestInitDTO): Promise<unknown>;
200
+ }
201
+
191
202
  export interface SpindleUploadFile {
192
203
  name: string;
193
204
  mimeType: string;
package/src/index.ts CHANGED
@@ -142,6 +142,7 @@ export type {
142
142
  SpindleInputBarActionHandle,
143
143
  SpindleSandboxFrameOptions,
144
144
  SpindleSandboxFrameHandle,
145
+ SpindleSandboxAPI,
145
146
  SpindleContextMenuOptions,
146
147
  SpindleContextMenuItemDef,
147
148
  SpindleContextMenuResult,
@@ -921,6 +921,8 @@ export interface SpindleAPI {
921
921
  list(filter?: FrontendProcessListOptionsDTO): Promise<FrontendProcessInfoDTO[]>;
922
922
  /** Get a single tracked process by ID. Returns `null` if it no longer exists. */
923
923
  get(processId: string): Promise<FrontendProcessInfoDTO | null>;
924
+ /** Send a message to a specific frontend process */
925
+ send(processId: string, payload: unknown, userId?: string): void;
924
926
  /** Request graceful termination of a tracked process. */
925
927
  stop(processId: string, options?: FrontendProcessStopOptionsDTO): Promise<void>;
926
928
  /** Subscribe to lifecycle transitions (`starting`, `running`, `timed_out`, etc.). */
@@ -951,6 +953,8 @@ export interface SpindleAPI {
951
953
  list(filter?: BackendProcessListOptionsDTO): Promise<BackendProcessInfoDTO[]>;
952
954
  /** Get a single tracked subprocess by ID. Returns `null` if it no longer exists. */
953
955
  get(processId: string): Promise<BackendProcessInfoDTO | null>;
956
+ /** Send a message to a specific backend process */
957
+ send(processId: string, payload: unknown, userId?: string): void;
954
958
  /** Request graceful termination of a tracked subprocess. */
955
959
  stop(processId: string, options?: BackendProcessStopOptionsDTO): Promise<void>;
956
960
  /** Subscribe to lifecycle transitions (`starting`, `running`, `timed_out`, etc.). */