@verdant-web/store 3.0.6 → 3.1.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.
@@ -1,83 +1,30 @@
1
1
  import { ClientWithCollections } from '../../index.js';
2
2
  export declare const todoCollection: import("@verdant-web/common").StorageCollectionSchema<{
3
- id: {
4
- type: "string";
5
- indexed: true;
6
- default: () => string;
7
- };
3
+ id: import("@verdant-web/common").StorageStringFieldSchema;
4
+ content: import("@verdant-web/common").StorageStringFieldSchema;
5
+ done: import("@verdant-web/common").StorageBooleanFieldSchema;
6
+ tags: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageStringFieldSchema>;
7
+ category: import("@verdant-web/common").StorageStringFieldSchema;
8
+ attachments: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageObjectFieldSchema<{
9
+ name: import("@verdant-web/common").StorageStringFieldSchema;
10
+ test: import("@verdant-web/common").StorageNumberFieldSchema;
11
+ }>>;
12
+ }, {
8
13
  content: {
9
- type: "string";
10
- indexed: true;
11
- };
12
- done: {
13
- type: "boolean";
14
- default: false;
15
- };
16
- tags: {
17
- type: "array";
18
- items: {
19
- type: "string";
20
- };
21
- };
22
- category: {
23
- type: "string";
14
+ field: "content";
24
15
  };
25
- attachments: {
26
- type: "array";
27
- items: {
28
- type: "object";
29
- properties: {
30
- name: {
31
- type: "string";
32
- };
33
- test: {
34
- type: "number";
35
- default: number;
36
- };
37
- };
38
- };
39
- };
40
- }, {
41
16
  example: {
42
17
  type: "string";
43
18
  compute: (doc: import("@verdant-web/common").ShapeFromFields<{
44
- id: {
45
- type: "string";
46
- indexed: true;
47
- default: () => string;
48
- };
49
- content: {
50
- type: "string";
51
- indexed: true;
52
- };
53
- done: {
54
- type: "boolean";
55
- default: false;
56
- };
57
- tags: {
58
- type: "array";
59
- items: {
60
- type: "string";
61
- };
62
- };
63
- category: {
64
- type: "string";
65
- };
66
- attachments: {
67
- type: "array";
68
- items: {
69
- type: "object";
70
- properties: {
71
- name: {
72
- type: "string";
73
- };
74
- test: {
75
- type: "number";
76
- default: number;
77
- };
78
- };
79
- };
80
- };
19
+ id: import("@verdant-web/common").StorageStringFieldSchema;
20
+ content: import("@verdant-web/common").StorageStringFieldSchema;
21
+ done: import("@verdant-web/common").StorageBooleanFieldSchema;
22
+ tags: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageStringFieldSchema>;
23
+ category: import("@verdant-web/common").StorageStringFieldSchema;
24
+ attachments: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageObjectFieldSchema<{
25
+ name: import("@verdant-web/common").StorageStringFieldSchema;
26
+ test: import("@verdant-web/common").StorageNumberFieldSchema;
27
+ }>>;
81
28
  }>) => string;
82
29
  };
83
30
  }, {
@@ -89,38 +36,38 @@ export declare const todoCollection: import("@verdant-web/common").StorageCollec
89
36
  };
90
37
  }>;
