@spine-event-engine/core 2.0.0-snapshot.2 → 2.0.0-snapshot.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -8
- package/REFERENCE.md +31 -3
- package/dist/codegen/index.d.ts +10 -0
- package/dist/codegen/index.d.ts.map +1 -0
- package/dist/codegen/index.js +20 -0
- package/dist/codegen/index.js.map +1 -0
- package/dist/entity/entity-column.d.ts +158 -0
- package/dist/entity/entity-column.d.ts.map +1 -0
- package/dist/entity/entity-column.js +303 -0
- package/dist/entity/entity-column.js.map +1 -0
- package/dist/index.d.ts +84 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +331 -7
- package/dist/index.js.map +1 -1
- package/dist/internal/subscription-lifecycle.d.ts +0 -1
- package/dist/internal/subscription-lifecycle.d.ts.map +1 -1
- package/dist/internal/subscription-lifecycle.js +0 -1
- package/dist/internal/subscription-lifecycle.js.map +1 -1
- package/dist/query/entity-field-classification.d.ts +20 -0
- package/dist/query/entity-field-classification.d.ts.map +1 -0
- package/dist/query/entity-field-classification.js +62 -0
- package/dist/query/entity-field-classification.js.map +1 -0
- package/dist/query/entity-query.d.ts +405 -0
- package/dist/query/entity-query.d.ts.map +1 -0
- package/dist/query/entity-query.js +841 -0
- package/dist/query/entity-query.js.map +1 -0
- package/dist/query/generated-entity-query.d.ts +197 -0
- package/dist/query/generated-entity-query.d.ts.map +1 -0
- package/dist/query/generated-entity-query.js +202 -0
- package/dist/query/generated-entity-query.js.map +1 -0
- package/dist/spi/entity-query-plan.d.ts +7 -0
- package/dist/spi/entity-query-plan.d.ts.map +1 -0
- package/dist/spi/entity-query-plan.js +15 -0
- package/dist/spi/entity-query-plan.js.map +1 -0
- package/dist/spi/subscription-lifecycle.d.ts +5 -0
- package/dist/spi/subscription-lifecycle.d.ts.map +1 -0
- package/dist/spi/subscription-lifecycle.js +18 -0
- package/dist/spi/subscription-lifecycle.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -7
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import { type Message, type MessageShape } from "@bufbuild/protobuf";
|
|
2
|
+
import type { GenMessage } from "@bufbuild/protobuf/codegenv2";
|
|
3
|
+
import { type ActorContext } from "@spine-event-engine/proto";
|
|
4
|
+
import { type Query } from "@spine-event-engine/proto/client";
|
|
5
|
+
import { EntityColumn, type EntityColumnOperator, type EntityColumnValue } from "../entity/entity-column.js";
|
|
6
|
+
/**
|
|
7
|
+
* Registered Entity columns available to a query for one state schema.
|
|
8
|
+
*
|
|
9
|
+
* @typeParam Schema Generated state schema that declares the columns.
|
|
10
|
+
*/
|
|
11
|
+
export type EntityColumnCollection<Schema extends GenMessage<Message>> = Readonly<Record<string, EntityColumn<Schema>>>;
|
|
12
|
+
/**
|
|
13
|
+
* Extracts the column type used by a query predicate.
|
|
14
|
+
*
|
|
15
|
+
* @typeParam Predicate Predicate whose column type is extracted.
|
|
16
|
+
*/
|
|
17
|
+
export type PredicateColumn<Predicate> = Predicate extends EntityPredicate<infer Column> ? Column : never;
|
|
18
|
+
/**
|
|
19
|
+
* Extracts the state schema that declares an Entity column.
|
|
20
|
+
*
|
|
21
|
+
* @typeParam Column Column whose state schema is extracted.
|
|
22
|
+
*/
|
|
23
|
+
export type ColumnSchema<Column> = Column extends EntityColumn<infer Schema> ? Schema : never;
|
|
24
|
+
/**
|
|
25
|
+
* Extracts the generated field name declared by an Entity column.
|
|
26
|
+
*
|
|
27
|
+
* @typeParam Column Column whose field name is extracted.
|
|
28
|
+
*/
|
|
29
|
+
export type ColumnName<Column> = Column extends EntityColumn<GenMessage<Message>, infer Name> ? Name : never;
|
|
30
|
+
/**
|
|
31
|
+
* Extracts the identifier value declared by an Entity state schema.
|
|
32
|
+
*
|
|
33
|
+
* @typeParam Schema Generated state schema with an ID field.
|
|
34
|
+
*/
|
|
35
|
+
export type EntityQueryIdentifier<Schema extends GenMessage<Message>> = MessageShape<Schema> extends {
|
|
36
|
+
readonly id: infer Identifier;
|
|
37
|
+
} ? Identifier : never;
|
|
38
|
+
/**
|
|
39
|
+
* A predicate whose columns belong to one query schema and registered column collection.
|
|
40
|
+
*
|
|
41
|
+
* @typeParam Schema Generated state schema selected by the query.
|
|
42
|
+
* @typeParam Columns Registered columns for that state schema.
|
|
43
|
+
* @typeParam Predicate Predicate checked against the registered columns.
|
|
44
|
+
*/
|
|
45
|
+
export type EntityQueryPredicateFor<Schema extends GenMessage<Message>, Columns extends EntityColumnCollection<Schema>, Predicate extends EntityPredicate> = ColumnSchema<PredicateColumn<Predicate>> extends Schema ? ColumnName<PredicateColumn<Predicate>> extends keyof Columns ? Predicate : never : never;
|
|
46
|
+
/**
|
|
47
|
+
* Represents one typed leaf comparison in an Entity query predicate.
|
|
48
|
+
*
|
|
49
|
+
* @typeParam Column Column compared by this predicate.
|
|
50
|
+
*/
|
|
51
|
+
export interface EntityComparisonPredicate<Column extends EntityColumn = EntityColumn> {
|
|
52
|
+
/**
|
|
53
|
+
* Identifies this predicate as a leaf comparison.
|
|
54
|
+
*/
|
|
55
|
+
readonly kind: "comparison";
|
|
56
|
+
/**
|
|
57
|
+
* Identifies the column compared by this predicate.
|
|
58
|
+
*/
|
|
59
|
+
readonly column: Column;
|
|
60
|
+
/**
|
|
61
|
+
* Identifies the comparison operator applied to the column.
|
|
62
|
+
*/
|
|
63
|
+
readonly operator: EntityColumnOperator<Column>;
|
|
64
|
+
/**
|
|
65
|
+
* Stores the value compared with the column.
|
|
66
|
+
*/
|
|
67
|
+
readonly value: Exclude<EntityColumnValue<Column>, undefined>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Represents a nested conjunction or disjunction in an Entity query predicate.
|
|
71
|
+
*
|
|
72
|
+
* @typeParam Column Column type accepted by nested predicates.
|
|
73
|
+
*/
|
|
74
|
+
export interface EntityGroup<Column extends EntityColumn = EntityColumn> {
|
|
75
|
+
/**
|
|
76
|
+
* Identifies the logical operation that combines the predicates.
|
|
77
|
+
*/
|
|
78
|
+
readonly kind: "all" | "either";
|
|
79
|
+
/**
|
|
80
|
+
* Lists the predicates combined by this group.
|
|
81
|
+
*/
|
|
82
|
+
readonly predicates: readonly EntityPredicate<Column>[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Represents a typed predicate accepted by the Entity query builder.
|
|
86
|
+
*
|
|
87
|
+
* @typeParam Column Column type accepted by the comparison or group.
|
|
88
|
+
*/
|
|
89
|
+
export type EntityPredicate<Column extends EntityColumn = EntityColumn> = EntityComparisonPredicate<Column> | EntityGroup<Column>;
|
|
90
|
+
/**
|
|
91
|
+
* Storage-neutral form of a descriptor-backed Entity query.
|
|
92
|
+
*
|
|
93
|
+
* Server-side callers use this plan to execute the same typed DSL without a
|
|
94
|
+
* dependency on a client transport package.
|
|
95
|
+
*/
|
|
96
|
+
export interface EntityQueryPlan {
|
|
97
|
+
/**
|
|
98
|
+
* Optional filter that selects the states to read.
|
|
99
|
+
*/
|
|
100
|
+
readonly predicate?: EntityQueryPlanPredicate;
|
|
101
|
+
/**
|
|
102
|
+
* Optional ordered columns used to arrange matching states.
|
|
103
|
+
*/
|
|
104
|
+
readonly order?: readonly {
|
|
105
|
+
readonly column: string;
|
|
106
|
+
readonly direction: "asc" | "desc";
|
|
107
|
+
}[];
|
|
108
|
+
/**
|
|
109
|
+
* Optional maximum number of states returned by the read.
|
|
110
|
+
*/
|
|
111
|
+
readonly limit?: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* A storage-neutral Entity query predicate.
|
|
115
|
+
*/
|
|
116
|
+
export type EntityQueryPlanPredicate = {
|
|
117
|
+
/**
|
|
118
|
+
* Identifies this predicate as an ID filter.
|
|
119
|
+
*/
|
|
120
|
+
readonly kind: "ids";
|
|
121
|
+
/**
|
|
122
|
+
* Lists the IDs accepted by this filter.
|
|
123
|
+
*/
|
|
124
|
+
readonly ids: readonly unknown[];
|
|
125
|
+
} | {
|
|
126
|
+
/**
|
|
127
|
+
* Identifies this predicate as a leaf comparison.
|
|
128
|
+
*/
|
|
129
|
+
readonly kind: "comparison";
|
|
130
|
+
/**
|
|
131
|
+
* Names the state column compared by this predicate.
|
|
132
|
+
*/
|
|
133
|
+
readonly column: string;
|
|
134
|
+
/**
|
|
135
|
+
* Selects the comparison performed on the column.
|
|
136
|
+
*/
|
|
137
|
+
readonly operator: EntityColumnOperator<EntityColumn>;
|
|
138
|
+
/**
|
|
139
|
+
* Supplies the value compared with the column.
|
|
140
|
+
*/
|
|
141
|
+
readonly value: unknown;
|
|
142
|
+
} | {
|
|
143
|
+
/**
|
|
144
|
+
* Identifies the logical operation that combines nested predicates.
|
|
145
|
+
*/
|
|
146
|
+
readonly kind: "all" | "either";
|
|
147
|
+
/**
|
|
148
|
+
* Lists the predicates combined by this operation.
|
|
149
|
+
*/
|
|
150
|
+
readonly predicates: readonly EntityQueryPlanPredicate[];
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Builds a typed Entity query for the frozen Spine wire contract.
|
|
154
|
+
*
|
|
155
|
+
* @typeParam Schema Generated Entity state schema selected by the query.
|
|
156
|
+
* @typeParam Columns Registered columns for that state schema.
|
|
157
|
+
*/
|
|
158
|
+
export declare class EntityQueryBuilder<Schema extends GenMessage<Message>, Columns extends EntityColumnCollection<Schema>> {
|
|
159
|
+
#private;
|
|
160
|
+
/**
|
|
161
|
+
* Creates a builder for one Entity query.
|
|
162
|
+
*
|
|
163
|
+
* @param input Schema, registered columns, and actor context for the query.
|
|
164
|
+
*/
|
|
165
|
+
constructor(input: {
|
|
166
|
+
readonly schema: Schema;
|
|
167
|
+
readonly columns: Columns;
|
|
168
|
+
readonly context: ActorContext;
|
|
169
|
+
});
|
|
170
|
+
/**
|
|
171
|
+
* Adds Entity IDs to the query target.
|
|
172
|
+
*
|
|
173
|
+
* @param ids Entity IDs to include.
|
|
174
|
+
* @returns This builder.
|
|
175
|
+
*/
|
|
176
|
+
byId(...ids: readonly EntityQueryIdentifier<Schema>[]): this;
|
|
177
|
+
/**
|
|
178
|
+
* Adds a typed predicate. Repeated calls are combined with `ALL`.
|
|
179
|
+
*
|
|
180
|
+
* @typeParam Predicate Predicate type checked against the registered columns.
|
|
181
|
+
* @param predicate Predicate owned by this builder's registered columns.
|
|
182
|
+
* @returns This builder.
|
|
183
|
+
*/
|
|
184
|
+
where<Predicate extends EntityPredicate>(predicate: EntityQueryPredicateFor<Schema, Columns, Predicate>): this;
|
|
185
|
+
/**
|
|
186
|
+
* Adds one ordering clause in caller order.
|
|
187
|
+
*
|
|
188
|
+
* @typeParam Column Registered ordered column type.
|
|
189
|
+
* @param column Ordered column owned by this builder's Entity schema.
|
|
190
|
+
* @param direction Sort direction, ascending by default.
|
|
191
|
+
* @returns This builder.
|
|
192
|
+
*/
|
|
193
|
+
orderBy<Column extends Columns[keyof Columns]>(column: "greaterThan" extends EntityColumnOperator<Column> ? Column : never, direction?: "asc" | "desc"): this;
|
|
194
|
+
/**
|
|
195
|
+
* Sets a positive result limit that requires ordering.
|
|
196
|
+
*
|
|
197
|
+
* @param value Positive maximum number of returned entities.
|
|
198
|
+
* @returns This builder.
|
|
199
|
+
*/
|
|
200
|
+
limit(value: number): this;
|
|
201
|
+
/**
|
|
202
|
+
* Builds the `spine.client.Query` message.
|
|
203
|
+
*
|
|
204
|
+
* @returns The wire query message.
|
|
205
|
+
*/
|
|
206
|
+
build(): Query;
|
|
207
|
+
/**
|
|
208
|
+
* Builds the storage-neutral execution plan for this typed query.
|
|
209
|
+
*
|
|
210
|
+
* @returns An immutable plan equivalent to {@link build}'s wire query.
|
|
211
|
+
*/
|
|
212
|
+
buildPlan(): EntityQueryPlan;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Context-free Entity query that can be executed by different actor and tenant scopes.
|
|
216
|
+
*
|
|
217
|
+
* @typeParam Schema Generated state schema selected by this query.
|
|
218
|
+
* @typeParam Id Identifier type declared by the state's first field.
|
|
219
|
+
*/
|
|
220
|
+
export declare class EntityQueryDescription<Schema extends GenMessage<Message>, Id> {
|
|
221
|
+
#private;
|
|
222
|
+
private readonly schemaType;
|
|
223
|
+
private readonly idType;
|
|
224
|
+
/**
|
|
225
|
+
* Captures the compiled wire query and storage plan without execution context.
|
|
226
|
+
*
|
|
227
|
+
* @param schema Generated state schema selected by the query.
|
|
228
|
+
* @param wire Compiled wire query without actor context or request ID.
|
|
229
|
+
* @param plan Compiled storage-neutral query plan.
|
|
230
|
+
*/
|
|
231
|
+
constructor(schema: Schema, wire: Query, plan: EntityQueryPlan);
|
|
232
|
+
/**
|
|
233
|
+
* Returns the generated state schema selected by this query.
|
|
234
|
+
*
|
|
235
|
+
* @returns Generated state schema.
|
|
236
|
+
*/
|
|
237
|
+
get schema(): Schema;
|
|
238
|
+
/**
|
|
239
|
+
* Creates a fresh wire query without an actor or tenant context.
|
|
240
|
+
*
|
|
241
|
+
* @returns Wire query with a new request ID.
|
|
242
|
+
*/
|
|
243
|
+
build(): Query;
|
|
244
|
+
/**
|
|
245
|
+
* Returns a detached storage-neutral plan for local execution.
|
|
246
|
+
*
|
|
247
|
+
* @returns Independent copy of the compiled plan.
|
|
248
|
+
*/
|
|
249
|
+
buildPlan(): EntityQueryPlan;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Builds an Entity query without selecting an actor or tenant.
|
|
253
|
+
*
|
|
254
|
+
* @typeParam Schema Generated Entity state schema.
|
|
255
|
+
* @typeParam Columns Registered columns for that schema.
|
|
256
|
+
* @typeParam Name Local name of the canonical first identifier field.
|
|
257
|
+
*/
|
|
258
|
+
export declare class EntityQueryDraft<Schema extends GenMessage<Message>, Columns extends EntityColumnCollection<Schema>, Name extends keyof MessageShape<Schema> & string> {
|
|
259
|
+
#private;
|
|
260
|
+
/**
|
|
261
|
+
* Creates a context-free draft for one registered Entity state.
|
|
262
|
+
*
|
|
263
|
+
* @param input State schema, columns, and canonical identifier field name.
|
|
264
|
+
*/
|
|
265
|
+
constructor(input: {
|
|
266
|
+
readonly schema: Schema;
|
|
267
|
+
readonly columns: Columns;
|
|
268
|
+
readonly idField: Name;
|
|
269
|
+
});
|
|
270
|
+
/**
|
|
271
|
+
* Adds typed identifiers to the query target.
|
|
272
|
+
*
|
|
273
|
+
* @param ids Identifier values declared by the first state field.
|
|
274
|
+
* @returns This draft.
|
|
275
|
+
*/
|
|
276
|
+
byId(...ids: readonly Exclude<MessageShape<Schema>[Name], undefined>[]): this;
|
|
277
|
+
/**
|
|
278
|
+
* Adds a typed comparison or group predicate.
|
|
279
|
+
*
|
|
280
|
+
* @typeParam Predicate Predicate checked against the registered columns.
|
|
281
|
+
* @param predicate Predicate to append with conjunction.
|
|
282
|
+
* @returns This draft.
|
|
283
|
+
*/
|
|
284
|
+
where<Predicate extends EntityPredicate>(predicate: EntityQueryPredicateFor<Schema, Columns, Predicate>): this;
|
|
285
|
+
/**
|
|
286
|
+
* Adds ordering by a registered ordered column.
|
|
287
|
+
*
|
|
288
|
+
* @typeParam Column Registered ordered column type.
|
|
289
|
+
* @param column Ordered column.
|
|
290
|
+
* @param direction Ascending or descending direction.
|
|
291
|
+
* @returns This draft.
|
|
292
|
+
*/
|
|
293
|
+
orderBy<Column extends Columns[keyof Columns]>(column: "greaterThan" extends EntityColumnOperator<Column> ? Column : never, direction?: "asc" | "desc"): this;
|
|
294
|
+
/**
|
|
295
|
+
* Sets a positive result limit that requires ordering.
|
|
296
|
+
*
|
|
297
|
+
* @param value Maximum number of matching states.
|
|
298
|
+
* @returns This draft.
|
|
299
|
+
*/
|
|
300
|
+
limit(value: number): this;
|
|
301
|
+
/**
|
|
302
|
+
* Builds an independent query description for later execution.
|
|
303
|
+
*
|
|
304
|
+
* @returns Context-free query value with detached wire and plan copies.
|
|
305
|
+
*/
|
|
306
|
+
build(): EntityQueryDescription<Schema, Exclude<MessageShape<Schema>[Name], undefined>>;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Creates typed predicates and builders for Entity queries.
|
|
310
|
+
*/
|
|
311
|
+
export declare const EntityQuery: Readonly<{
|
|
312
|
+
/**
|
|
313
|
+
* Creates an equality predicate for a descriptor-backed Entity column.
|
|
314
|
+
*
|
|
315
|
+
* @typeParam Column Column type used by the comparison.
|
|
316
|
+
* @param column Column to compare.
|
|
317
|
+
* @param value Value to match.
|
|
318
|
+
* @returns Immutable equality predicate.
|
|
319
|
+
*/
|
|
320
|
+
eq<Column extends EntityColumn>(column: Column, value: Exclude<EntityColumnValue<Column>, undefined>): EntityComparisonPredicate<Column>;
|
|
321
|
+
/**
|
|
322
|
+
* Creates a greater-than predicate for an ordered Entity column.
|
|
323
|
+
*
|
|
324
|
+
* @typeParam Column Ordered column type used by the comparison.
|
|
325
|
+
* @param column Ordered column to compare.
|
|
326
|
+
* @param value Lower exclusive bound.
|
|
327
|
+
* @returns Immutable greater-than predicate.
|
|
328
|
+
*/
|
|
329
|
+
gt<Column extends EntityColumn>(column: "greaterThan" extends EntityColumnOperator<Column> ? Column : never, value: Exclude<EntityColumnValue<Column>, undefined>): EntityComparisonPredicate<Column>;
|
|
330
|
+
/**
|
|
331
|
+
* Creates a less-than predicate for an ordered Entity column.
|
|
332
|
+
*
|
|
333
|
+
* @typeParam Column Ordered column type used by the comparison.
|
|
334
|
+
* @param column Ordered column to compare.
|
|
335
|
+
* @param value Upper exclusive bound.
|
|
336
|
+
* @returns Immutable less-than predicate.
|
|
337
|
+
*/
|
|
338
|
+
lt<Column extends EntityColumn>(column: "lessThan" extends EntityColumnOperator<Column> ? Column : never, value: Exclude<EntityColumnValue<Column>, undefined>): EntityComparisonPredicate<Column>;
|
|
339
|
+
/**
|
|
340
|
+
* Creates a greater-than-or-equal predicate for an ordered Entity column.
|
|
341
|
+
*
|
|
342
|
+
* @typeParam Column Ordered column type used by the comparison.
|
|
343
|
+
* @param column Ordered column to compare.
|
|
344
|
+
* @param value Lower inclusive bound.
|
|
345
|
+
* @returns Immutable inclusive lower-bound predicate.
|
|
346
|
+
*/
|
|
347
|
+
ge<Column extends EntityColumn>(column: "greaterOrEqual" extends EntityColumnOperator<Column> ? Column : never, value: Exclude<EntityColumnValue<Column>, undefined>): EntityComparisonPredicate<Column>;
|
|
348
|
+
/**
|
|
349
|
+
* Creates a less-than-or-equal predicate for an ordered Entity column.
|
|
350
|
+
*
|
|
351
|
+
* @typeParam Column Ordered column type used by the comparison.
|
|
352
|
+
* @param column Ordered column to compare.
|
|
353
|
+
* @param value Upper inclusive bound.
|
|
354
|
+
* @returns Immutable inclusive upper-bound predicate.
|
|
355
|
+
*/
|
|
356
|
+
le<Column extends EntityColumn>(column: "lessOrEqual" extends EntityColumnOperator<Column> ? Column : never, value: Exclude<EntityColumnValue<Column>, undefined>): EntityComparisonPredicate<Column>;
|
|
357
|
+
/**
|
|
358
|
+
* Combines predicates conjunctively.
|
|
359
|
+
*
|
|
360
|
+
* @typeParam First Type of the required first predicate.
|
|
361
|
+
* @typeParam Rest Tuple of additional predicate types.
|
|
362
|
+
* @param first First predicate in the group.
|
|
363
|
+
* @param rest Remaining predicates in the group.
|
|
364
|
+
* @returns Immutable conjunction predicate.
|
|
365
|
+
*/
|
|
366
|
+
all<First extends EntityPredicate, Rest extends readonly EntityPredicate[]>(first: First, ...rest: Rest): EntityGroup<PredicateColumn<First | Rest[number]>>;
|
|
367
|
+
/**
|
|
368
|
+
* Combines predicates disjunctively.
|
|
369
|
+
*
|
|
370
|
+
* @typeParam First Type of the required first predicate.
|
|
371
|
+
* @typeParam Rest Tuple of additional predicate types.
|
|
372
|
+
* @param first First predicate in the group.
|
|
373
|
+
* @param rest Remaining predicates in the group.
|
|
374
|
+
* @returns Immutable disjunction predicate.
|
|
375
|
+
*/
|
|
376
|
+
either<First extends EntityPredicate, Rest extends readonly EntityPredicate[]>(first: First, ...rest: Rest): EntityGroup<PredicateColumn<First | Rest[number]>>;
|
|
377
|
+
/**
|
|
378
|
+
* Creates a builder for one Entity schema.
|
|
379
|
+
*
|
|
380
|
+
* @typeParam Schema Generated state schema selected by the builder.
|
|
381
|
+
* @typeParam Columns Registered columns for that state schema.
|
|
382
|
+
* @param input Schema, registered columns, and actor context for the query.
|
|
383
|
+
* @returns A mutable query builder.
|
|
384
|
+
*/
|
|
385
|
+
select<Schema extends GenMessage<Message>, Columns extends EntityColumnCollection<Schema>>(input: {
|
|
386
|
+
readonly schema: Schema;
|
|
387
|
+
readonly columns: Columns;
|
|
388
|
+
readonly context: ActorContext;
|
|
389
|
+
}): EntityQueryBuilder<Schema, Columns>;
|
|
390
|
+
/**
|
|
391
|
+
* Creates a context-free query draft for a state and its registered columns.
|
|
392
|
+
*
|
|
393
|
+
* @typeParam Schema Generated Entity state schema.
|
|
394
|
+
* @typeParam Columns Registered columns for that schema.
|
|
395
|
+
* @typeParam Name Local name of the state's first identifier field.
|
|
396
|
+
* @param input State schema, columns, and canonical identifier field name.
|
|
397
|
+
* @returns New context-free query draft.
|
|
398
|
+
*/
|
|
399
|
+
describe<Schema extends GenMessage<Message>, Columns extends EntityColumnCollection<Schema>, Name extends keyof MessageShape<Schema> & string>(input: {
|
|
400
|
+
readonly schema: Schema;
|
|
401
|
+
readonly columns: Columns;
|
|
402
|
+
readonly idField: Name;
|
|
403
|
+
}): EntityQueryDraft<Schema, Columns, Name>;
|
|
404
|
+
}>;
|
|
405
|
+
//# sourceMappingURL=entity-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-query.d.ts","sourceRoot":"","sources":["../../src/query/entity-query.ts"],"names":[],"mappings":"AAcA,OAAO,EAQL,KAAK,OAAO,EACZ,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAa/D,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAcL,KAAK,KAAK,EACX,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,YAAY,EACZ,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACvB,MAA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