import { Token } from './lib/token.js';
export type ByteView<T extends ArrayBufferLike = ArrayBufferLike> = Uint8Array<T>;
export type AllocatedByteView = Uint8Array<ArrayBuffer>;
export type TokenOrNestedTokens = Token | Token[] | TokenOrNestedTokens[];
export interface Reference {
    parent: Reference | undefined;
    obj: object | any[];
    includes(obj: object | any[]): boolean;
}
export type OptionalTypeEncoder = (data: any, typ: string, options: EncodeOptions, refStack?: Reference) => TokenOrNestedTokens | null;
export type StrictTypeEncoder = (data: any, typ: string, options: EncodeOptions, refStack?: Reference) => TokenOrNestedTokens;
export type TokenTypeEncoder = {
    (writer: ByteWriter, token: Token, options?: EncodeOptions): void;
    compareTokens(t1: Token, t2: Token, options?: EncodeOptions): number;
    encodedSize?(token: Token, options?: EncodeOptions): number;
};
export type MapSorter = (e1: (Token | Token[])[], e2: (Token | Token[])[], options?: EncodeOptions) => number;
export type QuickEncodeToken = (token: Token) => AllocatedByteView | undefined;
export interface DecodeTokenizer {
    done(): boolean;
    next(): Token;
    pos(): number;
}
/**
 * Control object passed to tag decoders, providing methods to decode the tagged content.
 */
export interface TagDecodeControl {
    /** Decode the tagged content */
    (): unknown;
    /** Decode CBOR map content as [key, value] entries array (preserves key types) */
    entries(): Array<[unknown, unknown]>;
}
export type TagDecoder = (decode: TagDecodeControl) => any;
export interface DecodeOptions {
    allowIndefinite?: boolean;
    allowUndefined?: boolean;
    coerceUndefinedToNull?: boolean;
    allowInfinity?: boolean;
    allowNaN?: boolean;
    allowBigInt?: boolean;
    strict?: boolean;
    useMaps?: boolean;
    rejectDuplicateMapKeys?: boolean;
    retainStringBytes?: boolean;
    tags?: {
        [tagNumber: number]: TagDecoder;
    };
    tokenizer?: DecodeTokenizer;
}
export interface EncodeOptions {
    float64?: boolean;
    addBreakTokens?: boolean;
    mapSorter?: MapSorter;
    quickEncodeToken?: QuickEncodeToken;
    typeEncoders?: {
        [typeName: string]: OptionalTypeEncoder;
    };
    /**
     * If true, plain object properties with `undefined` values are ignored during
     * encoding.
     */
    ignoreUndefinedProperties?: boolean;
}
export interface ByteWriter {
    chunks: (ByteView | number[])[];
    reset(): void;
    pushByte(byte: number): void;
    push(bytes: ByteView | number[]): void;
    toBytes(reset?: boolean | undefined): ByteView;
}
//# sourceMappingURL=interface.d.ts.map