/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import type { IMergeTreeAnnotateAdjustMsg, IMergeTreeAnnotateMsg } from "./ops.js"; import { type MapLike, type PropertySet } from "./properties.js"; /** * Minimally copies properties and the property manager from source to destination. * @internal */ export declare function copyPropertiesAndManager(source: { properties?: PropertySet; propertyManager?: PropertiesManager; }, destination: { properties?: PropertySet; propertyManager?: PropertiesManager; }): void; /** * @internal */ export type PropsOrAdjust = Pick | Pick; /** * The PropertiesManager class handles changes to properties, both remote and local. * It manages the lifecycle for local property changes, ensures all property changes are eventually consistent, * and provides methods to acknowledge changes, update the minimum sequence number (msn), and copy properties to another manager. * This class is essential for maintaining the integrity and consistency of property changes in collaborative environments. * @internal */ export declare class PropertiesManager { private readonly changes; /** * Rolls back local property changes. * This method reverts property changes based on the provided operation and segment. * If the operation is part of a collaborative session, it ensures that the changes are consistent with the remote state. * * @param op - The operation containing property changes. This can be an adjustment or a set of properties. * @param seg - The segment containing properties. This object may have a properties map that will be modified. * @param collaborating - Indicates if the operation is part of a collaborative session. Defaults to false. * @returns The deltas of the rolled-back properties. This is a map-like object representing the changes that were reverted. */ rollbackProperties(op: PropsOrAdjust, seg: { properties?: MapLike; }, collaborating?: boolean): MapLike; /** * Handles property changes. * This method applies property changes based on the provided operation, segment, sequence number, and collaboration state. * It also handles rolling back changes if specified. * * @param op - The operation containing property changes. * @param seg - The segment containing properties. * @param seq - The sequence number for the operation. * @param msn - The minimum sequence number for the operation. * @param collaborating - Indicates if the operation is part of a collaborative session. Defaults to false. * @param rollback - Specifies if the changes should be rolled back. Defaults to PropertiesRollback.None. * @returns The deltas of the applied or rolled-back properties. This is a map-like object representing the changes. */ handleProperties(op: PropsOrAdjust, seg: { properties?: MapLike; }, seq: number, msn: number, collaborating?: boolean, rollback?: boolean): MapLike; /** * Acknowledges property changes. * This method acknowledges the property changes based on the provided sequence number and operation. * * @param seq - The sequence number for the operation. * @param msn - The minimum sequence number for the operation. * @param op - The operation containing property changes. */ ack(seq: number, msn: number, op: PropsOrAdjust): void; /** * Updates the minimum sequence number (msn). * This method updates the minimum sequence number and removes any changes that have been acknowledged. * * @param msn - The minimum sequence number to update. */ updateMsn(msn: number): void; /** * Copies properties to another manager. * This method copies the properties and their changes from the current manager to the destination manager. * * @param oldProps - The old properties to be copied. * @param dest - The destination object containing properties and property manager. */ copyTo(oldProps: PropertySet | undefined, dest: { properties?: PropertySet; propertyManager?: PropertiesManager; }): void; /** * Gets properties at a specific sequence number. * This method retrieves the properties at the given sequence number. * This is only needed to support emitting snapshots in the legacy format. * If we remove the ability to emit the legacy format, we can remove this method, along with the need to track remote changes at all. * * @param oldProps - The old properties to be retrieved. * @param sequenceNumber - The sequence number to get properties at. * @returns The properties at the given sequence number. */ getAtSeq(oldProps: MapLike | undefined, sequenceNumber: number): MapLike; /** * Determines if all of the defined properties in a given property set are pending. * * @param props - The properties to check. * @returns True if all the properties are pending, false otherwise. */ hasPendingProperties(props: PropertySet): boolean; } //# sourceMappingURL=segmentPropertiesManager.d.ts.map