1- import type { BugSplat , BugSplatAttachment } from 'bugsplat' ;
1+ import type { BugSplat } from 'bugsplat' ;
22
33/**
4- * Builds the componentStack attachment for ErrorBoundary posts.
5- */
6- export type CreateComponentStackAttachment = (
7- componentStack : string
8- ) => BugSplatAttachment ;
9-
10- /**
11- * Default builder — wraps the stack in a `text/plain` `Blob`.
12- */
13- export const defaultCreateComponentStackAttachment : CreateComponentStackAttachment = (
14- componentStack
15- ) => ( {
16- filename : 'componentStack.txt' ,
17- data : new Blob ( [ componentStack ] , { type : 'text/plain' } ) ,
18- } ) ;
19-
20- /**
21- * Encapsulate BugSplat client instance and scope-level overrides.
4+ * Encapsulate BugSplat client instance
225 */
236export class Scope {
24- constructor (
25- private client : BugSplat | null = null ,
26- private createComponentStackAttachment : CreateComponentStackAttachment = defaultCreateComponentStackAttachment
27- ) { }
7+ constructor ( private client : BugSplat | null = null ) { }
288
299 /**
3010 * @returns BugSplat client instance or null if unset
@@ -36,15 +16,4 @@ export class Scope {
3616 setClient ( client : BugSplat ) {
3717 this . client = client ;
3818 }
39-
40- /**
41- * @returns the current componentStack attachment builder
42- */
43- getCreateComponentStackAttachment ( ) {
44- return this . createComponentStackAttachment ;
45- }
46-
47- setCreateComponentStackAttachment ( fn : CreateComponentStackAttachment ) {
48- this . createComponentStackAttachment = fn ;
49- }
5019}
0 commit comments