@witchcraft/spellcraft
    Preparing search index...

    The default class based implementation of the IKeysSorter interface.

    Creates a keys sorter for shortcut chains.

    Can either be passed some (object) enum of KeySortPos or it's keys with the values changed, for example:

    const MyKeySortPos = {
    [KEY_SORT_POS.modmouse]: 0,
    [KEY_SORT_POS.mod]: 1,
    // or
    modmouse: 0,
    mod: 1,
    //...
    }

    const mySorter = new KeysSorter(MyKeySortPos)
    new Shortcut([...keys], {sorter: mySorter})

    They way this works is the enum should contain every possible combination of key "types". All sort does is determine the type and use it's position in the enum to know where to sort it. If two keys are of the same type, they are sorted alphabetically by their id.

    Or you can extend from the class and implement a custom sort function.

    Ideally a single sorter should be created and shared amongst all instances. This is already taken care of if you do not pass a custom sorter, a default sorter instance is re-used throughout.

    The order of the default sorter can be changed without creating a new class by importing it early and changing it's order property.

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    order: KeySortPos

    Methods