@trust0/ridb-core 1.7.23 → 1.7.25

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.
@@ -38,16 +38,6 @@ declare function __wbgtest_console_warn(args: Array<any>): void;
38
38
  */
39
39
  declare function __wbgtest_console_error(args: Array<any>): void;
40
40
  /**
41
- */
42
- declare enum Errors {
43
- Error = 0,
44
- HookError = 1,
45
- QueryError = 2,
46
- SerializationError = 3,
47
- ValidationError = 4,
48
- AuthenticationError = 5,
49
- }
50
- /**
51
41
  * Represents the type of operation to be performed on the collection.
52
42
  */
53
43
  declare enum OpType {
@@ -72,6 +62,16 @@ declare enum OpType {
72
62
  */
73
63
  COUNT = 4,
74
64
  }
65
+ /**
66
+ */
67
+ declare enum Errors {
68
+ Error = 0,
69
+ HookError = 1,
70
+ QueryError = 2,
71
+ SerializationError = 3,
72
+ ValidationError = 4,
73
+ AuthenticationError = 5,
74
+ }
75
75
 
76
76
  declare class CoreStorage {
77
77
  /**
@@ -87,157 +87,132 @@ declare class CoreStorage {
87
87
 
88
88
 
89
89
  /**
90
- * Represents an operation to be performed on a collection.
90
+ * Represents a database containing collections of documents.
91
+ * RIDB extends from this class and is used to expose collections.
92
+ *
93
+ * So if you specify:
94
+ * ```typescript
95
+ * const db = new RIDB(
96
+ * {
97
+ * schemas: {
98
+ * demo: {
99
+ * version: 0,
100
+ * primaryKey: 'id',
101
+ * type: SchemaFieldType.object,
102
+ * properties: {
103
+ * id: {
104
+ * type: SchemaFieldType.string,
105
+ * maxLength: 60
106
+ * }
107
+ * }
108
+ * }
109
+ * } as const
110
+ * }
111
+ * )
112
+ * ```
113
+ *
114
+ * The collection will be available as `db.collections.demo` and all the methods for the collection (find, count, findById, update, create, delete) will be available.
91
115
  *
92
- * @template T - The schema type of the collection.
116
+ * @template T - A record of schema types.
93
117
  */
94
- type Operation<T extends SchemaType = SchemaType> = {
95
- /**
96
- * The name of the collection on which the operation will be performed.
97
- */
98
- collection: string,
99
-
100
- /**
101
- * The type of operation to be performed (e.g., CREATE, UPDATE, DELETE).
102
- */
103
- opType: OpType,
118
+ declare class Database<T extends SchemaTypeRecord> {
104
119
 
105
120
  /**
106
- * The data involved in the operation, conforming to the schema type.
121
+ * Creates a new `Database` instance with the provided schemas and storage module.
122
+ *
123
+ * @template TS - A record of schema types.
124
+ * @param {TS} schemas - The schemas to use for the collections.
125
+ * @param migrations
126
+ * @param plugins
127
+ * @param options
128
+ * @param password
129
+ * @returns {Promise<Database<TS>>} A promise that resolves to the created `Database` instance.
107
130
  */
108
- data: Doc<T>,
109
-
110
- primaryKeyField?: string,
111
- primaryKey?: string
112
- }
113
-
114
-
115
-
116
- declare const SchemaFieldType = {
117
- /**
118
- * String type for text data
119
- */
120
- string: 'string' as const,
121
-
122
- /**
123
- * Number type for numeric data (integers and floats)
124
- */
125
- number: 'number' as const,
126
-
127
- /**
128
- * Boolean type for true/false values
129
- */
130
- boolean: 'boolean' as const,
131
-
132
- /**
133
- * Array type for ordered collections of items
134
- */
135
- array: 'array' as const,
136
-
137
- /**
138
- * Object type for nested document structures
139
- */
140
- object: 'object' as const,
141
- };
142
-
131
+ static create<TS extends SchemaTypeRecord>(
132
+ db_name: string,
133
+ schemas: TS,
134
+ migrations: MigrationPathsForSchemas<TS> | MigrationPathsForSchema<TS[string]>,
135
+ plugins:Array<typeof BasePlugin>,
136
+ options: RIDBModule,
137
+ password?:string,
138
+ storage?: BaseStorage<TS>
139
+ ): Promise<Database<TS>>;
143
140
 
141
+ authenticate(password: string): Promise<boolean>;
144
142
 
145
- /**
146
- * Represents a property within a schema, including various constraints and nested properties.
147
- */
148
- declare class Property {
149
143
  /**
150
- * The type of the property.
144
+ * The collections in the database.
145
+ *
146
+ * This is a read-only property where the key is the name of the collection and the value is a `Collection` instance.
151
147
  */
152
- readonly type: SchemaFieldType;
148
+ readonly collections: {
149
+ [name in keyof T]: Collection<Schema<T[name]>>
150
+ }
153
151
 
154
- /**
155
- * The version of the property, if applicable.
156
- */
157
- readonly version?: number;
152
+ readonly started: boolean;
158
153
 
159
154
  /**
160
- * The primary key of the property, if applicable.
155
+ * Starts the database.
156
+ *
157
+ * @returns {Promise<void>} A promise that resolves when the database is started.
161
158
  */
162
- readonly primaryKey?: string;
159
+ start(): Promise<void>;
163
160
 
164
161
  /**
165
- * An optional array of nested properties for array-type properties.
162
+ * Closes the database.
163
+ *
164
+ * @returns {Promise<void>} A promise that resolves when the database is closed.
166
165
  */
167
- readonly items?: Property;
166
+ close(): Promise<void>;
167
+ }
168
168
 
169
- /**
170
- * The maximum number of items for array-type properties, if applicable.
171
- */
172
- readonly maxItems?: number;
169
+ /**
170
+ * Represents a function type for creating storage with the provided schema type records.
171
+ *
172
+ * @template T - The schema type record.
173
+ * @param {T} records - The schema type records.
174
+ * @returns {Promise<InternalsRecord>} A promise that resolves to the created internals record.
175
+ */
176
+ type CreateStorage = <T extends SchemaTypeRecord>(
177
+ records: T
178
+ ) => Promise<BaseStorage<T>>;
173
179
 
174
- /**
175
- * The minimum number of items for array-type properties, if applicable.
176
- */
177
- readonly minItems?: number;
180
+ /**
181
+ * Represents a storage module with a method for creating storage.
182
+ */
183
+ type RIDBModule = {
178
184
 
179
185
  /**
180
- * The maximum length for string-type properties, if applicable.
186
+ * Plugin constructors array
181
187
  */
182
- readonly maxLength?: number;
188
+ apply: (plugins:Array<typeof BasePlugin>) => Array<BasePlugin>;
189
+ };
190
+
183
191
 
184
- /**
185
- * The minimum length for string-type properties, if applicable.
186
- */
187
- readonly minLength?: number;
188
192
 
193
+ /**
194
+ * Represents an operation to be performed on a collection.
195
+ *
196
+ * @template T - The schema type of the collection.
197
+ */
198
+ type Operation<T extends SchemaType = SchemaType> = {
189
199
  /**
190
- * An optional array of required fields for object-type properties.
200
+ * The name of the collection on which the operation will be performed.
191
201
  */
192
- readonly required?: boolean;
202
+ collection: string,
193
203
 
194
204
  /**
195
- * An optional default value for the property.
205
+ * The type of operation to be performed (e.g., CREATE, UPDATE, DELETE).
196
206
  */
197
- readonly default?: any;
207
+ opType: OpType,
198
208
 
199
209
  /**
200
- * An optional map of nested properties for object-type properties.
210
+ * The data involved in the operation, conforming to the schema type.
201
211
  */
202
- readonly properties?: {
203
- [name: string]: Property;
204
- };
205
- }
206
-
207
-
208
-
209
- type Operators<T> = {
210
- $gte?: number,
211
- $gt?: number
212
- $lt?: number,
213
- $lte?: number,
214
- $eq?: T,
215
- $ne?: T
216
- };
217
-
218
- type InOperator<T> = { $in?: T[] };
219
- type NInOperator<T> = { $nin?: T[] };
220
-
221
- type OperatorOrType<T> = T extends number ?
222
- T | Operators<T> | InOperator<T> | NInOperator<T> :
223
- T | InOperator<T> | NInOperator<T>;
224
-
225
- type LogicalOperators<T extends SchemaType> = {
226
- $and?: Partial<QueryType<T>>[];
227
- $or?: Partial<QueryType<T>>[];
228
- };
229
-
230
- type QueryType<T extends SchemaType> = ({
231
- [K in keyof T['properties']as ExtractType<T['properties'][K]['type']> extends undefined ? never : K]?: OperatorOrType<
232
- ExtractType<
233
- T['properties'][K]['type']
234
- >
235
- >
236
- } & LogicalOperators<T>) | LogicalOperators<T>[];
212
+ data: Doc<T>,
237
213
 
238
- declare class Query<T extends SchemaType> {
239
- constructor(query: QueryType<T>, schema:Schema<T>);
240
- readonly query: QueryType<T>;
214
+ primaryKeyField?: string,
215
+ primaryKey?: string
241
216
  }
242
217
 
243
218
 
@@ -338,7 +313,6 @@ declare class Collection<T extends SchemaType> {
338
313
  /**
339
314
  * Updates a document in the collection by its ID.
340
315
  *
341
- * @param id - The ID of the document to update.
342
316
  * @param document - A partial document containing the fields to update.
343
317
  * @returns A promise that resolves when the update is complete.
344
318
  */
@@ -399,66 +373,38 @@ declare class BaseStorage<Schemas extends SchemaTypeRecord> extends StorageInter
399
373
 
400
374
 
401
375
 
402
- type Hook = (
403
- schema: Schema<SchemaType>,
404
- migration: MigrationPathsForSchema<SchemaType>,
405
- doc: Doc<SchemaType>
406
- ) => Doc<SchemaType>
407
-
408
- type BasePluginOptions = {
409
- docCreateHook?: Hook,
410
- docRecoverHook?: Hook
411
- }
412
-
413
- declare class BasePlugin implements BasePluginOptions {
414
- docCreateHook?:Hook;
415
- docRecoverHook?:Hook;
416
- }
376
+ type Operators<T> = {
377
+ $gte?: number,
378
+ $gt?: number
379
+ $lt?: number,
380
+ $lte?: number,
381
+ $eq?: T,
382
+ $ne?: T
383
+ };
417
384
 
385
+ type InOperator<T> = { $in?: T[] };
386
+ type NInOperator<T> = { $nin?: T[] };
418
387
 
388
+ type OperatorOrType<T> = T extends number ?
389
+ T | Operators<T> | InOperator<T> | NInOperator<T> :
390
+ T | InOperator<T> | NInOperator<T>;
419
391
 
420
- /**
421
- * Represents an IndexDB storage system extending the base storage functionality.
422
- *
423
- * @template T - The schema type.
424
- */
425
- declare class IndexDB<T extends SchemaTypeRecord> extends BaseStorage<T> {
426
- /**
427
- * Frees the resources used by the in-memory storage.
428
- */
429
- free(): void;
392
+ type LogicalOperators<T extends SchemaType> = {
393
+ $and?: Partial<QueryType<T>>[];
394
+ $or?: Partial<QueryType<T>>[];
395
+ };
430
396
 
431
- static create<SchemasCreate extends SchemaTypeRecord>(
432
- dbName: string,
433
- schemas: SchemasCreate,
434
- ): Promise<
435
- IndexDB<
436
- SchemasCreate
397
+ type QueryType<T extends SchemaType> = ({
398
+ [K in keyof T['properties']as ExtractType<T['properties'][K]['type']> extends undefined ? never : K]?: OperatorOrType<
399
+ ExtractType<
400
+ T['properties'][K]['type']
437
401
  >
438
- >;
439
- }
440
-
441
-
442
-
443
- /**
444
- * Represents an in-memory storage system extending the base storage functionality.
445
- *
446
- * @template T - The schema type.
447
- */
448
- declare class InMemory<T extends SchemaTypeRecord> extends BaseStorage<T> {
449
- /**
450
- * Frees the resources used by the in-memory storage.
451
- */
452
- free(): void;
402
+ >
403
+ } & LogicalOperators<T>) | LogicalOperators<T>[];
453
404
 
454
- static create<SchemasCreate extends SchemaTypeRecord>(
455
- dbName: string,
456
- schemas: SchemasCreate,
457
- ): Promise<
458
- InMemory<
459
- SchemasCreate
460
- >
461
- >;
405
+ declare class Query<T extends SchemaType> {
406
+ constructor(query: QueryType<T>, schema:Schema<T>);
407
+ readonly query: QueryType<T>;
462
408
  }
463
409
 
464
410
 
@@ -571,8 +517,127 @@ declare class Schema<T extends SchemaType> {
571
517
 
572
518
 
573
519
 
520
+ type EnumerateUpTo<
521
+ N extends number,
522
+ Acc extends number[] = []
523
+ > = Acc['length'] extends N ?
524
+ Acc[number]:
525
+ EnumerateUpTo<N, [...Acc, Acc['length']]> ;
526
+
527
+ type EnumerateFrom1To<
528
+ N extends number
529
+ > = Exclude<EnumerateUpTo<N>,0> | (N extends 0 ? never : N);
530
+
531
+ type IsVersionGreaterThan0<
532
+ V extends number
533
+ > = V extends 0 ? false : true;
534
+
535
+ type AnyVersionGreaterThan1<
536
+ T extends Record<string, SchemaType>
537
+ > = true extends {
538
+ [K in keyof T]: IsVersionGreaterThan0<T[K]['version']>;
539
+ } [keyof T] ? true : false;
540
+
541
+ type MigrationFunction<T extends SchemaType> = (doc: Doc <T> ) => Doc <T>
542
+
543
+ type MigrationPathsForSchema<
544
+ T extends SchemaType
545
+ > = T['version'] extends 0 ? {}: // No migrations needed for version 1
546
+ {
547
+ [K in EnumerateFrom1To < T['version'] > ]: MigrationFunction<T> ;
548
+ };
549
+
550
+ type MigrationPathsForSchemas<
551
+ T extends SchemaTypeRecord
552
+ > = {
553
+ [K in keyof T]: MigrationPathsForSchema<T[K]>;
554
+ };
555
+
556
+ type MigrationsParameter<
557
+ T extends SchemaTypeRecord
558
+ > = AnyVersionGreaterThan1<T> extends true ?
559
+ {
560
+ migrations: MigrationPathsForSchemas<T>
561
+ }:
562
+ {
563
+ migrations?: never
564
+ };
565
+
566
+
567
+
568
+ type Hook = (
569
+ schema: Schema<SchemaType>,
570
+ migration: MigrationPathsForSchema<SchemaType>,
571
+ doc: Doc<SchemaType>
572
+ ) => Doc<SchemaType>
573
+
574
+ type BasePluginOptions = {
575
+ docCreateHook?: Hook,
576
+ docRecoverHook?: Hook
577
+ }
578
+
579
+ declare class BasePlugin implements BasePluginOptions {
580
+ docCreateHook?:Hook;
581
+ docRecoverHook?:Hook;
582
+ }
583
+
584
+
585
+
586
+ declare const SchemaFieldType = {
587
+ /**
588
+ * String type for text data
589
+ */
590
+ string: 'string' as const,
591
+
592
+ /**
593
+ * Number type for numeric data (integers and floats)
594
+ */
595
+ number: 'number' as const,
596
+
597
+ /**
598
+ * Boolean type for true/false values
599
+ */
600
+ boolean: 'boolean' as const,
601
+
602
+ /**
603
+ * Array type for ordered collections of items
604
+ */
605
+ array: 'array' as const,
606
+
607
+ /**
608
+ * Object type for nested document structures
609
+ */
610
+ object: 'object' as const,
611
+ };
612
+
613
+
614
+
615
+ /**
616
+ * Represents an in-memory storage system extending the base storage functionality.
617
+ *
618
+ * @template T - The schema type.
619
+ */
620
+ declare class InMemory<T extends SchemaTypeRecord> extends BaseStorage<T> {
621
+ /**
622
+ * Frees the resources used by the in-memory storage.
623
+ */
624
+ free(): void;
625
+
626
+ static create<SchemasCreate extends SchemaTypeRecord>(
627
+ dbName: string,
628
+ schemas: SchemasCreate,
629
+ ): Promise<
630
+ InMemory<
631
+ SchemasCreate
632
+ >
633
+ >;
634
+ }
635
+
636
+
637
+
574
638
  /**
575
639
  * Represents a record of schema types, where each key is a string and the value is a `SchemaType`.
640
+ * @internal
576
641
  */
577
642
  type SchemaTypeRecord = {
578
643
  [name: string]: SchemaType
@@ -606,154 +671,89 @@ declare abstract class StorageInternal<Schemas extends SchemaTypeRecord> {
606
671
 
607
672
 
608
673
  /**
609
- * Represents a database containing collections of documents.
610
- * RIDB extends from this class and is used to expose collections.
611
- *
612
- * So if you specify:
613
- * ```typescript
614
- * const db = new RIDB(
615
- * {
616
- * schemas: {
617
- * demo: {
618
- * version: 0,
619
- * primaryKey: 'id',
620
- * type: SchemaFieldType.object,
621
- * properties: {
622
- * id: {
623
- * type: SchemaFieldType.string,
624
- * maxLength: 60
625
- * }
626
- * }
627
- * }
628
- * } as const
629
- * }
630
- * )
631
- * ```
632
- *
633
- * The collection will be available as `db.collections.demo` and all the methods for the collection (find, count, findById, update, create, delete) will be available.
674
+ * Represents an IndexDB storage system extending the base storage functionality.
634
675
  *
635
- * @template T - A record of schema types.
676
+ * @template T - The schema type.
636
677
  */
637
- declare class Database<T extends SchemaTypeRecord> {
638
-
678
+ declare class IndexDB<T extends SchemaTypeRecord> extends BaseStorage<T> {
639
679
  /**
640
- * Creates a new `Database` instance with the provided schemas and storage module.
641
- *
642
- * @template TS - A record of schema types.
643
- * @param {TS} schemas - The schemas to use for the collections.
644
- * @param migrations
645
- * @param plugins
646
- * @param options
647
- * @param password
648
- * @returns {Promise<Database<TS>>} A promise that resolves to the created `Database` instance.
680
+ * Frees the resources used by the in-memory storage.
649
681
  */
650
- static create<TS extends SchemaTypeRecord>(
651
- db_name: string,
652
- schemas: TS,
653
- migrations: MigrationPathsForSchemas<TS> | MigrationPathsForSchema<TS[string]>,
654
- plugins:Array<typeof BasePlugin>,
655
- options: RIDBModule,
656
- password?:string,
657
- storage?: BaseStorage<TS>
658
- ): Promise<Database<TS>>;
682
+ free(): void;
659
683
 
660
- authenticate(password: string): Promise<boolean>;
684
+ static create<SchemasCreate extends SchemaTypeRecord>(
685
+ dbName: string,
686
+ schemas: SchemasCreate,
687
+ ): Promise<
688
+ IndexDB<
689
+ SchemasCreate
690
+ >
691
+ >;
692
+ }
661
693
 
662
- /**
663
- * The collections in the database.
664
- *
665
- * This is a read-only property where the key is the name of the collection and the value is a `Collection` instance.
666
- */
667
- readonly collections: {
668
- [name in keyof T]: Collection<Schema<T[name]>>
669
- }
670
694
 
671
- readonly started: boolean;
672
695
 
696
+ /**
697
+ * Represents a property within a schema, including various constraints and nested properties.
698
+ */
699
+ declare class Property {
673
700
  /**
674
- * Starts the database.
675
- *
676
- * @returns {Promise<void>} A promise that resolves when the database is started.
701
+ * The type of the property.
677
702
  */
678
- start(): Promise<void>;
703
+ readonly type: SchemaFieldType;
679
704
 
680
705
  /**
681
- * Closes the database.
682
- *
683
- * @returns {Promise<void>} A promise that resolves when the database is closed.
706
+ * The version of the property, if applicable.
684
707
  */
685
- close(): Promise<void>;
686
- }
687
-
688
- /**
689
- * Represents a function type for creating storage with the provided schema type records.
690
- *
691
- * @template T - The schema type record.
692
- * @param {T} records - The schema type records.
693
- * @returns {Promise<InternalsRecord>} A promise that resolves to the created internals record.
694
- */
695
- type CreateStorage = <T extends SchemaTypeRecord>(
696
- records: T
697
- ) => Promise<BaseStorage<T>>;
698
-
699
- /**
700
- * Represents a storage module with a method for creating storage.
701
- */
702
- type RIDBModule = {
708
+ readonly version?: number;
703
709
 
704
710
  /**
705
- * Plugin constructors array
711
+ * The primary key of the property, if applicable.
706
712
  */
707
- apply: (plugins:Array<typeof BasePlugin>) => Array<BasePlugin>;
708
- };
709
-
710
-
713
+ readonly primaryKey?: string;
711
714
 
712
- type EnumerateUpTo<
713
- N extends number,
714
- Acc extends number[] = []
715
- > = Acc['length'] extends N ?
716
- Acc[number]:
717
- EnumerateUpTo<N, [...Acc, Acc['length']]> ;
715
+ /**
716
+ * An optional array of nested properties for array-type properties.
717
+ */
718
+ readonly items?: Property;
718
719
 
719
- type EnumerateFrom1To<
720
- N extends number
721
- > = Exclude<EnumerateUpTo<N>,0> | (N extends 0 ? never : N);
720
+ /**
721
+ * The maximum number of items for array-type properties, if applicable.
722
+ */
723
+ readonly maxItems?: number;
722
724
 
723
- type IsVersionGreaterThan0<
724
- V extends number
725
- > = V extends 0 ? false : true;
725
+ /**
726
+ * The minimum number of items for array-type properties, if applicable.
727
+ */
728
+ readonly minItems?: number;
726
729
 
727
- type AnyVersionGreaterThan1<
728
- T extends Record<string, SchemaType>
729
- > = true extends {
730
- [K in keyof T]: IsVersionGreaterThan0<T[K]['version']>;
731
- } [keyof T] ? true : false;
730
+ /**
731
+ * The maximum length for string-type properties, if applicable.
732
+ */
733
+ readonly maxLength?: number;
732
734
 
733
- type MigrationFunction<T extends SchemaType> = (doc: Doc <T> ) => Doc <T>
735
+ /**
736
+ * The minimum length for string-type properties, if applicable.
737
+ */
738
+ readonly minLength?: number;
734
739
 
735
- type MigrationPathsForSchema<
736
- T extends SchemaType
737
- > = T['version'] extends 0 ? {}: // No migrations needed for version 1
738
- {
739
- [K in EnumerateFrom1To < T['version'] > ]: MigrationFunction<T> ;
740
- };
740
+ /**
741
+ * An optional array of required fields for object-type properties.
742
+ */
743
+ readonly required?: boolean;
741
744
 
742
- type MigrationPathsForSchemas<
743
- T extends SchemaTypeRecord
744
- > = {
745
- [K in keyof T]: MigrationPathsForSchema<T[K]>;
746
- };
745
+ /**
746
+ * An optional default value for the property.
747
+ */
748
+ readonly default?: any;
747
749
 
748
- type MigrationsParameter<
749
- T extends SchemaTypeRecord
750
- > = AnyVersionGreaterThan1<T> extends true ?
751
- {
752
- migrations: MigrationPathsForSchemas<T>
753
- }:
754
- {
755
- migrations?: never
750
+ /**
751
+ * An optional map of nested properties for object-type properties.
752
+ */
753
+ readonly properties?: {
754
+ [name: string]: Property;
756
755
  };
756
+ }
757
757
 
758
758
 
759
759
  /**
@@ -871,6 +871,13 @@ interface InitOutput {
871
871
  readonly corestorage_getPrimaryKeyTyped: (a: number, b: number, c: number) => void;
872
872
  readonly corestorage_getIndexes: (a: number, b: number, c: number, d: number) => void;
873
873
  readonly corestorage_matchesQuery: (a: number, b: number, c: number, d: number) => void;
874
+ readonly __wbg_database_free: (a: number) => void;
875
+ readonly database_start: (a: number) => number;
876
+ readonly database_close: (a: number) => number;
877
+ readonly database_started: (a: number) => number;
878
+ readonly database_authenticate: (a: number, b: number, c: number) => number;
879
+ readonly database_collections: (a: number, b: number) => void;
880
+ readonly database_create: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
874
881
  readonly __wbg_operation_free: (a: number) => void;
875
882
  readonly operation_collection: (a: number, b: number) => void;
876
883
  readonly operation_opType: (a: number) => number;
@@ -879,20 +886,24 @@ interface InitOutput {
879
886
  readonly operation_primaryKey: (a: number) => number;
880
887
  readonly operation_primaryKeyIndex: (a: number, b: number) => void;
881
888
  readonly __wbg_corestorage_free: (a: number) => void;
889
+ readonly __wbg_collection_free: (a: number) => void;
890
+ readonly collection_name: (a: number, b: number) => void;
891
+ readonly collection_schema: (a: number, b: number) => void;
892
+ readonly collection_find: (a: number, b: number, c: number) => number;
893
+ readonly collection_parse_query_options: (a: number, b: number, c: number) => void;
894
+ readonly collection_count: (a: number, b: number, c: number) => number;
895
+ readonly collection_findById: (a: number, b: number) => number;
896
+ readonly collection_update: (a: number, b: number) => number;
897
+ readonly collection_create: (a: number, b: number) => number;
898
+ readonly collection_delete: (a: number, b: number) => number;
899
+ readonly __wbg_basestorage_free: (a: number) => void;
900
+ readonly basestorage_new: (a: number, b: number, c: number, d: number, e: number) => void;
901
+ readonly basestorage_addIndexSchemas: (a: number, b: number) => void;
902
+ readonly basestorage_getOption: (a: number, b: number, c: number, d: number) => void;
903
+ readonly basestorage_getSchema: (a: number, b: number, c: number, d: number) => void;
904
+ readonly basestorage_core: (a: number, b: number) => void;
882
905
  readonly main_js: () => void;
883
906
  readonly is_debug_mode: () => number;
884
- readonly __wbg_property_free: (a: number) => void;
885
- readonly property_is_valid: (a: number, b: number) => void;
886
- readonly property_type: (a: number) => number;
887
- readonly property_items: (a: number, b: number) => void;
888
- readonly property_maxItems: (a: number, b: number) => void;
889
- readonly property_minItems: (a: number, b: number) => void;
890
- readonly property_maxLength: (a: number, b: number) => void;
891
- readonly property_minLength: (a: number, b: number) => void;
892
- readonly property_properties: (a: number, b: number) => void;
893
- readonly __wbgt_test_property_creation_0: (a: number) => void;
894
- readonly __wbgt_test_property_validation_1: (a: number) => void;
895
- readonly __wbgt_test_invalid_property_2: (a: number) => void;
896
907
  readonly __wbg_query_free: (a: number) => void;
897
908
  readonly query_new: (a: number, b: number, c: number) => void;
898
909
  readonly query_query: (a: number, b: number) => void;
@@ -929,22 +940,19 @@ interface InitOutput {
929
940
  readonly __wbgt_test_query_parse_eq_operator_wrong_type_32: (a: number) => void;
930
941
  readonly __wbgt_test_query_parse_ne_operator_33: (a: number) => void;
931
942
  readonly __wbgt_test_query_parse_ne_operator_wrong_type_34: (a: number) => void;
932
- readonly __wbg_collection_free: (a: number) => void;
933
- readonly collection_name: (a: number, b: number) => void;
934
- readonly collection_schema: (a: number, b: number) => void;
935
- readonly collection_find: (a: number, b: number, c: number) => number;
936
- readonly collection_parse_query_options: (a: number, b: number, c: number) => void;
937
- readonly collection_count: (a: number, b: number, c: number) => number;
938
- readonly collection_findById: (a: number, b: number) => number;
939
- readonly collection_update: (a: number, b: number) => number;
940
- readonly collection_create: (a: number, b: number) => number;
941
- readonly collection_delete: (a: number, b: number) => number;
942
- readonly __wbg_basestorage_free: (a: number) => void;
943
- readonly basestorage_new: (a: number, b: number, c: number, d: number, e: number) => void;
944
- readonly basestorage_addIndexSchemas: (a: number, b: number) => void;
945
- readonly basestorage_getOption: (a: number, b: number, c: number, d: number) => void;
946
- readonly basestorage_getSchema: (a: number, b: number, c: number, d: number) => void;
947
- readonly basestorage_core: (a: number, b: number) => void;
943
+ readonly __wbg_schema_free: (a: number) => void;
944
+ readonly schema_validate: (a: number, b: number, c: number) => void;
945
+ readonly schema_is_valid: (a: number, b: number) => void;
946
+ readonly schema_create: (a: number, b: number) => void;
947
+ readonly schema_version: (a: number) => number;
948
+ readonly schema_primaryKey: (a: number, b: number) => void;
949
+ readonly schema_type: (a: number, b: number) => void;
950
+ readonly schema_indexes: (a: number, b: number) => void;
951
+ readonly schema_encrypted: (a: number, b: number) => void;
952
+ readonly schema_properties: (a: number, b: number) => void;
953
+ readonly __wbgt_test_schema_creation_3: (a: number) => void;
954
+ readonly __wbgt_test_schema_validation_4: (a: number) => void;
955
+ readonly __wbgt_test_invalid_schema_5: (a: number) => void;
948
956
  readonly __wbg_baseplugin_free: (a: number) => void;
949
957
  readonly baseplugin_new: (a: number, b: number, c: number) => void;
950
958
  readonly baseplugin_name: (a: number) => number;
@@ -952,6 +960,14 @@ interface InitOutput {
952
960
  readonly baseplugin_get_doc_recover_hook: (a: number) => number;
953
961
  readonly baseplugin_set_doc_create_hook: (a: number, b: number) => void;
954
962
  readonly baseplugin_set_doc_recover_hook: (a: number, b: number) => void;
963
+ readonly __wbg_inmemory_free: (a: number) => void;
964
+ readonly inmemory_create: (a: number, b: number, c: number) => number;
965
+ readonly inmemory_write: (a: number, b: number) => number;
966
+ readonly inmemory_find: (a: number, b: number, c: number, d: number, e: number) => number;
967
+ readonly inmemory_findDocumentById: (a: number, b: number, c: number, d: number) => number;
968
+ readonly inmemory_count: (a: number, b: number, c: number, d: number, e: number) => number;
969
+ readonly inmemory_close: (a: number) => number;
970
+ readonly inmemory_start: (a: number) => number;
955
971
  readonly __wbg_ridberror_free: (a: number) => void;
956
972
  readonly ridberror_new: (a: number, b: number, c: number, d: number, e: number) => number;
957
973
  readonly ridberror_type: (a: number, b: number) => void;
@@ -974,37 +990,21 @@ interface InitOutput {
974
990
  readonly indexdb_count: (a: number, b: number, c: number, d: number, e: number) => number;
975
991
  readonly indexdb_close: (a: number) => number;
976
992
  readonly indexdb_start: (a: number) => number;
977
- readonly __wbg_inmemory_free: (a: number) => void;
978
- readonly inmemory_create: (a: number, b: number, c: number) => number;
979
- readonly inmemory_write: (a: number, b: number) => number;
980
- readonly inmemory_find: (a: number, b: number, c: number, d: number, e: number) => number;
981
- readonly inmemory_findDocumentById: (a: number, b: number, c: number, d: number) => number;
982
- readonly inmemory_count: (a: number, b: number, c: number, d: number, e: number) => number;
983
- readonly inmemory_close: (a: number) => number;
984
- readonly inmemory_start: (a: number) => number;
985
993
  readonly __wbg_queryoptions_free: (a: number) => void;
986
994
  readonly queryoptions_limit: (a: number, b: number) => void;
987
995
  readonly queryoptions_offset: (a: number, b: number) => void;
988
- readonly __wbg_schema_free: (a: number) => void;
989
- readonly schema_validate: (a: number, b: number, c: number) => void;
990
- readonly schema_is_valid: (a: number, b: number) => void;
991
- readonly schema_create: (a: number, b: number) => void;
992
- readonly schema_version: (a: number) => number;
993
- readonly schema_primaryKey: (a: number, b: number) => void;
994
- readonly schema_type: (a: number, b: number) => void;
995
- readonly schema_indexes: (a: number, b: number) => void;
996
- readonly schema_encrypted: (a: number, b: number) => void;
997
- readonly schema_properties: (a: number, b: number) => void;
998
- readonly __wbgt_test_schema_creation_3: (a: number) => void;
999
- readonly __wbgt_test_schema_validation_4: (a: number) => void;
1000
- readonly __wbgt_test_invalid_schema_5: (a: number) => void;
1001
- readonly __wbg_database_free: (a: number) => void;
1002
- readonly database_start: (a: number) => number;
1003
- readonly database_close: (a: number) => number;
1004
- readonly database_started: (a: number) => number;
1005
- readonly database_authenticate: (a: number, b: number, c: number) => number;
1006
- readonly database_collections: (a: number, b: number) => void;
1007
- readonly database_create: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
996
+ readonly __wbg_property_free: (a: number) => void;
997
+ readonly property_is_valid: (a: number, b: number) => void;
998
+ readonly property_type: (a: number) => number;
999
+ readonly property_items: (a: number, b: number) => void;
1000
+ readonly property_maxItems: (a: number, b: number) => void;
1001
+ readonly property_minItems: (a: number, b: number) => void;
1002
+ readonly property_maxLength: (a: number, b: number) => void;
1003
+ readonly property_minLength: (a: number, b: number) => void;
1004
+ readonly property_properties: (a: number, b: number) => void;
1005
+ readonly __wbgt_test_property_creation_0: (a: number) => void;
1006
+ readonly __wbgt_test_property_validation_1: (a: number) => void;
1007
+ readonly __wbgt_test_invalid_property_2: (a: number) => void;
1008
1008
  readonly __wbg_wasmbindgentestcontext_free: (a: number) => void;
1009
1009
  readonly wasmbindgentestcontext_new: () => number;
1010
1010
  readonly wasmbindgentestcontext_args: (a: number, b: number, c: number) => void;
@@ -1017,16 +1017,16 @@ interface InitOutput {
1017
1017
  readonly __wbindgen_malloc: (a: number, b: number) => number;
1018
1018
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
1019
1019
  readonly __wbindgen_export_2: WebAssembly.Table;
1020
- readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h07337a613af73c1c: (a: number, b: number, c: number) => number;
1021
1020
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
1022
- readonly _dyn_core__ops__function__Fn__A_B_C___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h8ff44d1dd2af116f: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
1023
- readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hef5fe0a25bd463e1: (a: number, b: number, c: number) => void;
1024
- readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6fc97b853dde6831: (a: number, b: number, c: number) => void;
1021
+ readonly _dyn_core__ops__function__Fn__A_B_C___Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1d7727fe9471ac49: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
1022
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4e550b82c2b30c7a: (a: number, b: number, c: number) => void;
1023
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hef4d0d64e714d731: (a: number, b: number, c: number) => number;
1024
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf401bdfdf8c9bdd9: (a: number, b: number, c: number) => void;
1025
1025
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
1026
1026
  readonly __wbindgen_exn_store: (a: number) => void;
1027
- readonly wasm_bindgen__convert__closures__invoke0_mut__h2cca5e72c8e71f77: (a: number, b: number) => void;
1028
- readonly wasm_bindgen__convert__closures__invoke3_mut__h3e319120fb66fb1e: (a: number, b: number, c: number, d: number, e: number) => void;
1029
- readonly wasm_bindgen__convert__closures__invoke2_mut__h5f5731f0f637befa: (a: number, b: number, c: number, d: number) => void;
1027
+ readonly wasm_bindgen__convert__closures__invoke0_mut__he68973678185bd11: (a: number, b: number) => void;
1028
+ readonly wasm_bindgen__convert__closures__invoke3_mut__h711940be5154e055: (a: number, b: number, c: number, d: number, e: number) => void;
1029
+ readonly wasm_bindgen__convert__closures__invoke2_mut__hdfe55fa2a247d1ac: (a: number, b: number, c: number, d: number) => void;
1030
1030
  readonly __wbindgen_start: () => void;
1031
1031
  }
1032
1032