@latticexyz/store 2.2.18-9fa07c8489f1fbf167d0db01cd9aaa645a29c8e2 → 2.2.18-c2ad22c7feb566e1731ff16e8be291746bdffb3e

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,295 +0,0 @@
1
- declare const _default: {
2
- readonly multipleNamespaces: false;
3
- readonly namespace: string;
4
- readonly namespaces: {
5
- readonly store: {
6
- readonly label: "store";
7
- readonly namespace: string;
8
- readonly tables: {
9
- readonly StoreHooks: {
10
- readonly label: "StoreHooks";
11
- readonly namespaceLabel: "store";
12
- readonly type: "table";
13
- readonly namespace: string;
14
- readonly name: string;
15
- readonly tableId: `0x${string}`;
16
- readonly schema: {
17
- readonly tableId: {
18
- readonly type: "bytes32";
19
- readonly internalType: "ResourceId";
20
- };
21
- readonly hooks: {
22
- readonly type: "bytes21[]";
23
- readonly internalType: "bytes21[]";
24
- };
25
- };
26
- readonly key: readonly ["tableId"];
27
- readonly codegen: {
28
- readonly outputDirectory: string;
29
- readonly tableIdArgument: false;
30
- readonly storeArgument: false;
31
- readonly dataStruct: boolean;
32
- };
33
- readonly deploy: {
34
- readonly disabled: false;
35
- };
36
- };
37
- readonly Tables: {
38
- readonly label: "Tables";
39
- readonly namespaceLabel: "store";
40
- readonly type: "table";
41
- readonly namespace: string;
42
- readonly name: string;
43
- readonly tableId: `0x${string}`;
44
- readonly schema: {
45
- readonly tableId: {
46
- readonly type: "bytes32";
47
- readonly internalType: "ResourceId";
48
- };
49
- readonly fieldLayout: {
50
- readonly type: "bytes32";
51
- readonly internalType: "FieldLayout";
52
- };
53
- readonly keySchema: {
54
- readonly type: "bytes32";
55
- readonly internalType: "Schema";
56
- };
57
- readonly valueSchema: {
58
- readonly type: "bytes32";
59
- readonly internalType: "Schema";
60
- };
61
- readonly abiEncodedKeyNames: {
62
- readonly type: "bytes";
63
- readonly internalType: "bytes";
64
- };
65
- readonly abiEncodedFieldNames: {
66
- readonly type: "bytes";
67
- readonly internalType: "bytes";
68
- };
69
- };
70
- readonly key: readonly ["tableId"];
71
- readonly codegen: {
72
- readonly outputDirectory: string;
73
- readonly tableIdArgument: false;
74
- readonly storeArgument: false;
75
- readonly dataStruct: boolean;
76
- };
77
- readonly deploy: {
78
- readonly disabled: false;
79
- };
80
- };
81
- readonly ResourceIds: {
82
- readonly label: "ResourceIds";
83
- readonly namespaceLabel: "store";
84
- readonly type: "table";
85
- readonly namespace: string;
86
- readonly name: string;
87
- readonly tableId: `0x${string}`;
88
- readonly schema: {
89
- readonly resourceId: {
90
- readonly type: "bytes32";
91
- readonly internalType: "ResourceId";
92
- };
93
- readonly exists: {
94
- readonly type: "bool";
95
- readonly internalType: "bool";
96
- };
97
- };
98
- readonly key: readonly ["resourceId"];
99
- readonly codegen: {
100
- readonly outputDirectory: string;
101
- readonly tableIdArgument: false;
102
- readonly storeArgument: false;
103
- readonly dataStruct: boolean;
104
- };
105
- readonly deploy: {
106
- readonly disabled: false;
107
- };
108
- };
109
- readonly Hooks: {
110
- readonly label: "Hooks";
111
- readonly namespaceLabel: "store";
112
- readonly type: "table";
113
- readonly namespace: string;
114
- readonly name: string;
115
- readonly tableId: `0x${string}`;
116
- readonly schema: {
117
- readonly resourceId: {
118
- readonly type: "bytes32";
119
- readonly internalType: "ResourceId";
120
- };
121
- readonly hooks: {
122
- readonly type: "bytes21[]";
123
- readonly internalType: "bytes21[]";
124
- };
125
- };
126
- readonly key: readonly ["resourceId"];
127
- readonly codegen: {
128
- readonly outputDirectory: string;
129
- readonly tableIdArgument: true;
130
- readonly storeArgument: false;
131
- readonly dataStruct: boolean;
132
- };
133
- readonly deploy: {
134
- readonly disabled: true;
135
- };
136
- };
137
- };
138
- };
139
- };
140
- readonly tables: {
141
- readonly store__StoreHooks: {
142
- readonly label: "StoreHooks";
143
- readonly namespaceLabel: "store";
144
- readonly type: "table";
145
- readonly namespace: string;
146
- readonly name: string;
147
- readonly tableId: `0x${string}`;
148
- readonly schema: {
149
- readonly tableId: {
150
- readonly type: "bytes32";
151
- readonly internalType: "ResourceId";
152
- };
153
- readonly hooks: {
154
- readonly type: "bytes21[]";
155
- readonly internalType: "bytes21[]";
156
- };
157
- };
158
- readonly key: readonly ["tableId"];
159
- readonly codegen: {
160
- readonly outputDirectory: string;
161
- readonly tableIdArgument: false;
162
- readonly storeArgument: false;
163
- readonly dataStruct: boolean;
164
- };
165
- readonly deploy: {
166
- readonly disabled: false;
167
- };
168
- };
169
- readonly store__Tables: {
170
- readonly label: "Tables";
171
- readonly namespaceLabel: "store";
172
- readonly type: "table";
173
- readonly namespace: string;
174
- readonly name: string;
175
- readonly tableId: `0x${string}`;
176
- readonly schema: {
177
- readonly tableId: {
178
- readonly type: "bytes32";
179
- readonly internalType: "ResourceId";
180
- };
181
- readonly fieldLayout: {
182
- readonly type: "bytes32";
183
- readonly internalType: "FieldLayout";
184
- };
185
- readonly keySchema: {
186
- readonly type: "bytes32";
187
- readonly internalType: "Schema";
188
- };
189
- readonly valueSchema: {
190
- readonly type: "bytes32";
191
- readonly internalType: "Schema";
192
- };
193
- readonly abiEncodedKeyNames: {
194
- readonly type: "bytes";
195
- readonly internalType: "bytes";
196
- };
197
- readonly abiEncodedFieldNames: {
198
- readonly type: "bytes";
199
- readonly internalType: "bytes";
200
- };
201
- };
202
- readonly key: readonly ["tableId"];
203
- readonly codegen: {
204
- readonly outputDirectory: string;
205
- readonly tableIdArgument: false;
206
- readonly storeArgument: false;
207
- readonly dataStruct: boolean;
208
- };
209
- readonly deploy: {
210
- readonly disabled: false;
211
- };
212
- };
213
- readonly store__ResourceIds: {
214
- readonly label: "ResourceIds";
215
- readonly namespaceLabel: "store";
216
- readonly type: "table";
217
- readonly namespace: string;
218
- readonly name: string;
219
- readonly tableId: `0x${string}`;
220
- readonly schema: {
221
- readonly resourceId: {
222
- readonly type: "bytes32";
223
- readonly internalType: "ResourceId";
224
- };
225
- readonly exists: {
226
- readonly type: "bool";
227
- readonly internalType: "bool";
228
- };
229
- };
230
- readonly key: readonly ["resourceId"];
231
- readonly codegen: {
232
- readonly outputDirectory: string;
233
- readonly tableIdArgument: false;
234
- readonly storeArgument: false;
235
- readonly dataStruct: boolean;
236
- };
237
- readonly deploy: {
238
- readonly disabled: false;
239
- };
240
- };
241
- readonly store__Hooks: {
242
- readonly label: "Hooks";
243
- readonly namespaceLabel: "store";
244
- readonly type: "table";
245
- readonly namespace: string;
246
- readonly name: string;
247
- readonly tableId: `0x${string}`;
248
- readonly schema: {
249
- readonly resourceId: {
250
- readonly type: "bytes32";
251
- readonly internalType: "ResourceId";
252
- };
253
- readonly hooks: {
254
- readonly type: "bytes21[]";
255
- readonly internalType: "bytes21[]";
256
- };
257
- };
258
- readonly key: readonly ["resourceId"];
259
- readonly codegen: {
260
- readonly outputDirectory: string;
261
- readonly tableIdArgument: true;
262
- readonly storeArgument: false;
263
- readonly dataStruct: boolean;
264
- };
265
- readonly deploy: {
266
- readonly disabled: true;
267
- };
268
- };
269
- };
270
- readonly sourceDirectory: "src";
271
- readonly userTypes: {
272
- readonly ResourceId: {
273
- readonly filePath: "./src/ResourceId.sol";
274
- readonly type: "bytes32";
275
- };
276
- readonly FieldLayout: {
277
- readonly filePath: "./src/FieldLayout.sol";
278
- readonly type: "bytes32";
279
- };
280
- readonly Schema: {
281
- readonly filePath: "./src/Schema.sol";
282
- readonly type: "bytes32";
283
- };
284
- };
285
- readonly enums: {};
286
- readonly enumValues: {};
287
- readonly codegen: {
288
- readonly storeImportPath: "./src";
289
- readonly userTypesFilename: "common.sol";
290
- readonly outputDirectory: "codegen";
291
- readonly indexFilename: "index.sol";
292
- };
293
- };
294
-
295
- export { _default as default };
@@ -1,215 +0,0 @@
1
- import { Dict, show } from '@ark/util';
2
- import { AbiType, Table as Table$1 } from '@latticexyz/config';
3
- import { StaticAbiType } from '@latticexyz/schema-type/internal';
4
-
5
- declare const Scope: {
6
- readonly types: {};
7
- };
8
- type Scope = typeof Scope;
9
- type AbiTypeScope = ScopeOptions<{
10
- [t in AbiType]: t;
11
- }>;
12
- declare const AbiTypeScope: AbiTypeScope;
13
- type ScopeOptions<types extends Dict<string, AbiType> = Dict<string, AbiType>> = {
14
- types: types;
15
- };
16
- type getStaticAbiTypeKeys<schema extends SchemaInput, scope extends Scope = AbiTypeScope> = SchemaInput extends schema ? string : {
17
- [key in keyof schema]: scope["types"] extends {
18
- [_ in schema[key]]: StaticAbiType;
19
- } ? key : never;
20
- }[keyof schema];
21
- type extendScope<scope extends ScopeOptions, additionalTypes extends Dict<string, AbiType>> = show<ScopeOptions<show<scope["types"] & additionalTypes>>>;
22
- declare function extendScope<scope extends ScopeOptions, additionalTypes extends Dict<string, AbiType>>(scope: scope, additionalTypes: additionalTypes): extendScope<scope, additionalTypes>;
23
-
24
- type EnumsInput = {
25
- readonly [enumName: string]: readonly [string, ...string[]];
26
- };
27
- type SchemaInput = {
28
- readonly [fieldName: string]: string;
29
- };
30
- type ScopedSchemaInput<scope extends Scope> = {
31
- readonly [fieldName: string]: keyof scope["types"];
32
- };
33
- type TableCodegenInput = Partial<TableCodegen>;
34
- type TableDeployInput = Partial<TableDeploy>;
35
- type TableInput = {
36
- /**
37
- * Human-readable label for this table. Used as config keys, library names, and filenames.
38
- * Labels are not length constrained like resource names, but special characters should be avoided to be compatible with the filesystem, Solidity compiler, etc.
39
- */
40
- readonly label: string;
41
- /**
42
- * Human-readable label for this table's namespace. Used for namespace config keys and directory names.
43
- * Defaults to the nearest namespace in the config or root namespace if not set.
44
- */
45
- readonly namespaceLabel?: string;
46
- /**
47
- * Table type used in table's resource ID and determines how storage and events are used by this table.
48
- * Defaults to `table` if not set.
49
- */
50
- readonly type?: "table" | "offchainTable";
51
- /**
52
- * Table namespace used in table's resource ID. Only root systems and systems of the same namespace can write to this table.
53
- * Defaults to the nearest namespace in the config or root namespace if not set.
54
- */
55
- readonly namespace?: string;
56
- /**
57
- * Table name used in table's resource ID.
58
- * Defaults to the first 16 characters of `label` if not set.
59
- */
60
- readonly name?: string;
61
- /**
62
- * Schema definition for this table's records.
63
- */
64
- readonly schema: SchemaInput;
65
- /**
66
- * Primary key for records of this table. An array of zero or more schema field names.
67
- * Using an empty array acts like a singleton, where only one record can exist for this table.
68
- */
69
- readonly key: readonly string[];
70
- readonly codegen?: TableCodegenInput;
71
- readonly deploy?: TableDeployInput;
72
- };
73
- type TableShorthandInput = SchemaInput | string;
74
- type TablesInput = {
75
- readonly [label: string]: Omit<TableInput, "label" | "namespaceLabel" | "namespace"> | TableShorthandInput;
76
- };
77
- type CodegenInput = Partial<Codegen>;
78
- type NamespaceInput = {
79
- /**
80
- * Human-readable namespace label. Used as config keys and directory names.
81
- * Labels are not length constrained like namespaces within resource IDs, but special characters should be avoided to be compatible with the filesystem, Solidity compiler, etc.
82
- */
83
- readonly label: string;
84
- /**
85
- * Namespace used in resource ID.
86
- * Defaults to the first 16 characters of `label` if not set.
87
- */
88
- readonly namespace?: string;
89
- readonly tables?: TablesInput;
90
- };
91
- type NamespacesInput = {
92
- readonly [label: string]: Omit<NamespaceInput, "label">;
93
- };
94
- type StoreInput = Omit<NamespaceInput, "label"> & {
95
- readonly namespaces?: NamespacesInput;
96
- /**
97
- * Directory of Solidity source relative to the MUD config.
98
- * This is used to resolve other paths in the config, like codegen and user types.
99
- *
100
- * Defaults to `src` to match `foundry.toml`'s default. If you change this from the default, you may also need to configure foundry with the same source directory.
101
- */
102
- readonly sourceDirectory?: string;
103
- readonly userTypes?: UserTypes;
104
- readonly enums?: EnumsInput;
105
- readonly codegen?: CodegenInput;
106
- };
107
-
108
- type UserTypes = {
109
- readonly [userTypeName: string]: {
110
- readonly type: AbiType;
111
- readonly filePath: string;
112
- };
113
- };
114
- type Enums = EnumsInput;
115
- type EnumValues = {
116
- readonly [enumName: string]: {
117
- readonly [enumElement: string]: number;
118
- };
119
- };
120
- type TableCodegen = {
121
- /**
122
- * Directory to output codegenerated files relative to config's `codegen.outputDirectory`.
123
- *
124
- * Defaults to `tables`.
125
- */
126
- readonly outputDirectory: string;
127
- readonly tableIdArgument: boolean;
128
- readonly storeArgument: boolean;
129
- readonly dataStruct: boolean;
130
- };
131
- type TableDeploy = {
132
- readonly disabled: boolean;
133
- };
134
- type Table = show<Table$1 & {
135
- readonly codegen: TableCodegen;
136
- readonly deploy: TableDeploy;
137
- }>;
138
- type Tables = {
139
- readonly [label: string]: Table;
140
- };
141
- type Codegen = {
142
- /**
143
- * @internal
144
- * Absolute import path for a package import or starting with `.` for an import relative to project root dir.
145
- *
146
- * Defaults to `@latticexyz/store/src` if not set.
147
- */
148
- readonly storeImportPath: string;
149
- readonly userTypesFilename: string;
150
- /**
151
- * Directory to output codegenerated files relative to config's `sourceDirectory`.
152
- *
153
- * Defaults to `codegen`.
154
- */
155
- readonly outputDirectory: string;
156
- /**
157
- * Tables index filename.
158
- *
159
- * Defaults to `"index.sol"` when in single-namespace mode, and `false` for multi-namespace mode.
160
- *
161
- * @deprecated We recommend importing directly from table libraries rather than from the index for better compile times and deterministic deploys.
162
- */
163
- readonly indexFilename: string | false;
164
- };
165
- type Namespace = {
166
- /**
167
- * Human-readable namespace label. Used as config keys and directory names.
168
- * Labels are not length constrained like namespaces within resource IDs, but special characters should be avoided to be compatible with the filesystem, Solidity compiler, etc.
169
- */
170
- readonly label: string;
171
- /**
172
- * Namespace used in resource ID.
173
- */
174
- readonly namespace: string;
175
- readonly tables: Tables;
176
- };
177
- type Namespaces = {
178
- readonly [label: string]: Namespace;
179
- };
180
- type Store = {
181
- /**
182
- * @internal
183
- * Whether this project is using multiple namespaces or not, dictated by using `namespaces` config key.
184
- *
185
- * If using multiple namespaces, systems must be organized in `namespaces/{namespaceLabel}` directories.
186
- * Similarly, table libraries will be generated into these namespace directories.
187
- */
188
- readonly multipleNamespaces: boolean;
189
- /**
190
- * When in single-namespace mode, this is set to the config's base `namespace`.
191
- * When in multi-namespace mode, this is `null`.
192
- */
193
- readonly namespace: string | null;
194
- readonly namespaces: Namespaces;
195
- /**
196
- * Flattened set of tables, where each key is `{namespaceLabel}__{tableLabel}`.
197
- * For namespace labels using an empty string, no double-underscore is used, so the key is `{tableLabel}`.
198
- * This is kept for backwards compatibility.
199
- * It's recommended that you use `config.namespaces[namespaceLabel].tables[tableLabel]` instead.
200
- */
201
- readonly tables: Namespace["tables"];
202
- /**
203
- * Directory of Solidity source relative to the MUD config.
204
- * This is used to resolve other paths in the config, like codegen and user types.
205
- *
206
- * Defaults to `src` to match `foundry.toml`'s default. If you change this from the default, you may also need to configure foundry with the same source directory.
207
- */
208
- readonly sourceDirectory: string;
209
- readonly userTypes: UserTypes;
210
- readonly enums: Enums;
211
- readonly enumValues: EnumValues;
212
- readonly codegen: Codegen;
213
- };
214
-
215
- export { AbiTypeScope as A, type CodegenInput as C, type EnumsInput as E, type NamespaceInput as N, type StoreInput as S, type TableCodegenInput as T, type UserTypes as U, type Store as a, type SchemaInput as b, type ScopedSchemaInput as c, type TableDeployInput as d, type TableInput as e, type TableShorthandInput as f, type TablesInput as g, type NamespacesInput as h, type Enums as i, type EnumValues as j, type TableCodegen as k, type TableDeploy as l, type Table as m, type Tables as n, type Codegen as o, type Namespace as p, type Namespaces as q, Scope as r, type ScopeOptions as s, type getStaticAbiTypeKeys as t, extendScope as u };