91
38
  export declare const weirdCollection: import("@verdant-web/common").StorageCollectionSchema<{
92
- id: {
93
- type: "string";
94
- indexed: true;
95
- default: () => string;
96
- };
97
- weird: {
98
- type: "any";
99
- };
100
- map: {
101
- type: "map";
102
- values: {
103
- type: string;
104
- };
105
- };
106
- fileList: {
107
- type: "array";
108
- items: {
109
- type: "file";
110
- };
111
- };
112
- objectMap: {
113
- type: "map";
114
- values: {
115
- type: string;
116
- properties: {
117
- content: {
118
- type: string;
119
- };
120
- };
121
- };
122
- };
123
- }, {}, {}>;
39
+ id: import("@verdant-web/common").StorageStringFieldSchema;
40
+ weird: import("@verdant-web/common").StorageAnyFieldSchema<any>;
41
+ map: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageStringFieldSchema>;
42
+ fileList: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageFileFieldSchema>;
43
+ objectMap: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageObjectFieldSchema<{
44
+ content: import("@verdant-web/common").StorageStringFieldSchema;
45
+ }>>;
46
+ }, import("@verdant-web/common").StorageSyntheticIndices<{
47
+ id: import("@verdant-web/common").StorageStringFieldSchema;
48
+ weird: import("@verdant-web/common").StorageAnyFieldSchema<any>;
49
+ map: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageStringFieldSchema>;
50
+ fileList: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageFileFieldSchema>;
51
+ objectMap: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageObjectFieldSchema<{
52
+ content: import("@verdant-web/common").StorageStringFieldSchema;
53
+ }>>;
54
+ }>, import("@verdant-web/common").CollectionCompoundIndices<{
55
+ id: import("@verdant-web/common").StorageStringFieldSchema;
56
+ weird: import("@verdant-web/common").StorageAnyFieldSchema<any>;
57
+ map: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageStringFieldSchema>;
58
+ fileList: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageFileFieldSchema>;
59
+ objectMap: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageObjectFieldSchema<{
60
+ content: import("@verdant-web/common").StorageStringFieldSchema;
61
+ }>>;
62
+ }, import("@verdant-web/common").StorageSyntheticIndices<{
63
+ id: import("@verdant-web/common").StorageStringFieldSchema;
64
+ weird: import("@verdant-web/common").StorageAnyFieldSchema<any>;
65
+ map: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageStringFieldSchema>;
66
+ fileList: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageFileFieldSchema>;
67
+ objectMap: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageObjectFieldSchema<{
68
+ content: import("@verdant-web/common").StorageStringFieldSchema;
69
+ }>>;
70
+ }>>>;
124
71
  export declare function createTestStorage({ idb, disableRebasing, metadataVersion, log, }?: {
125
72
  idb?: IDBFactory;
126
73
  disableRebasing?: boolean;
@@ -6,49 +6,36 @@ const common_1 = require("@verdant-web/common");
6
6
  const fake_indexeddb_1 = require("fake-indexeddb");
7
7
  const index_js_1 = require("../../index.js");
8
8
  const constants_js_1 = require("../../client/constants.js");
9
- exports.todoCollection = (0, common_1.collection)({
9
+ exports.todoCollection = common_1.schema.collection({
10
10
  name: 'todo',
11
11
  primaryKey: 'id',
12
12
  fields: {
13
- id: {
14
- type: 'string',
15
- indexed: true,
13
+ id: common_1.schema.fields.string({
16
14
  default: () => Math.random().toString(36).slice(2, 9),
17
- },
18
- content: {
19
- type: 'string',
20
- indexed: true,
21
- },
22
- done: {
23
- type: 'boolean',
15
+ }),
16
+ content: common_1.schema.fields.string(),
17
+ done: common_1.schema.fields.boolean({
24
18
  default: false,
25
- },
26
- tags: {
27
- type: 'array',
28
- items: {
29
- type: 'string',
30
- },
31
- },
32
- category: {
33
- type: 'string',
34
- },
35
- attachments: {
36
- type: 'array',
37
- items: {
38
- type: 'object',
19
+ }),
20
+ tags: common_1.schema.fields.array({
21
+ items: common_1.schema.fields.string(),
22
+ }),
23
+ category: common_1.schema.fields.string(),
24
+ attachments: common_1.schema.fields.array({
25
+ items: common_1.schema.fields.object({
39
26
  properties: {
40
- name: {
41
- type: 'string',
42
- },
43
- test: {
44
- type: 'number',
27
+ name: common_1.schema.fields.string(),
28
+ test: common_1.schema.fields.number({
45
29
  default: 1,
46
- },
30
+ }),
47
31
  },
48
- },
49
- },
32
+ }),
33
+ }),
50
34
  },
51
- synthetics: {
35
+ indexes: {
36
+ content: {
37
+ field: 'content',
38
+ },
52
39
  example: {
53
40
  type: 'string',
54
41
  compute: (doc) => doc.content,
@@ -63,44 +50,28 @@ exports.todoCollection = (0, common_1.collection)({
63
50
  },
64
51
  },
65
52
  });
66
- exports.weirdCollection = (0, common_1.collection)({
53
+ exports.weirdCollection = common_1.schema.collection({
67
54
  name: 'weird',
68
55
  primaryKey: 'id',
69
56
  fields: {
70
- id: {
71
- type: 'string',
72
- indexed: true,
57
+ id: common_1.schema.fields.string({
73
58
  default: () => Math.random().toString(36).slice(2, 9),
74
- },
75
- weird: {
76
- type: 'any',
77
- },
78
- map: {
79
- type: 'map',
80
- values: {
81
- type: 'string',
82
- },
83
- },
84
- fileList: {
85
- type: 'array',
86
- items: {
87
- type: 'file',
88
- },
89
- },
90
- objectMap: {
91
- type: 'map',
92
- values: {
93
- type: 'object',
59
+ }),
60
+ weird: common_1.schema.fields.any(),
61
+ map: common_1.schema.fields.map({
62
+ values: common_1.schema.fields.string(),
63
+ }),
64
+ fileList: common_1.schema.fields.array({
65
+ items: common_1.schema.fields.file(),
66
+ }),
67
+ objectMap: common_1.schema.fields.map({
68
+ values: common_1.schema.fields.object({
94
69
  properties: {
95
- content: {
96
- type: 'string',
97
- },
70
+ content: common_1.schema.fields.string(),
98
71
  },
99
- },
100
- },
72
+ }),
73
+ }),
101
74
  },
102
- synthetics: {},
103
- compounds: {},
104
75
  });
105
76
  const testSchema = (0, common_1.schema)({
106
77
  version: 1,
@@ -1 +1 @@
1
- {"version":3,"file":"testStorage.js","sourceRoot":"","sources":["../../../../src/__tests__/fixtures/testStorage.ts"],"names":[],"mappings":";;;AAAA,gDAA0E;AAC1E,aAAa;AACb,mDAA4C;AAC5C,6CAAyE;AACzE,4DAAiE;AAEpD,QAAA,cAAc,GAAG,IAAA,mBAAU,EAAC;IACxC,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE;QACP,EAAE,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;SACrD;QACD,OAAO,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,IAAI;SACb;QACD,IAAI,EAAE;YACL,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;SACd;QACD,IAAI,EAAE;YACL,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EAAE;YACV,IAAI,EAAE,KAAK;YACX,MAAM,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACX,OAAO,EAAE;wBACR,IAAI,EAAE,QAAQ;qBACd;iBACD;aACD;SACD;KACD;IACD,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,EAAE;CACb,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,IAAA,eAAM,EAAC;IACzB,OAAO,EAAE,CAAC;IACV,WAAW,EAAE;QACZ,KAAK,EAAE,sBAAc;QACrB,MAAM,EAAE,uBAAe;KACvB;CACD,CAAC,CAAC;AAEH,SAAgB,iBAAiB,CAAC,EACjC,GAAG,GAAG,IAAI,2BAAU,EAAE,EACtB,eAAe,GAAG,KAAK,EACvB,eAAe,EACf,GAAG,MAMA,EAAE;IACL,MAAM,OAAO,GAAG,IAAI,2BAAgB,CAAC;QACpC,MAAM,EAAE,UAAU;QAClB,UAAU,EAAE,CAAC,IAAA,wBAAe,EAAK,UAAU,CAAC,CAAC;QAC7C,SAAS,EAAE,GAAG;QACd,SAAS,EAAE,MAAM;QACjB,eAAe;QACf,GAAG;QACH,CAAC,mCAAoB,CAAC,EAAE,eAAe;KACvC,CAAC,CAAC,IAAI,EAAE,CAAC;IACV,OAAO,OAAyC,CAAC;AAClD,CAAC;AArBD,8CAqBC"}
1
+ {"version":3,"file":"testStorage.js","sourceRoot":"","sources":["../../../../src/__tests__/fixtures/testStorage.ts"],"names":[],"mappings":";;;AAAA,gDAA8D;AAC9D,aAAa;AACb,mDAA4C;AAC5C,6CAAyE;AACzE,4DAAiE;AAEpD,QAAA,cAAc,GAAG,eAAM,CAAC,UAAU,CAAC;IAC/C,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE;QACP,EAAE,EAAE,eAAM,CAAC,MAAM,CAAC,MAAM,CAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAA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V,OAAO,OAAyC,CAAC;AAClD,CAAC;AArBD,8CAqBC"}
@@ -12,8 +12,10 @@ export type { ObjectEntity, ListEntity, EntityShape, AccessibleEntityProperty, A
12
12
  export { ServerSync } from './sync/Sync.js';
13
13
  export type { SyncTransportMode } from './sync/Sync.js';
14
14
  export { EntityFile, type EntityFileSnapshot } from './files/EntityFile.js';
15
- export { collection, schema, createDefaultMigration, migrate, createMigration, } from '@verdant-web/common';
16
- export type { StorageDocument, StorageSchema, StorageCollectionSchema, Migration, } from '@verdant-web/common';
15
+ export {
16
+ /** @deprecated - use schema.collection */
17
+ collection, schema, createDefaultMigration, migrate, createMigration, } from '@verdant-web/common';
18
+ export type { StorageDocument, StorageSchema, StorageCollectionSchema, StorageAnyFieldSchema, StorageArrayFieldSchema, StorageObjectFieldSchema, StorageBooleanFieldSchema, StorageFieldSchema, StorageFileFieldSchema, StorageMapFieldSchema, StorageNumberFieldSchema, StorageStringFieldSchema, StorageFieldsSchema, IndexValueTag, Migration, } from '@verdant-web/common';
17
19
  export type { UserInfo } from '@verdant-web/common';
18
20
  export type { Query } from './queries/types.js';
19
21
  export type { QueryStatus } from './queries/BaseQuery.js';
package/dist/cjs/index.js CHANGED
@@ -14,6 +14,7 @@ Object.defineProperty(exports, "ServerSync", { enumerable: true, get: function (
14
14
  var EntityFile_js_1 = require("./files/EntityFile.js");
15
15
  Object.defineProperty(exports, "EntityFile", { enumerable: true, get: function () { return EntityFile_js_1.EntityFile; } });
16
16
  var common_1 = require("@verdant-web/common");
17
+ /** @deprecated - use schema.collection */
17
18
  Object.defineProperty(exports, "collection", { enumerable: true, get: function () { return common_1.collection; } });
18
19
  Object.defineProperty(exports, "schema", { enumerable: true, get: function () { return common_1.schema; } });
19
20
  Object.defineProperty(exports, "createDefaultMigration", { enumerable: true, get: function () { return common_1.createDefaultMigration; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,sEAGsC;AAG7B,iGALR,sCAAgB,OAKQ;AAGI,kGAR5B,sCAAgB,OAQ6B;AAL9C,kDAA4C;AAGnC,uFAHA,kBAAM,OAGA;AAGI,wFANV,kBAAM,OAMW;AAG1B,kDAA8C;AAArC,mGAAA,MAAM,OAAA;AASf,0CAA4C;AAAnC,qGAAA,UAAU,OAAA;AAEnB,uDAA4E;AAAnE,2GAAA,UAAU,OAAA;AACnB,8CAM6B;AAL5B,oGAAA,UAAU,OAAA;AACV,gGAAA,MAAM,OAAA;AACN,gHAAA,sBAAsB,OAAA;AACtB,iGAAA,OAAO,OAAA;AACP,yGAAA,eAAe,OAAA;AAYhB,mDAA2D;AAAlD,+GAAA,kBAAkB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,sEAGsC;AAG7B,iGALR,sCAAgB,OAKQ;AAGI,kGAR5B,sCAAgB,OAQ6B;AAL9C,kDAA4C;AAGnC,uFAHA,kBAAM,OAGA;AAGI,wFANV,kBAAM,OAMW;AAG1B,kDAA8C;AAArC,mGAAA,MAAM,OAAA;AASf,0CAA4C;AAAnC,qGAAA,UAAU,OAAA;AAEnB,uDAA4E;AAAnE,2GAAA,UAAU,OAAA;AACnB,8CAO6B;AAN5B,0CAA0C;AAC1C,oGAAA,UAAU,OAAA;AACV,gGAAA,MAAM,OAAA;AACN,gHAAA,sBAAsB,OAAA;AACtB,iGAAA,OAAO,OAAA;AACP,yGAAA,eAAe,OAAA;AAuBhB,mDAA2D;AAAlD,+GAAA,kBAAkB,OAAA"}
@@ -1,83 +1,30 @@
1
1
  import { ClientWithCollections } from '../../index.js';
2
2
  export declare const todoCollection: import("@verdant-web/common").StorageCollectionSchema<{
3
- id: {
4
- type: "string";
5
- indexed: true;
6
- default: () => string;
7
- };
3
+ id: import("@verdant-web/common").StorageStringFieldSchema;
4
+ content: import("@verdant-web/common").StorageStringFieldSchema;
5
+ done: import("@verdant-web/common").StorageBooleanFieldSchema;
6
+ tags: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageStringFieldSchema>;
7
+ category: import("@verdant-web/common").StorageStringFieldSchema;
8
+ attachments: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageObjectFieldSchema<{
9
+ name: import("@verdant-web/common").StorageStringFieldSchema;
10
+ test: import("@verdant-web/common").StorageNumberFieldSchema;
11
+ }>>;
12
+ }, {
8
13
  content: {
9
- type: "string";
10
- indexed: true;
11
- };
12
- done: {
13
- type: "boolean";
14
- default: false;
15
- };
16
- tags: {
17
- type: "array";
18
- items: {
19
- type: "string";
20
- };
21
- };
22
- category: {
23
- type: "string";
14
+ field: "content";
24
15
  };
25
- attachments: {
26
- type: "array";
27
- items: {
28
- type: "object";
29
- properties: {
30
- name: {
31
- type: "string";
32
- };
33
- test: {
34
- type: "number";
35
- default: number;
36
- };
37
- };
38
- };
39
- };
40
- }, {
41
16
  example: {
42
17
  type: "string";
43
18
  compute: (doc: import("@verdant-web/common").ShapeFromFields<{
44
- id: {
45
- type: "string";
46
- indexed: true;
47
- default: () => string;
48
- };
49
- content: {
50
- type: "string";
51
- indexed: true;
52
- };
53
- done: {
54
- type: "boolean";
55
- default: false;
56
- };
57
- tags: {
58
- type: "array";
59
- items: {
60
- type: "string";
61
- };
62
- };
63
- category: {
64
- type: "string";
65
- };
66
- attachments: {
67
- type: "array";
68
- items: {
69
- type: "object";
70
- properties: {
71
- name: {
72
- type: "string";
73
- };
74
- test: {
75
- type: "number";
76
- default: number;
77
- };
78
- };
79
- };
80
- };
19
+ id: import("@verdant-web/common").StorageStringFieldSchema;
20
+ content: import("@verdant-web/common").StorageStringFieldSchema;
21
+ done: import("@verdant-web/common").StorageBooleanFieldSchema;
22
+ tags: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageStringFieldSchema>;
23
+ category: import("@verdant-web/common").StorageStringFieldSchema;
24
+ attachments: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageObjectFieldSchema<{
25
+ name: import("@verdant-web/common").StorageStringFieldSchema;
26
+ test: import("@verdant-web/common").StorageNumberFieldSchema;
27
+ }>>;
81
28
  }>) => string;
82
29
  };
83
30
  }, {
@@ -89,38 +36,38 @@ export declare const todoCollection: import("@verdant-web/common").StorageCollec
89
36
  };
90
37
  }>;
91
38
  export declare const weirdCollection: import("@verdant-web/common").StorageCollectionSchema<{
92
- id: {
93
- type: "string";
94
- indexed: true;
95
- default: () => string;
96
- };
97
- weird: {
98
- type: "any";
99
- };
100
- map: {
101
- type: "map";
102
- values: {
103
- type: string;
104
- };
105
- };
106
- fileList: {
107
- type: "array";
108
- items: {
109
- type: "file";
110
- };
111
- };
112
- objectMap: {
113
- type: "map";
114
- values: {
115
- type: string;
116
- properties: {
117
- content: {
118
- type: string;
119
- };
120
- };
121
- };
122
- };
123
- }, {}, {}>;
39
+ id: import("@verdant-web/common").StorageStringFieldSchema;
40
+ weird: import("@verdant-web/common").StorageAnyFieldSchema<any>;
41
+ map: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageStringFieldSchema>;
42
+ fileList: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageFileFieldSchema>;
43
+ objectMap: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageObjectFieldSchema<{
44
+ content: import("@verdant-web/common").StorageStringFieldSchema;
45
+ }>>;
46
+ }, import("@verdant-web/common").StorageSyntheticIndices<{
47
+ id: import("@verdant-web/common").StorageStringFieldSchema;
48
+ weird: import("@verdant-web/common").StorageAnyFieldSchema<any>;
49
+ map: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageStringFieldSchema>;
50
+ fileList: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageFileFieldSchema>;
51
+ objectMap: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageObjectFieldSchema<{
52
+ content: import("@verdant-web/common").StorageStringFieldSchema;
53
+ }>>;
54
+ }>, import("@verdant-web/common").CollectionCompoundIndices<{
55
+ id: import("@verdant-web/common").StorageStringFieldSchema;
56
+ weird: import("@verdant-web/common").StorageAnyFieldSchema<any>;
57
+ map: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageStringFieldSchema>;
58
+ fileList: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageFileFieldSchema>;
59
+ objectMap: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageObjectFieldSchema<{
60
+ content: import("@verdant-web/common").StorageStringFieldSchema;
61
+ }>>;
62
+ }, import("@verdant-web/common").StorageSyntheticIndices<{
63
+ id: import("@verdant-web/common").StorageStringFieldSchema;
64
+ weird: import("@verdant-web/common").StorageAnyFieldSchema<any>;
65
+ map: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageStringFieldSchema>;
66
+ fileList: import("@verdant-web/common").StorageArrayFieldSchema<import("@verdant-web/common").StorageFileFieldSchema>;
67
+ objectMap: import("@verdant-web/common").StorageMapFieldSchema<import("@verdant-web/common").StorageObjectFieldSchema<{
68
+ content: import("@verdant-web/common").StorageStringFieldSchema;
69
+ }>>;
70
+ }>>>;
124
71
  export declare function createTestStorage({ idb, disableRebasing, metadataVersion, log, }?: {
125
72
  idb?: IDBFactory;
126
73
  disableRebasing?: boolean;