@witchcraft/spellcraft
    Preparing search index...

    Function setCommandsProp

    • Sets a settable command property.

      You should not use this to set command state the manager manages (those tagged with

      Type Parameters

      • TEntries extends CommandsSetEntries
      • TProp extends keyof CommandsSetEntries
      • TEntry extends
            | {
                error: "DUPLICATE_COMMAND";
                hooks: GetCommandHooks<"entries@add">;
                manager: BaseCommandsManager;
                val: Command;
            }
            | {
                error: "MISSING"
                | "COMMAND_IN_USE";
                hooks: GetCommandHooks<"entries@remove">;
                manager: PickManager<"options", "stringifier"> & Record<any, any> & Pick<
                    Manager,
                    "commands",
                > & Pick<Manager, "shortcuts" | "keys">;
                val: Command;
            }
      • THooks extends Partial<Hooks>
      • TCheck extends boolean | "only" = true

      Parameters

      • prop: TProp
      • val: TEntry["val"]
      • manager: TEntry["manager"] & { hooks?: THooks }

        Commands is mutated if check is not "only".

      • __namedParameters: { check?: TCheck } = {}

      Returns Result<
          TCheck extends "only"
              ? true
              : Command<string, CommandExecute<string>, Condition>,

              | MultipleErrors<TEntry["error"]>
              | CanHookErrors<THooks, "canSetCommandsProp">,
      >

      in the docs) unless you've forgone using the manager.