import { F as FieldData, a as FullSchemaConfig, S as StoreConfig } from './storeConfig-6528f30c.js';
export { D as DEFAULTS, l as EnumsConfig, E as ExpandSchemaConfig, f as ExpandTableConfig, k as ExpandTablesConfig, m as FullEnumsConfig, e as FullTableConfig, j as FullTablesConfig, M as MUDUserConfig, P as PATH_DEFAULTS, c as SchemaConfig, b as ShorthandSchemaConfig, q as StoreUserConfig, T as TABLE_DEFAULTS, d as TableConfig, h as TablesConfig, U as UserTypesConfig, r as resolveUserTypes, n as zEnumsConfig, s as zPluginStoreConfig, z as zSchemaConfig, p as zStoreConfig, g as zTableConfig, i as zTablesConfig, o as zUserTypesConfig } from './storeConfig-6528f30c.js';
export { R as ResolvedStoreConfig, r as resolveConfig } from './resolveConfig-7f6d4ccb.js';
import { StaticAbiType, SchemaAbiType, SchemaAbiTypeToPrimitiveType } from '@latticexyz/schema-type/internal';
import { Hex } from 'viem';
import '@latticexyz/schema-type/deprecated';
import 'zod';
import '@latticexyz/common/type-utils';
import '@latticexyz/config/library';
import '@latticexyz/common/codegen';

type KeySchema = {
    readonly [k: string]: {
        readonly type: StaticAbiType;
    };
};
type ValueSchema = {
    readonly [k: string]: {
        readonly type: SchemaAbiType;
    };
};
type Table = {
    readonly tableId: Hex;
    readonly namespace: string;
    readonly name: string;
    readonly keySchema: KeySchema;
    readonly valueSchema: ValueSchema;
};
type Tables = {
    readonly [k: string]: Table;
};
/** Map a table schema like `{ value: { type: "uint256" } }` to its primitive types like `{ value: bigint }` */
type SchemaToPrimitives<schema extends ValueSchema> = {
    readonly [key in keyof schema]: SchemaAbiTypeToPrimitiveType<schema[key]["type"]>;
};
type ConfigFieldTypeToSchemaAbiType<T extends FieldData<string>> = T extends SchemaAbiType ? T : T extends `${string}[${string}]` ? "uint8[]" : "uint8";
type ConfigFieldTypeToPrimitiveType<T extends FieldData<string>> = T extends SchemaAbiType ? SchemaAbiTypeToPrimitiveType<T> : T extends `${string}[${string}]` ? number[] : number;
/** Map a table schema config like `{ value: "uint256", type: "SomeEnum" }` to its primitive types like `{ value: bigint, type: number }` */
type SchemaConfigToPrimitives<T extends FullSchemaConfig> = {
    [key in keyof T]: ConfigFieldTypeToPrimitiveType<T[key]>;
};
type ConfigToTablesPrimitives<C extends StoreConfig> = {
    [key in keyof C["tables"]]: {
        key: SchemaConfigToPrimitives<C["tables"][key]["keySchema"]>;
        value: SchemaConfigToPrimitives<C["tables"][key]["valueSchema"]>;
    };
};
type ConfigToKeyPrimitives<C extends StoreConfig, Table extends keyof ConfigToTablesPrimitives<C>> = ConfigToTablesPrimitives<C>[Table]["key"];
type ConfigToValuePrimitives<C extends StoreConfig, Table extends keyof ConfigToTablesPrimitives<C>> = ConfigToTablesPrimitives<C>[Table]["value"];
type ConfigToRecordPrimitives<C extends StoreConfig, Table extends keyof ConfigToTablesPrimitives<C>> = {
    key: ConfigToKeyPrimitives<C, Table>;
    value: ConfigToValuePrimitives<C, Table>;
};

export { ConfigFieldTypeToPrimitiveType, ConfigFieldTypeToSchemaAbiType, ConfigToKeyPrimitives, ConfigToRecordPrimitives, ConfigToTablesPrimitives, ConfigToValuePrimitives, FieldData, FullSchemaConfig, KeySchema, SchemaConfigToPrimitives, SchemaToPrimitives, StoreConfig, Table, Tables, ValueSchema };
