@@ -26,22 +26,24 @@ export interface DocumentReference<T extends MetaType> {
26
26
*
27
27
* @returns A Promise that resolves with an array of CollectionReferences.
28
28
*/
29
- listCollections ( ) : Promise < Array < CollectionReference < T > > > // ! revisit and fix type
29
+ listCollections ( ) : Promise < CollectionReference < any > [ ] > // ! revisit and fix type
30
30
}
31
31
32
32
export interface CollectionReference < T extends MetaType > extends Query < T > {
33
33
/** The collection's identifier. */
34
- readonly id : T [ 'docID ' ]
34
+ readonly id : T [ 'collectionID ' ]
35
35
/**
36
36
* A reference to the containing `DocumentReference` if this is a
37
37
* subcollection. If this isn't a subcollection, the reference is null.
38
38
*/
39
- readonly parent : T [ 'parent' ]
39
+ readonly parent : T [ 'parent' ] extends MetaType
40
+ ? DocumentReference < T [ 'parent' ] >
41
+ : null
40
42
/**
41
43
* A string representing the path of the referenced collection (relative
42
44
* to the root of the database).
43
45
*/
44
- readonly path : T [ 'docPath ' ]
46
+ readonly path : T [ 'collectionPath ' ]
45
47
/**
46
48
* Retrieves the list of documents in this collection.
47
49
*
@@ -54,7 +56,7 @@ export interface CollectionReference<T extends MetaType> extends Query<T> {
54
56
* @return {Promise<DocumentReference[]> } The list of documents in this
55
57
* collection.
56
58
*/
57
- listDocuments ( ) : Promise < Array < DocumentReference < T > > > // ! revisit
59
+ listDocuments ( ) : Promise < DocumentReference < T > [ ] > // ! revisit
58
60
}
59
61
60
62
export interface Query < T extends MetaType > {
@@ -85,14 +87,4 @@ export interface Query<T extends MetaType> {
85
87
* @return The created Query.
86
88
*/
87
89
select ( ...field : ( keyof T [ 'writeFlatten' ] ) [ ] ) : Query < T > // ! revisit
88
- /**
89
- * Specifies the offset of the returned results.
90
- *
91
- * This function returns a new (immutable) instance of the Query (rather
92
- * than modify the existing instance) to impose the offset.
93
- *
94
- * @param offset The offset to apply to the Query results.
95
- * @return The created Query.
96
- */
97
- offset ( offset : number ) : Query < T > // ! revisit
98
90
}
0 commit comments