@witchcraft/spellcraft
    Preparing search index...

    Type Alias IStringifier

    type IStringifier = {
        stringify(
            entry: Shortcut,
            manager: Pick<Manager, "keys" | "commands">,
        ): string;
        stringify(
            entry: string | string[] | string[][],
            manager: Pick<Manager, "keys">,
        ): string;
        stringify(
            entry:
                | Condition
                | Command<string, CommandExecute<string>, Condition>
                | Key
                | Key[],
        ): string;
        stringify(
            entry:
                | string
                | string[]
                | Condition
                | Command<string, CommandExecute<string>, Condition>
                | Key
                | string[][]
                | Shortcut<string, Condition>
                | Key[],
            manager: Pick<Manager, "keys"> | Pick<Manager, "commands" | "keys">,
        ): string;
        stringifyCommand(
            name: undefined | string,
            manager: Pick<Manager, "commands">,
        ): string;
        stringifyList(type: "keys", entries: Key[]): string;
        stringifyList(
            type: "commands",
            entries: Command<string, CommandExecute<string>, Condition>[],
        ): string;
        stringifyList(
            type: "keys",
            entries: string[],
            manager: Pick<Manager, "keys">,
        ): string;
        stringifyList(
            type: "commands",
            entries: string[],
            manager: Pick<Manager, "commands">,
        ): string;
        stringifyList(
            type: "shortcuts",
            entries: Shortcut<string, Condition>[],
            manager: Pick<Manager, "keys" | "commands">,
        ): string;
        stringifyPropertyValue(entry: any): string;
    }

    Implemented by

    Index

    Methods

    • Stringifies commands by name (stringify interprets single strings as key ids.).

      Parameters

      • name: undefined | string
      • manager: Pick<Manager, "commands">

      Returns string

    • Stringifies lists of keys, shortcuts, or commands.

      The type must be specified because we can't magically tell what type something is for string lists and/or empty lists.

      Parameters

      • type: "keys"
      • entries: Key[]

      Returns string

    • Parameters

      Returns string

    • Parameters

      • type: "keys"
      • entries: string[]
      • manager: Pick<Manager, "keys">

      Returns string

    • Parameters

      • type: "commands"
      • entries: string[]
      • manager: Pick<Manager, "commands">

      Returns string

    • Parameters

      Returns string

    • Stringifies the property values of items when there is an error (e.g. "You cannot change prop x from a to b because of y." a and b here being the property values).

      Parameters

      • entry: any

      Returns string