"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.EncodedModularChangeset = void 0;
const typebox_1 = require("@sinclair/typebox");
const modularChangeFormatV1_js_1 = require("./modularChangeFormatV1.js");
const noAdditionalProps = { additionalProperties: false };
const EncodedRenames = typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({
    oldId: modularChangeFormatV1_js_1.EncodedChangeAtomId,
    newId: modularChangeFormatV1_js_1.EncodedChangeAtomId,
    count: typebox_1.Type.Number(),
}), noAdditionalProps));
const EncodedRootNodes = typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Object({ detachId: modularChangeFormatV1_js_1.EncodedChangeAtomId, nodeChangeset: modularChangeFormatV1_js_1.EncodedNodeChangeset }, noAdditionalProps)));
exports.EncodedModularChangeset = typebox_1.Type.Object({
    maxId: typebox_1.Type.Optional(modularChangeFormatV1_js_1.ChangesetLocalIdSchema),
    fieldChanges: modularChangeFormatV1_js_1.EncodedFieldChangeMap,
    rootNodes: EncodedRootNodes,
    nodeRenames: EncodedRenames,
    revisions: typebox_1.Type.ReadonlyOptional(typebox_1.Type.Array(modularChangeFormatV1_js_1.EncodedRevisionInfo)),
    // TODO#8574: separating `builds` and `refreshers` here means that we encode their `EncodedBuilds.trees` separately.
    // This can lead to a less efficient wire representation because of duplicated schema/shape information.
    builds: typebox_1.Type.Optional(modularChangeFormatV1_js_1.EncodedBuilds),
    refreshers: typebox_1.Type.Optional(modularChangeFormatV1_js_1.EncodedBuilds),
    /**
     * The number of constraints within this changeset that are violated.
     */
    violations: typebox_1.Type.Optional(typebox_1.Type.Number({ minimum: 0, multipleOf: 1 })),
}, noAdditionalProps);
//# sourceMappingURL=modularChangeFormatV2.js.map