import { KaitaiStreamReader, KaitaiStreamWriter, StreamBufferType } from '@iotize/common/byte-stream';
export declare function enumKeyOrValueToNumber<T>(key: string | number | T, mapping: any): number;
export declare class TapStreamReader extends KaitaiStreamReader {
    static fromArray(array: Uint8Array): TapStreamReader;
    static create(packet: Uint8Array | TapStreamReader): TapStreamReader;
    readStr(n: number): string;
    /**
     * Read given byte size as string
     * @param n number of byte to read
     */
    readString(n?: number): string;
    /**
     * Read string until terminator character is reached
     */
    readStringTerminator(terminator: string): string;
    readU2(): number;
    readU4(): number;
    readF4(): number;
    subStream(length: number): TapStreamReader;
}
export declare class TapStreamWriter extends KaitaiStreamWriter {
    constructor(lengthOrBuffer?: number | StreamBufferType, byteOffset?: number, isBigEndian?: boolean);
    static create(size: number): TapStreamWriter;
    writeFunction(type: string, options: any, fieldValue?: any, fieldSize?: any): this;
    addPadding(padSize: number): this;
    addCRC(options?: {
        offset?: number;
    }): this;
    writeUnsigned(value: number, length: number): this;
    writeU4(value: number): this;
    writeU2(value: number): this;
    writeU1(value: number): this;
    writeF4(value: number): this;
    writeFloat(value: number, length: number): this;
    writeSigned(value: number, length: number): this;
    writeString(value: string | undefined, length?: number): this;
    writeStr(value: string, length?: number): this;
    writeBitsInt(value: number, n: number): this;
    writeBits(value: number, n: number): this;
    writeBoolean(value: number | boolean, n: number): this;
}
