@witchcraft/spellcraft
    Preparing search index...

    Function setCommandProp

    • Sets a settable command property.

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

      Type Parameters

      • TEntries extends CommandSetEntries
      • TProp extends keyof CommandSetEntries
      • TEntry extends
            | Unmanaged<"condition">
            | Unmanaged<"execute">
            | Unmanaged<"description">
            | {
                error: "DUPLICATE_COMMAND" | "COMMAND_IN_USE" | "MULTIPLE_ERRORS";
                hooks: GetCommandHooks<"name">;
                manager: Pick<Manager, "shortcuts" | "commands" | "keys"> & PickManager<
                    "options",
                    "stringifier",
                >;
                val: string;
            }
      • THooks extends Partial<Hooks>
      • TCheck extends boolean | "only" = true

      Parameters

      • command: Command

        Command is mutated if check is not "only".

      • prop: TProp
      • val: TEntry["val"]
      • manager: (TEntry["manager"] extends never ? unknown : TEntry["manager"]) & {
            hooks?: THooks;
        }
      • __namedParameters: { check?: TCheck } = {}

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

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

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

      Note that while the manager argument is always required, for unmanaged properties you can pass {} and for most others you can pass a partial manager if needed. This is because it's very difficult to keep the heavy per prop types and allow the manager to be optional in these cases.