"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.EncodedFieldBatchV2 = exports.EncodedFieldBatchV1 = exports.supportsIncrementalEncoding = exports.FieldBatchFormatVersion = void 0;
const index_js_1 = require("../../../../util/index.js");
const formatGeneric_js_1 = require("./formatGeneric.js");
const formatV1_js_1 = require("./formatV1.js");
const formatV2_js_1 = require("./formatV2.js");
exports.FieldBatchFormatVersion = (0, index_js_1.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.
 */
function supportsIncrementalEncoding(version) {
    if (version === exports.FieldBatchFormatVersion.v1) {
        return false;
    }
    return true;
}
exports.supportsIncrementalEncoding = supportsIncrementalEncoding;
exports.EncodedFieldBatchV1 = (0, formatGeneric_js_1.EncodedFieldBatchGeneric)(exports.FieldBatchFormatVersion.v1, formatV1_js_1.EncodedChunkShapeV1);
exports.EncodedFieldBatchV2 = (0, formatGeneric_js_1.EncodedFieldBatchGeneric)(exports.FieldBatchFormatVersion.v2, formatV2_js_1.EncodedChunkShapeV2);
//# sourceMappingURL=versions.js.map