/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { strictEnum } from "../../../../util/index.js";
import { EncodedFieldBatchGeneric } from "./formatGeneric.js";
import { EncodedChunkShapeV1 } from "./formatV1.js";
import { EncodedChunkShapeV2 } from "./formatV2.js";
export const FieldBatchFormatVersion = strictEnum("FieldBatchFormatVersion", {
    /**
     * Initial version.
     * @remarks
     * For simplicity of implementation the format for this version allows the same chunk shapes as v2, but must not use {@link EncodedIncrementalChunkShape}
     * as older clients will not know how to handle that shape but think they can handle this format.
     */
    v1: 1,
    /**
     * Adds support for incremental encoding of chunks.
     * @remarks
     * {@link EncodedIncrementalChunkShape} was added in this version.
     */
    v2: 2,
});
/**
 * Whether the given format version supports incremental chunk encoding.
 *
 * @remarks
 * This helper should be used for comparison since experimental versions
 * can be a string.
 */
export function supportsIncrementalEncoding(version) {
    if (version === FieldBatchFormatVersion.v1) {
        return false;
    }
    return true;
}
export const EncodedFieldBatchV1 = EncodedFieldBatchGeneric(FieldBatchFormatVersion.v1, EncodedChunkShapeV1);
export const EncodedFieldBatchV2 = EncodedFieldBatchGeneric(FieldBatchFormatVersion.v2, EncodedChunkShapeV2);
//# sourceMappingURL=versions.js.map