@dxos/app-framework - v0.8.3
    Preparing search index...

    Interface UndoMappingProps<Op, Inv>

    Props for creating an UndoMapping.

    interface UndoMappingProps<
        Op extends Operation.Definition<any, any>,
        Inv extends Operation.Definition<any, any>,
    > {
        deriveContext: (
            input: InputOf<Op>,
            output: OutputOf<Op>,
        ) => undefined | InputOf<Inv>;
        inverse: Inv;
        message?: MessageProvider<Op>;
        operation: Op;
    }

    Type Parameters

    • Op extends Operation.Definition<any, any>
    • Inv extends Operation.Definition<any, any>
    Index

    Properties

    deriveContext: (
        input: InputOf<Op>,
        output: OutputOf<Op>,
    ) => undefined | InputOf<Inv>

    Derives the input for the inverse operation from the forward operation's input and output. Return undefined to indicate the operation is not undoable.

    inverse: Inv

    The inverse operation to invoke for undo.

    message?: MessageProvider<Op>

    Optional message to show in the undo toast. Can be a static Label or a function that derives the message from input/output.

    operation: Op

    The forward operation.