/**
 * Antelope/SYSIO ABI Decoder
 */
import { ABIDef } from "../chain/Abi.js";
import { BytesType } from "../chain/Bytes.js";
import { ABISerializable, ABISerializableConstructor, ABISerializableType } from "./Serializable.js";
import { BuiltinTypes } from "./Builtins.js";
interface DecodeArgsBase {
    abi?: ABIDef;
    data?: BytesType | ABIDecoder;
    json?: string;
    object?: any;
    customTypes?: ABISerializableConstructor[];
    /** Optional encoder metadata. */
    metadata?: Record<string, any>;
    /**
     * Binary extension handling, if set to true missing extensions will be initialized,
     * otherwise they will be set to null. Defaults to false.
     */
    strictExtensions?: boolean;
    /**
     * Set to ignore invalid UTF-8, otherwise an error will be thrown (default).
     */
    ignoreInvalidUTF8?: boolean;
}
interface TypedDecodeArgs<T extends ABISerializableType> extends DecodeArgsBase {
    type: T;
}
interface BuiltinDecodeArgs<T extends keyof BuiltinTypes> extends DecodeArgsBase {
    type: T;
}
interface UntypedDecodeArgs extends DecodeArgsBase {
    type: ABISerializableType;
}
export declare function abiDecode<T extends keyof BuiltinTypes>(args: BuiltinDecodeArgs<T>): BuiltinTypes[T];
export declare function abiDecode<T extends ABISerializableConstructor>(args: TypedDecodeArgs<T>): InstanceType<T>;
export declare function abiDecode(args: UntypedDecodeArgs): ABISerializable;
/** Marker for objects when they have been resolved, i.e. their types `from` factory method will not need to resolve children. */
export declare const Resolved: unique symbol;
export declare class ABIDecoder {
    private array;
    static __className: string;
    private pos;
    private data;
    private textDecoder;
    /** User declared metadata, can be used to pass info to instances when decoding.  */
    metadata: Record<string, any>;
    constructor(array: Uint8Array, textDecoder?: TextDecoder);
    canRead(bytes?: number): boolean;
    private ensure;
    setPosition(pos: number): void;
    getPosition(): number;
    advance(bytes: number): void;
    /** Read one byte. */
    readByte(): number;
    /** Read floating point as JavaScript number, 32 or 64 bits. */
    readFloat(byteWidth: number): number;
    readVaruint32(): number;
    readVarint32(): number;
    readArray(length: number): Uint8Array<ArrayBufferLike>;
    readString(): string;
}
export {};
//# sourceMappingURL=Decoder.d.ts.map