/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import type { TSchema } from "@sinclair/typebox";
import type { JsonCompatibleReadOnly } from "../../util/index.js";
import { type ICodecFamily, type ICodecOptions, type IJsonCodec, type FormatVersion, type FluidClientVersion, type CodecWriteOptions } from "../codec.js";
import { Versioned } from "./format.js";
export declare function makeVersionedCodec<TDecoded, TEncoded extends Versioned = JsonCompatibleReadOnly & Versioned, TValidate = TEncoded, TContext = void>(supportedVersions: Set<FormatVersion>, { jsonValidator: validator }: ICodecOptions, inner: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>): IJsonCodec<TDecoded, TEncoded, TValidate, TContext>;
export declare function makeVersionedValidatedCodec<EncodedSchema extends TSchema, TDecoded, TEncoded extends Versioned = JsonCompatibleReadOnly & Versioned, TValidate = TEncoded, TContext = void>(options: ICodecOptions, supportedVersions: Set<number>, schema: EncodedSchema, codec: IJsonCodec<TDecoded, TEncoded, TValidate, TContext>): IJsonCodec<TDecoded, TEncoded, TValidate, TContext>;
/**
 * Creates a codec which dispatches to the appropriate member of a codec family based on the version of
 * data it encounters.
 * @remarks
 * Each member of the codec family must write an explicit version number into the data it encodes (implementing {@link Versioned}).
 *
 * TODO: Users of this should migrate to {@link ClientVersionDispatchingCodecBuilder} so that the actual format version used can be encapsulated.
 */
export declare function makeVersionDispatchingCodec<TDecoded, TContext>(family: ICodecFamily<TDecoded, TContext>, options: ICodecOptions & {
    writeVersion: number;
}): IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>;
/**
 * Creates a codec which dispatches to the appropriate member of a codec family based on the `oldestCompatibleClient` for encode and the
 * version number in data it encounters for decode.
 * @privateRemarks
 * This is a two stage builder so the first stage can encapsulate all codec specific details and the second can bring in configuration.
 */
export declare class ClientVersionDispatchingCodecBuilder<TDecoded, TContext> {
    /**
     * The codec family to dispatch to.
     */
    private readonly family;
    /**
     * A function which maps a {@link FluidClientVersion} to a version number for the codec family which is supported by that version.
     * This can (and typically does) pick the newest version of the codec which is known to be compatible with the client version so that
     * any improvements in newer versions of the codec can be used when allowed.
     */
    private readonly versionMapping;
    constructor(
    /**
     * The codec family to dispatch to.
     */
    family: ICodecFamily<TDecoded, TContext>, 
    /**
     * A function which maps a {@link FluidClientVersion} to a version number for the codec family which is supported by that version.
     * This can (and typically does) pick the newest version of the codec which is known to be compatible with the client version so that
     * any improvements in newer versions of the codec can be used when allowed.
     */
    versionMapping: (oldestCompatibleClient: FluidClientVersion) => number);
    build(options: CodecWriteOptions): IJsonCodec<TDecoded, JsonCompatibleReadOnly, JsonCompatibleReadOnly, TContext>;
}
//# sourceMappingURL=codec.d.ts.map