@aiao/rxdb-test 0.0.15 → 0.0.17

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.
Files changed (50) hide show
  1. package/README.md +30 -1
  2. package/dist/entities/FileLarge.d.ts +339 -0
  3. package/dist/entities/FileLarge.js +77 -0
  4. package/dist/entities/FileNode.d.ts +335 -0
  5. package/dist/entities/FileNode.js +77 -0
  6. package/dist/entities/MenuLarge.d.ts +294 -0
  7. package/dist/entities/MenuLarge.js +41 -0
  8. package/dist/entities/MenuSimple.d.ts +290 -0
  9. package/dist/entities/MenuSimple.js +41 -0
  10. package/dist/entities/Todo.d.ts +165 -0
  11. package/dist/entities/Todo.js +34 -0
  12. package/dist/entities/TypeDemo.d.ts +289 -0
  13. package/dist/entities/TypeDemo.js +137 -0
  14. package/dist/entities/index.d.ts +14 -1655
  15. package/dist/entities/index.js +6 -360
  16. package/dist/graph/index.d.ts +1 -2
  17. package/dist/graph/index.js +1 -1
  18. package/dist/shop/Attribute.d.ts +992 -0
  19. package/dist/shop/Attribute.js +50 -0
  20. package/dist/shop/AttributeValue.d.ts +999 -0
  21. package/dist/shop/AttributeValue.js +51 -0
  22. package/dist/shop/Category.d.ts +772 -0
  23. package/dist/shop/Category.js +52 -0
  24. package/dist/shop/IdCard.d.ts +647 -0
  25. package/dist/shop/IdCard.js +43 -0
  26. package/dist/shop/Order.d.ts +690 -0
  27. package/dist/shop/Order.js +66 -0
  28. package/dist/shop/OrderItem.d.ts +665 -0
  29. package/dist/shop/OrderItem.js +76 -0
  30. package/dist/shop/Product.d.ts +761 -0
  31. package/dist/shop/Product.js +58 -0
  32. package/dist/shop/SKU.d.ts +634 -0
  33. package/dist/shop/SKU.js +74 -0
  34. package/dist/shop/SKUAttributes.d.ts +625 -0
  35. package/dist/shop/SKUAttributes.js +56 -0
  36. package/dist/shop/User.d.ts +679 -0
  37. package/dist/shop/User.js +74 -0
  38. package/dist/shop/index.d.ts +52 -2990
  39. package/dist/shop/index.js +10 -528
  40. package/dist/system/RxDBBranch.d.ts +396 -0
  41. package/dist/system/RxDBBranch.js +106 -0
  42. package/dist/system/RxDBChange.d.ts +361 -0
  43. package/dist/system/RxDBChange.js +123 -0
  44. package/dist/system/RxDBMigration.d.ts +167 -0
  45. package/dist/system/RxDBMigration.js +40 -0
  46. package/dist/system/RxDBSync.d.ts +339 -0
  47. package/dist/system/RxDBSync.js +122 -0
  48. package/dist/system/index.d.ts +9 -1240
  49. package/dist/system/index.js +4 -384
  50. package/package.json +3 -3
@@ -1,386 +1,13 @@
1
- import { BooleanRules, CountOptions, DateRules, ENTITY_STATIC_TYPES, EntityType, FindAllOptions, FindByCursorOptions, FindOneOptions, FindOneOrFailOptions, FindOptions, FindTreeOptions, IEntity, ITreeEntity, NumberRules, RelationBooleanRules, RelationDateRules, RelationEntitiesObservable, RelationEntityObservable, RelationExistsRules, RelationNumberRules, RelationStringRules, RelationUUIDRules, RuleGroupBase, StringRules, UUID, UUIDRules } from '@aiao/rxdb';
2
- import { Observable } from 'rxjs';
1
+ import { RxDBBranch } from './RxDBBranch.js';
2
+ import { RxDBChange } from './RxDBChange.js';
3
+ import { RxDBMigration } from './RxDBMigration.js';
4
+ import { RxDBSync } from './RxDBSync.js';
5
+ import { EntityType } from '@aiao/rxdb';
3
6
 
