@archie/devtools 0.0.4 → 0.0.6

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.
@@ -0,0 +1,7 @@
1
+ import {
2
+ injectInspector
3
+ } from "../../chunk-NYVHR4QL.mjs";
4
+ import "../../chunk-6MYORGLK.mjs";
5
+
6
+ // src/client/inject-inspector/auto.ts
7
+ injectInspector();
@@ -0,0 +1,33 @@
1
+ /** Only configured domains (Archie host origins) and optionally localhost in dev. "*" is never used. */
2
+ type InjectOptions = {
3
+ id?: string;
4
+ /**
5
+ * Origin(s) allowed to send postMessage commands to the inspector.
6
+ * If not set, uses Archie host origins + localhost when dev is true.
7
+ * "*" is not allowed; pass an array of concrete origins.
8
+ */
9
+ allowedOrigins?: string | string[];
10
+ /**
11
+ * Origin to which the inspector sends postMessage replies.
12
+ * If not set and in an iframe, uses document.referrer origin.
13
+ * "*" is not allowed.
14
+ */
15
+ targetOrigin?: string;
16
+ /**
17
+ * When true, allowedOrigins default includes localhost for local testing.
18
+ * When undefined, inferred from document.referrer (localhost or missing = dev).
19
+ */
20
+ dev?: boolean;
21
+ };
22
+ /**
23
+ * Loads and runs the Archie inspector script (dynamic import).
24
+ * Safe to call multiple times: avoids duplicate execution by id.
25
+ * No-op when run outside the browser (e.g. SSR).
26
+ *
27
+ * Origin restrictions are always set (never "*"): Archie host origins, and in dev optionally localhost.
28
+ *
29
+ * @returns Promise that resolves to the marker script element, or null if not in browser / already present
30
+ */
31
+ declare function injectInspector(opts?: InjectOptions): Promise<HTMLScriptElement | null> | null;
32
+
33
+ export { type InjectOptions, injectInspector };
@@ -0,0 +1,33 @@
1
+ /** Only configured domains (Archie host origins) and optionally localhost in dev. "*" is never used. */
2
+ type InjectOptions = {
3
+ id?: string;
4
+ /**
5
+ * Origin(s) allowed to send postMessage commands to the inspector.
6
+ * If not set, uses Archie host origins + localhost when dev is true.
7
+ * "*" is not allowed; pass an array of concrete origins.
8
+ */
9
+ allowedOrigins?: string | string[];
10
+ /**
11
+ * Origin to which the inspector sends postMessage replies.
12
+ * If not set and in an iframe, uses document.referrer origin.
13
+ * "*" is not allowed.
14
+ */
15
+ targetOrigin?: string;
16
+ /**
17
+ * When true, allowedOrigins default includes localhost for local testing.
18
+ * When undefined, inferred from document.referrer (localhost or missing = dev).
19
+ */
20
+ dev?: boolean;
21
+ };
22
+ /**
23
+ * Loads and runs the Archie inspector script (dynamic import).
24
+ * Safe to call multiple times: avoids duplicate execution by id.
25
+ * No-op when run outside the browser (e.g. SSR).
26
+ *
27
+ * Origin restrictions are always set (never "*"): Archie host origins, and in dev optionally localhost.
28
+ *
29
+ * @returns Promise that resolves to the marker script element, or null if not in browser / already present
30
+ */
31
+ declare function injectInspector(opts?: InjectOptions): Promise<HTMLScriptElement | null> | null;
32
+
33
+ export { type InjectOptions, injectInspector };