The IOperationStack interface defines a stack of operations that can be performed on a data structure. It has a property operations which is a map of operation IDs to operation objects. The interface also defines methods add, get, update, and delete for manipulating the operations in the stack.

interface IOperationStack {
    operations: Map<
        string,
        {
            _id?: string;
            data?: Record<string, any>;
            delta?: Record<string, any>;
            eventTime?: number;
            method?: "POST" | "UPDATE" | "DELETE";
            operationId?: string;
            operationType?:
                | "node"
                | "structure"
                | "structure-child"
                | "relation"
                | "metadata"
                | "list"
                | "list-child";
            ref?: any;
        },
    >;
    addOperation(
        operation: {
            _id?: string;
            data?: Record<string, any>;
            delta?: Record<string, any>;
            eventTime?: number;
            method?: "POST" | "UPDATE" | "DELETE";
            operationId?: string;
            operationType?:
                | "node"
                | "structure"
                | "structure-child"
                | "relation"
                | "metadata"
                | "list"
                | "list-child";
            ref?: any;
        },
    ): void;
    deleteOperation(operationId: any): void;
    getOperation(operationId: any): void;
    updateOperation(operationId: any): void;
}

Implemented by

Properties

operations: Map<
    string,
    {
        _id?: string;
        data?: Record<string, any>;
        delta?: Record<string, any>;
        eventTime?: number;
        method?: "POST" | "UPDATE" | "DELETE";
        operationId?: string;
        operationType?:
            | "node"
            | "structure"
            | "structure-child"
            | "relation"
            | "metadata"
            | "list"
            | "list-child";
        ref?: any;
    },
>

Methods

  • The add(operation:IOperation):void; function is a method of the IOperationStack interface. It is used to add an operation to the stack of operations. The operation parameter is of type IOperation, which represents an operation that can be performed on a data structure. The function does not return anything (void).

    Parameters

    • operation: {
          _id?: string;
          data?: Record<string, any>;
          delta?: Record<string, any>;
          eventTime?: number;
          method?: "POST" | "UPDATE" | "DELETE";
          operationId?: string;
          operationType?:
              | "node"
              | "structure"
              | "structure-child"
              | "relation"
              | "metadata"
              | "list"
              | "list-child";
          ref?: any;
      }

    Returns void

  • The delete(operationId):void; function is a method of the IOperationStack interface. It is used to remove an operation from the stack of operations based on its ID. The operationId parameter is the ID of the operation to be deleted. The function does not return anything (void).

    Parameters

    • operationId: any

    Returns void

  • The get(operationId):void; function is a method of the IOperationStack interface. It is used to retrieve an operation from the stack of operations based on its ID. The operationId parameter is the ID of the operation to be retrieved. The function does not return anything (void).

    Parameters

    • operationId: any

    Returns void

  • The update(operationId):void; function is a method of the IOperationStack interface. It is used to update an operation in the stack of operations based on its ID. The operationId parameter is the ID of the operation to be updated. The function does not return anything (void).

    Parameters

    • operationId: any

    Returns void