import { ImportDatum, StaticResourceData, RenderKeyTuple, RenderField, RenderStaticField, RenderDynamicField, RenderType, SolidityUserDefinedType } from '@latticexyz/common/codegen';
import { S as StoreConfig } from './storeConfig-6528f30c.js';
import { S as Store } from './output-b02052a1.js';
import { SchemaType } from '@latticexyz/schema-type/deprecated';
import 'zod';
import '@latticexyz/common/type-utils';
import '@latticexyz/config/library';
import '@arktype/util';
import '@latticexyz/config';

interface RenderTableOptions {
    /** List of symbols to import, and their file paths */
    imports: ImportDatum[];
    /** Name of the library to render. */
    libraryName: string;
    /** Name of the struct to render. If undefined, struct and its methods aren't rendered. */
    structName?: string;
    /** Data used to statically register the table. If undefined, all methods receive `_tableId` as an argument. */
    staticResourceData?: StaticResourceData;
    /** Path for store package imports */
    storeImportPath: string;
    keyTuple: RenderKeyTuple[];
    fields: RenderField[];
    staticFields: RenderStaticField[];
    dynamicFields: RenderDynamicField[];
    /** Whether to render getter functions */
    withGetters: boolean;
    /** Whether to render dynamic field methods (push, pop, update) */
    withDynamicFieldMethods: boolean;
    /** Whether to render get/set methods for the whole record */
    withRecordMethods: boolean;
    /** Whether to additionally render field methods without a field name suffix */
    withSuffixlessFieldMethods: boolean;
    /** Whether to render additional methods that accept a manual `IStore` argument */
    storeArgument: boolean;
}

/**
 * Returns Solidity code for all the field-specific table methods (get, set, push, pop, etc.)
 * @param options RenderTableOptions
 * @returns string of Solidity code
 */
declare function renderFieldMethods(options: RenderTableOptions): string;
/**
 * Returns Solidity code for how to encode a particular field into bytes before storing onchain
 * @param field RenderField
 * @returns string of Solidity code
 */
declare function renderEncodeFieldSingle(field: RenderField): string;
/**
 * Returns Solidity code for decoding a bytes value into its Solidity primitive type
 * @param field description of field type
 * @param offset byte-length offset of value in encoded bytes
 * @returns string of Solidity code
 */
declare function renderDecodeValueType(field: RenderType, offset: number): string;

/**
 * Returns Solidity code for whole-record methods (get, set)
 * @param options RenderTableOptions
 * @returns string of Solidity code
 */
declare function renderRecordMethods(options: RenderTableOptions): string;
/**
 * Returns Solidity code to prepare variables needed to store encoded record on chain
 * @param options RenderTableOptions
 * @param namePrefix optional field name prefix to change how the field is accessed
 * @returns string of Solidity code
 */
declare function renderRecordData(options: RenderTableOptions, namePrefix?: string): string;
/**
 * Returns Solidity code for the delete record method
 * @param options RenderTableOptions
 * @returns string of Solidity code
 */
declare function renderDeleteRecordMethods(options: RenderTableOptions): string;

/**
 * Renders Solidity code for a MUD table library, using the specified options
 * @param options options for rendering the table
 * @returns string of Solidity code
 */
declare function renderTable(options: RenderTableOptions): string;

/**
 * Renders Solidity code for enums defined in the provided config
 */
declare function renderTypesFromConfig(config: StoreConfig): string;

declare function tablegen(configV2: Store, outputBaseDirectory: string, remappings: [string, string][]): Promise<void>;

interface TableOptions {
    /** Path where the file is expected to be written (relative to project root) */
    outputPath: string;
    /** Name of the table, as used in filename and library name */
    tableName: string;
    /** Options for `renderTable` function */
    renderOptions: RenderTableOptions;
}
/**
 * Transforms store config and available solidity user types into useful options for `tablegen` and `renderTable`
 */
declare function getTableOptions(config: StoreConfig, solidityUserTypes: Record<string, SolidityUserDefinedType>): TableOptions[];

/**
 * Renders `DecodeSlice` library with the necessary header and imports,
 * which provides methods for decoding `Slice` into arrays of all primitive types
 * @returns string of Solidity code
 */
declare function renderDecodeSlice(): string;

/**
 * Renders `EncodeArray` library with the necessary header and imports,
 * which provides methods for encoding arrays of all primitive types into `Slice`
 * @returns string of Solidity code
 */
declare function renderEncodeArray(): string;

/**
 * Renders `decodeArray_*` method for decoding `Slice` into the array of provided primitive type
 * @param element name and byte length of the primitive type
 * @returns string of Solidity code
 */
declare function renderTightCoderDecode(element: Pick<RenderType, "internalTypeId" | "staticByteLength">): string;
/**
 * Renders `encode` method for encoding the array of provided primitive type into `Slice`
 * @param element name and byte length of the primitive type
 * @returns string of Solidity code
 */
declare function renderTightCoderEncode(element: Pick<RenderType, "internalTypeId" | "staticByteLength">): string;

declare function renderTightCoderAutoTestFunction({ typeId }: {
    typeId: string;
}): string;
declare function renderTightCoderAutoTest(): string;

/**
 * Resolve an abi or user type into a SchemaType and RenderType
 */
declare function resolveAbiOrUserType(abiOrUserType: string, config: StoreConfig, solidityUserTypes: Record<string, SolidityUserDefinedType>): {
    schemaType: SchemaType;
    renderType: RenderType;
};
/**
 * Get the required import for SchemaType|userType (`undefined` means that no import is required)
 */
declare function importForAbiOrUserType(abiOrUserType: string, usedInDirectory: string, config: StoreConfig, solidityUserTypes: Record<string, SolidityUserDefinedType>): ImportDatum | undefined;
declare function getSchemaTypeInfo(schemaType: SchemaType): RenderType;
declare function getUserTypeInfo(userType: string, config: StoreConfig, solidityUserTypes: Record<string, SolidityUserDefinedType>): {
    schemaType: SchemaType;
    renderType: RenderType;
};

export { RenderTableOptions, TableOptions, getSchemaTypeInfo, getTableOptions, getUserTypeInfo, importForAbiOrUserType, renderDecodeSlice, renderDecodeValueType, renderDeleteRecordMethods, renderEncodeArray, renderEncodeFieldSingle, renderFieldMethods, renderRecordData, renderRecordMethods, renderTable, renderTightCoderAutoTest, renderTightCoderAutoTestFunction, renderTightCoderDecode, renderTightCoderEncode, renderTypesFromConfig, resolveAbiOrUserType, tablegen };
