@@ -16,7 +16,6 @@ import {
16
16
ATTR_SERVER_PORT ,
17
17
} from '@opentelemetry/semantic-conventions' ;
18
18
import type { SpanAttributes } from '@sentry/core' ;
19
- import type { unwrap as shimmerUnwrap , wrap as shimmerWrap } from 'shimmer' ;
20
19
import type { FirebaseInstrumentation } from '../firebaseInstrumentation' ;
21
20
import type {
22
21
AddDocType ,
@@ -37,6 +36,11 @@ import type {
37
36
WithFieldValue ,
38
37
} from '../types' ;
39
38
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
+
40
44
/**
41
45
*
42
46
* @param tracer - Opentelemetry Tracer
@@ -47,8 +51,8 @@ import type {
47
51
export function patchFirestore (
48
52
tracer : Tracer ,
49
53
firestoreSupportedVersions : string [ ] ,
50
- wrap : typeof shimmerWrap ,
51
- unwrap : typeof shimmerUnwrap ,
54
+ wrap : ShimmerWrap ,
55
+ unwrap : ShimmerUnwrap ,
52
56
config : FirebaseInstrumentationConfig ,
53
57
) : InstrumentationNodeModuleDefinition {
54
58
// eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -102,8 +106,8 @@ export function patchFirestore(
102
106
function wrapMethods (
103
107
// eslint-disable-next-line @typescript-eslint/no-explicit-any
104
108
moduleExports : any ,
105
- wrap : typeof shimmerWrap ,
106
- unwrap : typeof shimmerUnwrap ,
109
+ wrap : ShimmerWrap ,
110
+ unwrap : ShimmerUnwrap ,
107
111
tracer : Tracer ,
108
112
firestoreSpanCreationHook : FirestoreSpanCreationHook ,
109
113
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -121,7 +125,7 @@ function wrapMethods(
121
125
function unwrapMethods (
122
126
// eslint-disable-next-line @typescript-eslint/no-explicit-any
123
127
moduleExports : any ,
124
- unwrap : typeof shimmerUnwrap ,
128
+ unwrap : ShimmerUnwrap ,
125
129
// eslint-disable-next-line @typescript-eslint/no-explicit-any
126
130
) : any {
127
131
for ( const method of [ 'addDoc' , 'getDocs' , 'setDoc' , 'deleteDoc' ] ) {
0 commit comments