@@ -39,14 +39,10 @@ import type {
3939import type { FieldPath } from './FieldPath' ;
4040
4141/**
42- * An `AppliableConstraint` is an abstraction of a constraint that can be applied
43- * to a Firestore query .
42+ * Abstraction of a constraint that can be applied to a Firestore query.
43+ * Not exported — public API matches firebase-js-sdk ({ @link QueryConstraint} only) .
4444 */
45- export abstract class AppliableConstraint {
46- /**
47- * Takes the provided {@link Query} and returns a copy of the {@link Query} with this
48- * {@link AppliableConstraint} applied.
49- */
45+ abstract class AppliableConstraint {
5046 abstract _apply < AppModelType = DocumentData , DbModelType extends DocumentData = DocumentData > (
5147 query : Query < AppModelType , DbModelType > ,
5248 ) : Query < AppModelType , DbModelType > ;
@@ -58,38 +54,21 @@ export abstract class AppliableConstraint {
5854 * {@link orderBy}, {@link startAt}, {@link startAfter}, {@link endBefore},
5955 * {@link endAt}, {@link limit}, {@link limitToLast} and can then be passed to
6056 * {@link query} to create a new query instance that also contains this `QueryConstraint`.
61- *
62- * @remarks
63- * Matches Firebase JS SDK API. We use QueryConstraintBase for shared implementation
64- * because Query objects are native module wrappers that expose methods matching
65- * constraint types (orderBy, limit, etc.), allowing dynamic dispatch via `query[type]()`.
6657 */
6758export abstract class QueryConstraint extends AppliableConstraint {
68- /** The type of this query constraint */
6959 abstract readonly type : QueryConstraintType ;
7060
71- /**
72- * Takes the provided {@link Query} and returns a copy of the {@link Query} with this
73- * {@link QueryConstraint} applied.
74- */
7561 _apply < AppModelType = DocumentData , DbModelType extends DocumentData = DocumentData > (
7662 _queryRef : Query < AppModelType , DbModelType > ,
7763 ) : Query < AppModelType , DbModelType > {
78- // This method is implemented in subclasses (QueryConstraintBase provides the default implementation)
79- // Making it non-abstract ensures it appears in .d.ts so subclasses inherit it
8064 throw new Error ( '_apply must be implemented by subclass' ) ;
8165 }
8266}
8367
8468/**
85- * Base implementation for orderBy/limit/startAt/endAt/where constraints.
86- *
87- * @remarks
88- * Differs from JS SDK (where each constraint implements its own _apply) because
89- * our Query objects are native wrappers. All constraints use the same pattern:
90- * `query[this.type](...args)`, so we share implementation via this base class.
69+ * Shared _apply for orderBy/limit/startAt/endAt/where. Not exported — implementation detail.
9170 */
92- export abstract class QueryConstraintBase extends QueryConstraint {
71+ abstract class QueryConstraintBase extends QueryConstraint {
9372 abstract readonly type : QueryConstraintType ;
9473 private readonly _args : unknown [ ] ;
9574
0 commit comments