@univerjscoreinterfacesIoperation

@univerjs/core v0.5.0-beta.1Docs


Interface: IOperation<P, R>

CommandType.OPERATION should implement this interface.

Extends

Type Parameters

Type ParameterDefault type
P extends objectobject
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.idpackages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/command/command.service.ts:66
typepublicOPERATIONThe type of the command.ICommand.type-packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/command/command.service.ts:127

Methods

handler()

handler(accessor, params): R

The handler of the operation.

Parameters

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

Returns

R

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

Overrides

ICommand.handler

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/command/command.service.ts:135