import { GenericProvableExtended } from './generic.js'; export { ProvableFromLayout, GenericLayout, genericLayoutFold }; type GenericTypeMap = { Field: Field; Bool: Bool; UInt32: UInt32; UInt64: UInt64; Sign: Sign; PublicKey: PublicKey; AuthRequired: AuthRequired; TokenId: TokenId; }; type AnyTypeMap = GenericTypeMap; type TypeMapValues = { [K in keyof TypeMap & keyof JsonMap]: GenericProvableExtended; }; declare function ProvableFromLayout(TypeMap: TypeMapValues, customTypes: Record>): { provableFromLayout: (typeData: GenericLayout) => { sizeInFields(): number; toFields(value: T): TypeMap["Field"][]; toAuxiliary(value?: T | undefined): any[]; fromFields(fields: TypeMap["Field"][], aux: any[]): T; toJSON(value: T): TJson; fromJSON(json: TJson): T; check(value: T): void; toInput(value: T): { fields?: TypeMap["Field"][] | undefined; packed?: [TypeMap["Field"], number][] | undefined; }; emptyValue(): T; }; toJSONEssential: (typeData: GenericLayout, value: any) => any; emptyValue: (typeData: GenericLayout) => any; }; type GenericFoldSpec = { map: (type: GenericProvableExtended, value?: T, name?: string) => R; reduceArray: (array: R[], typeData: ArrayLayout) => R; reduceObject: (keys: string[], record: Record) => R; reduceFlaggedOption: (option: { isSome: R; value: R; }, typeData: FlaggedOptionLayout) => R; reduceOrUndefined: (value: R | undefined, innerTypeData: GenericLayout) => R; }; declare function genericLayoutFold(TypeMap: TypeMapValues, customTypes: Record>, spec: GenericFoldSpec, typeData: GenericLayout, value?: T): R; type WithChecked = { checkedType?: GenericLayout; checkedTypeName?: string; }; type BaseLayout = { type: keyof TypeMap & string; } & WithChecked; type RangeLayout> = { type: 'object'; name: string; keys: ['lower', 'upper']; entries: { lower: T; upper: T; }; } & WithChecked; type OptionLayout> = { type: 'option'; } & ({ optionType: 'closedInterval'; rangeMin: any; rangeMax: any; inner: RangeLayout; } | { optionType: 'flaggedOption'; inner: T; } | { optionType: 'orUndefined'; inner: T; }) & WithChecked; type FlaggedOptionLayout> = Exclude, { optionType: 'orUndefined'; }>; type ArrayLayout = { type: 'array'; inner: GenericLayout; staticLength: number | null; } & WithChecked; type ObjectLayout = { type: 'object'; name: string; keys: string[]; entries: Record>; } & WithChecked; type GenericLayout = OptionLayout | BaseLayout | ObjectLayout | ArrayLayout;