@witchcraft/spellcraft
Github
Issues
npm
Preparing search index...
core/addShortcut
addShortcut
Function addShortcut
addShortcut
<
THooks
extends
Partial
<
Hooks
>
,
TCheck
extends
boolean
|
"only"
=
true
,
>
(
shortcut
:
Shortcut
,
manager
:
Pick
<
Manager
,
"shortcuts"
|
"commands"
|
"keys"
>
&
PickManager
<
"options"
,
"stringifier"
|
"conditionEquals"
|
"evaluateCondition"
,
>
&
Record
<
any
,
any
>
&
PickManager
<
"options"
,
"sorter"
>
&
{
hooks
?:
THooks
;
}
,
opts
?:
{
check
?:
TCheck
}
,
)
:
Result
<
TCheck
extends
"only"
?
true
:
Shortcut
<
string
,
Condition
>
,
|
MultipleErrors
<
("DUPLICATE_SHORTCUT" | "UNKNOWN_COMMAND" | ChainError)
,
>
|
CanHookErrors
<
THooks
extends
never
?
never
:
THooks
,
"canSetShortcutsProp"
,
>
,
>
Type Parameters
THooks
extends
Partial
<
Hooks
>
TCheck
extends
boolean
|
"only"
=
true
Parameters
shortcut
:
Shortcut
manager
:
Pick
<
Manager
,
"shortcuts"
|
"commands"
|
"keys"
>
&
PickManager
<
"options"
,
"stringifier"
|
"conditionEquals"
|
"evaluateCondition"
,
>
&
Record
<
any
,
any
>
&
PickManager
<
"options"
,
"sorter"
>
&
{
hooks
?:
THooks
}
opts
:
{
check
?:
TCheck
}
= {}
Returns
Result
<
TCheck
extends
"only"
?
true
:
Shortcut
<
string
,
Condition
>
,
|
MultipleErrors
<
("DUPLICATE_SHORTCUT" | "UNKNOWN_COMMAND" | ChainError)
,
>
|
CanHookErrors
<
THooks
extends
never
?
never
:
THooks
,
"canSetShortcutsProp"
,
>
,
>
Settings
Member Visibility
Protected
Inherited
Theme
OS
Light
Dark
Github
Issues
npm
@witchcraft/spellcraft
Loading...