@latticexyz/store 2.0.13-main-609de113f → 3.0.0-main-560fd6a0c

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,57 +0,0 @@
1
- import { j as ValidateTableOptions, l as validateTable, u as extendedScope, w as validateStore, r as resolveStore } from './store-cb0f85e1.js';
2
- import { ErrorMessage, conform } from '@arktype/util';
3
- import { FixedArrayAbiType } from '@latticexyz/schema-type/internal';
4
- import { k as TableShorthandInput, a as Scope, A as AbiTypeScope, c as SchemaInput, g as getStaticAbiTypeKeys, d as ScopedSchemaInput, l as TablesWithShorthandsInput, m as StoreWithShorthandsInput } from './output-2853398e.js';
5
-
6
- declare const NoStaticKeyFieldError = "Invalid schema. Expected an `id` field with a static ABI type or an explicit `key` option.";
7
- type NoStaticKeyFieldError = ErrorMessage<typeof NoStaticKeyFieldError>;
8
- declare function isTableShorthandInput(shorthand: unknown): shorthand is TableShorthandInput;
9
- type validateTableWithShorthand<table, scope extends Scope = AbiTypeScope, options extends ValidateTableOptions = {
10
- inStoreContext: boolean;
11
- }> = table extends TableShorthandInput ? validateTableShorthand<table, scope> : validateTable<table, scope, options>;
12
- type validateTableShorthand<input, scope extends Scope = AbiTypeScope> = input extends SchemaInput ? "id" extends getStaticAbiTypeKeys<input, scope> ? conform<input, ScopedSchemaInput<scope>> : NoStaticKeyFieldError : input extends FixedArrayAbiType ? input : input extends keyof scope["types"] ? input : input extends string ? keyof scope["types"] : ScopedSchemaInput<scope>;
13
- declare function validateTableShorthand<scope extends Scope = AbiTypeScope>(shorthand: unknown, scope?: scope): asserts shorthand is TableShorthandInput;
14
- type resolveTableShorthand<shorthand, scope extends Scope = AbiTypeScope> = shorthand extends FixedArrayAbiType ? {
15
- schema: {
16
- id: "bytes32";
17
- value: shorthand;
18
- };
19
- key: ["id"];
20
- } : shorthand extends keyof scope["types"] ? {
21
- schema: {
22
- id: "bytes32";
23
- value: shorthand;
24
- };
25
- key: ["id"];
26
- } : shorthand extends SchemaInput ? "id" extends getStaticAbiTypeKeys<shorthand, scope> ? {
27
- schema: shorthand;
28
- key: ["id"];
29
- } : never : never;
30
- declare function resolveTableShorthand<shorthand extends TableShorthandInput, scope extends Scope = AbiTypeScope>(shorthand: shorthand, scope?: scope): resolveTableShorthand<shorthand, scope>;
31
- declare function defineTableShorthand<shorthand, scope extends Scope = AbiTypeScope>(shorthand: validateTableShorthand<shorthand, scope>, scope?: scope): resolveTableShorthand<shorthand, scope>;
32
- /**
33
- * If a shorthand is provided, it is resolved to a full config.
34
- * If a full config is provided, it is passed through.
35
- */
36
- type resolveTableWithShorthand<table, scope extends Scope = AbiTypeScope> = table extends TableShorthandInput ? resolveTableShorthand<table, scope> : table;
37
- type resolveTablesWithShorthands<input, scope extends AbiTypeScope = AbiTypeScope> = {
38
- [key in keyof input]: resolveTableWithShorthand<input[key], scope>;
39
- };
40
- type validateTablesWithShorthands<tables, scope extends Scope = AbiTypeScope> = {
41
- [key in keyof tables]: validateTableWithShorthand<tables[key], scope, {
42
- inStoreContext: true;
43
- }>;
44
- };
45
- declare function validateTablesWithShorthands<scope extends Scope = AbiTypeScope>(tables: unknown, scope: scope): asserts tables is TablesWithShorthandsInput;
46
-
47
- type validateStoreWithShorthands<store> = {
48
- [key in keyof store]: key extends "tables" ? validateTablesWithShorthands<store[key], extendedScope<store>> : validateStore<store>[key];
49
- };
50
- declare function validateStoreWithShorthands(store: unknown): asserts store is StoreWithShorthandsInput;
51
- type resolveStoreWithShorthands<store> = resolveStore<{
52
- [key in keyof store]: key extends "tables" ? resolveTablesWithShorthands<store[key], extendedScope<store>> : store[key];
53
- }>;
54
- declare function resolveStoreWithShorthands<const store extends StoreWithShorthandsInput>(store: store): resolveStoreWithShorthands<store>;
55
- declare function defineStoreWithShorthands<const store>(store: validateStoreWithShorthands<store>): resolveStoreWithShorthands<store>;
56
-
57
- export { NoStaticKeyFieldError as N, validateTableShorthand as a, defineTableShorthand as b, resolveTableWithShorthand as c, defineStoreWithShorthands as d, resolveTablesWithShorthands as e, validateTablesWithShorthands as f, validateStoreWithShorthands as g, resolveStoreWithShorthands as h, isTableShorthandInput as i, resolveTableShorthand as r, validateTableWithShorthand as v };