@verdant-web/common 1.14.1 → 1.15.0
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/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/indexes.d.ts +3 -1
- package/dist/cjs/indexes.js +26 -3
- package/dist/cjs/indexes.js.map +1 -1
- package/dist/cjs/migration.d.ts +85 -18
- package/dist/cjs/migration.js +137 -13
- package/dist/cjs/migration.js.map +1 -1
- package/dist/cjs/oids.d.ts +2 -2
- package/dist/cjs/oids.js +6 -5
- package/dist/cjs/oids.js.map +1 -1
- package/dist/cjs/oids.test.js +4 -3
- package/dist/cjs/oids.test.js.map +1 -1
- package/dist/cjs/schema/fields.d.ts +2 -0
- package/dist/cjs/schema/fields.js +29 -1
- package/dist/cjs/schema/fields.js.map +1 -1
- package/dist/cjs/schema/index.d.ts +2 -2
- package/dist/cjs/schema/index.js +25 -2
- package/dist/cjs/schema/index.js.map +1 -1
- package/dist/cjs/schema/types/collection.d.ts +12 -40
- package/dist/cjs/schema/types/compounds.d.ts +6 -7
- package/dist/cjs/schema/types/fields.d.ts +12 -2
- package/dist/cjs/schema/types/shapes.d.ts +6 -6
- package/dist/cjs/schema/types/synthetics.d.ts +11 -2
- package/dist/cjs/schema/types.d.ts +3 -4
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/indexes.d.ts +3 -1
- package/dist/esm/indexes.js +23 -2
- package/dist/esm/indexes.js.map +1 -1
- package/dist/esm/migration.d.ts +85 -18
- package/dist/esm/migration.js +136 -13
- package/dist/esm/migration.js.map +1 -1
- package/dist/esm/oids.d.ts +2 -2
- package/dist/esm/oids.js +4 -3
- package/dist/esm/oids.js.map +1 -1
- package/dist/esm/oids.test.js +5 -4
- package/dist/esm/oids.test.js.map +1 -1
- package/dist/esm/replica.js +1 -1
- package/dist/esm/replica.js.map +1 -1
- package/dist/esm/schema/fields.d.ts +2 -0
- package/dist/esm/schema/fields.js +26 -0
- package/dist/esm/schema/fields.js.map +1 -1
- package/dist/esm/schema/index.d.ts +2 -2
- package/dist/esm/schema/index.js +25 -2
- package/dist/esm/schema/index.js.map +1 -1
- package/dist/esm/schema/types/collection.d.ts +12 -40
- package/dist/esm/schema/types/compounds.d.ts +6 -7
- package/dist/esm/schema/types/fields.d.ts +12 -2
- package/dist/esm/schema/types/shapes.d.ts +6 -6
- package/dist/esm/schema/types/synthetics.d.ts +11 -2
- package/dist/esm/schema/types.d.ts +3 -4
- package/dist/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
- package/src/index.ts +1 -0
- package/src/indexes.ts +51 -12
- package/src/migration.ts +300 -57
- package/src/oids.test.ts +5 -4
- package/src/oids.ts +4 -3
- package/src/schema/fields.ts +18 -0
- package/src/schema/index.ts +30 -3
- package/src/schema/types/collection.ts +14 -112
- package/src/schema/types/compounds.ts +29 -18
- package/src/schema/types/fields.ts +12 -2
- package/src/schema/types/shapes.ts +13 -14
- package/src/schema/types/synthetics.ts +31 -2
- package/src/schema/types.ts +3 -5
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { CollectionCompoundIndices } from './compounds.js';
|
|
2
|
+
import { StorageFieldsSchema } from './fields.js';
|
|
2
3
|
import {
|
|
3
|
-
|
|
4
|
-
StorageFieldSchema,
|
|
5
|
-
StorageFieldsSchema,
|
|
6
|
-
StorageIndexableFields,
|
|
7
|
-
} from './fields.js';
|
|
8
|
-
import { StorageDocument } from './shapes.js';
|
|
9
|
-
import {
|
|
10
|
-
StorageSyntheticIndexSchema,
|
|
4
|
+
DirectIndexableFieldName,
|
|
11
5
|
StorageSyntheticIndices,
|
|
12
6
|
} from './synthetics.js';
|
|
13
7
|
|
|
@@ -16,7 +10,8 @@ import {
|
|
|
16
10
|
*/
|
|
17
11
|
export type StorageCollectionSchema<
|
|
18
12
|
Fields extends StorageFieldsSchema = StorageFieldsSchema,
|
|
19
|
-
Synthetics extends
|
|
13
|
+
Synthetics extends
|
|
14
|
+
StorageSyntheticIndices<Fields> = StorageSyntheticIndices<Fields>,
|
|
20
15
|
Compounds extends CollectionCompoundIndices<
|
|
21
16
|
Fields,
|
|
22
17
|
Synthetics
|
|
@@ -24,110 +19,17 @@ export type StorageCollectionSchema<
|
|
|
24
19
|
> = {
|
|
25
20
|
name: string;
|
|
26
21
|
/**
|
|
27
|
-
*
|
|
22
|
+
* Your primary key must be a string, number, or boolean field. It must also
|
|
23
|
+
* not be rewritten.
|
|
28
24
|
*/
|
|
29
|
-
|
|
25
|
+
primaryKey: DirectIndexableFieldName<Fields>;
|
|
30
26
|
fields: Fields;
|
|
31
|
-
|
|
27
|
+
indexes?: Synthetics;
|
|
32
28
|
compounds?: Compounds;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
> = Schemas extends { name: Name } ? Schemas : never;
|
|
40
|
-
|
|
41
|
-
export type IndexedSchemaProperties<
|
|
42
|
-
Schema extends StorageCollectionSchema<any, any, any>,
|
|
43
|
-
> = {
|
|
44
|
-
[K in keyof CollectionSchemaFields<Schema> as CollectionSchemaFields<Schema>[K] extends {
|
|
45
|
-
indexed: true;
|
|
46
|
-
}
|
|
47
|
-
? K
|
|
48
|
-
: never]: CollectionSchemaFields<Schema>[K];
|
|
49
|
-
} & CollectionSchemaComputedIndexes<Schema> &
|
|
50
|
-
CollectionSchemaCompoundIndexes<Schema>;
|
|
51
|
-
|
|
52
|
-
export type CollectionIndexName<
|
|
53
|
-
Collection extends StorageCollectionSchema<any, any, any>,
|
|
54
|
-
> = Extract<keyof IndexedSchemaProperties<Collection>, string>;
|
|
55
|
-
|
|
56
|
-
export type CollectionProperties<
|
|
57
|
-
Collection extends StorageCollectionSchema<any, any, any>,
|
|
58
|
-
> = Collection['fields'] & Collection['synthetics'];
|
|
59
|
-
|
|
60
|
-
export type CollectionPropertyName<
|
|
61
|
-
Collection extends StorageCollectionSchema<any, any, any>,
|
|
62
|
-
> = Exclude<keyof CollectionProperties<Collection>, number | symbol>;
|
|
63
|
-
|
|
64
|
-
export type CollectionEvents<
|
|
65
|
-
Collection extends StorageCollectionSchema<any, any, any>,
|
|
66
|
-
> = {
|
|
67
|
-
put: (value: StorageDocument<Collection>) => void;
|
|
68
|
-
delete: (id: string) => void;
|
|
69
|
-
[key: `put:${string}`]: (value: StorageDocument<Collection>) => void;
|
|
70
|
-
[key: `delete:${string}`]: () => void;
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated - plural name is the key used to index this collection in the schema. this field is no longer used.
|
|
31
|
+
*/
|
|
32
|
+
pluralName?: string;
|
|
33
|
+
/** @deprecated - use "indexes" */
|
|
34
|
+
synthetics?: Synthetics;
|
|
71
35
|
};
|
|
72
|
-
|
|
73
|
-
export type SchemaForCollection<
|
|
74
|
-
Collection extends StorageCollectionSchema<any, any, any>,
|
|
75
|
-
> = Collection;
|
|
76
|
-
|
|
77
|
-
export type CollectionSchemaFields<
|
|
78
|
-
Schema extends StorageCollectionSchema<any, any, any>,
|
|
79
|
-
> = Schema extends StorageCollectionSchema<infer F, any, any> ? F : never;
|
|
80
|
-
export type CollectionSchemaComputedIndexes<
|
|
81
|
-
Schema extends StorageCollectionSchema<any, any, any>,
|
|
82
|
-
> = Schema extends StorageCollectionSchema<any, infer S, any> ? S : never;
|
|
83
|
-
export type CollectionSchemaCompoundIndexes<
|
|
84
|
-
Schema extends StorageCollectionSchema<any, any, any>,
|
|
85
|
-
> = Schema extends StorageCollectionSchema<any, any, infer C> ? C : never;
|
|
86
|
-
|
|
87
|
-
export type StorageIndexableProperties<
|
|
88
|
-
Schema extends StorageCollectionSchema<any, any, any>,
|
|
89
|
-
> = {
|
|
90
|
-
[K in keyof CollectionSchemaFields<Schema>]: CollectionSchemaFields<Schema>[K] extends {
|
|
91
|
-
indexed: boolean;
|
|
92
|
-
}
|
|
93
|
-
? CollectionSchemaFields<Schema>[K]
|
|
94
|
-
: never;
|
|
95
|
-
} & CollectionSchemaComputedIndexes<Schema>;
|
|
96
|
-
|
|
97
|
-
export type StorageSchemaProperty<
|
|
98
|
-
Schema extends StorageCollectionSchema<any, any, any>,
|
|
99
|
-
> = StorageSchemaProperties<Schema>[keyof StorageSchemaProperties<Schema>];
|
|
100
|
-
|
|
101
|
-
export type StorageSchemaPropertyName<
|
|
102
|
-
Schema extends StorageCollectionSchema<any, any, any>,
|
|
103
|
-
> = Extract<keyof StorageSchemaProperties<Schema>, string>;
|
|
104
|
-
|
|
105
|
-
export type GetSchemaProperty<
|
|
106
|
-
Schema extends StorageCollectionSchema<any, any, any>,
|
|
107
|
-
Key extends StorageSchemaPropertyName<Schema>,
|
|
108
|
-
> = StorageSchemaProperties<Schema>[Key];
|
|
109
|
-
|
|
110
|
-
export type StoragePropertySchema<BaseFields extends StorageFieldsSchema> =
|
|
111
|
-
| StorageFieldSchema
|
|
112
|
-
| NestedStorageFieldSchema
|
|
113
|
-
| StorageSyntheticIndexSchema<BaseFields>;
|
|
114
|
-
|
|
115
|
-
export type StoragePropertyName<
|
|
116
|
-
Fields extends StorageFieldsSchema,
|
|
117
|
-
Synthetics extends StorageSyntheticIndices<Fields>,
|
|
118
|
-
> =
|
|
119
|
-
| Exclude<keyof Fields, number | symbol>
|
|
120
|
-
| Exclude<keyof Synthetics, number | symbol>;
|
|
121
|
-
|
|
122
|
-
export type StorageIndexablePropertyName<
|
|
123
|
-
Fields extends StorageFieldsSchema,
|
|
124
|
-
Synthetics extends StorageSyntheticIndices<Fields>,
|
|
125
|
-
> =
|
|
126
|
-
| Extract<keyof StorageIndexableFields<Fields>, string>
|
|
127
|
-
| Extract<keyof Synthetics, string>;
|
|
128
|
-
|
|
129
|
-
export type StorageSchemaProperties<
|
|
130
|
-
Schema extends StorageCollectionSchema<any, any, any>,
|
|
131
|
-
> = Schema extends StorageCollectionSchema<infer F, infer S, infer C>
|
|
132
|
-
? F & S & C
|
|
133
|
-
: never;
|
|
@@ -1,33 +1,44 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
NestedStorageBooleanFieldSchema,
|
|
3
|
+
NestedStorageNumberFieldSchema,
|
|
4
|
+
NestedStorageStringFieldSchema,
|
|
5
|
+
StorageArrayFieldSchema,
|
|
6
|
+
StorageFieldsSchema,
|
|
7
|
+
} from './fields.js';
|
|
8
|
+
import {
|
|
9
|
+
DirectIndexableFieldName,
|
|
10
|
+
StorageSyntheticIndices,
|
|
11
|
+
} from './synthetics.js';
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
// arrays of primitives are eligible for compound indices
|
|
14
|
+
type PrimitiveArrayFields<Fields extends StorageFieldsSchema> = {
|
|
15
|
+
[K in keyof Fields as Fields[K] extends StorageArrayFieldSchema
|
|
16
|
+
? Fields[K]['items'] extends
|
|
17
|
+
| NestedStorageStringFieldSchema
|
|
18
|
+
| NestedStorageNumberFieldSchema
|
|
19
|
+
| NestedStorageBooleanFieldSchema
|
|
20
|
+
? K
|
|
21
|
+
: never
|
|
22
|
+
: never]: Fields[K];
|
|
11
23
|
};
|
|
24
|
+
type PrimitiveArrayFieldName<Fields extends StorageFieldsSchema> = Extract<
|
|
25
|
+
keyof PrimitiveArrayFields<Fields>,
|
|
26
|
+
string
|
|
27
|
+
>;
|
|
12
28
|
|
|
13
29
|
export type CollectionCompoundIndex<
|
|
14
30
|
Fields extends StorageFieldsSchema,
|
|
15
31
|
Synthetics extends StorageSyntheticIndices<Fields>,
|
|
16
32
|
> = {
|
|
17
33
|
// object fields cannot be compound index inputs
|
|
18
|
-
of:
|
|
34
|
+
of: (
|
|
35
|
+
| DirectIndexableFieldName<Fields>
|
|
36
|
+
| PrimitiveArrayFieldName<Fields>
|
|
37
|
+
| Extract<keyof Synthetics, string>
|
|
38
|
+
)[];
|
|
19
39
|
};
|
|
20
|
-
type CompoundFieldNameTuple<Name extends string> =
|
|
21
|
-
| [Name, Name]
|
|
22
|
-
| [Name, Name, Name]
|
|
23
|
-
| [Name, Name, Name, Name]
|
|
24
|
-
| [Name, Name, Name, Name, Name];
|
|
25
40
|
|
|
26
41
|
export type CollectionCompoundIndices<
|
|
27
42
|
Fields extends StorageFieldsSchema,
|
|
28
43
|
Synthetics extends StorageSyntheticIndices<Fields>,
|
|
29
44
|
> = Record<string, CollectionCompoundIndex<Fields, Synthetics>>;
|
|
30
|
-
|
|
31
|
-
export type CollectionCompoundIndexName<
|
|
32
|
-
Collection extends StorageCollectionSchema<any, any, any>,
|
|
33
|
-
> = Exclude<keyof CollectionSchemaCompoundIndexes<Collection>, number | symbol>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export type StorageStringFieldSchema = {
|
|
2
2
|
type: 'string';
|
|
3
|
+
/** @deprecated - add an index to indexes with this field name. */
|
|
3
4
|
indexed?: boolean;
|
|
4
5
|
nullable?: boolean;
|
|
5
6
|
default?: string | (() => string);
|
|
6
7
|
};
|
|
7
8
|
export type StorageNumberFieldSchema = {
|
|
8
9
|
type: 'number';
|
|
10
|
+
/** @deprecated - add an index to indexes with this field name. */
|
|
9
11
|
indexed?: boolean;
|
|
10
12
|
nullable?: boolean;
|
|
11
13
|
default?: number | (() => number);
|
|
@@ -14,6 +16,7 @@ export type StorageBooleanFieldSchema = {
|
|
|
14
16
|
type: 'boolean';
|
|
15
17
|
nullable?: boolean;
|
|
16
18
|
default?: boolean | (() => boolean);
|
|
19
|
+
/** @deprecated - add an index to indexes with this field name. */
|
|
17
20
|
indexed?: boolean;
|
|
18
21
|
};
|
|
19
22
|
export type StorageArrayFieldSchema = {
|
|
@@ -66,18 +69,25 @@ export type NestedStorageNumberFieldSchema = {
|
|
|
66
69
|
nullable?: boolean;
|
|
67
70
|
default?: number | (() => number);
|
|
68
71
|
};
|
|
72
|
+
export type NestedStorageBooleanFieldSchema = {
|
|
73
|
+
type: 'boolean';
|
|
74
|
+
nullable?: boolean;
|
|
75
|
+
default: boolean | (() => boolean);
|
|
76
|
+
};
|
|
69
77
|
|
|
70
78
|
export type NestedStorageFieldSchema =
|
|
71
79
|
| NestedStorageStringFieldSchema
|
|
72
80
|
| NestedStorageNumberFieldSchema
|
|
73
|
-
|
|
|
81
|
+
| NestedStorageBooleanFieldSchema
|
|
74
82
|
| StorageArrayFieldSchema
|
|
75
83
|
| StorageObjectFieldSchema
|
|
76
84
|
| StorageAnyFieldSchema
|
|
77
85
|
| StorageMapFieldSchema<any>
|
|
78
86
|
| StorageFileFieldSchema;
|
|
79
87
|
|
|
80
|
-
export type StorageFieldsSchema =
|
|
88
|
+
export type StorageFieldsSchema = {
|
|
89
|
+
[key: string]: StorageFieldSchema;
|
|
90
|
+
};
|
|
81
91
|
|
|
82
92
|
export type NestedStorageFieldsSchema = Record<
|
|
83
93
|
string,
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
StorageCollectionSchema,
|
|
3
|
-
StoragePropertySchema,
|
|
4
|
-
} from './collection.js';
|
|
1
|
+
import { StorageCollectionSchema } from './collection.js';
|
|
5
2
|
import {
|
|
6
3
|
NestedStorageFieldsSchema,
|
|
7
4
|
StorageArrayFieldSchema,
|
|
5
|
+
StorageFieldSchema,
|
|
8
6
|
StorageFieldsSchema,
|
|
9
7
|
StorageMapFieldSchema,
|
|
10
8
|
StorageObjectFieldSchema,
|
|
11
9
|
} from './fields.js';
|
|
12
10
|
|
|
13
|
-
type StoragePropertyIsNullable<T extends
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
: false
|
|
18
|
-
: T['type'] extends 'any'
|
|
11
|
+
type StoragePropertyIsNullable<T extends StorageFieldSchema> = T extends {
|
|
12
|
+
nullable?: boolean;
|
|
13
|
+
}
|
|
14
|
+
? T['nullable'] extends boolean
|
|
19
15
|
? true
|
|
20
|
-
: false
|
|
16
|
+
: false
|
|
17
|
+
: T['type'] extends 'any'
|
|
18
|
+
? true
|
|
19
|
+
: false;
|
|
21
20
|
|
|
22
|
-
export type BaseShapeFromProperty<T extends
|
|
21
|
+
export type BaseShapeFromProperty<T extends StorageFieldSchema> =
|
|
23
22
|
T['type'] extends 'string'
|
|
24
23
|
? string
|
|
25
24
|
: T['type'] extends 'number'
|
|
@@ -38,7 +37,7 @@ export type BaseShapeFromProperty<T extends StoragePropertySchema<any>> =
|
|
|
38
37
|
? File
|
|
39
38
|
: never;
|
|
40
39
|
|
|
41
|
-
export type ShapeFromProperty<T extends
|
|
40
|
+
export type ShapeFromProperty<T extends StorageFieldSchema> =
|
|
42
41
|
StoragePropertyIsNullable<T> extends true
|
|
43
42
|
? BaseShapeFromProperty<T> | null
|
|
44
43
|
: BaseShapeFromProperty<T>;
|
|
@@ -53,7 +52,7 @@ export type StorageDocument<
|
|
|
53
52
|
Collection extends StorageCollectionSchema<any, any, any>,
|
|
54
53
|
> = ShapeFromFields<Collection['fields']>;
|
|
55
54
|
|
|
56
|
-
type StoragePropertyIsOptional<T extends
|
|
55
|
+
type StoragePropertyIsOptional<T extends StorageFieldSchema> =
|
|
57
56
|
StoragePropertyIsNullable<T> extends true
|
|
58
57
|
? true
|
|
59
58
|
: T extends { default?: any }
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
StorageBooleanFieldSchema,
|
|
3
|
+
StorageFieldSchema,
|
|
4
|
+
StorageFieldsSchema,
|
|
5
|
+
StorageNumberFieldSchema,
|
|
6
|
+
StorageStringFieldSchema,
|
|
7
|
+
} from './fields.js';
|
|
2
8
|
import { ShapeFromFields } from './shapes.js';
|
|
3
9
|
|
|
4
10
|
export type StorageStringSyntheticSchema<Fields extends StorageFieldsSchema> = {
|
|
@@ -32,6 +38,23 @@ export type StorageBooleanArraySyntheticSchema<
|
|
|
32
38
|
type: 'boolean[]';
|
|
33
39
|
compute: (value: ShapeFromFields<Fields>) => boolean[];
|
|
34
40
|
};
|
|
41
|
+
export type StorageDirectSyntheticSchema<Fields extends StorageFieldsSchema> = {
|
|
42
|
+
field: DirectIndexableFieldName<Fields>;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
type DirectIndexableFields<Fields extends StorageFieldsSchema> = {
|
|
46
|
+
[K in keyof Fields as Fields[K] extends StorageStringFieldSchema
|
|
47
|
+
? K
|
|
48
|
+
: Fields[K] extends StorageNumberFieldSchema
|
|
49
|
+
? K
|
|
50
|
+
: Fields[K] extends StorageBooleanFieldSchema
|
|
51
|
+
? K
|
|
52
|
+
: never]: any;
|
|
53
|
+
};
|
|
54
|
+
export type DirectIndexableFieldName<Fields extends StorageFieldsSchema> =
|
|
55
|
+
keyof DirectIndexableFields<Fields> extends never
|
|
56
|
+
? string
|
|
57
|
+
: keyof DirectIndexableFields<Fields>;
|
|
35
58
|
|
|
36
59
|
export type StorageSyntheticIndices<Fields extends StorageFieldsSchema> =
|
|
37
60
|
Record<string, StorageSyntheticIndexSchema<Fields>>;
|
|
@@ -42,4 +65,10 @@ export type StorageSyntheticIndexSchema<Fields extends StorageFieldsSchema> =
|
|
|
42
65
|
| StorageBooleanSyntheticSchema<Fields>
|
|
43
66
|
| StorageStringArraySyntheticSchema<Fields>
|
|
44
67
|
| StorageNumberArraySyntheticSchema<Fields>
|
|
45
|
-
| StorageBooleanArraySyntheticSchema<Fields
|
|
68
|
+
| StorageBooleanArraySyntheticSchema<Fields>
|
|
69
|
+
| StorageDirectSyntheticSchema<Fields>;
|
|
70
|
+
|
|
71
|
+
export type IndexValueTag = Exclude<
|
|
72
|
+
StorageSyntheticIndexSchema<any>,
|
|
73
|
+
StorageDirectSyntheticSchema<any>
|
|
74
|
+
>['type'];
|
package/src/schema/types.ts
CHANGED
|
@@ -7,14 +7,12 @@ export * from './types/filters.js';
|
|
|
7
7
|
export * from './types/shapes.js';
|
|
8
8
|
export * from './types/synthetics.js';
|
|
9
9
|
|
|
10
|
-
export interface StorageInit<Schemas extends StorageCollectionSchema> {
|
|
11
|
-
collections: Record<string, Schemas>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
10
|
export type StorageSchema<
|
|
15
11
|
Collections extends {
|
|
16
12
|
[k: string]: StorageCollectionSchema;
|
|
17
|
-
} =
|
|
13
|
+
} = {
|
|
14
|
+
[k: string]: StorageCollectionSchema;
|
|
15
|
+
},
|
|
18
16
|
> = { version: number; wip?: true; collections: Collections };
|
|
19
17
|
|
|
20
18
|
export type SchemaCollectionName<Schema extends StorageSchema<any>> =
|