/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { Value } from "../../../core/index.js";
import { TreeChunk } from "../chunk.js";
import { EncodedChunkShape, EncodedFieldBatch, EncodedInlineArray, EncodedNestedArray, EncodedTreeShape, EncodedValueShape } from "./format.js";
import { ChunkDecoder, StreamCursor } from "./chunkCodecUtilities.js";
import { DecoderContext } from "./chunkDecodingGeneric.js";
/**
 * Decode `chunk` into a TreeChunk.
 */
export declare function decode(chunk: EncodedFieldBatch): TreeChunk[];
/**
 * Decode a node's value from `stream` using its shape.
 */
export declare function readValue(stream: StreamCursor, shape: EncodedValueShape): Value;
/**
 * Normalize a {@link TreeChunk} into an array.
 *
 * Unwraps {@link SequenceChunk}s, and wraps other chunks.
 */
export declare function deaggregateChunks(chunk: TreeChunk): TreeChunk[];
/**
 * Normalize a {@link TreeChunk}[] into a single TreeChunk.
 *
 * Avoids creating nested or less than 2 child {@link SequenceChunk}s.
 */
export declare function aggregateChunks(input: TreeChunk[]): TreeChunk;
/**
 * Decoder for {@link EncodedNestedArray}s.
 */
export declare class NestedArrayDecoder implements ChunkDecoder {
    private readonly shape;
    constructor(shape: EncodedNestedArray);
    decode(decoders: readonly ChunkDecoder[], stream: StreamCursor): TreeChunk;
}
/**
 * Decoder for {@link EncodedInlineArray}s.
 */
export declare class InlineArrayDecoder implements ChunkDecoder {
    private readonly shape;
    constructor(shape: EncodedInlineArray);
    decode(decoders: readonly ChunkDecoder[], stream: StreamCursor): TreeChunk;
}
/**
 * Decoder for {@link EncodedAnyShape}s.
 */
export declare const anyDecoder: ChunkDecoder;
/**
 * Decoder for {@link EncodedTreeShape}s.
 */
export declare class TreeDecoder implements ChunkDecoder {
    private readonly shape;
    private readonly cache;
    private readonly type?;
    private readonly fieldDecoders;
    constructor(shape: EncodedTreeShape, cache: DecoderContext<EncodedChunkShape>);
    decode(decoders: readonly ChunkDecoder[], stream: StreamCursor): TreeChunk;
}
//# sourceMappingURL=chunkDecoding.d.ts.map