@yorkie-js/sdk
    Preparing search index...

    Class Change<P>

    Change represents a unit of modification in the document.

    Type Parameters

    Index

    Constructors

    • Type Parameters

      Parameters

      • __namedParameters: {
            id: ChangeID;
            message?: string;
            operations?: Operation[];
            presenceChange?: PresenceChange<P>;
            undoRedo?: boolean;
        }

      Returns Change<P>

    Methods

    • execute executes the operations of this change to the given root.

      Parameters

      • root: CRDTRoot
      • presences: Map<string, P>
      • source: OpSource

      Returns {
          operations: Operation[];
          opInfos: OpInfo[];
          reverseOps: HistoryOperation<P>[];
      }

    • setPresenceChange replaces the presence change of this change. It is how a pending patch is rewritten into the full put the server asks for when it has no base to fold the patch into. The presence it resolves to is the same either way, so the change this document already applied locally stands.

      Parameters

      • presenceChange: PresenceChange<P>

      Returns void

    • create creates a new instance of Change.

      Type Parameters

      Parameters

      • __namedParameters: {
            id: ChangeID;
            message?: string;
            operations?: Operation[];
            presenceChange?: PresenceChange<P>;
            undoRedo?: boolean;
        }

      Returns Change<P>