4
- /**
5
- * rule
6
- */
7
- declare type RxDBSyncRule = StringRules<RxDBSync, 'id'>
8
- | StringRules<RxDBSync, 'namespace'>
9
- | StringRules<RxDBSync, 'entity'>
10
- | StringRules<RxDBSync, 'syncType'>
11
- | NumberRules<RxDBSync, 'lastPushedChangeId'>
12
- | DateRules<RxDBSync, 'lastPushedAt'>
13
- | DateRules<RxDBSync, 'lastPulledAt'>
14
- | NumberRules<RxDBSync, 'lastPullRemoteChangeId'>
15
- | BooleanRules<RxDBSync, 'enabled'>
16
- | DateRules<RxDBSync, 'createdAt'>
17
- | DateRules<RxDBSync, 'updatedAt'>
18
- | StringRules<RxDBSync, 'branchId'>
19
- | RelationExistsRules<'branch', RxDBBranchRuleGroup>
20
- | RelationStringRules<'branch.id', string>
21
- | RelationBooleanRules<'branch.activated', boolean>
22
- | RelationNumberRules<'branch.fromChangeId', number | null>
23
- | RelationBooleanRules<'branch.local', boolean>
24
- | RelationBooleanRules<'branch.remote', boolean>
25
- | RelationDateRules<'branch.createdAt', Date | null>
26
- | RelationDateRules<'branch.updatedAt', Date | null>
27
- | StringRules<RxDBBranch, 'parentId'>
28
- | RelationNumberRules<'branch.changes.id', number>
29
- | RelationNumberRules<'branch.changes.remoteId', number | null>
30
- | RelationStringRules<'branch.changes.type', string>
31
- | RelationUUIDRules<'branch.changes.transactionId', UUID | null>
32
- | RelationStringRules<'branch.changes.namespace', string>
33
- | RelationStringRules<'branch.changes.entity', string>
34
- | RelationUUIDRules<'branch.changes.entityId', UUID>
35
- | RelationDateRules<'branch.changes.createdAt', Date>
36
- | RelationDateRules<'branch.changes.updatedAt', Date>
37
- | RelationDateRules<'branch.changes.revertChangedAt', Date | null>
38
- | RelationNumberRules<'branch.changes.revertChangeId', number | null>
39
- | RelationDateRules<'branch.changes.redoInvalidatedAt', Date | null>
40
- | StringRules<RxDBChange, 'branchId'>
41
- | RelationStringRules<'branch.children.id', string>
42
- | RelationBooleanRules<'branch.children.activated', boolean>
43
- | RelationNumberRules<'branch.children.fromChangeId', number | null>
44
- | RelationBooleanRules<'branch.children.local', boolean>
45
- | RelationBooleanRules<'branch.children.remote', boolean>
46
- | RelationDateRules<'branch.children.createdAt', Date | null>
47
- | RelationDateRules<'branch.children.updatedAt', Date | null>
48
- | RelationStringRules<'branch.parent.id', string>
49
- | RelationBooleanRules<'branch.parent.activated', boolean>
50
- | RelationNumberRules<'branch.parent.fromChangeId', number | null>
51
- | RelationBooleanRules<'branch.parent.local', boolean>
52
- | RelationBooleanRules<'branch.parent.remote', boolean>
53
- | RelationDateRules<'branch.parent.createdAt', Date | null>
54
- | RelationDateRules<'branch.parent.updatedAt', Date | null>;
55
-
56
- /**
57
- * RuleGroupBase
58
- */
59
- export declare type RxDBSyncRuleGroup = RuleGroupBase<typeof RxDBSync,
60
- |'id'
61
- |'namespace'
62
- |'entity'
63
- |'syncType'
64
- |'lastPushedChangeId'
65
- |'lastPushedAt'
66
- |'lastPulledAt'
67
- |'lastPullRemoteChangeId'
68
- |'enabled'
69
- |'createdAt'
70
- |'updatedAt'
71
- |'branchId'
72
- |'branch'
73
- |'branch.id'
74
- |'branch.activated'
75
- |'branch.fromChangeId'
76
- |'branch.local'
77
- |'branch.remote'
78
- |'branch.createdAt'
79
- |'branch.updatedAt'
80
- |'parentId'
81
- |'branch.changes.id'
82
- |'branch.changes.remoteId'
83
- |'branch.changes.type'
84
- |'branch.changes.transactionId'
85
- |'branch.changes.namespace'
86
- |'branch.changes.entity'
87
- |'branch.changes.entityId'
88
- |'branch.changes.createdAt'
89
- |'branch.changes.updatedAt'
90
- |'branch.changes.revertChangedAt'
91
- |'branch.changes.revertChangeId'
92
- |'branch.changes.redoInvalidatedAt'
93
- |'branchId'
94
- |'branch.children.id'
95
- |'branch.children.activated'
96
- |'branch.children.fromChangeId'
97
- |'branch.children.local'
98
- |'branch.children.remote'
99
- |'branch.children.createdAt'
100
- |'branch.children.updatedAt'
101
- |'parentId'
102
- |'branch.parent.id'
103
- |'branch.parent.activated'
104
- |'branch.parent.fromChangeId'
105
- |'branch.parent.local'
106
- |'branch.parent.remote'
107
- |'branch.parent.createdAt'
108
- |'branch.parent.updatedAt'
109
- |'parentId',
110
- RxDBSyncRule>;
111
-
112
- /**
113
- * OrderByField
114
- */
115
- declare type RxDBSyncOrderByField = "id" | "namespace" | "entity" | "syncType" | "lastPushedChangeId" | "lastPushedAt" | "lastPulledAt" | "lastPullRemoteChangeId" | "enabled" | "createdAt" | "updatedAt";
116
-
117
- /**
118
- * rule
119
- */
120
- declare type RxDBMigrationRule = NumberRules<RxDBMigration, 'id'>
121
- | StringRules<RxDBMigration, 'name'>
122
- | DateRules<RxDBMigration, 'executedAt'>;
123
-
124
- /**
125
- * RuleGroupBase
126
- */
127
- export declare type RxDBMigrationRuleGroup = RuleGroupBase<typeof RxDBMigration,
128
- |'id'
129
- |'name'
130
- |'executedAt',
131
- RxDBMigrationRule>;
132
-
133
- /**
134
- * OrderByField
135
- */
136
- declare type RxDBMigrationOrderByField = "id" | "name" | "executedAt";
137
-
138
- /**
139
- * rule
140
- */
141
- declare type RxDBChangeRule = NumberRules<RxDBChange, 'id'>
142
- | NumberRules<RxDBChange, 'remoteId'>
143
- | StringRules<RxDBChange, 'type'>
144
- | UUIDRules<RxDBChange, 'transactionId'>
145
- | StringRules<RxDBChange, 'namespace'>
146
- | StringRules<RxDBChange, 'entity'>
147
- | UUIDRules<RxDBChange, 'entityId'>
148
- | DateRules<RxDBChange, 'createdAt'>
149
- | DateRules<RxDBChange, 'updatedAt'>
150
- | DateRules<RxDBChange, 'revertChangedAt'>
151
- | NumberRules<RxDBChange, 'revertChangeId'>
152
- | DateRules<RxDBChange, 'redoInvalidatedAt'>
153
- | StringRules<RxDBChange, 'branchId'>
154
- | RelationExistsRules<'branch', RxDBBranchRuleGroup>
155
- | RelationStringRules<'branch.id', string>
156
- | RelationBooleanRules<'branch.activated', boolean>
157
- | RelationNumberRules<'branch.fromChangeId', number | null>
158
- | RelationBooleanRules<'branch.local', boolean>
159
- | RelationBooleanRules<'branch.remote', boolean>
160
- | RelationDateRules<'branch.createdAt', Date | null>
161
- | RelationDateRules<'branch.updatedAt', Date | null>
162
- | StringRules<RxDBBranch, 'parentId'>
163
- | RelationStringRules<'branch.syncs.id', string>
164
- | RelationStringRules<'branch.syncs.namespace', string>
165
- | RelationStringRules<'branch.syncs.entity', string>
166
- | RelationStringRules<'branch.syncs.syncType', string>
167
- | RelationNumberRules<'branch.syncs.lastPushedChangeId', number | null>
168
- | RelationDateRules<'branch.syncs.lastPushedAt', Date | null>
169
- | RelationDateRules<'branch.syncs.lastPulledAt', Date | null>
170
- | RelationNumberRules<'branch.syncs.lastPullRemoteChangeId', number | null>
171
- | RelationBooleanRules<'branch.syncs.enabled', boolean>
172
- | RelationDateRules<'branch.syncs.createdAt', Date | null>
173
- | RelationDateRules<'branch.syncs.updatedAt', Date | null>
174
- | StringRules<RxDBSync, 'branchId'>
175
- | RelationStringRules<'branch.children.id', string>
176
- | RelationBooleanRules<'branch.children.activated', boolean>
177
- | RelationNumberRules<'branch.children.fromChangeId', number | null>
178
- | RelationBooleanRules<'branch.children.local', boolean>
179
- | RelationBooleanRules<'branch.children.remote', boolean>
180
- | RelationDateRules<'branch.children.createdAt', Date | null>
181
- | RelationDateRules<'branch.children.updatedAt', Date | null>
182
- | RelationStringRules<'branch.parent.id', string>
183
- | RelationBooleanRules<'branch.parent.activated', boolean>
184
- | RelationNumberRules<'branch.parent.fromChangeId', number | null>
185
- | RelationBooleanRules<'branch.parent.local', boolean>
186
- | RelationBooleanRules<'branch.parent.remote', boolean>
187
- | RelationDateRules<'branch.parent.createdAt', Date | null>
188
- | RelationDateRules<'branch.parent.updatedAt', Date | null>;
189
-
190
- /**
191
- * RuleGroupBase
192
- */
193
- export declare type RxDBChangeRuleGroup = RuleGroupBase<typeof RxDBChange,
194
- |'id'
195
- |'remoteId'
196
- |'type'
197
- |'transactionId'
198
- |'namespace'
199
- |'entity'
200
- |'entityId'
201
- |'createdAt'
202
- |'updatedAt'
203
- |'revertChangedAt'
204
- |'revertChangeId'
205
- |'redoInvalidatedAt'
206
- |'branchId'
207
- |'branch'
208
- |'branch.id'
209
- |'branch.activated'
210
- |'branch.fromChangeId'
211
- |'branch.local'
212
- |'branch.remote'
213
- |'branch.createdAt'
214
- |'branch.updatedAt'
215
- |'parentId'
216
- |'branch.syncs.id'
217
- |'branch.syncs.namespace'
218
- |'branch.syncs.entity'
219
- |'branch.syncs.syncType'
220
- |'branch.syncs.lastPushedChangeId'
221
- |'branch.syncs.lastPushedAt'
222
- |'branch.syncs.lastPulledAt'
223
- |'branch.syncs.lastPullRemoteChangeId'
224
- |'branch.syncs.enabled'
225
- |'branch.syncs.createdAt'
226
- |'branch.syncs.updatedAt'
227
- |'branchId'
228
- |'branch.children.id'
229
- |'branch.children.activated'
230
- |'branch.children.fromChangeId'
231
- |'branch.children.local'
232
- |'branch.children.remote'
233
- |'branch.children.createdAt'
234
- |'branch.children.updatedAt'
235
- |'parentId'
236
- |'branch.parent.id'
237
- |'branch.parent.activated'
238
- |'branch.parent.fromChangeId'
239
- |'branch.parent.local'
240
- |'branch.parent.remote'
241
- |'branch.parent.createdAt'
242
- |'branch.parent.updatedAt'
243
- |'parentId',
244
- RxDBChangeRule>;
245
-
246
- /**
247
- * OrderByField
248
- */
249
- declare type RxDBChangeOrderByField = "id" | "remoteId" | "type" | "transactionId" | "namespace" | "entity" | "entityId" | "inversePatch" | "patch" | "createdAt" | "updatedAt" | "revertChangedAt" | "revertChangeId" | "redoInvalidatedAt";
250
-
251
- /**
252
- * rule
253
- */
254
- declare type RxDBBranchRule = StringRules<RxDBBranch, 'id'>
255
- | BooleanRules<RxDBBranch, 'activated'>
256
- | NumberRules<RxDBBranch, 'fromChangeId'>
257
- | BooleanRules<RxDBBranch, 'local'>
258
- | BooleanRules<RxDBBranch, 'remote'>
259
- | DateRules<RxDBBranch, 'createdAt'>
260
- | DateRules<RxDBBranch, 'updatedAt'>
261
- | StringRules<RxDBBranch, 'parentId'>
262
- | RelationExistsRules<'changes', RxDBChangeRuleGroup>
263
- | RelationNumberRules<'changes.id', number>
264
- | RelationNumberRules<'changes.remoteId', number | null>
265
- | RelationStringRules<'changes.type', string>
266
- | RelationUUIDRules<'changes.transactionId', UUID | null>
267
- | RelationStringRules<'changes.namespace', string>
268
- | RelationStringRules<'changes.entity', string>
269
- | RelationUUIDRules<'changes.entityId', UUID>
270
- | RelationDateRules<'changes.createdAt', Date>
271
- | RelationDateRules<'changes.updatedAt', Date>
272
- | RelationDateRules<'changes.revertChangedAt', Date | null>
273
- | RelationNumberRules<'changes.revertChangeId', number | null>
274
- | RelationDateRules<'changes.redoInvalidatedAt', Date | null>
275
- | StringRules<RxDBChange, 'branchId'>
276
- | RelationExistsRules<'syncs', RxDBSyncRuleGroup>
277
- | RelationStringRules<'syncs.id', string>
278
- | RelationStringRules<'syncs.namespace', string>
279
- | RelationStringRules<'syncs.entity', string>
280
- | RelationStringRules<'syncs.syncType', string>
281
- | RelationNumberRules<'syncs.lastPushedChangeId', number | null>
282
- | RelationDateRules<'syncs.lastPushedAt', Date | null>
283
- | RelationDateRules<'syncs.lastPulledAt', Date | null>
284
- | RelationNumberRules<'syncs.lastPullRemoteChangeId', number | null>
285
- | RelationBooleanRules<'syncs.enabled', boolean>
286
- | RelationDateRules<'syncs.createdAt', Date | null>
287
- | RelationDateRules<'syncs.updatedAt', Date | null>
288
- | StringRules<RxDBSync, 'branchId'>
289
- | RelationExistsRules<'children', RxDBBranchRuleGroup>
290
- | RelationStringRules<'children.id', string>
291
- | RelationBooleanRules<'children.activated', boolean>
292
- | RelationNumberRules<'children.fromChangeId', number | null>
293
- | RelationBooleanRules<'children.local', boolean>
294
- | RelationBooleanRules<'children.remote', boolean>
295
- | RelationDateRules<'children.createdAt', Date | null>
296
- | RelationDateRules<'children.updatedAt', Date | null>
297
- | RelationExistsRules<'parent', RxDBBranchRuleGroup>
298
- | RelationStringRules<'parent.id', string>
299
- | RelationBooleanRules<'parent.activated', boolean>
300
- | RelationNumberRules<'parent.fromChangeId', number | null>
301
- | RelationBooleanRules<'parent.local', boolean>
302
- | RelationBooleanRules<'parent.remote', boolean>
303
- | RelationDateRules<'parent.createdAt', Date | null>
304
- | RelationDateRules<'parent.updatedAt', Date | null>;
305
-
306
- /**
307
- * RuleGroupBase
308
- */
309
- export declare type RxDBBranchRuleGroup = RuleGroupBase<typeof RxDBBranch,
310
- |'id'
311
- |'activated'
312
- |'fromChangeId'
313
- |'local'
314
- |'remote'
315
- |'createdAt'
316
- |'updatedAt'
317
- |'parentId'
318
- |'changes'
319
- |'changes.id'
320
- |'changes.remoteId'
321
- |'changes.type'
322
- |'changes.transactionId'
323
- |'changes.namespace'
324
- |'changes.entity'
325
- |'changes.entityId'
326
- |'changes.createdAt'
327
- |'changes.updatedAt'
328
- |'changes.revertChangedAt'
329
- |'changes.revertChangeId'
330
- |'changes.redoInvalidatedAt'
331
- |'branchId'
332
- |'syncs'
333
- |'syncs.id'
334
- |'syncs.namespace'
335
- |'syncs.entity'
336
- |'syncs.syncType'
337
- |'syncs.lastPushedChangeId'
338
- |'syncs.lastPushedAt'
339
- |'syncs.lastPulledAt'
340
- |'syncs.lastPullRemoteChangeId'
341
- |'syncs.enabled'
342
- |'syncs.createdAt'
343
- |'syncs.updatedAt'
344
- |'branchId'
345
- |'children'
346
- |'children.id'
347
- |'children.activated'
348
- |'children.fromChangeId'
349
- |'children.local'
350
- |'children.remote'
351
- |'children.createdAt'
352
- |'children.updatedAt'
353
- |'parentId'
354
- |'parent'
355
- |'parent.id'
356
- |'parent.activated'
357
- |'parent.fromChangeId'
358
- |'parent.local'
359
- |'parent.remote'
360
- |'parent.createdAt'
361
- |'parent.updatedAt'
362
- |'parentId',
363
- RxDBBranchRule>;
364
-
365
- /**
366
- * OrderByField
367
- */
368
- declare type RxDBBranchOrderByField = "id" | "activated" | "fromChangeId" | "local" | "remote" | "createdAt" | "updatedAt";
369
-
370
- /**
371
- * TreeRule
372
- */
373
- declare type RxDBBranchTreeRule = RelationBooleanRules<'children.activated', boolean>
374
- | RelationNumberRules<'children.fromChangeId', number | null>
375
- | RelationBooleanRules<'children.local', boolean>
376
- | RelationBooleanRules<'children.remote', boolean>
377
- | RelationDateRules<'children.createdAt', Date | null>
378
- | RelationDateRules<'children.updatedAt', Date | null>;
379
-
380
- /**
381
- * TreeRuleGroup
382
- */
383
- export declare type RxDBBranchTreeRuleGroup = RuleGroupBase<typeof RxDBBranch, 'children.activated' | 'children.fromChangeId' | 'children.local' | 'children.remote' | 'children.createdAt' | 'children.updatedAt', RxDBBranchTreeRule>;
7
+ export * from './RxDBBranch.js';
8
+ export * from './RxDBChange.js';
9
+ export * from './RxDBMigration.js';
10
+ export * from './RxDBSync.js';
384
11
 
