@univerjs/core v0.5.0-beta.1 • Docs
Interface: IMutation<P, R>
CommandType.MUTATION should implement this interface.
Extends
ICommand
<P
,R
>
Type Parameters
Type Parameter | Default type |
---|---|
P extends object | - |
R | boolean |
Properties
Property | Modifier | Type | Description | Overrides | Inherited from | Defined in |
---|---|---|---|---|---|---|
id | readonly | string | Identifier 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 .id | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/command/command.service.ts:66 |
type | public | MUTATION | The type of the command. | ICommand .type | - | packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/command/command.service.ts:112 |
Methods
handler()
handler(accessor, params): R
The handler of the mutation.
Parameters
Parameter | Type | Description |
---|---|---|
accessor | IAccessor | The accessor to the dependency injection container. |
params | P | Params 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
Defined in
packages/api/tmp/univer-pro/submodules/univer/packages/core/src/services/command/command.service.ts:120