@trust0/ridb-core 1.7.34 → 1.7.35
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/build/ridb_core.d.ts +309 -309
- package/build/ridb_core.js +50 -50
- package/build/ridb_core.mjs +50 -50
- package/build/ridb_core_bg.mjs +1 -1
- package/package.json +1 -1
package/build/ridb_core.d.ts
CHANGED
|
@@ -73,6 +73,122 @@ declare enum Errors {
|
|
|
73
73
|
AuthenticationError = 5,
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Represents a property within a schema, including various constraints and nested properties.
|
|
78
|
+
*/
|
|
79
|
+
declare class Property {
|
|
80
|
+
/**
|
|
81
|
+
* The type of the property.
|
|
82
|
+
*/
|
|
83
|
+
readonly type: SchemaFieldType;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The version of the property, if applicable.
|
|
87
|
+
*/
|
|
88
|
+
readonly version?: number;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The primary key of the property, if applicable.
|
|
92
|
+
*/
|
|
93
|
+
readonly primaryKey?: string;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* An optional array of nested properties for array-type properties.
|
|
97
|
+
*/
|
|
98
|
+
readonly items?: Property;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The maximum number of items for array-type properties, if applicable.
|
|
102
|
+
*/
|
|
103
|
+
readonly maxItems?: number;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The minimum number of items for array-type properties, if applicable.
|
|
107
|
+
*/
|
|
108
|
+
readonly minItems?: number;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The maximum length for string-type properties, if applicable.
|
|
112
|
+
*/
|
|
113
|
+
readonly maxLength?: number;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* The minimum length for string-type properties, if applicable.
|
|
117
|
+
*/
|
|
118
|
+
readonly minLength?: number;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* An optional array of required fields for object-type properties.
|
|
122
|
+
*/
|
|
123
|
+
readonly required?: boolean;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* An optional default value for the property.
|
|
127
|
+
*/
|
|
128
|
+
readonly default?: any;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* An optional map of nested properties for object-type properties.
|
|
132
|
+
*/
|
|
133
|
+
readonly properties?: {
|
|
134
|
+
[name: string]: Property;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
declare const SchemaFieldType = {
|
|
141
|
+
/**
|
|
142
|
+
* String type for text data
|
|
143
|
+
*/
|
|
144
|
+
string: 'string' as const,
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Number type for numeric data (integers and floats)
|
|
148
|
+
*/
|
|
149
|
+
number: 'number' as const,
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Boolean type for true/false values
|
|
153
|
+
*/
|
|
154
|
+
boolean: 'boolean' as const,
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Array type for ordered collections of items
|
|
158
|
+
*/
|
|
159
|
+
array: 'array' as const,
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Object type for nested document structures
|
|
163
|
+
*/
|
|
164
|
+
object: 'object' as const,
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Represents an IndexDB storage system extending the base storage functionality.
|
|
171
|
+
*
|
|
172
|
+
* @template T - The schema type.
|
|
173
|
+
*/
|
|
174
|
+
declare class IndexDB<T extends SchemaTypeRecord> extends BaseStorage<T> {
|
|
175
|
+
/**
|
|
176
|
+
* Frees the resources used by the in-memory storage.
|
|
177
|
+
*/
|
|
178
|
+
free(): void;
|
|
179
|
+
|
|
180
|
+
static create<SchemasCreate extends SchemaTypeRecord>(
|
|
181
|
+
dbName: string,
|
|
182
|
+
schemas: SchemasCreate,
|
|
183
|
+
): Promise<
|
|
184
|
+
IndexDB<
|
|
185
|
+
SchemasCreate
|
|
186
|
+
>
|
|
187
|
+
>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
76
192
|
type InternalsRecord = {
|
|
77
193
|
[name: string]: BaseStorage<SchemaTypeRecord>
|
|
78
194
|
};
|
|
@@ -232,6 +348,148 @@ type Operation<T extends SchemaType = SchemaType> = {
|
|
|
232
348
|
|
|
233
349
|
|
|
234
350
|
|
|
351
|
+
type Operators<T> = {
|
|
352
|
+
$gte?: number,
|
|
353
|
+
$gt?: number
|
|
354
|
+
$lt?: number,
|
|
355
|
+
$lte?: number,
|
|
356
|
+
$eq?: T,
|
|
357
|
+
$ne?: T
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
type InOperator<T> = { $in?: T[] };
|
|
361
|
+
type NInOperator<T> = { $nin?: T[] };
|
|
362
|
+
|
|
363
|
+
type OperatorOrType<T> = T extends number ?
|
|
364
|
+
T | Operators<T> | InOperator<T> | NInOperator<T> :
|
|
365
|
+
T | InOperator<T> | NInOperator<T>;
|
|
366
|
+
|
|
367
|
+
type LogicalOperators<T extends SchemaType> = {
|
|
368
|
+
$and?: Partial<QueryType<T>>[];
|
|
369
|
+
$or?: Partial<QueryType<T>>[];
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
type QueryType<T extends SchemaType> = ({
|
|
373
|
+
[K in keyof T['properties']as ExtractType<T['properties'][K]['type']> extends undefined ? never : K]?: OperatorOrType<
|
|
374
|
+
ExtractType<
|
|
375
|
+
T['properties'][K]['type']
|
|
376
|
+
>
|
|
377
|
+
>
|
|
378
|
+
} & LogicalOperators<T>) | LogicalOperators<T>[];
|
|
379
|
+
|
|
380
|
+
declare class Query<T extends SchemaType> {
|
|
381
|
+
constructor(query: QueryType<T>, schema:Schema<T>);
|
|
382
|
+
readonly query: QueryType<T>;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
type EnumerateUpTo<
|
|
388
|
+
N extends number,
|
|
389
|
+
Acc extends number[] = []
|
|
390
|
+
> = Acc['length'] extends N ?
|
|
391
|
+
Acc[number]:
|
|
392
|
+
EnumerateUpTo<N, [...Acc, Acc['length']]> ;
|
|
393
|
+
|
|
394
|
+
type EnumerateFrom1To<
|
|
395
|
+
N extends number
|
|
396
|
+
> = Exclude<EnumerateUpTo<N>,0> | (N extends 0 ? never : N);
|
|
397
|
+
|
|
398
|
+
type IsVersionGreaterThan0<
|
|
399
|
+
V extends number
|
|
400
|
+
> = V extends 0 ? false : true;
|
|
401
|
+
|
|
402
|
+
type AnyVersionGreaterThan1<
|
|
403
|
+
T extends Record<string, SchemaType>
|
|
404
|
+
> = true extends {
|
|
405
|
+
[K in keyof T]: IsVersionGreaterThan0<T[K]['version']>;
|
|
406
|
+
} [keyof T] ? true : false;
|
|
407
|
+
|
|
408
|
+
type MigrationFunction<T extends SchemaType> = (doc: Doc <T> ) => Doc <T>
|
|
409
|
+
|
|
410
|
+
type MigrationPathsForSchema<
|
|
411
|
+
T extends SchemaType
|
|
412
|
+
> = T['version'] extends 0 ? {}: // No migrations needed for version 1
|
|
413
|
+
{
|
|
414
|
+
[K in EnumerateFrom1To < T['version'] > ]: MigrationFunction<T> ;
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
type MigrationPathsForSchemas<
|
|
418
|
+
T extends SchemaTypeRecord
|
|
419
|
+
> = {
|
|
420
|
+
[K in keyof T]: MigrationPathsForSchema<T[K]>;
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
type MigrationsParameter<
|
|
424
|
+
T extends SchemaTypeRecord
|
|
425
|
+
> = AnyVersionGreaterThan1<T> extends true ?
|
|
426
|
+
{
|
|
427
|
+
migrations: MigrationPathsForSchemas<T>
|
|
428
|
+
}:
|
|
429
|
+
{
|
|
430
|
+
migrations?: never
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Represents an in-memory storage system extending the base storage functionality.
|
|
437
|
+
*
|
|
438
|
+
* @template T - The schema type.
|
|
439
|
+
*/
|
|
440
|
+
declare class InMemory<T extends SchemaTypeRecord> extends BaseStorage<T> {
|
|
441
|
+
/**
|
|
442
|
+
* Frees the resources used by the in-memory storage.
|
|
443
|
+
*/
|
|
444
|
+
free(): void;
|
|
445
|
+
|
|
446
|
+
static create<SchemasCreate extends SchemaTypeRecord>(
|
|
447
|
+
dbName: string,
|
|
448
|
+
schemas: SchemasCreate,
|
|
449
|
+
): Promise<
|
|
450
|
+
InMemory<
|
|
451
|
+
SchemasCreate
|
|
452
|
+
>
|
|
453
|
+
>;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Represents a record of schema types, where each key is a string and the value is a `SchemaType`.
|
|
460
|
+
* @internal
|
|
461
|
+
*/
|
|
462
|
+
type SchemaTypeRecord = {
|
|
463
|
+
[name: string]: SchemaType
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
declare abstract class StorageInternal<Schemas extends SchemaTypeRecord> {
|
|
467
|
+
constructor(
|
|
468
|
+
name: string,
|
|
469
|
+
schemas: Schemas
|
|
470
|
+
);
|
|
471
|
+
abstract start(): Promise<void>;
|
|
472
|
+
abstract close(): Promise<void>;
|
|
473
|
+
abstract count(
|
|
474
|
+
colectionName: keyof Schemas,
|
|
475
|
+
query: QueryType<Schemas[keyof Schemas]>,
|
|
476
|
+
options?: QueryOptions
|
|
477
|
+
): Promise<number>;
|
|
478
|
+
abstract findDocumentById(
|
|
479
|
+
collectionName: keyof Schemas,
|
|
480
|
+
id: string
|
|
481
|
+
): Promise<Doc<Schemas[keyof Schemas]> | null>;
|
|
482
|
+
abstract find(
|
|
483
|
+
collectionName: keyof Schemas,
|
|
484
|
+
query: QueryType<Schemas[keyof Schemas]>,
|
|
485
|
+
options?: QueryOptions
|
|
486
|
+
): Promise<Doc<Schemas[keyof Schemas]>[]>;
|
|
487
|
+
abstract write(
|
|
488
|
+
op: Operation<Schemas[keyof Schemas]>
|
|
489
|
+
): Promise<Doc<Schemas[keyof Schemas]>>;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
|
|
235
493
|
type BaseStorageOptions = {
|
|
236
494
|
[name:string]:string | boolean | number
|
|
237
495
|
}
|
|
@@ -381,120 +639,13 @@ type Hook = (
|
|
|
381
639
|
|
|
382
640
|
type BasePluginOptions = {
|
|
383
641
|
docCreateHook?: Hook,
|
|
384
|
-
docRecoverHook?: Hook
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
declare class BasePlugin implements BasePluginOptions {
|
|
388
|
-
docCreateHook?:Hook;
|
|
389
|
-
docRecoverHook?:Hook;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
type Operators<T> = {
|
|
395
|
-
$gte?: number,
|
|
396
|
-
$gt?: number
|
|
397
|
-
$lt?: number,
|
|
398
|
-
$lte?: number,
|
|
399
|
-
$eq?: T,
|
|
400
|
-
$ne?: T
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
type InOperator<T> = { $in?: T[] };
|
|
404
|
-
type NInOperator<T> = { $nin?: T[] };
|
|
405
|
-
|
|
406
|
-
type OperatorOrType<T> = T extends number ?
|
|
407
|
-
T | Operators<T> | InOperator<T> | NInOperator<T> :
|
|
408
|
-
T | InOperator<T> | NInOperator<T>;
|
|
409
|
-
|
|
410
|
-
type LogicalOperators<T extends SchemaType> = {
|
|
411
|
-
$and?: Partial<QueryType<T>>[];
|
|
412
|
-
$or?: Partial<QueryType<T>>[];
|
|
413
|
-
};
|
|
414
|
-
|
|
415
|
-
type QueryType<T extends SchemaType> = ({
|
|
416
|
-
[K in keyof T['properties']as ExtractType<T['properties'][K]['type']> extends undefined ? never : K]?: OperatorOrType<
|
|
417
|
-
ExtractType<
|
|
418
|
-
T['properties'][K]['type']
|
|
419
|
-
>
|
|
420
|
-
>
|
|
421
|
-
} & LogicalOperators<T>) | LogicalOperators<T>[];
|
|
422
|
-
|
|
423
|
-
declare class Query<T extends SchemaType> {
|
|
424
|
-
constructor(query: QueryType<T>, schema:Schema<T>);
|
|
425
|
-
readonly query: QueryType<T>;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
/**
|
|
431
|
-
* Represents an in-memory storage system extending the base storage functionality.
|
|
432
|
-
*
|
|
433
|
-
* @template T - The schema type.
|
|
434
|
-
*/
|
|
435
|
-
declare class InMemory<T extends SchemaTypeRecord> extends BaseStorage<T> {
|
|
436
|
-
/**
|
|
437
|
-
* Frees the resources used by the in-memory storage.
|
|
438
|
-
*/
|
|
439
|
-
free(): void;
|
|
440
|
-
|
|
441
|
-
static create<SchemasCreate extends SchemaTypeRecord>(
|
|
442
|
-
dbName: string,
|
|
443
|
-
schemas: SchemasCreate,
|
|
444
|
-
): Promise<
|
|
445
|
-
InMemory<
|
|
446
|
-
SchemasCreate
|
|
447
|
-
>
|
|
448
|
-
>;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
type EnumerateUpTo<
|
|
454
|
-
N extends number,
|
|
455
|
-
Acc extends number[] = []
|
|
456
|
-
> = Acc['length'] extends N ?
|
|
457
|
-
Acc[number]:
|
|
458
|
-
EnumerateUpTo<N, [...Acc, Acc['length']]> ;
|
|
459
|
-
|
|
460
|
-
type EnumerateFrom1To<
|
|
461
|
-
N extends number
|
|
462
|
-
> = Exclude<EnumerateUpTo<N>,0> | (N extends 0 ? never : N);
|
|
463
|
-
|
|
464
|
-
type IsVersionGreaterThan0<
|
|
465
|
-
V extends number
|
|
466
|
-
> = V extends 0 ? false : true;
|
|
467
|
-
|
|
468
|
-
type AnyVersionGreaterThan1<
|
|
469
|
-
T extends Record<string, SchemaType>
|
|
470
|
-
> = true extends {
|
|
471
|
-
[K in keyof T]: IsVersionGreaterThan0<T[K]['version']>;
|
|
472
|
-
} [keyof T] ? true : false;
|
|
473
|
-
|
|
474
|
-
type MigrationFunction<T extends SchemaType> = (doc: Doc <T> ) => Doc <T>
|
|
475
|
-
|
|
476
|
-
type MigrationPathsForSchema<
|
|
477
|
-
T extends SchemaType
|
|
478
|
-
> = T['version'] extends 0 ? {}: // No migrations needed for version 1
|
|
479
|
-
{
|
|
480
|
-
[K in EnumerateFrom1To < T['version'] > ]: MigrationFunction<T> ;
|
|
481
|
-
};
|
|
482
|
-
|
|
483
|
-
type MigrationPathsForSchemas<
|
|
484
|
-
T extends SchemaTypeRecord
|
|
485
|
-
> = {
|
|
486
|
-
[K in keyof T]: MigrationPathsForSchema<T[K]>;
|
|
487
|
-
};
|
|
642
|
+
docRecoverHook?: Hook
|
|
643
|
+
}
|
|
488
644
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
migrations: MigrationPathsForSchemas<T>
|
|
494
|
-
}:
|
|
495
|
-
{
|
|
496
|
-
migrations?: never
|
|
497
|
-
};
|
|
645
|
+
declare class BasePlugin implements BasePluginOptions {
|
|
646
|
+
docCreateHook?:Hook;
|
|
647
|
+
docRecoverHook?:Hook;
|
|
648
|
+
}
|
|
498
649
|
|
|
499
650
|
|
|
500
651
|
|
|
@@ -605,157 +756,6 @@ declare class Schema<T extends SchemaType> {
|
|
|
605
756
|
}
|
|
606
757
|
|
|
607
758
|
|
|
608
|
-
|
|
609
|
-
/**
|
|
610
|
-
* Represents a property within a schema, including various constraints and nested properties.
|
|
611
|
-
*/
|
|
612
|
-
declare class Property {
|
|
613
|
-
/**
|
|
614
|
-
* The type of the property.
|
|
615
|
-
*/
|
|
616
|
-
readonly type: SchemaFieldType;
|
|
617
|
-
|
|
618
|
-
/**
|
|
619
|
-
* The version of the property, if applicable.
|
|
620
|
-
*/
|
|
621
|
-
readonly version?: number;
|
|
622
|
-
|
|
623
|
-
/**
|
|
624
|
-
* The primary key of the property, if applicable.
|
|
625
|
-
*/
|
|
626
|
-
readonly primaryKey?: string;
|
|
627
|
-
|
|
628
|
-
/**
|
|
629
|
-
* An optional array of nested properties for array-type properties.
|
|
630
|
-
*/
|
|
631
|
-
readonly items?: Property;
|
|
632
|
-
|
|
633
|
-
/**
|
|
634
|
-
* The maximum number of items for array-type properties, if applicable.
|
|
635
|
-
*/
|
|
636
|
-
readonly maxItems?: number;
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
* The minimum number of items for array-type properties, if applicable.
|
|
640
|
-
*/
|
|
641
|
-
readonly minItems?: number;
|
|
642
|
-
|
|
643
|
-
/**
|
|
644
|
-
* The maximum length for string-type properties, if applicable.
|
|
645
|
-
*/
|
|
646
|
-
readonly maxLength?: number;
|
|
647
|
-
|
|
648
|
-
/**
|
|
649
|
-
* The minimum length for string-type properties, if applicable.
|
|
650
|
-
*/
|
|
651
|
-
readonly minLength?: number;
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* An optional array of required fields for object-type properties.
|
|
655
|
-
*/
|
|
656
|
-
readonly required?: boolean;
|
|
657
|
-
|
|
658
|
-
/**
|
|
659
|
-
* An optional default value for the property.
|
|
660
|
-
*/
|
|
661
|
-
readonly default?: any;
|
|
662
|
-
|
|
663
|
-
/**
|
|
664
|
-
* An optional map of nested properties for object-type properties.
|
|
665
|
-
*/
|
|
666
|
-
readonly properties?: {
|
|
667
|
-
[name: string]: Property;
|
|
668
|
-
};
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
/**
|
|
674
|
-
* Represents a record of schema types, where each key is a string and the value is a `SchemaType`.
|
|
675
|
-
* @internal
|
|
676
|
-
*/
|
|
677
|
-
type SchemaTypeRecord = {
|
|
678
|
-
[name: string]: SchemaType
|
|
679
|
-
};
|
|
680
|
-
|
|
681
|
-
declare abstract class StorageInternal<Schemas extends SchemaTypeRecord> {
|
|
682
|
-
constructor(
|
|
683
|
-
name: string,
|
|
684
|
-
schemas: Schemas
|
|
685
|
-
);
|
|
686
|
-
abstract start(): Promise<void>;
|
|
687
|
-
abstract close(): Promise<void>;
|
|
688
|
-
abstract count(
|
|
689
|
-
colectionName: keyof Schemas,
|
|
690
|
-
query: QueryType<Schemas[keyof Schemas]>,
|
|
691
|
-
options?: QueryOptions
|
|
692
|
-
): Promise<number>;
|
|
693
|
-
abstract findDocumentById(
|
|
694
|
-
collectionName: keyof Schemas,
|
|
695
|
-
id: string
|
|
696
|
-
): Promise<Doc<Schemas[keyof Schemas]> | null>;
|
|
697
|
-
abstract find(
|
|
698
|
-
collectionName: keyof Schemas,
|
|
699
|
-
query: QueryType<Schemas[keyof Schemas]>,
|
|
700
|
-
options?: QueryOptions
|
|
701
|
-
): Promise<Doc<Schemas[keyof Schemas]>[]>;
|
|
702
|
-
abstract write(
|
|
703
|
-
op: Operation<Schemas[keyof Schemas]>
|
|
704
|
-
): Promise<Doc<Schemas[keyof Schemas]>>;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
declare const SchemaFieldType = {
|
|
709
|
-
/**
|
|
710
|
-
* String type for text data
|
|
711
|
-
*/
|
|
712
|
-
string: 'string' as const,
|
|
713
|
-
|
|
714
|
-
/**
|
|
715
|
-
* Number type for numeric data (integers and floats)
|
|
716
|
-
*/
|
|
717
|
-
number: 'number' as const,
|
|
718
|
-
|
|
719
|
-
/**
|
|
720
|
-
* Boolean type for true/false values
|
|
721
|
-
*/
|
|
722
|
-
boolean: 'boolean' as const,
|
|
723
|
-
|
|
724
|
-
/**
|
|
725
|
-
* Array type for ordered collections of items
|
|
726
|
-
*/
|
|
727
|
-
array: 'array' as const,
|
|
728
|
-
|
|
729
|
-
/**
|
|
730
|
-
* Object type for nested document structures
|
|
731
|
-
*/
|
|
732
|
-
object: 'object' as const,
|
|
733
|
-
};
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
/**
|
|
738
|
-
* Represents an IndexDB storage system extending the base storage functionality.
|
|
739
|
-
*
|
|
740
|
-
* @template T - The schema type.
|
|
741
|
-
*/
|
|
742
|
-
declare class IndexDB<T extends SchemaTypeRecord> extends BaseStorage<T> {
|
|
743
|
-
/**
|
|
744
|
-
* Frees the resources used by the in-memory storage.
|
|
745
|
-
*/
|
|
746
|
-
free(): void;
|
|
747
|
-
|
|
748
|
-
static create<SchemasCreate extends SchemaTypeRecord>(
|
|
749
|
-
dbName: string,
|
|
750
|
-
schemas: SchemasCreate,
|
|
751
|
-
): Promise<
|
|
752
|
-
IndexDB<
|
|
753
|
-
SchemasCreate
|
|
754
|
-
>
|
|
755
|
-
>;
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
|
|
759
759
|
/**
|
|
760
760
|
*/
|
|
761
761
|
declare class RIDBError {
|
|
@@ -867,6 +867,28 @@ type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Modul
|
|
|
867
867
|
|
|
868
868
|
interface InitOutput {
|
|
869
869
|
readonly memory: WebAssembly.Memory;
|
|
870
|
+
readonly __wbg_property_free: (a: number) => void;
|
|
871
|
+
readonly property_is_valid: (a: number, b: number) => void;
|
|
872
|
+
readonly property_type: (a: number) => number;
|
|
873
|
+
readonly property_items: (a: number, b: number) => void;
|
|
874
|
+
readonly property_maxItems: (a: number, b: number) => void;
|
|
875
|
+
readonly property_minItems: (a: number, b: number) => void;
|
|
876
|
+
readonly property_maxLength: (a: number, b: number) => void;
|
|
877
|
+
readonly property_minLength: (a: number, b: number) => void;
|
|
878
|
+
readonly property_properties: (a: number, b: number) => void;
|
|
879
|
+
readonly __wbgt_test_property_creation_0: (a: number) => void;
|
|
880
|
+
readonly __wbgt_test_property_validation_1: (a: number) => void;
|
|
881
|
+
readonly __wbgt_test_invalid_property_2: (a: number) => void;
|
|
882
|
+
readonly __wbg_indexdb_free: (a: number) => void;
|
|
883
|
+
readonly indexdb_get_stores: (a: number, b: number) => void;
|
|
884
|
+
readonly indexdb_get_store: (a: number, b: number, c: number, d: number) => void;
|
|
885
|
+
readonly indexdb_create: (a: number, b: number, c: number) => number;
|
|
886
|
+
readonly indexdb_write: (a: number, b: number) => number;
|
|
887
|
+
readonly indexdb_find: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
888
|
+
readonly indexdb_findDocumentById: (a: number, b: number, c: number, d: number) => number;
|
|
889
|
+
readonly indexdb_count: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
890
|
+
readonly indexdb_close: (a: number) => number;
|
|
891
|
+
readonly indexdb_start: (a: number) => number;
|
|
870
892
|
readonly __wbg_collection_free: (a: number) => void;
|
|
871
893
|
readonly collection_name: (a: number, b: number) => void;
|
|
872
894
|
readonly collection_schema: (a: number, b: number) => void;
|
|
@@ -889,29 +911,6 @@ interface InitOutput {
|
|
|
889
911
|
readonly operation_primaryKeyIndex: (a: number, b: number) => void;
|
|
890
912
|
readonly corestorage_new: () => number;
|
|
891
913
|
readonly __wbg_corestorage_free: (a: number) => void;
|
|
892
|
-
readonly __wbg_basestorage_free: (a: number) => void;
|
|
893
|
-
readonly basestorage_new: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
894
|
-
readonly basestorage_addIndexSchemas: (a: number, b: number) => void;
|
|
895
|
-
readonly basestorage_getOption: (a: number, b: number, c: number, d: number) => void;
|
|
896
|
-
readonly basestorage_getSchema: (a: number, b: number, c: number, d: number) => void;
|
|
897
|
-
readonly basestorage_core: (a: number, b: number) => void;
|
|
898
|
-
readonly __wbg_database_free: (a: number) => void;
|
|
899
|
-
readonly database_start: (a: number) => number;
|
|
900
|
-
readonly database_close: (a: number) => number;
|
|
901
|
-
readonly database_started: (a: number) => number;
|
|
902
|
-
readonly database_authenticate: (a: number, b: number, c: number) => number;
|
|
903
|
-
readonly database_collections: (a: number, b: number) => void;
|
|
904
|
-
readonly database_create: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
905
|
-
readonly __wbg_queryoptions_free: (a: number) => void;
|
|
906
|
-
readonly queryoptions_limit: (a: number, b: number) => void;
|
|
907
|
-
readonly queryoptions_offset: (a: number, b: number) => void;
|
|
908
|
-
readonly __wbg_baseplugin_free: (a: number) => void;
|
|
909
|
-
readonly baseplugin_new: (a: number, b: number, c: number) => void;
|
|
910
|
-
readonly baseplugin_name: (a: number) => number;
|
|
911
|
-
readonly baseplugin_get_doc_create_hook: (a: number) => number;
|
|
912
|
-
readonly baseplugin_get_doc_recover_hook: (a: number) => number;
|
|
913
|
-
readonly baseplugin_set_doc_create_hook: (a: number, b: number) => void;
|
|
914
|
-
readonly baseplugin_set_doc_recover_hook: (a: number, b: number) => void;
|
|
915
914
|
readonly __wbg_query_free: (a: number) => void;
|
|
916
915
|
readonly query_new: (a: number, b: number, c: number) => void;
|
|
917
916
|
readonly query_query: (a: number, b: number) => void;
|
|
@@ -959,6 +958,29 @@ interface InitOutput {
|
|
|
959
958
|
readonly inmemory_start: (a: number) => number;
|
|
960
959
|
readonly main_js: () => void;
|
|
961
960
|
readonly is_debug_mode: () => number;
|
|
961
|
+
readonly __wbg_basestorage_free: (a: number) => void;
|
|
962
|
+
readonly basestorage_new: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
963
|
+
readonly basestorage_addIndexSchemas: (a: number, b: number) => void;
|
|
964
|
+
readonly basestorage_getOption: (a: number, b: number, c: number, d: number) => void;
|
|
965
|
+
readonly basestorage_getSchema: (a: number, b: number, c: number, d: number) => void;
|
|
966
|
+
readonly basestorage_core: (a: number, b: number) => void;
|
|
967
|
+
readonly __wbg_database_free: (a: number) => void;
|
|
968
|
+
readonly database_start: (a: number) => number;
|
|
969
|
+
readonly database_close: (a: number) => number;
|
|
970
|
+
readonly database_started: (a: number) => number;
|
|
971
|
+
readonly database_authenticate: (a: number, b: number, c: number) => number;
|
|
972
|
+
readonly database_collections: (a: number, b: number) => void;
|
|
973
|
+
readonly database_create: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
974
|
+
readonly __wbg_queryoptions_free: (a: number) => void;
|
|
975
|
+
readonly queryoptions_limit: (a: number, b: number) => void;
|
|
976
|
+
readonly queryoptions_offset: (a: number, b: number) => void;
|
|
977
|
+
readonly __wbg_baseplugin_free: (a: number) => void;
|
|
978
|
+
readonly baseplugin_new: (a: number, b: number, c: number) => void;
|
|
979
|
+
readonly baseplugin_name: (a: number) => number;
|
|
980
|
+
readonly baseplugin_get_doc_create_hook: (a: number) => number;
|
|
981
|
+
readonly baseplugin_get_doc_recover_hook: (a: number) => number;
|
|
982
|
+
readonly baseplugin_set_doc_create_hook: (a: number, b: number) => void;
|
|
983
|
+
readonly baseplugin_set_doc_recover_hook: (a: number, b: number) => void;
|
|
962
984
|
readonly __wbg_ridberror_free: (a: number) => void;
|
|
963
985
|
readonly ridberror_new: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
964
986
|
readonly ridberror_type: (a: number, b: number) => void;
|
|
@@ -984,28 +1006,6 @@ interface InitOutput {
|
|
|
984
1006
|
readonly __wbgt_test_schema_creation_3: (a: number) => void;
|
|
985
1007
|
readonly __wbgt_test_schema_validation_4: (a: number) => void;
|
|
986
1008
|
readonly __wbgt_test_invalid_schema_5: (a: number) => void;
|
|
987
|
-
readonly __wbg_property_free: (a: number) => void;
|
|
988
|
-
readonly property_is_valid: (a: number, b: number) => void;
|
|
989
|
-
readonly property_type: (a: number) => number;
|
|
990
|
-
readonly property_items: (a: number, b: number) => void;
|
|
991
|
-
readonly property_maxItems: (a: number, b: number) => void;
|
|
992
|
-
readonly property_minItems: (a: number, b: number) => void;
|
|
993
|
-
readonly property_maxLength: (a: number, b: number) => void;
|
|
994
|
-
readonly property_minLength: (a: number, b: number) => void;
|
|
995
|
-
readonly property_properties: (a: number, b: number) => void;
|
|
996
|
-
readonly __wbgt_test_property_creation_0: (a: number) => void;
|
|
997
|
-
readonly __wbgt_test_property_validation_1: (a: number) => void;
|
|
998
|
-
readonly __wbgt_test_invalid_property_2: (a: number) => void;
|
|
999
|
-
readonly __wbg_indexdb_free: (a: number) => void;
|
|
1000
|
-
readonly indexdb_get_stores: (a: number, b: number) => void;
|
|
1001
|
-
readonly indexdb_get_store: (a: number, b: number, c: number, d: number) => void;
|
|
1002
|
-
readonly indexdb_create: (a: number, b: number, c: number) => number;
|
|
1003
|
-
readonly indexdb_write: (a: number, b: number) => number;
|
|
1004
|
-
readonly indexdb_find: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
1005
|
-
readonly indexdb_findDocumentById: (a: number, b: number, c: number, d: number) => number;
|
|
1006
|
-
readonly indexdb_count: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
1007
|
-
readonly indexdb_close: (a: number) => number;
|
|
1008
|
-
readonly indexdb_start: (a: number) => number;
|
|
1009
1009
|
readonly __wbg_wasmbindgentestcontext_free: (a: number) => void;
|
|
1010
1010
|
readonly wasmbindgentestcontext_new: () => number;
|
|
1011
1011
|
readonly wasmbindgentestcontext_args: (a: number, b: number, c: number) => void;
|