import { Dict, show } from '@ark/util'; import { AbiType, Table as Table$1 } from '@latticexyz/config'; import { StaticAbiType } from '@latticexyz/schema-type/internal'; declare const Scope: { readonly types: {}; }; type Scope = typeof Scope; type AbiTypeScope = ScopeOptions<{ [t in AbiType]: t; }>; declare const AbiTypeScope: AbiTypeScope; type ScopeOptions = Dict> = { types: types; }; type getStaticAbiTypeKeys = SchemaInput extends schema ? string : { [key in keyof schema]: scope["types"] extends { [_ in schema[key]]: StaticAbiType; } ? key : never; }[keyof schema]; type extendScope> = show>>; declare function extendScope>(scope: scope, additionalTypes: additionalTypes): extendScope; type EnumsInput = { readonly [enumName: string]: readonly [string, ...string[]]; }; type SchemaInput = { readonly [fieldName: string]: string; }; type ScopedSchemaInput = { readonly [fieldName: string]: keyof scope["types"]; }; type TableCodegenInput = Partial; type TableDeployInput = Partial; type TableInput = { /** * Human-readable label for this table. Used as config keys, library names, and filenames. * Labels are not length constrained like resource names, but special characters should be avoided to be compatible with the filesystem, Solidity compiler, etc. */ readonly label: string; /** * Human-readable label for this table's namespace. Used for namespace config keys and directory names. * Defaults to the nearest namespace in the config or root namespace if not set. */ readonly namespaceLabel?: string; /** * Table type used in table's resource ID and determines how storage and events are used by this table. * Defaults to `table` if not set. */ readonly type?: "table" | "offchainTable"; /** * Table namespace used in table's resource ID. Only root systems and systems of the same namespace can write to this table. * Defaults to the nearest namespace in the config or root namespace if not set. */ readonly namespace?: string; /** * Table name used in table's resource ID. * Defaults to the first 16 characters of `label` if not set. */ readonly name?: string; /** * Schema definition for this table's records. */ readonly schema: SchemaInput; /** * Primary key for records of this table. An array of zero or more schema field names. * Using an empty array acts like a singleton, where only one record can exist for this table. */ readonly key: readonly string[]; readonly codegen?: TableCodegenInput; readonly deploy?: TableDeployInput; }; type TableShorthandInput = SchemaInput | string; type TablesInput = { readonly [label: string]: Omit | TableShorthandInput; }; type CodegenInput = Partial; type NamespaceInput = { /** * Human-readable namespace label. Used as config keys and directory names. * 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. */ readonly label: string; /** * Namespace used in resource ID. * Defaults to the first 16 characters of `label` if not set. */ readonly namespace?: string; readonly tables?: TablesInput; }; type NamespacesInput = { readonly [label: string]: Omit; }; type StoreInput = Omit & { readonly namespaces?: NamespacesInput; /** * Directory of Solidity source relative to the MUD config. * This is used to resolve other paths in the config, like codegen and user types. * * 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. */ readonly sourceDirectory?: string; readonly userTypes?: UserTypes; readonly enums?: EnumsInput; readonly codegen?: CodegenInput; }; type UserTypes = { readonly [userTypeName: string]: { readonly type: AbiType; readonly filePath: string; }; }; type Enums = EnumsInput; type EnumValues = { readonly [enumName: string]: { readonly [enumElement: string]: number; }; }; type TableCodegen = { /** * Directory to output codegenerated files relative to config's `codegen.outputDirectory`. * * Defaults to `tables`. */ readonly outputDirectory: string; readonly tableIdArgument: boolean; readonly storeArgument: boolean; readonly dataStruct: boolean; }; type TableDeploy = { readonly disabled: boolean; }; type Table = show; type Tables = { readonly [label: string]: Table; }; type Codegen = { /** * @internal * Absolute import path for a package import or starting with `.` for an import relative to project root dir. * * Defaults to `@latticexyz/store/src` if not set. */ readonly storeImportPath: string; readonly userTypesFilename: string; /** * Directory to output codegenerated files relative to config's `sourceDirectory`. * * Defaults to `codegen`. */ readonly outputDirectory: string; /** * Tables index filename. * * Defaults to `"index.sol"` when in single-namespace mode, and `false` for multi-namespace mode. * * @deprecated We recommend importing directly from table libraries rather than from the index for better compile times and deterministic deploys. */ readonly indexFilename: string | false; }; type Namespace = { /** * Human-readable namespace label. Used as config keys and directory names. * 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. */ readonly label: string; /** * Namespace used in resource ID. */ readonly namespace: string; readonly tables: Tables; }; type Namespaces = { readonly [label: string]: Namespace; }; type Store = { /** * @internal * Whether this project is using multiple namespaces or not, dictated by using `namespaces` config key. * * If using multiple namespaces, systems must be organized in `namespaces/{namespaceLabel}` directories. * Similarly, table libraries will be generated into these namespace directories. */ readonly multipleNamespaces: boolean; /** * When in single-namespace mode, this is set to the config's base `namespace`. * When in multi-namespace mode, this is `null`. */ readonly namespace: string | null; readonly namespaces: Namespaces; /** * Flattened set of tables, where each key is `{namespaceLabel}__{tableLabel}`. * For namespace labels using an empty string, no double-underscore is used, so the key is `{tableLabel}`. * This is kept for backwards compatibility. * It's recommended that you use `config.namespaces[namespaceLabel].tables[tableLabel]` instead. */ readonly tables: Namespace["tables"]; /** * Directory of Solidity source relative to the MUD config. * This is used to resolve other paths in the config, like codegen and user types. * * 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. */ readonly sourceDirectory: string; readonly userTypes: UserTypes; readonly enums: Enums; readonly enumValues: EnumValues; readonly codegen: Codegen; }; 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 };