Skip to content

Commit 272f722

Browse files
committed
poc full modular
1 parent 9bd9a23 commit 272f722

File tree

11 files changed

+1596
-1439
lines changed

11 files changed

+1596
-1439
lines changed

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

Lines changed: 85 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ export class AddFields implements Stage {
4545
name: string;
4646
}
4747

48+
// Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta
49+
//
50+
// @public
51+
export function addFields<AppModelType>(pipeline: Pipeline<AppModelType>, ...fields: Selectable[]): Pipeline<AppModelType>;
52+
4853
// @public
4954
export type AddPrefixToKeys<Prefix extends string, T extends Record<string, unknown>> = {
5055
[K in keyof T & string as `${Prefix}.${K}`]+?: string extends K ? any : T[K];
@@ -57,6 +62,17 @@ export class Aggregate implements Stage {
5762
name: string;
5863
}
5964

65+
// Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta
66+
//
67+
// @public
68+
export function aggregate<AppModelType>(pipeline: Pipeline<AppModelType>, ...accumulators: AccumulatorTarget[]): Pipeline<AppModelType>;
69+
70+
// @public
71+
export function aggregate<AppModelType>(pipeline: Pipeline<AppModelType>, options: {
72+
accumulators: AccumulatorTarget[];
73+
groups?: Array<string | Selectable>;
74+
}): Pipeline<AppModelType>;
75+
6076
// @public
6177
export class AggregateField<T> {
6278
readonly aggregateType: AggregateType;
@@ -270,13 +286,23 @@ export function collection<AppModelType, DbModelType extends DocumentData>(refer
270286
// @public
271287
export function collectionGroup(firestore: Firestore, collectionId: string): Query<DocumentData, DocumentData>;
272288

289+
// Warning: (ae-incompatible-release-tags) The symbol "collectionGroupP" is marked as @public, but its signature references "PipelineSource" which is marked as @beta
290+
//
291+
// @public (undocumented)
292+
export function collectionGroupP(pipelineSource: PipelineSource, collectionId: string): Pipeline;
293+
273294
// @beta (undocumented)
274295
export class CollectionGroupSource implements Stage {
275296
constructor(collectionId: string);
276297
// (undocumented)
277298
name: string;
278299
}
279300

301+
// Warning: (ae-incompatible-release-tags) The symbol "collectionP" is marked as @public, but its signature references "PipelineSource" which is marked as @beta
302+
//
303+
// @public (undocumented)
304+
export function collectionP(pipelineSource: PipelineSource, collectionPath: string): Pipeline;
305+
280306
// @public
281307
export class CollectionReference<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> extends Query<AppModelType, DbModelType> {
282308
get id(): string;
@@ -458,6 +484,11 @@ export function countExpression(value: Constant): Count;
458484
// @public
459485
export function countExpression(value: string): Count;
460486

487+
// Warning: (ae-incompatible-release-tags) The symbol "database" is marked as @public, but its signature references "PipelineSource" which is marked as @beta
488+
//
489+
// @public (undocumented)
490+
export function database(pipelineSource: PipelineSource): Pipeline;
491+
461492
// @beta (undocumented)
462493
export class DatabaseSource implements Stage {
463494
// (undocumented)
@@ -480,6 +511,11 @@ export class Distinct implements Stage {
480511
name: string;
481512
}
482513

514+
// Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta
515+
//
516+
// @public
517+
export function distinct<AppModelType>(pipeline: Pipeline<AppModelType>, ...groups: Array<string | Selectable>): Pipeline<AppModelType>;
518+
483519
// @beta (undocumented)
484520
export class Divide extends FirestoreFunction {
485521
constructor(left: Constant, right: Constant);
@@ -526,6 +562,11 @@ export class DocumentReference<AppModelType = DocumentData, DbModelType extends
526562
withConverter(converter: null): DocumentReference<DocumentData, DocumentData>;
527563
}
528564

565+
// Warning: (ae-incompatible-release-tags) The symbol "documents" is marked as @public, but its signature references "PipelineSource" which is marked as @beta
566+
//
567+
// @public (undocumented)
568+
export function documents(pipelineSource: PipelineSource, docs: DocumentReference[]): Pipeline;
569+
529570
// @public
530571
export class DocumentSnapshot<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> {
531572
protected constructor();
@@ -643,6 +684,11 @@ export function euclideanDistance(expr: Constant, other: VectorValue): Euclidean
643684
// @beta
644685
export function euclideanDistance(expr: Constant, other: Constant): EuclideanDistance;
645686

687+
// Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta
688+
//
689+
// @public
690+
export function execute<AppModelType>(pipeline: Pipeline<AppModelType>): Promise<Array<PipelineResult<AppModelType>>>;
691+
646692
// @beta (undocumented)
647693
export class Exists extends FirestoreFunction implements FilterCondition {
648694
constructor(expr: Constant);
@@ -1012,6 +1058,11 @@ export class FindNearest implements Stage {
10121058
name: string;
10131059
}
10141060

1061+
// Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta
1062+
//
1063+
// @public (undocumented)
1064+
export function findNearest<AppModelType>(pipeline: Pipeline<AppModelType>, options: FindNearestOptions): Pipeline<AppModelType>;
1065+
10151066
// @beta (undocumented)
10161067
export interface FindNearestOptions {
10171068
// (undocumented)
@@ -1029,10 +1080,6 @@ export interface FindNearestOptions {
10291080
// @public
10301081
export class Firestore {
10311082
get app(): FirebaseApp;
1032-
// Warning: (ae-incompatible-release-tags) The symbol "pipeline" is marked as @public, but its signature references "PipelineSource" which is marked as @beta
1033-
//
1034-
// (undocumented)
1035-
pipeline(): PipelineSource;
10361083
toJSON(): object;
10371084
type: 'firestore-lite' | 'firestore';
10381085
}
@@ -1166,6 +1213,9 @@ export class GenericStage implements Stage {
11661213
name: string;
11671214
}
11681215

1216+
// @public
1217+
export function genericStage<AppModelType>(pipeline: Pipeline<AppModelType>, name: string, params: any[]): Pipeline<AppModelType>;
1218+
11691219
// @public
11701220
export class GeoPoint {
11711221
constructor(latitude: number, longitude: number);
@@ -1322,6 +1372,9 @@ export class Limit implements Stage {
13221372
// @public
13231373
export function limit(limit: number): QueryLimitConstraint;
13241374

1375+
// @public
1376+
export function limitP<AppModelType>(pipeline: Pipeline<AppModelType>, limit: number): Pipeline<AppModelType>;
1377+
13251378
// @public
13261379
export function limitToLast(limit: number): QueryLimitConstraint;
13271380

@@ -1526,6 +1579,9 @@ export class Offset implements Stage {
15261579
name: string;
15271580
}
15281581

1582+
// @public
1583+
export function offset<AppModelType>(pipeline: Pipeline<AppModelType>, offset: number): Pipeline<AppModelType>;
1584+
15291585
// @beta (undocumented)
15301586
export class Or extends FirestoreFunction implements FilterCondition {
15311587
constructor(conditions: FilterExpr[]);
@@ -1557,36 +1613,6 @@ export type PartialWithFieldValue<T> = Partial<T> | (T extends Primitive ? T : T
15571613

15581614
// @public
15591615
export class Pipeline<AppModelType = DocumentData> {
1560-
// Warning: (ae-incompatible-release-tags) The symbol "addFields" is marked as @public, but its signature references "Selectable" which is marked as @beta
1561-
addFields(...fields: Selectable[]): Pipeline<AppModelType>;
1562-
// Warning: (ae-incompatible-release-tags) The symbol "aggregate" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta
1563-
aggregate(...accumulators: AccumulatorTarget[]): Pipeline<AppModelType>;
1564-
aggregate(options: {
1565-
accumulators: AccumulatorTarget[];
1566-
groups?: Array<string | Selectable>;
1567-
}): Pipeline<AppModelType>;
1568-
// Warning: (ae-incompatible-release-tags) The symbol "distinct" is marked as @public, but its signature references "Selectable" which is marked as @beta
1569-
distinct(...groups: Array<string | Selectable>): Pipeline<AppModelType>;
1570-
// Warning: (ae-incompatible-release-tags) The symbol "execute" is marked as @public, but its signature references "PipelineResult" which is marked as @beta
1571-
execute(): Promise<Array<PipelineResult<AppModelType>>>;
1572-
// Warning: (ae-incompatible-release-tags) The symbol "findNearest" is marked as @public, but its signature references "FindNearestOptions" which is marked as @beta
1573-
//
1574-
// (undocumented)
1575-
findNearest(options: FindNearestOptions): Pipeline<AppModelType>;
1576-
genericStage(name: string, params: any[]): Pipeline<AppModelType>;
1577-
limit(limit: number): Pipeline<AppModelType>;
1578-
offset(offset: number): Pipeline<AppModelType>;
1579-
// Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta
1580-
select(...selections: Array<Selectable | string>): Pipeline<AppModelType>;
1581-
// Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta
1582-
sort(...orderings: Ordering[]): Pipeline<AppModelType>;
1583-
// (undocumented)
1584-
sort(options: {
1585-
orderings: Ordering[];
1586-
}): Pipeline<AppModelType>;
1587-
// Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "FilterCondition" which is marked as @beta
1588-
// Warning: (ae-incompatible-release-tags) The symbol "where" is marked as @public, but its signature references "Constant" which is marked as @beta
1589-
where(condition: FilterCondition & Constant): Pipeline<AppModelType>;
15901616
}
15911617

15921618
// @public (undocumented)
@@ -1613,15 +1639,7 @@ export class PipelineResult<AppModelType = DocumentData> {
16131639

16141640
// @beta
16151641
export class PipelineSource {
1616-
// (undocumented)
1617-
collection(collectionPath: string): Pipeline;
1618-
// (undocumented)
1619-
collectionGroup(collectionId: string): Pipeline;
1620-
// (undocumented)
1621-
database(): Pipeline;
1622-
// (undocumented)
1623-
documents(docs: DocumentReference[]): Pipeline;
1624-
}
1642+
}
16251643

16261644
// @public
16271645
export type Primitive = string | number | boolean | undefined | null;
@@ -1794,6 +1812,11 @@ export class Select implements Stage {
17941812
name: string;
17951813
}
17961814

1815+
// Warning: (ae-incompatible-release-tags) The symbol "select" is marked as @public, but its signature references "Selectable" which is marked as @beta
1816+
//
1817+
// @public
1818+
export function select<AppModelType>(pipeline: Pipeline<AppModelType>, ...selections: Array<Selectable | string>): Pipeline<AppModelType>;
1819+
17971820
// @beta
17981821
export interface Selectable {
17991822
// (undocumented)
@@ -1839,6 +1862,16 @@ export class Sort implements Stage {
18391862
name: string;
18401863
}
18411864

1865+
// Warning: (ae-incompatible-release-tags) The symbol "sort" is marked as @public, but its signature references "Ordering" which is marked as @beta
1866+
//
1867+
// @public
1868+
export function sort<AppModelType>(pipeline: Pipeline<AppModelType>, ...orderings: Ordering[]): Pipeline<AppModelType>;
1869+
1870+
// @public (undocumented)
1871+
export function sort<AppModelType>(pipeline: Pipeline<AppModelType>, options: {
1872+
orderings: Ordering[];
1873+
}): Pipeline<AppModelType>;
1874+
18421875
// @beta (undocumented)
18431876
export interface Stage {
18441877
// (undocumented)
@@ -2153,6 +2186,12 @@ export function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value
21532186
// @public
21542187
export type WhereFilterOp = '<' | '<=' | '==' | '!=' | '>=' | '>' | 'array-contains' | 'in' | 'array-contains-any' | 'not-in';
21552188

2189+
// Warning: (ae-incompatible-release-tags) The symbol "whereP" is marked as @public, but its signature references "FilterCondition" which is marked as @beta
2190+
// Warning: (ae-incompatible-release-tags) The symbol "whereP" is marked as @public, but its signature references "Constant" which is marked as @beta
2191+
//
2192+
// @public
2193+
export function whereP<AppModelType>(pipeline: Pipeline<AppModelType>, condition: FilterCondition & Constant): Pipeline<AppModelType>;
2194+
21562195
// @public
21572196
export type WithFieldValue<T> = T | (T extends Primitive ? T : T extends {} ? {
21582197
[K in keyof T]: WithFieldValue<T[K]> | FieldValue;
@@ -2184,8 +2223,8 @@ export function xor(left: FilterExpr, ...right: FilterExpr[]): Xor;
21842223

21852224
// Warnings were encountered during analysis:
21862225
//
2187-
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9257:9 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta
2188-
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9258:9 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta
2189-
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:9287:9 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta
2226+
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:220:5 - (ae-incompatible-release-tags) The symbol "accumulators" is marked as @public, but its signature references "AccumulatorTarget" which is marked as @beta
2227+
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:221:5 - (ae-incompatible-release-tags) The symbol "groups" is marked as @public, but its signature references "Selectable" which is marked as @beta
2228+
// /Users/markduckworth/projects/firebase-js-sdk/packages/firestore/dist/lite/index.d.ts:10070:5 - (ae-incompatible-release-tags) The symbol "orderings" is marked as @public, but its signature references "Ordering" which is marked as @beta
21902229

21912230
```

0 commit comments

Comments
 (0)