/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
import { Type } from "@sinclair/typebox";
import { brandedNumberType } from "../util";
import { SessionIdSchema, RevisionTagSchema } from "../core";
const noAdditionalProps = { additionalProperties: false };
const CommitBase = (tChange) => Type.Object({
    revision: RevisionTagSchema,
    change: tChange,
    sessionId: SessionIdSchema,
});
/**
 * @privateRemarks - Commits are generally encoded from `GraphCommit`s, which often contain extra data.
 * This `noAdditionalProps` is especially important in that light.
 */
const Commit = (tChange) => Type.Composite([CommitBase(tChange)], noAdditionalProps);
const SeqNumber = brandedNumberType();
const SequencedCommit = (tChange) => Type.Composite([CommitBase(tChange), Type.Object({ sequenceNumber: SeqNumber })], noAdditionalProps);
const SummarySessionBranch = (tChange) => Type.Object({
    base: RevisionTagSchema,
    commits: Type.Array(Commit(tChange)),
}, noAdditionalProps);
export const EncodedEditManager = (tChange) => Type.Object({
    trunk: Type.Array(SequencedCommit(tChange)),
    branches: Type.Array(Type.Tuple([SessionIdSchema, SummarySessionBranch(tChange)])),
}, noAdditionalProps);
//# sourceMappingURL=editManagerFormat.js.map