/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import type { DiscriminatedUnionDispatcher } from "../../../codec/index.js";
import type { BrandedType } from "../../../util/index.js";
import type { TreeChunk } from "../chunk.js";
import { type ChunkDecoder, type StreamCursor } from "./chunkCodecUtilities.js";
import type { EncodedFieldBatchGeneric, IdentifierOrIndex } from "./formatGeneric.js";
import type { IdDecodingContext } from "./chunkDecoding.js";
/**
 * General purpose shape based tree decoder which gets its support for specific shapes from the caller.
 */
export declare function decode<TEncodedShape extends object, TCache>(decoderLibrary: DiscriminatedUnionDispatcher<TEncodedShape, [cache: TCache], ChunkDecoder>, cache: TCache, batch: EncodedFieldBatchGeneric<TEncodedShape>, rootDecoder: ChunkDecoder): TreeChunk[];
/**
 * Shared data for use in constructing decoders.
 */
export declare class DecoderContext<TEncodedShape = unknown> {
    readonly identifiers: readonly string[];
    readonly shapes: readonly TEncodedShape[];
    readonly idDecodingContext: IdDecodingContext;
    /**
     * @param identifiers - identifier substitution table (use to replace numeric identifier indexes with the actual identifiers from this table).
     */
    constructor(identifiers: readonly string[], shapes: readonly TEncodedShape[], idDecodingContext: IdDecodingContext);
    identifier<T extends string & BrandedType<string, string>>(encoded: IdentifierOrIndex): T;
}
/**
 * Read one identifier from the stream, advancing the stream offset.
 */
export declare function readStreamIdentifier<T extends string & BrandedType<string, string>>(stream: StreamCursor, cache: DecoderContext): T;
//# sourceMappingURL=chunkDecodingGeneric.d.ts.map