lumiverse-spindle-types 0.4.49 → 0.4.51

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/package.json +1 -1
  2. package/src/dom.ts +12 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lumiverse-spindle-types",
3
- "version": "0.4.49",
3
+ "version": "0.4.51",
4
4
  "types": "./src/index.ts",
5
5
  "keywords": [
6
6
  "lumiverse",
package/src/dom.ts CHANGED
@@ -1,21 +1,27 @@
1
- /** DOM helper API provided inside isolated frontend extension modules. */
1
+ /** DOM helper API provided to frontend extension modules. */
2
2
  export interface SpindleDOMHelper {
3
- /** Create a style element inside the extension sandbox document. Returns a removal function. */
3
+ /** Inject sanitized HTML into the host document at the given target. */
4
+ inject(target: string | Element, html: string, position?: InsertPosition): Element;
5
+
6
+ /** Create a style element in the host document. Returns a removal function. */
4
7
  addStyle(css: string): () => void;
5
8
 
6
- /** Create an element inside the extension sandbox document with optional attributes. */
9
+ /** Create an element in the host document with optional attributes. */
7
10
  createElement<K extends keyof HTMLElementTagNameMap>(
8
11
  tag: K,
9
12
  attrs?: Record<string, string>
10
13
  ): HTMLElementTagNameMap[K];
11
14
 
12
- /** Query inside the extension sandbox document. */
15
+ /** Create a host-managed sandboxed iframe for isolated scriptable content. */
16
+ createSandboxFrame(options: SpindleSandboxFrameOptions): SpindleSandboxFrameHandle;
17
+
18
+ /** Query inside the extension-owned host DOM. */
13
19
  query(selector: string): Element | null;
14
20
 
15
- /** Query all matches inside the extension sandbox document. */
21
+ /** Query all matches inside the extension-owned host DOM. */
16
22
  queryAll(selector: string): Element[];
17
23
 
18
- /** Remove all DOM created inside the extension sandbox document. */
24
+ /** Remove all DOM created by the extension helper. */
19
25
  cleanup(): void;
20
26
  }
21
27