/**
 * Helper type for dealing with fixed size byte arrays.
 *
 * It changes the type of `length` property of `Uint8Array` to the
 * generic `Length` type parameter which is runtime compatible with
 * the original, because it extends from the `number` type.
 */
import { Data } from '../types';
export interface Bytes<Length extends number> extends Uint8Array {
    readonly length: Length;
}
/**
 * Helper type for dealing with flexible sized byte arrays.
 *
 * The actual min and and max values are not stored in runtime, they
 * are only there to differentiate the type from the Uint8Array at
 * compile time.
 * @see BrandedType
 */
export interface FlexBytes<Min extends number, Max extends number> extends Uint8Array {
    readonly __min__: Min;
    readonly __max__: Max;
}
/**
 * Type guard for `Bytes<T>` type
 *
 * @param b       The byte array
 * @param length  The length of the byte array
 */
export declare function isBytes<Length extends number>(b: unknown, length: Length): b is Bytes<Length>;
/**
 * Function that verifies if passed data are Bytes and if the array has "length" number of bytes under given offset.
 * @param data
 * @param offset
 * @param length
 */
export declare function hasBytesAtOffset(data: unknown, offset: number, length: number): boolean;
/**
 * Verifies if a byte array has a certain length
 *
 * @param b       The byte array
 * @param length  The specified length
 */
export declare function assertBytes<Length extends number>(b: unknown, length: Length): asserts b is Bytes<Length>;
/**
 * Type guard for FlexBytes<Min,Max> type
 *
 * @param b       The byte array
 * @param min     Minimum size of the array
 * @param max     Maximum size of the array
 */
export declare function isFlexBytes<Min extends number, Max extends number = Min>(b: unknown, min: Min, max: Max): b is FlexBytes<Min, Max>;
/**
 * Verifies if a byte array has a certain length between min and max
 *
 * @param b       The byte array
 * @param min     Minimum size of the array
 * @param max     Maximum size of the array
 */
export declare function assertFlexBytes<Min extends number, Max extends number = Min>(b: unknown, min: Min, max: Max): asserts b is FlexBytes<Min, Max>;
/**
 * Return `length` bytes starting from `offset`
 *
 * @param data   The original data
 * @param offset The offset to start from
 * @param length The length of data to be returned
 */
export declare function bytesAtOffset<Length extends number>(data: Uint8Array, offset: number, length: Length): Bytes<Length>;
/**
 * Return flex bytes starting from `offset`
 *
 * @param data   The original data
 * @param offset The offset to start from
 * @param _min   The minimum size of the data
 * @param _max   The maximum size of the data
 */
export declare function flexBytesAtOffset<Min extends number, Max extends number>(data: Uint8Array, offset: number, _min: Min, _max: Max): FlexBytes<Min, Max>;
/**
 * Returns true if two byte arrays are equal
 *
 * @param a Byte array to compare
 * @param b Byte array to compare
 */
export declare function bytesEqual(a: Uint8Array, b: Uint8Array): boolean;
/**
 * Returns a new byte array filled with zeroes with the specified length
 *
 * @param length The length of data to be returned
 */
export declare function makeBytes<Length extends number>(length: Length): Bytes<Length>;
export declare function wrapBytesWithHelpers(data: Uint8Array): Data;
