Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "lib/api-helper/command/createCommand"

Index

Functions

Functions

createCommand

  • createCommand<PARAMS>(sdm: MachineOrMachineOptions, commandMaker: function, name: string, paramsMaker?: Maker<PARAMS>, details?: Partial<CommandDetails>): HandleCommand<PARAMS>
  • Wrap a function in a command handler, allowing use of custom parameters. Targeting (targets property) is handled automatically if the parameters do not implement TargetsParams

    Type parameters

    • PARAMS

    Parameters

    • sdm: MachineOrMachineOptions

      machine or options

    • commandMaker: function

      function to create command function

    • name: string

      command name

    • Default value paramsMaker: Maker<PARAMS> = NoParameters as Maker<PARAMS>

      parameters factory, typically the name of a class with a no arg constructor

    • Default value details: Partial<CommandDetails> = {}

      optional details to customize behavior Add intent "edit "

    Returns HandleCommand<PARAMS>

Generated using TypeDoc