quick-bug-reporter-react 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,331 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ declare const DEFAULT_MAX_RECORDING_MS: number;
5
+ type BugTrackerProvider = "linear" | "jira";
6
+ type ReportCaptureMode = "video" | "screenshot";
7
+ type RecordingStopReason = "manual" | "time_limit" | "screen_ended";
8
+ type NetworkLogEntry = {
9
+ method: string;
10
+ url: string;
11
+ status: number | null;
12
+ durationMs: number;
13
+ timestamp: string;
14
+ };
15
+ type ScreenshotHighlightRegion = {
16
+ x: number;
17
+ y: number;
18
+ width: number;
19
+ height: number;
20
+ };
21
+ type BugClientMetadata = {
22
+ locale: string | null;
23
+ timezone: string | null;
24
+ language: string | null;
25
+ languages: string[];
26
+ platform: string | null;
27
+ referrer: string | null;
28
+ colorScheme: "light" | "dark" | "unknown";
29
+ viewport: {
30
+ width: number | null;
31
+ height: number | null;
32
+ pixelRatio: number | null;
33
+ };
34
+ screen: {
35
+ width: number | null;
36
+ height: number | null;
37
+ availWidth: number | null;
38
+ availHeight: number | null;
39
+ colorDepth: number | null;
40
+ };
41
+ device: {
42
+ hardwareConcurrency: number | null;
43
+ deviceMemoryGb: number | null;
44
+ maxTouchPoints: number | null;
45
+ online: boolean | null;
46
+ cookieEnabled: boolean | null;
47
+ };
48
+ connection: {
49
+ effectiveType: string | null;
50
+ downlinkMbps: number | null;
51
+ rttMs: number | null;
52
+ saveData: boolean | null;
53
+ };
54
+ captureMode: ReportCaptureMode;
55
+ capture: {
56
+ startedAt: string;
57
+ stoppedAt: string;
58
+ elapsedMs: number;
59
+ };
60
+ annotation?: {
61
+ imageWidth: number;
62
+ imageHeight: number;
63
+ highlights: ScreenshotHighlightRegion[];
64
+ };
65
+ };
66
+ type BugSessionArtifacts = {
67
+ videoBlob: Blob | null;
68
+ screenshotBlob: Blob | null;
69
+ networkLogs: NetworkLogEntry[];
70
+ captureMode: ReportCaptureMode;
71
+ startedAt: string;
72
+ stoppedAt: string;
73
+ elapsedMs: number;
74
+ stopReason: RecordingStopReason;
75
+ };
76
+ type BugReportPayload = {
77
+ title: string;
78
+ description: string;
79
+ videoBlob: Blob | null;
80
+ screenshotBlob: Blob | null;
81
+ networkLogs: NetworkLogEntry[];
82
+ captureMode: ReportCaptureMode;
83
+ pageUrl: string;
84
+ userAgent: string;
85
+ startedAt: string;
86
+ stoppedAt: string;
87
+ elapsedMs: number;
88
+ metadata: BugClientMetadata;
89
+ };
90
+ type BugSubmitResult = {
91
+ provider: BugTrackerProvider;
92
+ issueId: string;
93
+ issueKey: string;
94
+ issueUrl: string | null;
95
+ warnings: string[];
96
+ };
97
+ type SubmitProgressCallback = (message: string) => void;
98
+ interface BugReporterIntegration {
99
+ readonly provider: BugTrackerProvider;
100
+ submit(payload: BugReportPayload, onProgress?: SubmitProgressCallback): Promise<BugSubmitResult>;
101
+ }
102
+ declare function formatNetworkLogs(logs: NetworkLogEntry[]): string;
103
+ declare function toErrorMessage(error: unknown): string;
104
+ declare function collectClientEnvironmentMetadata(): Omit<BugClientMetadata, "captureMode" | "capture">;
105
+
106
+ declare class NetworkLogger {
107
+ private originalFetch;
108
+ private logs;
109
+ private recording;
110
+ start(): void;
111
+ stop(): NetworkLogEntry[];
112
+ clear(): void;
113
+ getLogs(): NetworkLogEntry[];
114
+ isRecording(): boolean;
115
+ }
116
+
117
+ type ScreenRecorderStartOptions = {
118
+ onEnded?: () => void;
119
+ };
120
+ declare class ScreenRecorder {
121
+ private mediaRecorder;
122
+ private displayStream;
123
+ private microphoneStream;
124
+ private mixedStream;
125
+ private audioContext;
126
+ private displayAudioStream;
127
+ private microphoneAudioStream;
128
+ private chunks;
129
+ private recording;
130
+ private stopPromise;
131
+ private stopResolver;
132
+ private lastBlob;
133
+ private onEnded;
134
+ start(options?: ScreenRecorderStartOptions): Promise<void>;
135
+ stop(): Promise<Blob | null>;
136
+ isRecording(): boolean;
137
+ getLastBlob(): Blob | null;
138
+ clearLastBlob(): void;
139
+ dispose(): void;
140
+ private cleanupStreams;
141
+ private resetStopPromise;
142
+ private buildMixedAudioTracks;
143
+ }
144
+
145
+ type CaptureRegion = {
146
+ x: number;
147
+ y: number;
148
+ width: number;
149
+ height: number;
150
+ };
151
+ declare class ScreenshotCapturer {
152
+ capture(): Promise<Blob>;
153
+ private captureViaDomSnapshot;
154
+ captureRegion(region: CaptureRegion): Promise<Blob>;
155
+ private cropBlob;
156
+ }
157
+
158
+ type BugSessionOptions = {
159
+ maxDurationMs?: number;
160
+ screenRecorder?: ScreenRecorder;
161
+ screenshotCapturer?: ScreenshotCapturer;
162
+ networkLogger?: NetworkLogger;
163
+ onAutoStop?: (artifacts: BugSessionArtifacts) => void;
164
+ };
165
+ declare class BugSession {
166
+ private readonly maxDurationMs;
167
+ private readonly screenRecorder;
168
+ private readonly screenshotCapturer;
169
+ private readonly networkLogger;
170
+ private readonly onAutoStop?;
171
+ private recording;
172
+ private startedAtMs;
173
+ private autoStopTimeout;
174
+ private stopInFlight;
175
+ private lastArtifacts;
176
+ constructor(options?: BugSessionOptions);
177
+ start(): Promise<void>;
178
+ captureScreenshot(region?: CaptureRegion): Promise<BugSessionArtifacts>;
179
+ stop(reason?: RecordingStopReason): Promise<BugSessionArtifacts | null>;
180
+ isRecording(): boolean;
181
+ getElapsedMs(): number;
182
+ getMaxDurationMs(): number;
183
+ getLastArtifacts(): BugSessionArtifacts | null;
184
+ getLastCaptureMode(): ReportCaptureMode | null;
185
+ resetArtifacts(): void;
186
+ dispose(): Promise<void>;
187
+ private stopInternal;
188
+ private handleForcedStop;
189
+ private clearAutoStopTimer;
190
+ }
191
+
192
+ type BugReporterOptions = {
193
+ integration: BugReporterIntegration;
194
+ maxDurationMs?: number;
195
+ onAutoStop?: (artifacts: BugSessionArtifacts) => void;
196
+ session?: BugSession;
197
+ };
198
+ type BugReporterSubmitOptions = {
199
+ screenshotBlob?: Blob | null;
200
+ metadata?: Partial<BugClientMetadata>;
201
+ onProgress?: SubmitProgressCallback;
202
+ };
203
+ declare class BugReporter {
204
+ private integration;
205
+ private readonly session;
206
+ constructor(options: BugReporterOptions);
207
+ start(): Promise<void>;
208
+ captureScreenshot(region?: CaptureRegion): Promise<BugSessionArtifacts>;
209
+ stop(): Promise<BugSessionArtifacts | null>;
210
+ submit(title: string, description: string, options?: BugReporterSubmitOptions): Promise<BugSubmitResult>;
211
+ isRecording(): boolean;
212
+ getElapsedMs(): number;
213
+ getMaxDurationMs(): number;
214
+ getLastArtifacts(): BugSessionArtifacts | null;
215
+ clearDraft(): void;
216
+ setIntegration(integration: BugReporterIntegration): void;
217
+ getSelectedProvider(): BugTrackerProvider;
218
+ dispose(): Promise<void>;
219
+ }
220
+
221
+ type LinearIntegrationOptions = {
222
+ apiKey?: string;
223
+ teamId?: string;
224
+ projectId?: string;
225
+ graphqlEndpoint?: string;
226
+ submitProxyEndpoint?: string;
227
+ createIssueProxyEndpoint?: string;
228
+ uploadProxyEndpoint?: string;
229
+ fetchImpl?: typeof fetch;
230
+ };
231
+ declare class LinearIntegration implements BugReporterIntegration {
232
+ readonly provider: "linear";
233
+ private readonly apiKey?;
234
+ private readonly teamId?;
235
+ private readonly projectId?;
236
+ private readonly graphqlEndpoint;
237
+ private readonly submitProxyEndpoint?;
238
+ private readonly createIssueProxyEndpoint?;
239
+ private readonly uploadProxyEndpoint?;
240
+ private readonly fetchImpl;
241
+ constructor(options: LinearIntegrationOptions);
242
+ submit(payload: BugReportPayload, onProgress?: SubmitProgressCallback): Promise<BugSubmitResult>;
243
+ private submitViaProxy;
244
+ private createIssue;
245
+ private addComment;
246
+ private uploadAsset;
247
+ private requestUploadTarget;
248
+ }
249
+
250
+ type JiraIntegrationOptions = {
251
+ baseUrl?: string;
252
+ email?: string;
253
+ apiToken?: string;
254
+ projectKey?: string;
255
+ issueType?: string;
256
+ submitProxyEndpoint?: string;
257
+ createIssueProxyEndpoint?: string;
258
+ uploadAttachmentProxyEndpoint?: string;
259
+ fetchImpl?: typeof fetch;
260
+ };
261
+ declare class JiraIntegration implements BugReporterIntegration {
262
+ readonly provider: "jira";
263
+ private readonly baseUrl?;
264
+ private readonly email?;
265
+ private readonly apiToken?;
266
+ private readonly projectKey?;
267
+ private readonly issueType;
268
+ private readonly submitProxyEndpoint?;
269
+ private readonly createIssueProxyEndpoint?;
270
+ private readonly uploadAttachmentProxyEndpoint?;
271
+ private readonly fetchImpl;
272
+ constructor(options: JiraIntegrationOptions);
273
+ submit(payload: BugReportPayload, onProgress?: SubmitProgressCallback): Promise<BugSubmitResult>;
274
+ private submitViaProxy;
275
+ private createIssue;
276
+ private uploadAttachment;
277
+ }
278
+
279
+ type BugReporterIntegrations = Partial<Record<"linear" | "jira", BugReporterIntegration>>;
280
+
281
+ type BugReporterProviderProps = {
282
+ children: ReactNode;
283
+ integrations: BugReporterIntegrations;
284
+ defaultProvider?: BugTrackerProvider;
285
+ maxDurationMs?: number;
286
+ };
287
+ type ScreenshotAnnotationState = {
288
+ annotatedBlob: Blob | null;
289
+ highlights: ScreenshotHighlightRegion[];
290
+ imageWidth: number;
291
+ imageHeight: number;
292
+ };
293
+ type BugReporterContextValue = {
294
+ isOpen: boolean;
295
+ openModal: () => void;
296
+ closeModal: () => void;
297
+ draftMode: ReportCaptureMode | null;
298
+ hasDraft: boolean;
299
+ isRecording: boolean;
300
+ elapsedMs: number;
301
+ maxDurationMs: number;
302
+ isSubmitting: boolean;
303
+ submissionProgress: string | null;
304
+ isCapturingScreenshot: boolean;
305
+ isSelectingRegion: boolean;
306
+ error: string | null;
307
+ success: string | null;
308
+ autoStopNotice: string | null;
309
+ availableProviders: BugTrackerProvider[];
310
+ selectedProvider: BugTrackerProvider | null;
311
+ setSelectedProvider: (provider: BugTrackerProvider) => void;
312
+ startRecording: () => Promise<boolean>;
313
+ stopRecording: () => Promise<boolean>;
314
+ captureQuickScreenshot: () => Promise<boolean>;
315
+ startRegionSelection: () => void;
316
+ videoPreviewUrl: string | null;
317
+ screenshotPreviewUrl: string | null;
318
+ screenshotHighlightCount: number;
319
+ updateScreenshotAnnotation: (annotation: ScreenshotAnnotationState) => void;
320
+ clearDraft: () => void;
321
+ submitReport: (title: string, description: string) => Promise<BugSubmitResult | null>;
322
+ resetMessages: () => void;
323
+ };
324
+ declare function BugReporterProvider({ children, integrations, defaultProvider, maxDurationMs, }: BugReporterProviderProps): react_jsx_runtime.JSX.Element;
325
+ declare function useBugReporter(): BugReporterContextValue;
326
+
327
+ declare function FloatingBugButton(): react_jsx_runtime.JSX.Element | null;
328
+
329
+ declare function BugReporterModal(): react_jsx_runtime.JSX.Element;
330
+
331
+ export { type BugClientMetadata, type BugReportPayload, BugReporter, type BugReporterIntegration, type BugReporterIntegrations, BugReporterModal, BugReporterProvider, BugSession, type BugSessionArtifacts, type BugSubmitResult, type BugTrackerProvider, type CaptureRegion, DEFAULT_MAX_RECORDING_MS, FloatingBugButton, JiraIntegration, type JiraIntegrationOptions, LinearIntegration, type LinearIntegrationOptions, type NetworkLogEntry, NetworkLogger, type RecordingStopReason, type ReportCaptureMode, ScreenRecorder, ScreenshotCapturer, type ScreenshotHighlightRegion, type SubmitProgressCallback, collectClientEnvironmentMetadata, formatNetworkLogs, toErrorMessage, useBugReporter };
@@ -0,0 +1,331 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ declare const DEFAULT_MAX_RECORDING_MS: number;
5
+ type BugTrackerProvider = "linear" | "jira";
6
+ type ReportCaptureMode = "video" | "screenshot";
7
+ type RecordingStopReason = "manual" | "time_limit" | "screen_ended";
8
+ type NetworkLogEntry = {
9
+ method: string;
10
+ url: string;
11
+ status: number | null;
12
+ durationMs: number;
13
+ timestamp: string;
14
+ };
15
+ type ScreenshotHighlightRegion = {
16
+ x: number;
17
+ y: number;
18
+ width: number;
19
+ height: number;
20
+ };
21
+ type BugClientMetadata = {
22
+ locale: string | null;
23
+ timezone: string | null;
24
+ language: string | null;
25
+ languages: string[];
26
+ platform: string | null;
27
+ referrer: string | null;
28
+ colorScheme: "light" | "dark" | "unknown";
29
+ viewport: {
30
+ width: number | null;
31
+ height: number | null;
32
+ pixelRatio: number | null;
33
+ };
34
+ screen: {
35
+ width: number | null;
36
+ height: number | null;
37
+ availWidth: number | null;
38
+ availHeight: number | null;
39
+ colorDepth: number | null;
40
+ };
41
+ device: {
42
+ hardwareConcurrency: number | null;
43
+ deviceMemoryGb: number | null;
44
+ maxTouchPoints: number | null;
45
+ online: boolean | null;
46
+ cookieEnabled: boolean | null;
47
+ };
48
+ connection: {
49
+ effectiveType: string | null;
50
+ downlinkMbps: number | null;
51
+ rttMs: number | null;
52
+ saveData: boolean | null;
53
+ };
54
+ captureMode: ReportCaptureMode;
55
+ capture: {
56
+ startedAt: string;
57
+ stoppedAt: string;
58
+ elapsedMs: number;
59
+ };
60
+ annotation?: {
61
+ imageWidth: number;
62
+ imageHeight: number;
63
+ highlights: ScreenshotHighlightRegion[];
64
+ };
65
+ };
66
+ type BugSessionArtifacts = {
67
+ videoBlob: Blob | null;
68
+ screenshotBlob: Blob | null;
69
+ networkLogs: NetworkLogEntry[];
70
+ captureMode: ReportCaptureMode;
71
+ startedAt: string;
72
+ stoppedAt: string;
73
+ elapsedMs: number;
74
+ stopReason: RecordingStopReason;
75
+ };
76
+ type BugReportPayload = {
77
+ title: string;
78
+ description: string;
79
+ videoBlob: Blob | null;
80
+ screenshotBlob: Blob | null;
81
+ networkLogs: NetworkLogEntry[];
82
+ captureMode: ReportCaptureMode;
83
+ pageUrl: string;
84
+ userAgent: string;
85
+ startedAt: string;
86
+ stoppedAt: string;
87
+ elapsedMs: number;
88
+ metadata: BugClientMetadata;
89
+ };
90
+ type BugSubmitResult = {
91
+ provider: BugTrackerProvider;
92
+ issueId: string;
93
+ issueKey: string;
94
+ issueUrl: string | null;
95
+ warnings: string[];
96
+ };
97
+ type SubmitProgressCallback = (message: string) => void;
98
+ interface BugReporterIntegration {
99
+ readonly provider: BugTrackerProvider;
100
+ submit(payload: BugReportPayload, onProgress?: SubmitProgressCallback): Promise<BugSubmitResult>;
101
+ }
102
+ declare function formatNetworkLogs(logs: NetworkLogEntry[]): string;
103
+ declare function toErrorMessage(error: unknown): string;
104
+ declare function collectClientEnvironmentMetadata(): Omit<BugClientMetadata, "captureMode" | "capture">;
105
+
106
+ declare class NetworkLogger {
107
+ private originalFetch;
108
+ private logs;
109
+ private recording;
110
+ start(): void;
111
+ stop(): NetworkLogEntry[];
112
+ clear(): void;
113
+ getLogs(): NetworkLogEntry[];
114
+ isRecording(): boolean;
115
+ }
116
+
117
+ type ScreenRecorderStartOptions = {
118
+ onEnded?: () => void;
119
+ };
120
+ declare class ScreenRecorder {
121
+ private mediaRecorder;
122
+ private displayStream;
123
+ private microphoneStream;
124
+ private mixedStream;
125
+ private audioContext;
126
+ private displayAudioStream;
127
+ private microphoneAudioStream;
128
+ private chunks;
129
+ private recording;
130
+ private stopPromise;
131
+ private stopResolver;
132
+ private lastBlob;
133
+ private onEnded;
134
+ start(options?: ScreenRecorderStartOptions): Promise<void>;
135
+ stop(): Promise<Blob | null>;
136
+ isRecording(): boolean;
137
+ getLastBlob(): Blob | null;
138
+ clearLastBlob(): void;
139
+ dispose(): void;
140
+ private cleanupStreams;
141
+ private resetStopPromise;
142
+ private buildMixedAudioTracks;
143
+ }
144
+
145
+ type CaptureRegion = {
146
+ x: number;
147
+ y: number;
148
+ width: number;
149
+ height: number;
150
+ };
151
+ declare class ScreenshotCapturer {
152
+ capture(): Promise<Blob>;
153
+ private captureViaDomSnapshot;
154
+ captureRegion(region: CaptureRegion): Promise<Blob>;
155
+ private cropBlob;
156
+ }
157
+
158
+ type BugSessionOptions = {
159
+ maxDurationMs?: number;
160
+ screenRecorder?: ScreenRecorder;
161
+ screenshotCapturer?: ScreenshotCapturer;
162
+ networkLogger?: NetworkLogger;
163
+ onAutoStop?: (artifacts: BugSessionArtifacts) => void;
164
+ };
165
+ declare class BugSession {
166
+ private readonly maxDurationMs;
167
+ private readonly screenRecorder;
168
+ private readonly screenshotCapturer;
169
+ private readonly networkLogger;
170
+ private readonly onAutoStop?;
171
+ private recording;
172
+ private startedAtMs;
173
+ private autoStopTimeout;
174
+ private stopInFlight;
175
+ private lastArtifacts;
176
+ constructor(options?: BugSessionOptions);
177
+ start(): Promise<void>;
178
+ captureScreenshot(region?: CaptureRegion): Promise<BugSessionArtifacts>;
179
+ stop(reason?: RecordingStopReason): Promise<BugSessionArtifacts | null>;
180
+ isRecording(): boolean;
181
+ getElapsedMs(): number;
182
+ getMaxDurationMs(): number;
183
+ getLastArtifacts(): BugSessionArtifacts | null;
184
+ getLastCaptureMode(): ReportCaptureMode | null;
185
+ resetArtifacts(): void;
186
+ dispose(): Promise<void>;
187
+ private stopInternal;
188
+ private handleForcedStop;
189
+ private clearAutoStopTimer;
190
+ }
191
+
192
+ type BugReporterOptions = {
193
+ integration: BugReporterIntegration;
194
+ maxDurationMs?: number;
195
+ onAutoStop?: (artifacts: BugSessionArtifacts) => void;
196
+ session?: BugSession;
197
+ };
198
+ type BugReporterSubmitOptions = {
199
+ screenshotBlob?: Blob | null;
200
+ metadata?: Partial<BugClientMetadata>;
201
+ onProgress?: SubmitProgressCallback;
202
+ };
203
+ declare class BugReporter {
204
+ private integration;
205
+ private readonly session;
206
+ constructor(options: BugReporterOptions);
207
+ start(): Promise<void>;
208
+ captureScreenshot(region?: CaptureRegion): Promise<BugSessionArtifacts>;
209
+ stop(): Promise<BugSessionArtifacts | null>;
210
+ submit(title: string, description: string, options?: BugReporterSubmitOptions): Promise<BugSubmitResult>;
211
+ isRecording(): boolean;
212
+ getElapsedMs(): number;
213
+ getMaxDurationMs(): number;
214
+ getLastArtifacts(): BugSessionArtifacts | null;
215
+ clearDraft(): void;
216
+ setIntegration(integration: BugReporterIntegration): void;
217
+ getSelectedProvider(): BugTrackerProvider;
218
+ dispose(): Promise<void>;
219
+ }
220
+
221
+ type LinearIntegrationOptions = {
222
+ apiKey?: string;
223
+ teamId?: string;
224
+ projectId?: string;
225
+ graphqlEndpoint?: string;
226
+ submitProxyEndpoint?: string;
227
+ createIssueProxyEndpoint?: string;
228
+ uploadProxyEndpoint?: string;
229
+ fetchImpl?: typeof fetch;
230
+ };
231
+ declare class LinearIntegration implements BugReporterIntegration {
232
+ readonly provider: "linear";
233
+ private readonly apiKey?;
234
+ private readonly teamId?;
235
+ private readonly projectId?;
236
+ private readonly graphqlEndpoint;
237
+ private readonly submitProxyEndpoint?;
238
+ private readonly createIssueProxyEndpoint?;
239
+ private readonly uploadProxyEndpoint?;
240
+ private readonly fetchImpl;
241
+ constructor(options: LinearIntegrationOptions);
242
+ submit(payload: BugReportPayload, onProgress?: SubmitProgressCallback): Promise<BugSubmitResult>;
243
+ private submitViaProxy;
244
+ private createIssue;
245
+ private addComment;
246
+ private uploadAsset;
247
+ private requestUploadTarget;
248
+ }
249
+
250
+ type JiraIntegrationOptions = {
251
+ baseUrl?: string;
252
+ email?: string;
253
+ apiToken?: string;
254
+ projectKey?: string;
255
+ issueType?: string;
256
+ submitProxyEndpoint?: string;
257
+ createIssueProxyEndpoint?: string;
258
+ uploadAttachmentProxyEndpoint?: string;
259
+ fetchImpl?: typeof fetch;
260
+ };
261
+ declare class JiraIntegration implements BugReporterIntegration {
262
+ readonly provider: "jira";
263
+ private readonly baseUrl?;
264
+ private readonly email?;
265
+ private readonly apiToken?;
266
+ private readonly projectKey?;
267
+ private readonly issueType;
268
+ private readonly submitProxyEndpoint?;
269
+ private readonly createIssueProxyEndpoint?;
270
+ private readonly uploadAttachmentProxyEndpoint?;
271
+ private readonly fetchImpl;
272
+ constructor(options: JiraIntegrationOptions);
273
+ submit(payload: BugReportPayload, onProgress?: SubmitProgressCallback): Promise<BugSubmitResult>;
274
+ private submitViaProxy;
275
+ private createIssue;
276
+ private uploadAttachment;
277
+ }
278
+
279
+ type BugReporterIntegrations = Partial<Record<"linear" | "jira", BugReporterIntegration>>;
280
+
281
+ type BugReporterProviderProps = {
282
+ children: ReactNode;
283
+ integrations: BugReporterIntegrations;
284
+ defaultProvider?: BugTrackerProvider;
285
+ maxDurationMs?: number;
286
+ };
287
+ type ScreenshotAnnotationState = {
288
+ annotatedBlob: Blob | null;
289
+ highlights: ScreenshotHighlightRegion[];
290
+ imageWidth: number;
291
+ imageHeight: number;
292
+ };
293
+ type BugReporterContextValue = {
294
+ isOpen: boolean;
295
+ openModal: () => void;
296
+ closeModal: () => void;
297
+ draftMode: ReportCaptureMode | null;
298
+ hasDraft: boolean;
299
+ isRecording: boolean;
300
+ elapsedMs: number;
301
+ maxDurationMs: number;
302
+ isSubmitting: boolean;
303
+ submissionProgress: string | null;
304
+ isCapturingScreenshot: boolean;
305
+ isSelectingRegion: boolean;
306
+ error: string | null;
307
+ success: string | null;
308
+ autoStopNotice: string | null;
309
+ availableProviders: BugTrackerProvider[];
310
+ selectedProvider: BugTrackerProvider | null;
311
+ setSelectedProvider: (provider: BugTrackerProvider) => void;
312
+ startRecording: () => Promise<boolean>;
313
+ stopRecording: () => Promise<boolean>;
314
+ captureQuickScreenshot: () => Promise<boolean>;
315
+ startRegionSelection: () => void;
316
+ videoPreviewUrl: string | null;
317
+ screenshotPreviewUrl: string | null;
318
+ screenshotHighlightCount: number;
319
+ updateScreenshotAnnotation: (annotation: ScreenshotAnnotationState) => void;
320
+ clearDraft: () => void;
321
+ submitReport: (title: string, description: string) => Promise<BugSubmitResult | null>;
322
+ resetMessages: () => void;
323
+ };
324
+ declare function BugReporterProvider({ children, integrations, defaultProvider, maxDurationMs, }: BugReporterProviderProps): react_jsx_runtime.JSX.Element;
325
+ declare function useBugReporter(): BugReporterContextValue;
326
+
327
+ declare function FloatingBugButton(): react_jsx_runtime.JSX.Element | null;
328
+
329
+ declare function BugReporterModal(): react_jsx_runtime.JSX.Element;
330
+
331
+ export { type BugClientMetadata, type BugReportPayload, BugReporter, type BugReporterIntegration, type BugReporterIntegrations, BugReporterModal, BugReporterProvider, BugSession, type BugSessionArtifacts, type BugSubmitResult, type BugTrackerProvider, type CaptureRegion, DEFAULT_MAX_RECORDING_MS, FloatingBugButton, JiraIntegration, type JiraIntegrationOptions, LinearIntegration, type LinearIntegrationOptions, type NetworkLogEntry, NetworkLogger, type RecordingStopReason, type ReportCaptureMode, ScreenRecorder, ScreenshotCapturer, type ScreenshotHighlightRegion, type SubmitProgressCallback, collectClientEnvironmentMetadata, formatNetworkLogs, toErrorMessage, useBugReporter };