@@ -16,7 +16,6 @@ import {
1616 ATTR_SERVER_PORT ,
1717} from '@opentelemetry/semantic-conventions' ;
1818import type { SpanAttributes } from '@sentry/core' ;
19- import type { unwrap as shimmerUnwrap , wrap as shimmerWrap } from 'shimmer' ;
2019import type { FirebaseInstrumentation } from '../firebaseInstrumentation' ;
2120import type {
2221 AddDocType ,
@@ -37,6 +36,11 @@ import type {
3736 WithFieldValue ,
3837} from '../types' ;
3938
39+ // Inline minimal types used from `shimmer` to avoid importing shimmer's types directly.
40+ // We only need the shape for `wrap` and `unwrap` used in this file.
41+ type ShimmerWrap = ( target : any , name : string , wrapper : ( ...args : any [ ] ) => any ) => void ;
42+ type ShimmerUnwrap = ( target : any , name : string ) => void ;
43+
4044/**
4145 *
4246 * @param tracer - Opentelemetry Tracer
@@ -47,8 +51,8 @@ import type {
4751export function patchFirestore (
4852 tracer : Tracer ,
4953 firestoreSupportedVersions : string [ ] ,
50- wrap : typeof shimmerWrap ,
51- unwrap : typeof shimmerUnwrap ,
54+ wrap : ShimmerWrap ,
55+ unwrap : ShimmerUnwrap ,
5256 config : FirebaseInstrumentationConfig ,
5357) : InstrumentationNodeModuleDefinition {
5458 // eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -102,8 +106,8 @@ export function patchFirestore(
102106function wrapMethods (
103107 // eslint-disable-next-line @typescript-eslint/no-explicit-any
104108 moduleExports : any ,
105- wrap : typeof shimmerWrap ,
106- unwrap : typeof shimmerUnwrap ,
109+ wrap : ShimmerWrap ,
110+ unwrap : ShimmerUnwrap ,
107111 tracer : Tracer ,
108112 firestoreSpanCreationHook : FirestoreSpanCreationHook ,
109113 // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -121,7 +125,7 @@ function wrapMethods(
121125function unwrapMethods (
122126 // eslint-disable-next-line @typescript-eslint/no-explicit-any
123127 moduleExports : any ,
124- unwrap : typeof shimmerUnwrap ,
128+ unwrap : ShimmerUnwrap ,
125129 // eslint-disable-next-line @typescript-eslint/no-explicit-any
126130) : any {
127131 for ( const method of [ 'addDoc' , 'getDocs' , 'setDoc' , 'deleteDoc' ] ) {
0 commit comments