@bugdump/sdk 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.
- package/README.md +154 -0
- package/dist/index.cjs +517 -0
- package/dist/index.d.cts +270 -0
- package/dist/index.d.ts +270 -0
- package/dist/index.global.js +576 -0
- package/dist/index.js +517 -0
- package/package.json +58 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { eventWithTime } from '@rrweb/types';
|
|
2
|
+
|
|
3
|
+
interface BugdumpConfig {
|
|
4
|
+
projectKey: string;
|
|
5
|
+
endpoint?: string;
|
|
6
|
+
}
|
|
7
|
+
interface BugdumpUserContext {
|
|
8
|
+
id?: string;
|
|
9
|
+
email?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
interface ReportPayload {
|
|
14
|
+
description: string;
|
|
15
|
+
priority?: 'low' | 'medium' | 'high' | 'critical';
|
|
16
|
+
reporterName?: string;
|
|
17
|
+
reporterEmail?: string;
|
|
18
|
+
reporterExternalId?: string;
|
|
19
|
+
pageUrl?: string;
|
|
20
|
+
referrerUrl?: string;
|
|
21
|
+
userAgent?: string;
|
|
22
|
+
viewport?: {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
};
|
|
26
|
+
consoleLogs?: Record<string, unknown>[];
|
|
27
|
+
networkRequests?: Record<string, unknown>[];
|
|
28
|
+
performance?: Record<string, unknown>;
|
|
29
|
+
customContext?: Record<string, unknown>;
|
|
30
|
+
annotations?: Record<string, unknown>[];
|
|
31
|
+
attachments?: Array<{
|
|
32
|
+
fileId: string;
|
|
33
|
+
type: 'screenshot' | 'recording' | 'voice_note' | 'session_replay';
|
|
34
|
+
metadata?: Record<string, unknown>;
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
interface ReportResponse {
|
|
38
|
+
id: string;
|
|
39
|
+
publicId: string;
|
|
40
|
+
}
|
|
41
|
+
interface UploadRequest {
|
|
42
|
+
originalName: string;
|
|
43
|
+
mimeType: string;
|
|
44
|
+
size: number;
|
|
45
|
+
}
|
|
46
|
+
interface UploadResponse {
|
|
47
|
+
fileId: string;
|
|
48
|
+
url: string;
|
|
49
|
+
fields: Record<string, string>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare class HttpClient {
|
|
53
|
+
private endpoint;
|
|
54
|
+
private apiKey;
|
|
55
|
+
constructor(endpoint: string, apiKey: string);
|
|
56
|
+
submitReport(payload: ReportPayload): Promise<ReportResponse>;
|
|
57
|
+
requestUpload(request: UploadRequest): Promise<UploadResponse>;
|
|
58
|
+
uploadFileToS3(presignedUrl: string, fields: Record<string, string>, file: Blob): Promise<void>;
|
|
59
|
+
private post;
|
|
60
|
+
}
|
|
61
|
+
declare class BugdumpApiError extends Error {
|
|
62
|
+
readonly code: string;
|
|
63
|
+
readonly statusCode: number;
|
|
64
|
+
readonly details: unknown;
|
|
65
|
+
constructor(code: string, statusCode: number, details?: unknown);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface ConsoleLogEntry {
|
|
69
|
+
level: 'log' | 'warn' | 'error' | 'info' | 'debug';
|
|
70
|
+
args: unknown[];
|
|
71
|
+
timestamp: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface NetworkRequestEntry {
|
|
75
|
+
method: string;
|
|
76
|
+
url: string;
|
|
77
|
+
status: number | null;
|
|
78
|
+
statusText: string | null;
|
|
79
|
+
requestHeaders: Record<string, string>;
|
|
80
|
+
responseHeaders: Record<string, string>;
|
|
81
|
+
duration: number | null;
|
|
82
|
+
startedAt: number;
|
|
83
|
+
error: string | null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface PerformanceSnapshot {
|
|
87
|
+
timing: PerformanceTimingData | null;
|
|
88
|
+
memory: PerformanceMemoryData | null;
|
|
89
|
+
resources: PerformanceResourceData[];
|
|
90
|
+
}
|
|
91
|
+
interface PerformanceTimingData {
|
|
92
|
+
domContentLoaded: number | null;
|
|
93
|
+
loadComplete: number | null;
|
|
94
|
+
firstPaint: number | null;
|
|
95
|
+
firstContentfulPaint: number | null;
|
|
96
|
+
ttfb: number | null;
|
|
97
|
+
}
|
|
98
|
+
interface PerformanceMemoryData {
|
|
99
|
+
usedJSHeapSize: number;
|
|
100
|
+
totalJSHeapSize: number;
|
|
101
|
+
jsHeapSizeLimit: number;
|
|
102
|
+
}
|
|
103
|
+
interface PerformanceResourceData {
|
|
104
|
+
name: string;
|
|
105
|
+
type: string;
|
|
106
|
+
duration: number;
|
|
107
|
+
size: number;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface MetadataSnapshot {
|
|
111
|
+
userAgent: string;
|
|
112
|
+
language: string;
|
|
113
|
+
platform: string;
|
|
114
|
+
viewport: {
|
|
115
|
+
width: number;
|
|
116
|
+
height: number;
|
|
117
|
+
};
|
|
118
|
+
screenResolution: {
|
|
119
|
+
width: number;
|
|
120
|
+
height: number;
|
|
121
|
+
};
|
|
122
|
+
devicePixelRatio: number;
|
|
123
|
+
url: string;
|
|
124
|
+
referrer: string;
|
|
125
|
+
timestamp: number;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
interface TelemetrySnapshot {
|
|
129
|
+
consoleLogs: ConsoleLogEntry[];
|
|
130
|
+
networkRequests: NetworkRequestEntry[];
|
|
131
|
+
sessionReplayEvents: eventWithTime[];
|
|
132
|
+
performance: PerformanceSnapshot;
|
|
133
|
+
metadata: MetadataSnapshot;
|
|
134
|
+
}
|
|
135
|
+
declare class Bugdump {
|
|
136
|
+
private static instance;
|
|
137
|
+
private state;
|
|
138
|
+
private httpClient;
|
|
139
|
+
private consoleCollector;
|
|
140
|
+
private networkCollector;
|
|
141
|
+
private sessionReplayCollector;
|
|
142
|
+
private widget;
|
|
143
|
+
private constructor();
|
|
144
|
+
static init(config: BugdumpConfig): Bugdump;
|
|
145
|
+
static getInstance(): Bugdump | null;
|
|
146
|
+
identify(user: BugdumpUserContext): void;
|
|
147
|
+
setContext(context: Record<string, unknown>): void;
|
|
148
|
+
open(): void;
|
|
149
|
+
close(): void;
|
|
150
|
+
collectTelemetry(): TelemetrySnapshot;
|
|
151
|
+
destroy(): void;
|
|
152
|
+
getConfig(): Required<BugdumpConfig> | null;
|
|
153
|
+
getUser(): BugdumpUserContext | null;
|
|
154
|
+
getContext(): Record<string, unknown>;
|
|
155
|
+
getHttpClient(): HttpClient;
|
|
156
|
+
isWidgetOpen(): boolean;
|
|
157
|
+
private mountWidget;
|
|
158
|
+
private handleSubmit;
|
|
159
|
+
private ensureInitialized;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
interface ScreenshotOptions {
|
|
163
|
+
quality?: number;
|
|
164
|
+
target?: HTMLElement;
|
|
165
|
+
filter?: (node: HTMLElement) => boolean;
|
|
166
|
+
}
|
|
167
|
+
interface ScreenshotResult {
|
|
168
|
+
blob: Blob;
|
|
169
|
+
width: number;
|
|
170
|
+
height: number;
|
|
171
|
+
}
|
|
172
|
+
declare function captureScreenshot(options?: ScreenshotOptions): Promise<ScreenshotResult>;
|
|
173
|
+
|
|
174
|
+
type AnnotationTool = 'arrow' | 'box' | 'text' | 'blur' | 'freehand';
|
|
175
|
+
interface Point {
|
|
176
|
+
x: number;
|
|
177
|
+
y: number;
|
|
178
|
+
}
|
|
179
|
+
interface BaseDrawOperation {
|
|
180
|
+
id: string;
|
|
181
|
+
tool: AnnotationTool;
|
|
182
|
+
color: string;
|
|
183
|
+
lineWidth: number;
|
|
184
|
+
timestamp: number;
|
|
185
|
+
}
|
|
186
|
+
interface ArrowOperation extends BaseDrawOperation {
|
|
187
|
+
tool: 'arrow';
|
|
188
|
+
start: Point;
|
|
189
|
+
end: Point;
|
|
190
|
+
}
|
|
191
|
+
interface BoxOperation extends BaseDrawOperation {
|
|
192
|
+
tool: 'box';
|
|
193
|
+
start: Point;
|
|
194
|
+
end: Point;
|
|
195
|
+
}
|
|
196
|
+
interface TextOperation extends BaseDrawOperation {
|
|
197
|
+
tool: 'text';
|
|
198
|
+
position: Point;
|
|
199
|
+
text: string;
|
|
200
|
+
fontSize: number;
|
|
201
|
+
}
|
|
202
|
+
interface BlurOperation extends BaseDrawOperation {
|
|
203
|
+
tool: 'blur';
|
|
204
|
+
start: Point;
|
|
205
|
+
end: Point;
|
|
206
|
+
blurRadius: number;
|
|
207
|
+
}
|
|
208
|
+
interface FreehandOperation extends BaseDrawOperation {
|
|
209
|
+
tool: 'freehand';
|
|
210
|
+
points: Point[];
|
|
211
|
+
}
|
|
212
|
+
type DrawOperation = ArrowOperation | BoxOperation | TextOperation | BlurOperation | FreehandOperation;
|
|
213
|
+
declare function renderOperationsToCanvas(ctx: CanvasRenderingContext2D, operations: DrawOperation[]): void;
|
|
214
|
+
declare class AnnotationOverlay {
|
|
215
|
+
private container;
|
|
216
|
+
private width;
|
|
217
|
+
private height;
|
|
218
|
+
private canvas;
|
|
219
|
+
private ctx;
|
|
220
|
+
private operations;
|
|
221
|
+
private currentTool;
|
|
222
|
+
private color;
|
|
223
|
+
private lineWidth;
|
|
224
|
+
private fontSize;
|
|
225
|
+
private blurRadius;
|
|
226
|
+
private isDrawing;
|
|
227
|
+
private startPoint;
|
|
228
|
+
private currentPoints;
|
|
229
|
+
private screenshotImage;
|
|
230
|
+
private onPointerDownBound;
|
|
231
|
+
private onPointerMoveBound;
|
|
232
|
+
private onPointerUpBound;
|
|
233
|
+
constructor(container: HTMLElement, width: number, height: number);
|
|
234
|
+
setScreenshotImage(image: HTMLImageElement): void;
|
|
235
|
+
setTool(tool: AnnotationTool): void;
|
|
236
|
+
getTool(): AnnotationTool;
|
|
237
|
+
setColor(color: string): void;
|
|
238
|
+
setLineWidth(lineWidth: number): void;
|
|
239
|
+
setFontSize(fontSize: number): void;
|
|
240
|
+
setBlurRadius(radius: number): void;
|
|
241
|
+
getOperations(): DrawOperation[];
|
|
242
|
+
undo(): void;
|
|
243
|
+
clear(): void;
|
|
244
|
+
addTextAtPosition(position: Point, text: string): void;
|
|
245
|
+
destroy(): void;
|
|
246
|
+
private getCanvasPoint;
|
|
247
|
+
private onPointerDown;
|
|
248
|
+
private onPointerMove;
|
|
249
|
+
private onPointerUp;
|
|
250
|
+
private promptTextInput;
|
|
251
|
+
private drawPreview;
|
|
252
|
+
private redraw;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
interface Attachment {
|
|
256
|
+
id: string;
|
|
257
|
+
type: 'screenshot' | 'recording' | 'voice_note' | 'file';
|
|
258
|
+
blob: Blob;
|
|
259
|
+
name: string;
|
|
260
|
+
thumbnailUrl?: string;
|
|
261
|
+
annotations?: DrawOperation[];
|
|
262
|
+
}
|
|
263
|
+
interface PanelSubmitData {
|
|
264
|
+
description: string;
|
|
265
|
+
reporterName: string;
|
|
266
|
+
reporterEmail: string;
|
|
267
|
+
attachments: Attachment[];
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export { AnnotationOverlay, type AnnotationTool, type ArrowOperation, type Attachment, type BlurOperation, type BoxOperation, Bugdump, BugdumpApiError, type BugdumpConfig, type BugdumpUserContext, type ConsoleLogEntry, type DrawOperation, type FreehandOperation, HttpClient, type MetadataSnapshot, type NetworkRequestEntry, type PanelSubmitData, type PerformanceSnapshot, type Point, type ReportPayload, type ReportResponse, type ScreenshotOptions, type ScreenshotResult, type TelemetrySnapshot, type TextOperation, type UploadRequest, type UploadResponse, captureScreenshot, renderOperationsToCanvas };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { eventWithTime } from '@rrweb/types';
|
|
2
|
+
|
|
3
|
+
interface BugdumpConfig {
|
|
4
|
+
projectKey: string;
|
|
5
|
+
endpoint?: string;
|
|
6
|
+
}
|
|
7
|
+
interface BugdumpUserContext {
|
|
8
|
+
id?: string;
|
|
9
|
+
email?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
interface ReportPayload {
|
|
14
|
+
description: string;
|
|
15
|
+
priority?: 'low' | 'medium' | 'high' | 'critical';
|
|
16
|
+
reporterName?: string;
|
|
17
|
+
reporterEmail?: string;
|
|
18
|
+
reporterExternalId?: string;
|
|
19
|
+
pageUrl?: string;
|
|
20
|
+
referrerUrl?: string;
|
|
21
|
+
userAgent?: string;
|
|
22
|
+
viewport?: {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
};
|
|
26
|
+
consoleLogs?: Record<string, unknown>[];
|
|
27
|
+
networkRequests?: Record<string, unknown>[];
|
|
28
|
+
performance?: Record<string, unknown>;
|
|
29
|
+
customContext?: Record<string, unknown>;
|
|
30
|
+
annotations?: Record<string, unknown>[];
|
|
31
|
+
attachments?: Array<{
|
|
32
|
+
fileId: string;
|
|
33
|
+
type: 'screenshot' | 'recording' | 'voice_note' | 'session_replay';
|
|
34
|
+
metadata?: Record<string, unknown>;
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
interface ReportResponse {
|
|
38
|
+
id: string;
|
|
39
|
+
publicId: string;
|
|
40
|
+
}
|
|
41
|
+
interface UploadRequest {
|
|
42
|
+
originalName: string;
|
|
43
|
+
mimeType: string;
|
|
44
|
+
size: number;
|
|
45
|
+
}
|
|
46
|
+
interface UploadResponse {
|
|
47
|
+
fileId: string;
|
|
48
|
+
url: string;
|
|
49
|
+
fields: Record<string, string>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare class HttpClient {
|
|
53
|
+
private endpoint;
|
|
54
|
+
private apiKey;
|
|
55
|
+
constructor(endpoint: string, apiKey: string);
|
|
56
|
+
submitReport(payload: ReportPayload): Promise<ReportResponse>;
|
|
57
|
+
requestUpload(request: UploadRequest): Promise<UploadResponse>;
|
|
58
|
+
uploadFileToS3(presignedUrl: string, fields: Record<string, string>, file: Blob): Promise<void>;
|
|
59
|
+
private post;
|
|
60
|
+
}
|
|
61
|
+
declare class BugdumpApiError extends Error {
|
|
62
|
+
readonly code: string;
|
|
63
|
+
readonly statusCode: number;
|
|
64
|
+
readonly details: unknown;
|
|
65
|
+
constructor(code: string, statusCode: number, details?: unknown);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface ConsoleLogEntry {
|
|
69
|
+
level: 'log' | 'warn' | 'error' | 'info' | 'debug';
|
|
70
|
+
args: unknown[];
|
|
71
|
+
timestamp: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface NetworkRequestEntry {
|
|
75
|
+
method: string;
|
|
76
|
+
url: string;
|
|
77
|
+
status: number | null;
|
|
78
|
+
statusText: string | null;
|
|
79
|
+
requestHeaders: Record<string, string>;
|
|
80
|
+
responseHeaders: Record<string, string>;
|
|
81
|
+
duration: number | null;
|
|
82
|
+
startedAt: number;
|
|
83
|
+
error: string | null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface PerformanceSnapshot {
|
|
87
|
+
timing: PerformanceTimingData | null;
|
|
88
|
+
memory: PerformanceMemoryData | null;
|
|
89
|
+
resources: PerformanceResourceData[];
|
|
90
|
+
}
|
|
91
|
+
interface PerformanceTimingData {
|
|
92
|
+
domContentLoaded: number | null;
|
|
93
|
+
loadComplete: number | null;
|
|
94
|
+
firstPaint: number | null;
|
|
95
|
+
firstContentfulPaint: number | null;
|
|
96
|
+
ttfb: number | null;
|
|
97
|
+
}
|
|
98
|
+
interface PerformanceMemoryData {
|
|
99
|
+
usedJSHeapSize: number;
|
|
100
|
+
totalJSHeapSize: number;
|
|
101
|
+
jsHeapSizeLimit: number;
|
|
102
|
+
}
|
|
103
|
+
interface PerformanceResourceData {
|
|
104
|
+
name: string;
|
|
105
|
+
type: string;
|
|
106
|
+
duration: number;
|
|
107
|
+
size: number;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface MetadataSnapshot {
|
|
111
|
+
userAgent: string;
|
|
112
|
+
language: string;
|
|
113
|
+
platform: string;
|
|
114
|
+
viewport: {
|
|
115
|
+
width: number;
|
|
116
|
+
height: number;
|
|
117
|
+
};
|
|
118
|
+
screenResolution: {
|
|
119
|
+
width: number;
|
|
120
|
+
height: number;
|
|
121
|
+
};
|
|
122
|
+
devicePixelRatio: number;
|
|
123
|
+
url: string;
|
|
124
|
+
referrer: string;
|
|
125
|
+
timestamp: number;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
interface TelemetrySnapshot {
|
|
129
|
+
consoleLogs: ConsoleLogEntry[];
|
|
130
|
+
networkRequests: NetworkRequestEntry[];
|
|
131
|
+
sessionReplayEvents: eventWithTime[];
|
|
132
|
+
performance: PerformanceSnapshot;
|
|
133
|
+
metadata: MetadataSnapshot;
|
|
134
|
+
}
|
|
135
|
+
declare class Bugdump {
|
|
136
|
+
private static instance;
|
|
137
|
+
private state;
|
|
138
|
+
private httpClient;
|
|
139
|
+
private consoleCollector;
|
|
140
|
+
private networkCollector;
|
|
141
|
+
private sessionReplayCollector;
|
|
142
|
+
private widget;
|
|
143
|
+
private constructor();
|
|
144
|
+
static init(config: BugdumpConfig): Bugdump;
|
|
145
|
+
static getInstance(): Bugdump | null;
|
|
146
|
+
identify(user: BugdumpUserContext): void;
|
|
147
|
+
setContext(context: Record<string, unknown>): void;
|
|
148
|
+
open(): void;
|
|
149
|
+
close(): void;
|
|
150
|
+
collectTelemetry(): TelemetrySnapshot;
|
|
151
|
+
destroy(): void;
|
|
152
|
+
getConfig(): Required<BugdumpConfig> | null;
|
|
153
|
+
getUser(): BugdumpUserContext | null;
|
|
154
|
+
getContext(): Record<string, unknown>;
|
|
155
|
+
getHttpClient(): HttpClient;
|
|
156
|
+
isWidgetOpen(): boolean;
|
|
157
|
+
private mountWidget;
|
|
158
|
+
private handleSubmit;
|
|
159
|
+
private ensureInitialized;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
interface ScreenshotOptions {
|
|
163
|
+
quality?: number;
|
|
164
|
+
target?: HTMLElement;
|
|
165
|
+
filter?: (node: HTMLElement) => boolean;
|
|
166
|
+
}
|
|
167
|
+
interface ScreenshotResult {
|
|
168
|
+
blob: Blob;
|
|
169
|
+
width: number;
|
|
170
|
+
height: number;
|
|
171
|
+
}
|
|
172
|
+
declare function captureScreenshot(options?: ScreenshotOptions): Promise<ScreenshotResult>;
|
|
173
|
+
|
|
174
|
+
type AnnotationTool = 'arrow' | 'box' | 'text' | 'blur' | 'freehand';
|
|
175
|
+
interface Point {
|
|
176
|
+
x: number;
|
|
177
|
+
y: number;
|
|
178
|
+
}
|
|
179
|
+
interface BaseDrawOperation {
|
|
180
|
+
id: string;
|
|
181
|
+
tool: AnnotationTool;
|
|
182
|
+
color: string;
|
|
183
|
+
lineWidth: number;
|
|
184
|
+
timestamp: number;
|
|
185
|
+
}
|
|
186
|
+
interface ArrowOperation extends BaseDrawOperation {
|
|
187
|
+
tool: 'arrow';
|
|
188
|
+
start: Point;
|
|
189
|
+
end: Point;
|
|
190
|
+
}
|
|
191
|
+
interface BoxOperation extends BaseDrawOperation {
|
|
192
|
+
tool: 'box';
|
|
193
|
+
start: Point;
|
|
194
|
+
end: Point;
|
|
195
|
+
}
|
|
196
|
+
interface TextOperation extends BaseDrawOperation {
|
|
197
|
+
tool: 'text';
|
|
198
|
+
position: Point;
|
|
199
|
+
text: string;
|
|
200
|
+
fontSize: number;
|
|
201
|
+
}
|
|
202
|
+
interface BlurOperation extends BaseDrawOperation {
|
|
203
|
+
tool: 'blur';
|
|
204
|
+
start: Point;
|
|
205
|
+
end: Point;
|
|
206
|
+
blurRadius: number;
|
|
207
|
+
}
|
|
208
|
+
interface FreehandOperation extends BaseDrawOperation {
|
|
209
|
+
tool: 'freehand';
|
|
210
|
+
points: Point[];
|
|
211
|
+
}
|
|
212
|
+
type DrawOperation = ArrowOperation | BoxOperation | TextOperation | BlurOperation | FreehandOperation;
|
|
213
|
+
declare function renderOperationsToCanvas(ctx: CanvasRenderingContext2D, operations: DrawOperation[]): void;
|
|
214
|
+
declare class AnnotationOverlay {
|
|
215
|
+
private container;
|
|
216
|
+
private width;
|
|
217
|
+
private height;
|
|
218
|
+
private canvas;
|
|
219
|
+
private ctx;
|
|
220
|
+
private operations;
|
|
221
|
+
private currentTool;
|
|
222
|
+
private color;
|
|
223
|
+
private lineWidth;
|
|
224
|
+
private fontSize;
|
|
225
|
+
private blurRadius;
|
|
226
|
+
private isDrawing;
|
|
227
|
+
private startPoint;
|
|
228
|
+
private currentPoints;
|
|
229
|
+
private screenshotImage;
|
|
230
|
+
private onPointerDownBound;
|
|
231
|
+
private onPointerMoveBound;
|
|
232
|
+
private onPointerUpBound;
|
|
233
|
+
constructor(container: HTMLElement, width: number, height: number);
|
|
234
|
+
setScreenshotImage(image: HTMLImageElement): void;
|
|
235
|
+
setTool(tool: AnnotationTool): void;
|
|
236
|
+
getTool(): AnnotationTool;
|
|
237
|
+
setColor(color: string): void;
|
|
238
|
+
setLineWidth(lineWidth: number): void;
|
|
239
|
+
setFontSize(fontSize: number): void;
|
|
240
|
+
setBlurRadius(radius: number): void;
|
|
241
|
+
getOperations(): DrawOperation[];
|
|
242
|
+
undo(): void;
|
|
243
|
+
clear(): void;
|
|
244
|
+
addTextAtPosition(position: Point, text: string): void;
|
|
245
|
+
destroy(): void;
|
|
246
|
+
private getCanvasPoint;
|
|
247
|
+
private onPointerDown;
|
|
248
|
+
private onPointerMove;
|
|
249
|
+
private onPointerUp;
|
|
250
|
+
private promptTextInput;
|
|
251
|
+
private drawPreview;
|
|
252
|
+
private redraw;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
interface Attachment {
|
|
256
|
+
id: string;
|
|
257
|
+
type: 'screenshot' | 'recording' | 'voice_note' | 'file';
|
|
258
|
+
blob: Blob;
|
|
259
|
+
name: string;
|
|
260
|
+
thumbnailUrl?: string;
|
|
261
|
+
annotations?: DrawOperation[];
|
|
262
|
+
}
|
|
263
|
+
interface PanelSubmitData {
|
|
264
|
+
description: string;
|
|
265
|
+
reporterName: string;
|
|
266
|
+
reporterEmail: string;
|
|
267
|
+
attachments: Attachment[];
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export { AnnotationOverlay, type AnnotationTool, type ArrowOperation, type Attachment, type BlurOperation, type BoxOperation, Bugdump, BugdumpApiError, type BugdumpConfig, type BugdumpUserContext, type ConsoleLogEntry, type DrawOperation, type FreehandOperation, HttpClient, type MetadataSnapshot, type NetworkRequestEntry, type PanelSubmitData, type PerformanceSnapshot, type Point, type ReportPayload, type ReportResponse, type ScreenshotOptions, type ScreenshotResult, type TelemetrySnapshot, type TextOperation, type UploadRequest, type UploadResponse, captureScreenshot, renderOperationsToCanvas };
|