@realsee/vr-signals API Documentation - v2.0.0
Preparing search index...
StandardActionAPI
Interface StandardActionAPI<ActionMap>
标准化的 Action 执行接口
interface
StandardActionAPI
<
ActionMap
extends
Record
<
string
,
(
...
args
:
any
[]
)
=>
any
>
,
>
{
execute
<
K
extends
string
|
number
|
symbol
>
(
action
:
K
,
data
:
Parameters
<
ActionMap
[
K
]
>
[
0
]
,
options
?:
ActionExecuteOptions
,
)
:
Promise
<
ReturnType
<
ActionMap
[
K
]
>
>
;
executeWithAbort
<
K
extends
string
|
number
|
symbol
>
(
action
:
K
,
data
:
Parameters
<
ActionMap
[
K
]
>
[
0
]
,
options
?:
ActionExecuteOptions
,
)
:
{
promise
:
Promise
<
ReturnType
<
ActionMap
[
K
]
>
>
;
abort
:
()
=>
void
;
signal
:
AbortSignal
;
}
;
registerAction
<
K
extends
string
|
number
|
symbol
>
(
name
:
K
,
handler
:
ActionMap
[
K
]
,
)
:
void
;
unregisterAction
<
K
extends
string
|
number
|
symbol
>
(
name
:
K
)
:
boolean
;
hasAction
<
K
extends
string
|
number
|
symbol
>
(
name
:
K
)
:
boolean
;
getRegisteredActions
()
:
(
keyof
ActionMap
)
[]
;
}
Type Parameters
ActionMap
extends
Record
<
string
,
(
...
args
:
any
[]
)
=>
any
>
Index
Methods
execute
execute
With
Abort
register
Action
unregister
Action
has
Action
get
Registered
Actions
Methods
execute
execute
<
K
extends
string
|
number
|
symbol
>
(
action
:
K
,
data
:
Parameters
<
ActionMap
[
K
]
>
[
0
]
,
options
?:
ActionExecuteOptions
,
)
:
Promise
<
ReturnType
<
ActionMap
[
K
]
>
>
Type Parameters
K
extends
string
|
number
|
symbol
Parameters
action
:
K
data
:
Parameters
<
ActionMap
[
K
]
>
[
0
]
Optional
options
:
ActionExecuteOptions
Returns
Promise
<
ReturnType
<
ActionMap
[
K
]
>
>
execute
With
Abort
executeWithAbort
<
K
extends
string
|
number
|
symbol
>
(
action
:
K
,
data
:
Parameters
<
ActionMap
[
K
]
>
[
0
]
,
options
?:
ActionExecuteOptions
,
)
:
{
promise
:
Promise
<
ReturnType
<
ActionMap
[
K
]
>
>
;
abort
:
()
=>
void
;
signal
:
AbortSignal
;
}
Type Parameters
K
extends
string
|
number
|
symbol
Parameters
action
:
K
data
:
Parameters
<
ActionMap
[
K
]
>
[
0
]
Optional
options
:
ActionExecuteOptions
Returns
{
promise
:
Promise
<
ReturnType
<
ActionMap
[
K
]
>
>
;
abort
:
()
=>
void
;
signal
:
AbortSignal
;
}
register
Action
registerAction
<
K
extends
string
|
number
|
symbol
>
(
name
:
K
,
handler
:
ActionMap
[
K
]
,
)
:
void
Type Parameters
K
extends
string
|
number
|
symbol
Parameters
name
:
K
handler
:
ActionMap
[
K
]
Returns
void
unregister
Action
unregisterAction
<
K
extends
string
|
number
|
symbol
>
(
name
:
K
)
:
boolean
Type Parameters
K
extends
string
|
number
|
symbol
Parameters
name
:
K
Returns
boolean
has
Action
hasAction
<
K
extends
string
|
number
|
symbol
>
(
name
:
K
)
:
boolean
Type Parameters
K
extends
string
|
number
|
symbol
Parameters
name
:
K
Returns
boolean
get
Registered
Actions
getRegisteredActions
()
:
(
keyof
ActionMap
)
[]
Returns (
keyof
ActionMap
)
[]
Settings
Member Visibility
Inherited
Theme
OS
Light
Dark
On This Page
Methods
execute
execute
With
Abort
register
Action
unregister
Action
has
Action
get
Registered
Actions
@realsee/vr-signals API Documentation - v2.0.0
Loading...
标准化的 Action 执行接口