lumiverse-spindle-types 0.4.51 → 0.4.52

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.52",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
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,