Skip to content

Commit ffc5ba1

Browse files
Cleanup
1 parent c014c87 commit ffc5ba1

File tree

4 files changed

+666
-101
lines changed

4 files changed

+666
-101
lines changed

common/api-review/firestore-lite.api.md

Lines changed: 334 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,348 @@
44
55
```ts
66

7-
// Warning: (ae-forgotten-export) The symbol "Foo" needs to be exported by the entry point index.d.ts
7+
import { DocumentData as DocumentData_2 } from '@firebase/firestore-types';
8+
import { FirebaseApp } from '@firebase/app-types';
9+
import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
10+
import { _FirebaseService } from '@firebase/app-types';
11+
import { Provider } from '@firebase/component';
12+
import { SetOptions as SetOptions_2 } from '@firebase/firestore-types';
13+
14+
// @public (undocumented)
15+
export function addDoc<T>(reference: CollectionReference<T>, data: T): Promise<DocumentReference<T>>;
16+
17+
// @public (undocumented)
18+
export function arrayRemove(...elements: unknown[]): FieldValue;
19+
20+
// @public (undocumented)
21+
export function arrayUnion(...elements: unknown[]): FieldValue;
22+
23+
// @public (undocumented)
24+
export function collection(firestore: FirebaseFirestore, collectionPath: string): CollectionReference<DocumentData>;
25+
26+
// @public (undocumented)
27+
export function collection(reference: CollectionReference<unknown>, collectionPath: string): CollectionReference<DocumentData>;
28+
29+
// @public (undocumented)
30+
export function collection(reference: DocumentReference, collectionPath: string): CollectionReference<DocumentData>;
31+
32+
// @public (undocumented)
33+
export function collectionGroup(firestore: FirebaseFirestore, collectionId: string): Query<DocumentData>;
34+
35+
// @public (undocumented)
36+
export class CollectionReference<T = DocumentData> extends Query<T> {
37+
constructor(firestore: FirebaseFirestore, converter: FirestoreDataConverter<T> | null, _path: ResourcePath);
38+
// (undocumented)
39+
doc(path?: string): DocumentReference<T>;
40+
// (undocumented)
41+
readonly firestore: FirebaseFirestore;
42+
// (undocumented)
43+
get id(): string;
44+
// (undocumented)
45+
get parent(): DocumentReference<DocumentData> | null;
46+
// (undocumented)
47+
get path(): string;
48+
// Warning: (ae-forgotten-export) The symbol "ResourcePath" needs to be exported by the entry point index.d.ts
49+
//
50+
// (undocumented)
51+
readonly _path: ResourcePath;
52+
// (undocumented)
53+
readonly type = "collection";
54+
// (undocumented)
55+
withConverter<U>(converter: FirestoreDataConverter<U>): CollectionReference<U>;
56+
}
57+
58+
// @public (undocumented)
59+
export function deleteDoc(reference: DocumentReference): Promise<void>;
60+
61+
// @public (undocumented)
62+
export function deleteField(): FieldValue;
63+
64+
// @public (undocumented)
65+
export function doc(firestore: FirebaseFirestore, documentPath: string): DocumentReference<DocumentData>;
66+
67+
// @public (undocumented)
68+
export function doc<T>(reference: CollectionReference<T>, documentPath?: string): DocumentReference<T>;
69+
70+
// @public (undocumented)
71+
export function doc(reference: DocumentReference<unknown>, documentPath: string): DocumentReference<DocumentData>;
72+
73+
// @public (undocumented)
74+
export interface DocumentData {
75+
// (undocumented)
76+
[field: string]: any;
77+
}
78+
79+
// @public (undocumented)
80+
export function documentId(): FieldPath;
81+
82+
// Warning: (ae-forgotten-export) The symbol "_DocumentKeyReference" needs to be exported by the entry point index.d.ts
883
//
84+
// @public
85+
export class DocumentReference<T = DocumentData> extends _DocumentKeyReference<T> {
86+
constructor(firestore: FirebaseFirestore, _converter: FirestoreDataConverter<T> | null, _path: ResourcePath);
87+
// (undocumented)
88+
collection(path: string): CollectionReference<DocumentData>;
89+
// (undocumented)
90+
readonly firestore: FirebaseFirestore;
91+
// (undocumented)
92+
get id(): string;
93+
// (undocumented)
94+
get parent(): CollectionReference<T>;
95+
// (undocumented)
96+
get path(): string;
97+
// (undocumented)
98+
readonly _path: ResourcePath;
99+
// (undocumented)
100+
readonly type = "document";
101+
// (undocumented)
102+
withConverter<U>(converter: FirestoreDataConverter<U>): DocumentReference<U>;
103+
}
104+
105+
// @public (undocumented)
106+
export class DocumentSnapshot<T = DocumentData> {
107+
constructor(_firestore: FirebaseFirestore, _key: DocumentKey, _document: Document_2 | null, _converter: UntypedFirestoreDataConverter<T> | null);
108+
// Warning: (ae-forgotten-export) The symbol "UntypedFirestoreDataConverter" needs to be exported by the entry point index.d.ts
109+
//
110+
// (undocumented)
111+
_converter: UntypedFirestoreDataConverter<T> | null;
112+
// (undocumented)
113+
data(): T | undefined;
114+
// Warning: (ae-forgotten-export) The symbol "Document" needs to be exported by the entry point index.d.ts
115+
//
116+
// (undocumented)
117+
_document: Document_2 | null;
118+
// (undocumented)
119+
exists(): this is QueryDocumentSnapshot<T>;
120+
// (undocumented)
121+
_firestore: FirebaseFirestore;
122+
// (undocumented)
123+
get(fieldPath: string | FieldPath): any;
124+
// (undocumented)
125+
get id(): string;
126+
// Warning: (ae-forgotten-export) The symbol "DocumentKey" needs to be exported by the entry point index.d.ts
127+
//
128+
// (undocumented)
129+
_key: DocumentKey;
130+
// (undocumented)
131+
get ref(): DocumentReference<T>;
132+
}
133+
134+
// @public (undocumented)
135+
export function endAt(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
136+
137+
// @public (undocumented)
138+
export function endAt(...fieldValues: unknown[]): QueryConstraint;
139+
140+
// @public (undocumented)
141+
export function endBefore(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
142+
143+
// @public (undocumented)
144+
export function endBefore(...fieldValues: unknown[]): QueryConstraint;
145+
146+
// Warning: (ae-forgotten-export) The symbol "_BaseFieldPath" needs to be exported by the entry point index.d.ts
147+
//
148+
// @public
149+
export class FieldPath extends _BaseFieldPath {
150+
constructor(...fieldNames: string[]);
151+
// (undocumented)
152+
isEqual(other: FieldPath): boolean;
153+
}
154+
155+
// Warning: (ae-forgotten-export) The symbol "_SerializableFieldValue" needs to be exported by the entry point index.d.ts
156+
//
157+
// @public
158+
export abstract class FieldValue extends _SerializableFieldValue {
159+
}
160+
161+
// @public
162+
export class FirebaseFirestore implements _FirebaseService {
163+
constructor(app: FirebaseApp, authProvider: Provider<FirebaseAuthInternalName>);
164+
// (undocumented)
165+
readonly app: FirebaseApp;
166+
// (undocumented)
167+
_configureClient(settings: Settings): void;
168+
// Warning: (ae-forgotten-export) The symbol "CredentialsProvider" needs to be exported by the entry point index.d.ts
169+
//
170+
// (undocumented)
171+
readonly _credentials: CredentialsProvider;
172+
// Warning: (ae-forgotten-export) The symbol "DatabaseId" needs to be exported by the entry point index.d.ts
173+
//
174+
// (undocumented)
175+
readonly _databaseId: DatabaseId;
176+
// (undocumented)
177+
_delete(): Promise<void>;
178+
// (undocumented)
179+
_getSettings(): Settings;
180+
// (undocumented)
181+
get _initialized(): boolean;
182+
// (undocumented)
183+
readonly _persistenceKey: string;
184+
// (undocumented)
185+
protected _settings?: Settings;
186+
protected _terminate(): Promise<void>;
187+
// (undocumented)
188+
get _terminated(): boolean;
189+
}
190+
9191
// @public (undocumented)
10-
export class BarPublic extends Foo<number> {
192+
export interface FirestoreDataConverter<T> {
193+
// (undocumented)
194+
fromFirestore(snapshot: QueryDocumentSnapshot<DocumentData>): T;
195+
// (undocumented)
196+
toFirestore(modelObject: T): DocumentData;
197+
// (undocumented)
198+
toFirestore(modelObject: Partial<T>, options: SetOptions): DocumentData;
11199
}
12200

13201
// @public (undocumented)
14-
export class FooPublic<T> extends Foo<string> {
202+
export function getDoc<T>(reference: DocumentReference<T>): Promise<DocumentSnapshot<T>>;
203+
204+
// @public (undocumented)
205+
export function getDocs<T>(query: Query<T>): Promise<QuerySnapshot<T>>;
206+
207+
// @public (undocumented)
208+
export function getFirestore(app: FirebaseApp): FirebaseFirestore;
209+
210+
// @public (undocumented)
211+
export function increment(n: number): FieldValue;
212+
213+
// @public (undocumented)
214+
export function initializeFirestore(app: FirebaseApp, settings: Settings): FirebaseFirestore;
215+
216+
// @public (undocumented)
217+
export function limit(limit: number): QueryConstraint;
218+
219+
// @public (undocumented)
220+
export function limitToLast(limit: number): QueryConstraint;
221+
222+
// @public (undocumented)
223+
export function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryConstraint;
224+
225+
// @public (undocumented)
226+
export type OrderByDirection = 'desc' | 'asc';
227+
228+
// @public (undocumented)
229+
export class Query<T = DocumentData> {
230+
constructor(firestore: FirebaseFirestore, _converter: FirestoreDataConverter<T> | null, _query: Query_2);
231+
// (undocumented)
232+
readonly _converter: FirestoreDataConverter<T> | null;
15233
// (undocumented)
16-
randomData?: T;
234+
readonly firestore: FirebaseFirestore;
235+
// Warning: (ae-forgotten-export) The symbol "Query" needs to be exported by the entry point index.d.ts
236+
//
237+
// (undocumented)
238+
readonly _query: Query_2;
239+
// (undocumented)
240+
readonly type: 'query' | 'collection';
241+
// (undocumented)
242+
withConverter<U>(converter: FirestoreDataConverter<U>): Query<U>;
243+
}
244+
245+
// @public (undocumented)
246+
export function query<T>(query: Query<T>, ...queryConstraints: QueryConstraint[]): Query<T>;
247+
248+
// @public (undocumented)
249+
export abstract class QueryConstraint {
250+
abstract _apply<T>(query: Query<T>): Query<T>;
251+
// (undocumented)
252+
abstract readonly type: QueryConstraintType;
253+
}
254+
255+
// @public (undocumented)
256+
export type QueryConstraintType = 'where' | 'orderBy' | 'limit' | 'limitToLast' | 'startAt' | 'startAfter' | 'endAt' | 'endBefore';
257+
258+
// @public (undocumented)
259+
export class QueryDocumentSnapshot<T = DocumentData> extends DocumentSnapshot<T> {
260+
// (undocumented)
261+
data(): T;
17262
}
18263

264+
// @public (undocumented)
265+
export function queryEqual<T>(left: Query<T>, right: Query<T>): boolean;
266+
267+
// @public (undocumented)
268+
export class QuerySnapshot<T = DocumentData> {
269+
constructor(query: Query<T>, _docs: Array<QueryDocumentSnapshot<T>>);
270+
// (undocumented)
271+
get docs(): Array<QueryDocumentSnapshot<T>>;
272+
// (undocumented)
273+
readonly _docs: Array<QueryDocumentSnapshot<T>>;
274+
// (undocumented)
275+
get empty(): boolean;
276+
// (undocumented)
277+
forEach(callback: (result: QueryDocumentSnapshot<T>) => void, thisArg?: unknown): void;
278+
// (undocumented)
279+
readonly query: Query<T>;
280+
// (undocumented)
281+
get size(): number;
282+
}
283+
284+
// @public (undocumented)
285+
export function refEqual<T>(left: DocumentReference<T> | CollectionReference<T>, right: DocumentReference<T> | CollectionReference<T>): boolean;
286+
287+
// @public (undocumented)
288+
export function serverTimestamp(): FieldValue;
289+
290+
// @public (undocumented)
291+
export function setDoc<T>(reference: DocumentReference<T>, data: T): Promise<void>;
292+
293+
// @public (undocumented)
294+
export function setDoc<T>(reference: DocumentReference<T>, data: Partial<T>, options: SetOptions): Promise<void>;
295+
296+
// @public (undocumented)
297+
export type SetOptions = {
298+
readonly merge?: boolean;
299+
} | {
300+
readonly mergeFields?: Array<string | FieldPath>;
301+
};
302+
303+
// @public (undocumented)
304+
export interface Settings {
305+
// (undocumented)
306+
host?: string;
307+
// (undocumented)
308+
ignoreUndefinedProperties?: boolean;
309+
// (undocumented)
310+
ssl?: boolean;
311+
}
312+
313+
// @public (undocumented)
314+
export function snapshotEqual<T>(left: DocumentSnapshot<T> | QuerySnapshot<T>, right: DocumentSnapshot<T> | QuerySnapshot<T>): boolean;
315+
316+
// @public (undocumented)
317+
export function startAfter(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
318+
319+
// @public (undocumented)
320+
export function startAfter(...fieldValues: unknown[]): QueryConstraint;
321+
322+
// @public (undocumented)
323+
export function startAt(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
324+
325+
// @public (undocumented)
326+
export function startAt(...fieldValues: unknown[]): QueryConstraint;
327+
328+
// @public (undocumented)
329+
export function terminate(firestore: FirebaseFirestore): Promise<void>;
330+
331+
// @public (undocumented)
332+
export interface UpdateData {
333+
// (undocumented)
334+
[fieldPath: string]: any;
335+
}
336+
337+
// @public (undocumented)
338+
export function updateDoc(reference: DocumentReference<unknown>, data: UpdateData): Promise<void>;
339+
340+
// @public (undocumented)
341+
export function updateDoc(reference: DocumentReference<unknown>, field: string | FieldPath, value: unknown, ...moreFieldsAndValues: unknown[]): Promise<void>;
342+
343+
// @public (undocumented)
344+
export function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryConstraint;
345+
346+
// @public (undocumented)
347+
export type WhereFilterOp = '<' | '<=' | '==' | '!=' | '>=' | '>' | 'array-contains' | 'in' | 'array-contains-any' | 'not-in';
348+
19349

20350
// (No @packageDocumentation comment for this package)
21351

0 commit comments

Comments
 (0)