docs » cp.commands


Commands Module.

Submodules

API Overview

  • Functions - API calls offered directly by the extension
  • Fields - Variables which can only be accessed from an object returned by a constructor
  • Methods - API calls which can only be made on an object returned by a constructor

API Documentation

Functions

group

Signature cp.commands.group(id) -> cp.command or nil
Type Function
Description Creates a collection of commands. These commands can be enabled or disabled as a group.
Parameters
  • * `id` - The ID to retrieve
Returns
  • `cp.commands` - The command group with the specified ID, or `nil` if none exists.

groupIds

Signature cp.commands.groupIds() -> table
Type Function
Description Returns an array of IDs of command groups which have been created.
Parameters
  • * N/A
Returns
  • `table` - The array of group IDs.

groups

Signature cp.commands.groups() -> table of cp.commands
Type Function
Description Returns a table with the set of commands.
Parameters
  • * `id` - The ID to retrieve
Returns
  • `cp.commands` - The command group with the specified ID, or `nil` if none exists.

Fields

enabled

Signature cp.commands.enabled <cp.prop: boolean>
Type Field
Description If enabled, the commands in the group will be active as well.

isEditable

Signature cp.commands.isEditable <cp.prop: boolean>
Type Field
Description If set to false, the command group is not user-editable.

Methods

new

Signature cp.commands:new(id) -> cp.commands
Type Method
Description Creates a collection of commands. These commands can be enabled or disabled as a group.
Parameters
  • `id` - The unique ID for this command group.
Returns
  • cp.commands - The commands group that was created.

results matching ""

    No results matching ""