import { TypeMap } from './transaction-leaves.js'; import { Field } from '../snarky.js'; import { ProvableExtended } from '../lib/circuit_value.js'; import { HashInput } from '../lib/hash.js'; export { provableFromLayout, Layout, ProvableExtended, toJSONEssential }; declare type CustomTypes = Record>; declare function provableFromLayout(typeData: Layout, customTypes: CustomTypes): { sizeInFields(): number; toFields(value: T): Field[]; toAuxiliary(value?: T): any[]; fromFields(fields: Field[], aux: any[]): T; toJSON(value: T): TJson; check(value: T): void; toInput(value: T): HashInput; witness(f: () => T): T; }; declare function toJSONEssential(typeData: Layout, value: any, customTypes: CustomTypes): any; declare type WithChecked = { checkedType?: Layout; checkedTypeName?: string; }; declare type BaseLayout = { type: keyof TypeMap; } & WithChecked; declare type RangeLayout = { type: 'object'; name: string; keys: ['lower', 'upper']; entries: { lower: T; upper: T; }; } & WithChecked; declare type OptionLayout = { type: 'option'; } & ({ optionType: 'flaggedOption'; inner: RangeLayout; } | { optionType: 'flaggedOption'; inner: T; } | { optionType: 'orUndefined'; inner: T; }) & WithChecked; declare type ArrayLayout = { type: 'array'; inner: Layout; staticLength: number | null; } & WithChecked; declare type Layout = OptionLayout | BaseLayout | ({ type: 'object'; name: string; keys: string[]; entries: Record; } & WithChecked) | ArrayLayout;