@loupeink/web-sdk 1.0.0

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,44 @@
1
+ interface LoupeWidgetConfig {
2
+ apiKey: string;
3
+ edgeFunctionUrl?: string;
4
+ position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
5
+ color?: string;
6
+ buttonLabel?: string;
7
+ }
8
+ declare class LoupeWidget {
9
+ private config;
10
+ private hostEl;
11
+ private shadow;
12
+ constructor(config: LoupeWidgetConfig);
13
+ mount(container: HTMLElement): void;
14
+ destroy(): void;
15
+ }
16
+
17
+ interface PageContext {
18
+ url: string;
19
+ title: string;
20
+ viewportWidth: number;
21
+ viewportHeight: number;
22
+ userAgent: string;
23
+ capturedAt: string;
24
+ }
25
+ declare function capturePageContext(): PageContext;
26
+
27
+ interface SubmitFeedbackOpts {
28
+ apiKey: string;
29
+ edgeFunctionUrl: string;
30
+ comment: string;
31
+ severity: 'critical' | 'major' | 'minor' | 'suggestion';
32
+ screenshotDataUrl: string | null;
33
+ context: PageContext;
34
+ }
35
+ declare function submitFeedback(opts: SubmitFeedbackOpts): Promise<{
36
+ ok: boolean;
37
+ }>;
38
+
39
+ declare function captureScreenshot(widgetHostEl: HTMLElement): Promise<string>;
40
+
41
+ declare function init(config: LoupeWidgetConfig): void;
42
+ declare function destroy(): void;
43
+
44
+ export { LoupeWidget, type LoupeWidgetConfig, capturePageContext, captureScreenshot, destroy, init, submitFeedback };
@@ -0,0 +1,44 @@
1
+ interface LoupeWidgetConfig {
2
+ apiKey: string;
3
+ edgeFunctionUrl?: string;
4
+ position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
5
+ color?: string;
6
+ buttonLabel?: string;
7
+ }
8
+ declare class LoupeWidget {
9
+ private config;
10
+ private hostEl;
11
+ private shadow;
12
+ constructor(config: LoupeWidgetConfig);
13
+ mount(container: HTMLElement): void;
14
+ destroy(): void;
15
+ }
16
+
17
+ interface PageContext {
18
+ url: string;
19
+ title: string;
20
+ viewportWidth: number;
21
+ viewportHeight: number;
22
+ userAgent: string;
23
+ capturedAt: string;
24
+ }
25
+ declare function capturePageContext(): PageContext;
26
+
27
+ interface SubmitFeedbackOpts {
28
+ apiKey: string;
29
+ edgeFunctionUrl: string;
30
+ comment: string;
31
+ severity: 'critical' | 'major' | 'minor' | 'suggestion';
32
+ screenshotDataUrl: string | null;
33
+ context: PageContext;
34
+ }
35
+ declare function submitFeedback(opts: SubmitFeedbackOpts): Promise<{
36
+ ok: boolean;
37
+ }>;
38
+
39
+ declare function captureScreenshot(widgetHostEl: HTMLElement): Promise<string>;
40
+
41
+ declare function init(config: LoupeWidgetConfig): void;
42
+ declare function destroy(): void;
43
+
44
+ export { LoupeWidget, type LoupeWidgetConfig, capturePageContext, captureScreenshot, destroy, init, submitFeedback };