@witchcraft/spellcraft
Github
Issues
npm
Preparing search index...
core/createShortcuts
createShortcuts
Function createShortcuts
createShortcuts
<
THooks
extends
Partial
<
Hooks
>
,
TRawShortcuts
extends
Shortcut
<
string
,
Condition
>
[]
,
TCheck
extends
boolean
|
"only"
=
true
,
>
(
shortcutsList
:
TRawShortcuts
,
manager
:
Pick
<
Manager
,
"commands"
|
"keys"
>
&
PickManager
<
"options"
,
"stringifier"
|
"sorter"
|
"conditionEquals"
|
"evaluateCondition"
,
>
&
{
hooks
?:
THooks
}
,
opts
?:
Partial
<
Pick
<
Shortcuts
,
"ignoreModifierConflicts"
|
"ignoreChainConflicts"
>
,
>
,
__namedParameters
?:
{
check
?:
boolean
|
"only"
}
,
)
:
Result
<
TCheck
extends
"only"
?
true
:
Shortcuts
,
|
MultipleErrors
<
("DUPLICATE_SHORTCUT" | "UNKNOWN_COMMAND" | ChainError)
,
>
|
CanHookErrors
<
THooks
extends
never
?
never
:
THooks
,
"canSetShortcutsProp"
,
>
,
>
Shortcut
Creates a set of shortcuts.
Type Parameters
THooks
extends
Partial
<
Hooks
>
TRawShortcuts
extends
Shortcut
<
string
,
Condition
>
[]
TCheck
extends
boolean
|
"only"
=
true
Parameters
shortcutsList
:
TRawShortcuts
manager
:
Pick
<
Manager
,
"commands"
|
"keys"
>
&
PickManager
<
"options"
,
"stringifier"
|
"sorter"
|
"conditionEquals"
|
"evaluateCondition"
,
>
&
{
hooks
?:
THooks
}
Optional
opts
:
Partial
<
Pick
<
Shortcuts
,
"ignoreModifierConflicts"
|
"ignoreChainConflicts"
>
>
__namedParameters
:
{
check
?:
boolean
|
"only"
}
= {}
Returns
Result
<
TCheck
extends
"only"
?
true
:
Shortcuts
,
|
MultipleErrors
<
("DUPLICATE_SHORTCUT" | "UNKNOWN_COMMAND" | ChainError)
,
>
|
CanHookErrors
<
THooks
extends
never
?
never
:
THooks
,
"canSetShortcutsProp"
,
>
,
>
Settings
Member Visibility
Protected
Inherited
Theme
OS
Light
Dark
On This Page
Shortcut
Github
Issues
npm
@witchcraft/spellcraft
Loading...
Shortcut
Creates a set of shortcuts.