@@ -4,28 +4,17 @@ const {
4
4
query,
5
5
where,
6
6
getDocs,
7
- CollectionReference,
8
- Firestore,
9
- WhereFilterOp,
10
- QueryConstraint,
11
- Query,
12
- QuerySnapshot,
13
- QueryDocumentSnapshot,
14
7
getFirestore,
15
- DocumentData,
16
8
doc,
17
9
deleteDoc,
18
- DocumentReference,
19
10
onSnapshot,
20
- FirestoreError,
21
- DocumentSnapshot,
22
11
setDoc,
23
12
addDoc,
24
13
} = require ( "firebase/firestore" ) ;
25
14
26
15
/**
27
16
*
28
- * @returns { Firestore }
17
+ * @returns { import("firebase/firestore"). Firestore }
29
18
*/
30
19
exports . getFirestoreImp = function ( ) {
31
20
return getFirestore ( ) ;
@@ -34,8 +23,8 @@ exports.getFirestoreImp = function () {
34
23
/**
35
24
*
36
25
* @param {String } path
37
- * @param {Firestore } firestore
38
- * @returns {() => CollectionReference }
26
+ * @param {import("firebase/firestore"). Firestore } firestore
27
+ * @returns {() => import("firebase/firestore"). CollectionReference }
39
28
*/
40
29
exports . collectionImp = function ( path , firestore ) {
41
30
return function ( ) {
@@ -46,9 +35,9 @@ exports.collectionImp = function (path, firestore) {
46
35
/**
47
36
*
48
37
* @param {String } path
49
- * @param {WhereFilterOp } opStr
38
+ * @param {import("firebase/firestore"). WhereFilterOp } opStr
50
39
* @param {unknown } value
51
- * @returns {() => QueryConstraint }
40
+ * @returns {() => import("firebase/firestore"). QueryConstraint }
52
41
*/
53
42
exports . whereImp = function ( path , opStr , value ) {
54
43
return function ( ) {
@@ -58,9 +47,9 @@ exports.whereImp = function (path, opStr, value) {
58
47
59
48
/**
60
49
*
61
- * @param {QueryConstraint[] } queryConstraints
62
- * @param {Query } q
63
- * @returns {() => Query }
50
+ * @param {import("firebase/firestore"). QueryConstraint[] } queryConstraints
51
+ * @param {import("firebase/firestore"). Query } q
52
+ * @returns {() => import("firebase/firestore"). Query }
64
53
*/
65
54
exports . queryImp = function ( queryConstraints , q ) {
66
55
return function ( ) {
@@ -70,8 +59,8 @@ exports.queryImp = function (queryConstraints, q) {
70
59
71
60
/**
72
61
*
73
- * @param {Query } q
74
- * @returns {() => Promise<QuerySnapshot> }
62
+ * @param {import("firebase/firestore"). Query } q
63
+ * @returns {() => Promise<import("firebase/firestore"). QuerySnapshot> }
75
64
*/
76
65
exports . getDocsImp = function ( q ) {
77
66
return function ( ) {
@@ -81,8 +70,8 @@ exports.getDocsImp = function (q) {
81
70
82
71
/**
83
72
*
84
- * @param {(result: QueryDocumentSnapshot) => () => void } callback
85
- * @param {QuerySnapshot } snapshot
73
+ * @param {(result: import("firebase/firestore"). QueryDocumentSnapshot) => () => void } callback
74
+ * @param {import("firebase/firestore"). QuerySnapshot } snapshot
86
75
* @returns {() => void }
87
76
*/
88
77
exports . foreachImp = function ( callback , snapshot ) {
@@ -95,8 +84,8 @@ exports.foreachImp = function (callback, snapshot) {
95
84
96
85
/**
97
86
*
98
- * @param {QuerySnapshot } snapshot
99
- * @returns {() => QueryDocumentSnapshot[] }
87
+ * @param {import("firebase/firestore"). QuerySnapshot } snapshot
88
+ * @returns {() => import("firebase/firestore"). QueryDocumentSnapshot[] }
100
89
*/
101
90
exports . getSnapshotDocsImp = function ( snapshot ) {
102
91
return function ( ) {
@@ -106,8 +95,8 @@ exports.getSnapshotDocsImp = function (snapshot) {
106
95
107
96
/**
108
97
*
109
- * @param {DocumentSnapshot<DocumentData> } snapshot
110
- * @returns {() => DocumentData | undefined }
98
+ * @param {import("firebase/firestore"). DocumentSnapshot<import("firebase/firestore"). DocumentData> } snapshot
99
+ * @returns {() => import("firebase/firestore"). DocumentData | undefined }
111
100
*/
112
101
exports . getDocSnapshotDataImp = function ( snapshot ) {
113
102
return function ( ) {
@@ -118,8 +107,8 @@ exports.getDocSnapshotDataImp = function (snapshot) {
118
107
119
108
/**
120
109
*
121
- * @param {QueryDocumentSnapshot } snapshot
122
- * @returns {() => DocumentData }
110
+ * @param {import("firebase/firestore"). QueryDocumentSnapshot } snapshot
111
+ * @returns {() => import("firebase/firestore"). DocumentData }
123
112
*/
124
113
exports . getSnapshotDataImp = function ( snapshot ) {
125
114
return function ( ) {
@@ -129,10 +118,10 @@ exports.getSnapshotDataImp = function (snapshot) {
129
118
130
119
/**
131
120
*
132
- * @param {Firestore } firestore
121
+ * @param {import("firebase/firestore"). Firestore } firestore
133
122
* @param {String } path
134
123
* @param {String[] } pathSegments
135
- * @returns {() => DocumentReference }
124
+ * @returns {() => import("firebase/firestore"). DocumentReference }
136
125
*/
137
126
exports . docImp = function ( firestore , path , pathSegments ) {
138
127
return function ( ) {
@@ -142,7 +131,7 @@ exports.docImp = function (firestore, path, pathSegments) {
142
131
143
132
/**
144
133
*
145
- * @param {DocumentReference } doc
134
+ * @param {import("firebase/firestore"). DocumentReference } doc
146
135
* @returns {() => Promise<void> }
147
136
*/
148
137
exports . deleteImp = function ( doc ) {
@@ -153,10 +142,10 @@ exports.deleteImp = function (doc) {
153
142
154
143
/**
155
144
*
156
- * @param {(snapshot: QuerySnapshot) => void } onNext
157
- * @param {(error: FirestoreError) => void } onError
145
+ * @param {(snapshot: import("firebase/firestore"). QuerySnapshot) => void } onNext
146
+ * @param {(error: import("firebase/firestore"). FirestoreError) => void } onError
158
147
* @param {() => void } onCompletion
159
- * @param {Query } query
148
+ * @param {import("firebase/firestore"). Query } query
160
149
* @returns {() => () => void }
161
150
*/
162
151
exports . onSnapshotImp = function ( onNext , onError , onCompletion , query ) {
@@ -168,9 +157,9 @@ exports.onSnapshotImp = function (onNext, onError, onCompletion, query) {
168
157
169
158
/**
170
159
*
171
- * @param {DocumentReference<DocumentData> } doc
172
- * @param {(snapshot: DocumentSnapshot) => void } onNext
173
- * @param {(error: FirestoreError) => void } onError
160
+ * @param {import("firebase/firestore"). DocumentReference<import("firebase/firestore"). DocumentData> } doc
161
+ * @param {(snapshot: import("firebase/firestore"). DocumentSnapshot) => void } onNext
162
+ * @param {(error: import("firebase/firestore"). FirestoreError) => void } onError
174
163
* @param {() => void } onCompletion
175
164
* @returns {() => () => void }
176
165
*/
@@ -183,7 +172,7 @@ exports.onDocSnapshotImp = function (doc, onNext, onError, onCompletion) {
183
172
184
173
/**
185
174
*
186
- * @param {QuerySnapshot } qs
175
+ * @param {import("firebase/firestore"). QuerySnapshot } qs
187
176
* @returns {() => Boolean }
188
177
*/
189
178
exports . isQuerySnapshotEmptyImp = function ( qs ) {
@@ -194,8 +183,8 @@ exports.isQuerySnapshotEmptyImp = function (qs) {
194
183
195
184
/**
196
185
*
197
- * @param {DocumentReference<DocumentData> } doc
198
- * @param {DocumentData } data
186
+ * @param {import("firebase/firestore"). DocumentReference<import("firebase/firestore"). DocumentData> } doc
187
+ * @param {import("firebase/firestore"). DocumentData } data
199
188
* @returns {() => Promise<void> }
200
189
*/
201
190
exports . setDocImp = function ( doc , data ) {
@@ -206,9 +195,9 @@ exports.setDocImp = function (doc, data) {
206
195
207
196
/**
208
197
*
209
- * @param {CollectionReference<DocumentData> } collection
210
- * @param {DocumentData } data
211
- * @returns {() => Promise<DocumentReference<DocumentData>> }
198
+ * @param {import("firebase/firestore"). CollectionReference<import("firebase/firestore"). DocumentData> } collection
199
+ * @param {import("firebase/firestore"). DocumentData } data
200
+ * @returns {() => Promise<import("firebase/firestore"). DocumentReference<import("firebase/firestore"). DocumentData>> }
212
201
*/
213
202
exports . addDocImp = function ( collection , data ) {
214
203
return function ( ) {
0 commit comments