385
12
  /**
386
13
  * rxdb
@@ -409,863 +36,5 @@ declare module "@aiao/rxdb" {
409
36
  }
410
37
  }
411
38
 
412
- /**
413
- * 静态类型
414
- */
415
- export interface RxDBSyncStaticTypes {
416
- /**
417
- * id 类型
418
- */
419
- idType: string;
420
- /**
421
- * 查询选项
422
- */
423
- getOptions: string;
424
- /**
425
- * 查询选项
426
- */
427
- findOneOrFailOptions: FindOneOrFailOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>;
428
- /**
429
- * 查询选项
430
- */
431
- findOptions: FindOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>;
432
- /**
433
- * 查询选项
434
- */
435
- findOneOptions: FindOneOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>;
436
- /**
437
- * 查询选项
438
- */
439
- findAllOptions: FindAllOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>;
440
- /**
441
- * 查询选项
442
- */
443
- findByCursorOptions: FindByCursorOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>;
444
- /**
445
- * 查询选项
446
- */
447
- countOptions: CountOptions<typeof RxDBSync,RxDBSyncRuleGroup>;
448
- }
449
-
450
- /**
451
- * 初始化数据
452
- */
453
- export interface RxDBSyncInitData {
454
- /**
455
- * id
456
- */
457
- id?: string;
458
- /**
459
- * namespace
460
- */
461
- namespace?: string;
462
- /**
463
- * entity
464
- */
465
- entity?: string;
466
- /**
467
- * syncType
468
- * @default 'none'
469
- */
470
- syncType?: string;
471
- /**
472
- * lastPushedChangeId
473
- */
474
- lastPushedChangeId?: number | null;
475
- /**
476
- * lastPushedAt
477
- */
478
- lastPushedAt?: Date | null;
479
- /**
480
- * lastPulledAt
481
- */
482
- lastPulledAt?: Date | null;
483
- /**
484
- * lastPullRemoteChangeId
485
- */
486
- lastPullRemoteChangeId?: number | null;
487
- /**
488
- * enabled
489
- */
490
- enabled?: boolean;
491
- /**
492
- * createdAt
493
- * @default new Date()
494
- */
495
- createdAt?: Date | null;
496
- /**
497
- * updatedAt
498
- * @default new Date()
499
- */
500
- updatedAt?: Date | null;
501
- }
502
-
503
- /**
504
- * 静态类型
505
- */
506
- export interface RxDBMigrationStaticTypes {
507
- /**
508
- * id 类型
509
- */
510
- idType: number;
511
- /**
512
- * 查询选项
513
- */
514
- getOptions: number;
515
- /**
516
- * 查询选项
517
- */
518
- findOneOrFailOptions: FindOneOrFailOptions<typeof RxDBMigration,RxDBMigrationRuleGroup,RxDBMigrationOrderByField>;
519
- /**
520
- * 查询选项
521
- */
522
- findOptions: FindOptions<typeof RxDBMigration,RxDBMigrationRuleGroup,RxDBMigrationOrderByField>;
523
- /**
524
- * 查询选项
525
- */
526
- findOneOptions: FindOneOptions<typeof RxDBMigration,RxDBMigrationRuleGroup,RxDBMigrationOrderByField>;
527
- /**
528
- * 查询选项
529
- */
530
- findAllOptions: FindAllOptions<typeof RxDBMigration,RxDBMigrationRuleGroup,RxDBMigrationOrderByField>;
531
- /**
532
- * 查询选项
533
- */
534
- findByCursorOptions: FindByCursorOptions<typeof RxDBMigration,RxDBMigrationRuleGroup,RxDBMigrationOrderByField>;
535
- /**
536
- * 查询选项
537
- */
538
- countOptions: CountOptions<typeof RxDBMigration,RxDBMigrationRuleGroup>;
539
- }
540
-
541
- /**
542
- * 初始化数据
543
- */
544
- export interface RxDBMigrationInitData {
545
- /**
546
- * id
547
- */
548
- id?: number;
549
- /**
550
- * name
551
- */
552
- name?: string;
553
- /**
554
- * executedAt
555
- * @default new Date()
556
- */
557
- executedAt?: Date;
558
- }
559
-
560
- /**
561
- * 静态类型
562
- */
563
- export interface RxDBChangeStaticTypes {
564
- /**
565
- * id 类型
566
- */
567
- idType: number;
568
- /**
569
- * 查询选项
570
- */
571
- getOptions: number;
572
- /**
573
- * 查询选项
574
- */
575
- findOneOrFailOptions: FindOneOrFailOptions<typeof RxDBChange,RxDBChangeRuleGroup,RxDBChangeOrderByField>;
576
- /**
577
- * 查询选项
578
- */
579
- findOptions: FindOptions<typeof RxDBChange,RxDBChangeRuleGroup,RxDBChangeOrderByField>;
580
- /**
581
- * 查询选项
582
- */
583
- findOneOptions: FindOneOptions<typeof RxDBChange,RxDBChangeRuleGroup,RxDBChangeOrderByField>;
584
- /**
585
- * 查询选项
586
- */
587
- findAllOptions: FindAllOptions<typeof RxDBChange,RxDBChangeRuleGroup,RxDBChangeOrderByField>;
588
- /**
589
- * 查询选项
590
- */
591
- findByCursorOptions: FindByCursorOptions<typeof RxDBChange,RxDBChangeRuleGroup,RxDBChangeOrderByField>;
592
- /**
593
- * 查询选项
594
- */
595
- countOptions: CountOptions<typeof RxDBChange,RxDBChangeRuleGroup>;
596
- }
597
-
598
- /**
599
- * 初始化数据
600
- */
601
- export interface RxDBChangeInitData {
602
- /**
603
- * id
604
- */
605
- id?: number;
606
- /**
607
- * remoteId
608
- */
609
- remoteId?: number | null;
610
- /**
611
- * type
612
- */
613
- type?: string;
614
- /**
615
- * transactionId
616
- */
617
- transactionId?: UUID | null;
618
- /**
619
- * namespace
620
- */
621
- namespace?: string;
622
- /**
623
- * entity
624
- */
625
- entity?: string;
626
- /**
627
- * entityId
628
- */
629
- entityId?: UUID;
630
- /**
631
- * inversePatch
632
- */
633
- inversePatch?: Record<string, any> | null;
634
- /**
635
- * patch
636
- */
637
- patch?: Record<string, any> | null;
638
- /**
639
- * createdAt
640
- * @default new Date()
641
- */
642
- createdAt?: Date;
643
- /**
644
- * updatedAt
645
- * @default new Date()
646
- */
647
- updatedAt?: Date;
648
- /**
649
- * revertChangedAt
650
- */
651
- revertChangedAt?: Date | null;
652
- /**
653
- * revertChangeId
654
- */
655
- revertChangeId?: number | null;
656
- /**
657
- * redoInvalidatedAt
658
- */
659
- redoInvalidatedAt?: Date | null;
660
- }
661
-
662
- /**
663
- * 静态类型
664
- */
665
- export interface RxDBBranchStaticTypes {
666
- /**
667
- * id 类型
668
- */
669
- idType: string;
670
- /**
671
- * 查询选项
672
- */
673
- getOptions: string;
674
- /**
675
- * 查询选项
676
- */
677
- findOneOrFailOptions: FindOneOrFailOptions<typeof RxDBBranch,RxDBBranchRuleGroup,RxDBBranchOrderByField>;
678
- /**
679
- * 查询选项
680
- */
681
- findOptions: FindOptions<typeof RxDBBranch,RxDBBranchRuleGroup,RxDBBranchOrderByField>;
682
- /**
683
- * 查询选项
684
- */
685
- findOneOptions: FindOneOptions<typeof RxDBBranch,RxDBBranchRuleGroup,RxDBBranchOrderByField>;
686
- /**
687
- * 查询选项
688
- */
689
- findAllOptions: FindAllOptions<typeof RxDBBranch,RxDBBranchRuleGroup,RxDBBranchOrderByField>;
690
- /**
691
- * 查询选项
692
- */
693
- findByCursorOptions: FindByCursorOptions<typeof RxDBBranch,RxDBBranchRuleGroup,RxDBBranchOrderByField>;
694
- /**
695
- * 查询选项
696
- */
697
- countOptions: CountOptions<typeof RxDBBranch,RxDBBranchRuleGroup>;
698
- /**
699
- * 查询的实体
700
- */
701
- entity: RxDBBranch;
702
- /**
703
- * 查询选项
704
- */
705
- findDescendantsOptions: FindTreeOptions<typeof RxDBBranch,RxDBBranchTreeRuleGroup>;
706
- /**
707
- * 查询选项
708
- */
709
- countDescendantsOptions: FindTreeOptions<typeof RxDBBranch,RxDBBranchTreeRuleGroup>;
710
- /**
711
- * 查询选项
712
- */
713
- findAncestorsOptions: FindTreeOptions<typeof RxDBBranch,RxDBBranchTreeRuleGroup>;
714
- /**
715
- * 查询选项
716
- */
717
- countAncestorsOptions: FindTreeOptions<typeof RxDBBranch,RxDBBranchTreeRuleGroup>;
718
- }
719
-
720
- /**
721
- * 初始化数据
722
- */
723
- export interface RxDBBranchInitData {
724
- /**
725
- * id
726
- */
727
- id?: string;
728
- /**
729
- * activated
730
- */
731
- activated?: boolean;
732
- /**
733
- * fromChangeId
734
- */
735
- fromChangeId?: number | null;
736
- /**
737
- * local
738
- */
739
- local?: boolean;
740
- /**
741
- * remote
742
- */
743
- remote?: boolean;
744
- /**
745
- * createdAt
746
- * @default new Date()
747
- */
748
- createdAt?: Date | null;
749
- /**
750
- * updatedAt
751
- * @default new Date()
752
- */
753
- updatedAt?: Date | null;
754
- }
755
-
756
- /**
757
- * RxDBSync
758
- */
759
- export declare class RxDBSync {
760
- static [ENTITY_STATIC_TYPES]: RxDBSyncStaticTypes;
761
- /**
762
- * branch
763
- */
764
- readonly branch$: RelationEntityObservable<typeof RxDBBranch>;
765
- /**
766
- * createdAt
767
- * @default new Date()
768
- */
769
- readonly createdAt?: Date | null;
770
- /**
771
- * updatedAt
772
- * @default new Date()
773
- */
774
- readonly updatedAt?: Date | null;
775
- /**
776
- * branch id
777
- */
778
- branchId: string;
779
- /**
780
- * enabled
781
- */
782
- enabled: boolean;
783
- /**
784
- * entity
785
- */
786
- entity: string;
787
- /**
788
- * id
789
- */
790
- id: string;
791
- /**
792
- * lastPulledAt
793
- */
794
- lastPulledAt?: Date | null;
795
- /**
796
- * lastPullRemoteChangeId
797
- */
798
- lastPullRemoteChangeId?: number | null;
799
- /**
800
- * lastPushedAt
801
- */
802
- lastPushedAt?: Date | null;
803
- /**
804
- * lastPushedChangeId
805
- */
806
- lastPushedChangeId?: number | null;
807
- /**
808
- * namespace
809
- */
810
- namespace: string;
811
- /**
812
- * syncType
813
- * @default 'none'
814
- */
815
- syncType: string;
816
- /**
817
- * 初始化数据
818
- * @param initData 初始化数据
819
- */
820
- constructor(initData?: RxDBSyncInitData);
821
- /**
822
- * 统计实体数量
823
- * @param options 查询选项
824
- * @example
825
- * RxDBSync.count({ where: { combinator: 'and', rules: [] } }).subscribe(total => console.log(total));
826
- */
827
- static count(options: CountOptions<typeof RxDBSync,RxDBSyncRuleGroup>): Observable<number>;
828
- /**
829
- * 查询多个实体
830
- * @param options 查询选项
831
- * @example
832
- * RxDBSync.find({ where: { combinator: 'and', rules: [] }] }).subscribe(list => console.log(list));
833
- */
834
- static find(options: FindOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>): Observable<RxDBSync[]>;
835
- /**
836
- * 查询所有实体
837
- * @param options 查询选项
838
- * @example
839
- * RxDBSync.findAll({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
840
- */
841
- static findAll(options: FindAllOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>): Observable<RxDBSync[]>;
842
- /**
843
- * 游标分页查询
844
- * @param options 查询选项
845
- * @example
846
- * RxDBSync.findByCursor({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
847
- */
848
- static findByCursor(options: FindByCursorOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>): Observable<RxDBSync[]>;
849
- /**
850
- * 查询单个实体,未找到时返回 undefined
851
- * @param options 查询选项
852
- * @example
853
- * RxDBSync.findOne({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
854
- */
855
- static findOne(options: FindOneOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>): Observable<RxDBSync | undefined>;
856
- /**
857
- * 查询单个实体,未找到时抛出错误
858
- * @param options 查询选项
859
- * @example
860
- * RxDBSync.findOneOrFail({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
861
- */
862
- static findOneOrFail(options: FindOneOrFailOptions<typeof RxDBSync,RxDBSyncRuleGroup,RxDBSyncOrderByField>): Observable<RxDBSync>;
863
- /**
864
- * 根据 ID 获取单个实体
865
- * @param options 查询选项
866
- * @example
867
- * RxDBSync.get('123').subscribe(entity => console.log(entity));
868
- */
869
- static get(options: string): Observable<RxDBSync>;
870
- /**
871
- * 删除
872
- */
873
- remove(): Promise<RxDBSync>;
874
- /**
875
- * 重置数据
876
- */
877
- reset(): void;
878
- /**
879
- * 保存
880
- */
881
- save(): Promise<RxDBSync>;
882
- }
883
-
884
- /**
885
- * RxDBMigration
886
- */
887
- export declare class RxDBMigration {
888
- static [ENTITY_STATIC_TYPES]: RxDBMigrationStaticTypes;
889
- /**
890
- * executedAt
891
- * @default new Date()
892
- */
893
- readonly executedAt: Date;
894
- /**
895
- * name
896
- */
897
- readonly name: string;
898
- /**
899
- * id
900
- */
901
- id: number;
902
- /**
903
- * 初始化数据
904
- * @param initData 初始化数据
905
- */
906
- constructor(initData?: RxDBMigrationInitData);
907
- /**
908
- * 统计实体数量
909
- * @param options 查询选项
910
- * @example
911
- * RxDBMigration.count({ where: { combinator: 'and', rules: [] } }).subscribe(total => console.log(total));
912
- */
913
- static count(options: CountOptions<typeof RxDBMigration,RxDBMigrationRuleGroup>): Observable<number>;
914
- /**
915
- * 查询多个实体
916
- * @param options 查询选项
917
- * @example
918
- * RxDBMigration.find({ where: { combinator: 'and', rules: [] }] }).subscribe(list => console.log(list));
919
- */
920
- static find(options: FindOptions<typeof RxDBMigration,RxDBMigrationRuleGroup,RxDBMigrationOrderByField>): Observable<RxDBMigration[]>;
921
- /**
922
- * 查询所有实体
923
- * @param options 查询选项
924
- * @example
925
- * RxDBMigration.findAll({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
926
- */
927
- static findAll(options: FindAllOptions<typeof RxDBMigration,RxDBMigrationRuleGroup,RxDBMigrationOrderByField>): Observable<RxDBMigration[]>;
928
- /**
929
- * 游标分页查询
930
- * @param options 查询选项
931
- * @example
932
- * RxDBMigration.findByCursor({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
933
- */
934
- static findByCursor(options: FindByCursorOptions<typeof RxDBMigration,RxDBMigrationRuleGroup,RxDBMigrationOrderByField>): Observable<RxDBMigration[]>;
935
- /**
936
- * 查询单个实体,未找到时返回 undefined
937
- * @param options 查询选项
938
- * @example
939
- * RxDBMigration.findOne({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
940
- */
941
- static findOne(options: FindOneOptions<typeof RxDBMigration,RxDBMigrationRuleGroup,RxDBMigrationOrderByField>): Observable<RxDBMigration | undefined>;
942
- /**
943
- * 查询单个实体,未找到时抛出错误
944
- * @param options 查询选项
945
- * @example
946
- * RxDBMigration.findOneOrFail({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
947
- */
948
- static findOneOrFail(options: FindOneOrFailOptions<typeof RxDBMigration,RxDBMigrationRuleGroup,RxDBMigrationOrderByField>): Observable<RxDBMigration>;
949
- /**
950
- * 根据 ID 获取单个实体
951
- * @param options 查询选项
952
- * @example
953
- * RxDBMigration.get('123').subscribe(entity => console.log(entity));
954
- */
955
- static get(options: number): Observable<RxDBMigration>;
956
- /**
957
- * 删除
958
- */
959
- remove(): Promise<RxDBMigration>;
960
- /**
961
- * 重置数据
962
- */
963
- reset(): void;
964
- /**
965
- * 保存
966
- */
967
- save(): Promise<RxDBMigration>;
968
- }
969
-
970
- /**
971
- * RxDBChange
972
- */
973
- export declare class RxDBChange {
974
- static [ENTITY_STATIC_TYPES]: RxDBChangeStaticTypes;
975
- /**
976
- * branch
977
- */
978
- readonly branch$: RelationEntityObservable<typeof RxDBBranch>;
979
- /**
980
- * createdAt
981
- * @default new Date()
982
- */
983
- readonly createdAt: Date;
984
- /**
985
- * entity
986
- */
987
- readonly entity: string;
988
- /**
989
- * entityId
990
- */
991
- readonly entityId: UUID;
992
- /**
993
- * inversePatch
994
- */
995
- readonly inversePatch?: Record<string, any> | null;
996
- /**
997
- * namespace
998
- */
999
- readonly namespace: string;
1000
- /**
1001
- * patch
1002
- */
1003
- readonly patch?: Record<string, any> | null;
1004
- /**
1005
- * remoteId
1006
- */
1007
- readonly remoteId?: number | null;
1008
- /**
1009
- * type
1010
- */
1011
- readonly type: string;
1012
- /**
1013
- * updatedAt
1014
- * @default new Date()
1015
- */
1016
- readonly updatedAt: Date;
1017
- /**
1018
- * branch id
1019
- */
1020
- branchId?: string | null;
1021
- /**
1022
- * id
1023
- */
1024
- id: number;
1025
- /**
1026
- * redoInvalidatedAt
1027
- */
1028
- redoInvalidatedAt?: Date | null;
1029
- /**
1030
- * revertChangedAt
1031
- */
1032
- revertChangedAt?: Date | null;
1033
- /**
1034
- * revertChangeId
1035
- */
1036
- revertChangeId?: number | null;
1037
- /**
1038
- * transactionId
1039
- */
1040
- transactionId?: UUID | null;
1041
- /**
1042
- * 初始化数据
1043
- * @param initData 初始化数据
1044
- */
1045
- constructor(initData?: RxDBChangeInitData);
1046
- /**
1047
- * 统计实体数量
1048
- * @param options 查询选项
1049
- * @example
1050
- * RxDBChange.count({ where: { combinator: 'and', rules: [] } }).subscribe(total => console.log(total));
1051
- */
1052
- static count(options: CountOptions<typeof RxDBChange,RxDBChangeRuleGroup>): Observable<number>;
1053
- /**
1054
- * 查询多个实体
1055
- * @param options 查询选项
1056
- * @example
1057
- * RxDBChange.find({ where: { combinator: 'and', rules: [] }] }).subscribe(list => console.log(list));
1058
- */
1059
- static find(options: FindOptions<typeof RxDBChange,RxDBChangeRuleGroup,RxDBChangeOrderByField>): Observable<RxDBChange[]>;
1060
- /**
1061
- * 查询所有实体
1062
- * @param options 查询选项
1063
- * @example
1064
- * RxDBChange.findAll({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
1065
- */
1066
- static findAll(options: FindAllOptions<typeof RxDBChange,RxDBChangeRuleGroup,RxDBChangeOrderByField>): Observable<RxDBChange[]>;
1067
- /**
1068
- * 游标分页查询
1069
- * @param options 查询选项
1070
- * @example
1071
- * RxDBChange.findByCursor({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
1072
- */
1073
- static findByCursor(options: FindByCursorOptions<typeof RxDBChange,RxDBChangeRuleGroup,RxDBChangeOrderByField>): Observable<RxDBChange[]>;
1074
- /**
1075
- * 查询单个实体,未找到时返回 undefined
1076
- * @param options 查询选项
1077
- * @example
1078
- * RxDBChange.findOne({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
1079
- */
1080
- static findOne(options: FindOneOptions<typeof RxDBChange,RxDBChangeRuleGroup,RxDBChangeOrderByField>): Observable<RxDBChange | undefined>;
1081
- /**
1082
- * 查询单个实体,未找到时抛出错误
1083
- * @param options 查询选项
1084
- * @example
1085
- * RxDBChange.findOneOrFail({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
1086
- */
1087
- static findOneOrFail(options: FindOneOrFailOptions<typeof RxDBChange,RxDBChangeRuleGroup,RxDBChangeOrderByField>): Observable<RxDBChange>;
1088
- /**
1089
- * 根据 ID 获取单个实体
1090
- * @param options 查询选项
1091
- * @example
1092
- * RxDBChange.get('123').subscribe(entity => console.log(entity));
1093
- */
1094
- static get(options: number): Observable<RxDBChange>;
1095
- /**
1096
- * 删除
1097
- */
1098
- remove(): Promise<RxDBChange>;
1099
- /**
1100
- * 重置数据
1101
- */
1102
- reset(): void;
1103
- /**
1104
- * 保存
1105
- */
1106
- save(): Promise<RxDBChange>;
1107
- }
1108
-
1109
- /**
1110
- * RxDBBranch
1111
- */
1112
- export declare class RxDBBranch {
1113
- static [ENTITY_STATIC_TYPES]: RxDBBranchStaticTypes;
1114
- /**
1115
- * changes
1116
- */
1117
- readonly changes$: RelationEntitiesObservable<RxDBChange>;
1118
- /**
1119
- * children
1120
- */
1121
- readonly children$: RelationEntitiesObservable<RxDBBranch>;
1122
- /**
1123
- * createdAt
1124
- * @default new Date()
1125
- */
1126
- readonly createdAt?: Date | null;
1127
- /**
1128
- * parent
1129
- */
1130
- readonly parent$: RelationEntityObservable<typeof RxDBBranch>;
1131
- /**
1132
- * syncs
1133
- */
1134
- readonly syncs$: RelationEntitiesObservable<RxDBSync>;
1135
- /**
1136
- * updatedAt
1137
- * @default new Date()
1138
- */
1139
- readonly updatedAt?: Date | null;
1140
- /**
1141
- * activated
1142
- */
1143
- activated: boolean;
1144
- /**
1145
- * fromChangeId
1146
- */
1147
- fromChangeId?: number | null;
1148
- /**
1149
- * id
1150
- */
1151
- id: string;
1152
- /**
1153
- * local
1154
- */
1155
- local: boolean;
1156
- /**
1157
- * parent id
1158
- */
1159
- parentId?: string | null;
1160
- /**
1161
- * remote
1162
- */
1163
- remote: boolean;
1164
- /**
1165
- * 初始化数据
1166
- * @param initData 初始化数据
1167
- */
1168
- constructor(initData?: RxDBBranchInitData);
1169
- /**
1170
- * 统计实体数量
1171
- * @param options 查询选项
1172
- * @example
1173
- * RxDBBranch.count({ where: { combinator: 'and', rules: [] } }).subscribe(total => console.log(total));
1174
- */
1175
- static count(options: CountOptions<typeof RxDBBranch,RxDBBranchRuleGroup>): Observable<number>;
1176
- /**
1177
- * 统计祖先实体数量(不包含自身)
1178
- * @param options 查询选项
1179
- * @example
1180
- * // 统计某节点的祖先层级深度
1181
- RxDBBranch.countAncestors({ entityId: grand.id }).subscribe(depth => console.log(depth));
1182
- */
1183
- static countAncestors(options?: FindTreeOptions<typeof RxDBBranch,RxDBBranchTreeRuleGroup>): Observable<number>;
1184
- /**
1185
- * 统计子孙实体数量(不包含自身)
1186
- * @param options 查询选项
1187
- * @example
1188
- * // 统计某节点下的后代数量
1189
- RxDBBranch.countDescendants({ entityId: root.id }).subscribe(count => console.log(count));
1190
- */
1191
- static countDescendants(options?: FindTreeOptions<typeof RxDBBranch,RxDBBranchTreeRuleGroup>): Observable<number>;
1192
- /**
1193
- * 查询多个实体
1194
- * @param options 查询选项
1195
- * @example
1196
- * RxDBBranch.find({ where: { combinator: 'and', rules: [] }] }).subscribe(list => console.log(list));
1197
- */
1198
- static find(options: FindOptions<typeof RxDBBranch,RxDBBranchRuleGroup,RxDBBranchOrderByField>): Observable<RxDBBranch[]>;
1199
- /**
1200
- * 查询所有实体
1201
- * @param options 查询选项
1202
- * @example
1203
- * RxDBBranch.findAll({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
1204
- */
1205
- static findAll(options: FindAllOptions<typeof RxDBBranch,RxDBBranchRuleGroup,RxDBBranchOrderByField>): Observable<RxDBBranch[]>;
1206
- /**
1207
- * 查询祖先实体(包含自身)
1208
- * @param options 查询选项
1209
- * @example
1210
- * // 查询某节点的所有祖先(面包屑导航)
1211
- RxDBBranch.findAncestors({ entityId: grand.id }).subscribe(ancestors => console.log(ancestors));
1212
-
1213
- // 仅查询直接父节点(level 1)
1214
- RxDBBranch.findAncestors({ entityId: grand.id, level: 1 }).subscribe(parents => console.log(parents));
1215
- */
1216
- static findAncestors(options?: FindTreeOptions<typeof RxDBBranch,RxDBBranchTreeRuleGroup>): Observable<RxDBBranch[]>;
1217
- /**
1218
- * 游标分页查询
1219
- * @param options 查询选项
1220
- * @example
1221
- * RxDBBranch.findByCursor({ where: { combinator: 'and', rules: [] } }).subscribe(list => console.log(list));
1222
- */
1223
- static findByCursor(options: FindByCursorOptions<typeof RxDBBranch,RxDBBranchRuleGroup,RxDBBranchOrderByField>): Observable<RxDBBranch[]>;
1224
- /**
1225
- * 查询子孙实体(包含自身)
1226
- * @param options 查询选项
1227
- * @example
1228
- * // 查询某节点的所有后代
1229
- RxDBBranch.findDescendants({ entityId: root.id }).subscribe(list => console.log(list));
1230
-
1231
- // 仅查询直接子节点(level 1)
1232
- RxDBBranch.findDescendants({ entityId: root.id, level: 1 }).subscribe(children => console.log(children));
1233
- */
1234
- static findDescendants(options?: FindTreeOptions<typeof RxDBBranch,RxDBBranchTreeRuleGroup>): Observable<RxDBBranch[]>;
1235
- /**
1236
- * 查询单个实体,未找到时返回 undefined
1237
- * @param options 查询选项
1238
- * @example
1239
- * RxDBBranch.findOne({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
1240
- */
1241
- static findOne(options: FindOneOptions<typeof RxDBBranch,RxDBBranchRuleGroup,RxDBBranchOrderByField>): Observable<RxDBBranch | undefined>;
1242
- /**
1243
- * 查询单个实体,未找到时抛出错误
1244
- * @param options 查询选项
1245
- * @example
1246
- * RxDBBranch.findOneOrFail({ where: { combinator: 'and', rules: [] } }).subscribe(entity => console.log(entity));
1247
- */
1248
- static findOneOrFail(options: FindOneOrFailOptions<typeof RxDBBranch,RxDBBranchRuleGroup,RxDBBranchOrderByField>): Observable<RxDBBranch>;
1249
- /**
1250
- * 根据 ID 获取单个实体
1251
- * @param options 查询选项
1252
- * @example
1253
- * RxDBBranch.get('123').subscribe(entity => console.log(entity));
1254
- */
1255
- static get(options: string): Observable<RxDBBranch>;
1256
- /**
1257
- * 删除
1258
- */
1259
- remove(): Promise<RxDBBranch>;
1260
- /**
1261
- * 重置数据
1262
- */
1263
- reset(): void;
1264
- /**
1265
- * 保存
1266
- */
1267
- save(): Promise<RxDBBranch>;
1268
- }
1269
-
1270
39
  export declare const ENTITIES: EntityType[];
1271
40