Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Caution
This class is still in pre-release. Its signature may change or it may be removed in future releases.
Provides the functionality for registering custom commands.
Methods
registerCommand
registerCommand(customCommand: CustomCommand, callback: (origin: CustomCommandOrigin, ...args: any[]) => CustomCommandResult | undefined): void
Registers a custom command that when executed triggers a script callback.
Parameters
customCommand: CustomCommand
callback: (origin: CustomCommandOrigin, ...args: any[]) => CustomCommandResult | undefined
The callback triggered when the command executes.
Returns void
Notes:
- This function can't be called in read-only mode.
- This function can be called in early-execution mode.
- This function can throw errors.
registerEnum
registerEnum(name: string, values: string[]): void
Registers a custom command enum.
Parameters
- name: string
- values: string[]
Notes:
- This function can't be called in read-only mode.
- This function can be called in early-execution mode.
- This function can throw errors.