import { BrandedType, PlainBytesReference } from '../types';
import { Bytes, FlexBytes } from '../utils/bytes';
export declare const MIN_PAYLOAD_SIZE = 1;
export declare const MAX_PAYLOAD_SIZE = 4096;
/**
 * General chunk interface for Swarm
 *
 * It stores the serialized data and provides functions to access
 * the fields of a chunk.
 *
 * It also provides an address function to calculate the address of
 * the chunk that is required for the Chunk API.
 */
export interface Chunk {
    readonly data: Uint8Array;
    span(): Bytes<8>;
    payload(): FlexBytes<1, 4096>;
    address(): PlainBytesReference;
}
declare type ValidChunkData = BrandedType<Uint8Array, 'ValidChunkData'>;
/**
 * Creates a content addressed chunk and verifies the payload size.
 *
 * @param payloadBytes the data to be stored in the chunk
 */
export declare function makeContentAddressedChunk(payloadBytes: Uint8Array): Chunk;
/**
 * Type guard for valid content addressed chunk data
 *
 * @param data          The chunk data
 * @param chunkAddress  The address of the chunk
 */
export declare function isValidChunkData(data: unknown, chunkAddress: PlainBytesReference): data is ValidChunkData;
/**
 * Asserts if data are representing given address of its chunk.
 *
 * @param data          The chunk data
 * @param chunkAddress  The address of the chunk
 *
 * @returns a valid content addressed chunk or throws error
 */
export declare function assertValidChunkData(data: unknown, chunkAddress: PlainBytesReference): asserts data is ValidChunkData;
export {};
