/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { BrandedType } from "../../../util";
import { DiscriminatedUnionDispatcher } from "../../../codec";
import { TreeChunk } from "../chunk";
import { EncodedChunkGeneric, IdentifierOrIndex } from "./formatGeneric";
import { ChunkDecoder, StreamCursor } from "./chunkCodecUtilities";
/**
 * 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, chunk: EncodedChunkGeneric<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[];
    /**
     * @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[]);
    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