@the-it-dept/bugsplat 0.0.1

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,13 @@
1
+ import { SplatConfig } from './types';
2
+
3
+ interface WidgetProps {
4
+ config: SplatConfig;
5
+ /** When true, use absolute positioning (for container mode) */
6
+ contained?: boolean;
7
+ /** External open state for trigger mode */
8
+ externalOpen?: boolean;
9
+ /** Callback when widget requests to close in trigger mode */
10
+ onClose?: () => void;
11
+ }
12
+ export declare function Widget({ config, contained, externalOpen, onClose }: WidgetProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,24 @@
1
+ import { ReportSummary, ReportDetail, WidgetConfig, ReportMetadata } from '../types';
2
+
3
+ export declare class SplatClient {
4
+ private apiKey;
5
+ private baseUrl;
6
+ private reporterToken;
7
+ constructor(apiKey: string, apiUrl?: string);
8
+ setReporterToken(token: string | null): void;
9
+ private request;
10
+ submitReport(data: {
11
+ title: string;
12
+ description: string;
13
+ email: string;
14
+ screenshot?: string;
15
+ metadata?: ReportMetadata;
16
+ }): Promise<{
17
+ report_id: string;
18
+ reporter_token: string;
19
+ status: string;
20
+ }>;
21
+ getReports(): Promise<ReportSummary[]>;
22
+ getReport(id: string): Promise<ReportDetail>;
23
+ getConfig(): Promise<WidgetConfig>;
24
+ }
@@ -0,0 +1,9 @@
1
+ import { SplatClient } from '../api/client';
2
+
3
+ interface HistoryListProps {
4
+ client: SplatClient;
5
+ onSelectReport: (id: string) => void;
6
+ previewMode?: boolean;
7
+ }
8
+ export declare function HistoryList({ client, onSelectReport, previewMode }: HistoryListProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ import { SplatClient } from '../api/client';
2
+
3
+ interface ReportDetailProps {
4
+ client: SplatClient;
5
+ reportId: string;
6
+ onBack: () => void;
7
+ previewMode?: boolean;
8
+ }
9
+ export declare function ReportDetail({ client, reportId, onBack, previewMode }: ReportDetailProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ import { SplatClient } from '../api/client';
2
+ import { Report } from '../types';
3
+
4
+ interface ReportFormProps {
5
+ client: SplatClient;
6
+ defaultEmail: string;
7
+ placeholder?: string;
8
+ onSubmit: (report: Report, token: string) => void;
9
+ }
10
+ export declare function ReportForm({ client, defaultEmail, placeholder, onSubmit }: ReportFormProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
package/dist/dev.d.ts ADDED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,7 @@
1
+ export declare function useReporter(apiKey: string): {
2
+ reporterToken: string | null;
3
+ email: string | null;
4
+ setReporterToken: (token: string) => void;
5
+ setEmail: (email: string) => void;
6
+ clearReporter: () => void;
7
+ };
@@ -0,0 +1,20 @@
1
+ import { SplatConfig, WidgetConfig } from './types';
2
+
3
+ export type { SplatConfig, Report, ReportStatus, WidgetConfig } from './types';
4
+ export { Widget, Widget as SplatWidget } from './Widget';
5
+ export { useReporter } from './hooks/useReporter';
6
+ export { SplatClient } from './api/client';
7
+ export interface SplatInstance {
8
+ /** Update widget configuration and re-render */
9
+ update: (config: Partial<SplatConfig> & Partial<WidgetConfig>) => void;
10
+ /** Destroy widget and clean up */
11
+ destroy: () => void;
12
+ /** Open the widget (for trigger mode) */
13
+ trigger: () => void;
14
+ /** Close the widget (for trigger mode) */
15
+ close: () => void;
16
+ }
17
+ /**
18
+ * Initialize the Splat widget and mount it to the DOM
19
+ */
20
+ export declare function init(config: SplatConfig): SplatInstance;