99 SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME ,
1010 SEMANTIC_ATTRIBUTE_SENTRY_OP ,
1111 SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN ,
12- spanToJSON ,
1312 spanToStreamedSpanJSON ,
1413 startInactiveSpan ,
1514 timestampInSeconds ,
@@ -23,6 +22,25 @@ import type { WebVitalReportEvent } from './utils';
2322import { getBrowserPerformanceAPI , listenForWebVitalReportEvents , msToSec , supportsWebVital } from './utils' ;
2423import type { PerformanceEventTiming } from './instrument' ;
2524
25+ // Locally-defined interfaces to avoid leaking bare global type references into the
26+ // generated .d.ts. The `declare global` augmentations in web-vitals/types.ts make these
27+ // available during this package's compilation but are NOT carried to consumers.
28+ // This mirrors the pattern used for PerformanceEventTiming in instrument.ts.
29+ export interface LayoutShift extends PerformanceEntry {
30+ value : number ;
31+ sources : Array < { node : Node | null } > ;
32+ hadRecentInput : boolean ;
33+ }
34+
35+ export interface LargestContentfulPaint extends PerformanceEntry {
36+ readonly renderTime : DOMHighResTimeStamp ;
37+ readonly loadTime : DOMHighResTimeStamp ;
38+ readonly size : number ;
39+ readonly id : string ;
40+ readonly url : string ;
41+ readonly element : Element | null ;
42+ }
43+
2644interface WebVitalSpanOptions {
2745 name : string ;
2846 op : string ;
@@ -268,7 +286,9 @@ export function _sendInpSpan(inpValue: number, entry: PerformanceEventTiming): v
268286 const rootSpan = activeSpan ? getRootSpan ( activeSpan ) : undefined ;
269287
270288 const spanToUse = cachedContext ?. span || rootSpan ;
271- const routeName = spanToUse ? spanToJSON ( spanToUse ) . description : getCurrentScope ( ) . getScopeData ( ) . transactionName ;
289+ const routeName = spanToUse
290+ ? spanToStreamedSpanJSON ( spanToUse ) . name
291+ : getCurrentScope ( ) . getScopeData ( ) . transactionName ;
272292 const name = cachedContext ?. elementName || htmlTreeAsString ( entry . target ) ;
273293
274294 _emitWebVitalSpan ( {
0 commit comments