API Reference
@univerjs
@univerjs/core
interfaces
Imutation

@univerjs/core v0.4.2Docs


Interface: IMutation<P, R>

CommandType.MUTATION should implement this interface.

Extends

Type Parameters

Type ParameterDefault type
P extends object-
Rboolean

Properties

PropertyModifierTypeDescriptionOverridesInherited fromDefined in
idreadonlystringIdentifier of the command. It should be unique in the application unless it is a IMultiCommand. Its pattern should be like <namespace>.<type>.<command-name>. Example { id: 'sheet.command.set-selection-frozen' }-ICommand.idsubmodules/univer/packages/core/src/services/command/command.service.ts:66 (opens in a new tab)
typepublicMUTATIONThe type of the command.ICommand.type-submodules/univer/packages/core/src/services/command/command.service.ts:112 (opens in a new tab)

Methods

handler()

handler(accessor, params): R

The handler of the mutation.

Parameters

ParameterTypeDescription
accessorIAccessorThe accessor to the dependency injection container.
paramsPParams of the mutation. Params should be serializable.

Returns

R

The result of the mutation. By default it should be a boolean value which indicates the mutation is executed successfully or not.

Overrides

ICommand.handler

Defined in

submodules/univer/packages/core/src/services/command/command.service.ts:120 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.