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.
- package/package.json +1 -1
- package/src/dom.ts +12 -6
package/package.json
CHANGED
package/src/dom.ts
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
/** DOM helper API provided
|
|
1
|
+
/** DOM helper API provided to frontend extension modules. */
|
|
2
2
|
export interface SpindleDOMHelper {
|
|
3
|
-
/**
|
|
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
|
|
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
|
-
/**
|
|
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
|
|
21
|
+
/** Query all matches inside the extension-owned host DOM. */
|
|
16
22
|
queryAll(selector: string): Element[];
|
|
17
23
|
|
|
18
|
-
/** Remove all DOM created
|
|
24
|
+
/** Remove all DOM created by the extension helper. */
|
|
19
25
|
cleanup(): void;
|
|
20
26
|
}
|
|
21
27
|
|