import { GenericProvableExtended, GenericSignable } from './generic.js'; export { ProvableFromLayout, SignableFromLayout, GenericLayout, genericLayoutFold }; type GenericTypeMap = { Field: Field; Bool: Bool; UInt32: UInt32; UInt64: UInt64; Sign: Sign; BalanceChange: BalanceChange; PublicKey: PublicKey; AuthRequired: AuthRequired; TokenId: TokenId; }; type AnyTypeMap = GenericTypeMap; type TypeMapValues = { [K in keyof TypeMap & keyof JsonMap]: BaseType; }; type TypeMapProvable = { [K in keyof TypeMap & keyof JsonMap]: K extends keyof ValueMap ? GenericProvableExtended : never; }; type TypeMapSignable = { [K in keyof TypeMap & keyof JsonMap]: GenericSignable; }; declare function SignableFromLayout(TypeMap: TypeMapSignable, customTypes: Record>): { signableFromLayout: (typeData: GenericLayout) => { toJSON(value: T): TJson; fromJSON(json: TJson): T; toInput(value: T): { fields?: TypeMap["Field"][] | undefined; packed?: [TypeMap["Field"], number][] | undefined; }; empty(): T; }; toInput: (typeData: GenericLayout, value: any) => { fields?: TypeMap["Field"][] | undefined; packed?: [TypeMap["Field"], number][] | undefined; }; toJSON: (typeData: GenericLayout, value: any) => any; fromJSON: (typeData: GenericLayout, json: any) => any; empty: (typeData: GenericLayout) => any; toJSONEssential: (typeData: GenericLayout, value: any) => any; }; declare function ProvableFromLayout(TypeMap: TypeMapProvable, customTypes: Record>): { provableFromLayout: (typeData: GenericLayout) => GenericProvableExtended; toJSONEssential: (typeData: GenericLayout, value: any) => any; empty: (typeData: GenericLayout) => any; }; type GenericFoldSpec = { map: (type: BaseType, 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;