Search
Preparing search index...
The search index is not available
@planjs/utils
Options
All
Public
Public/Protected
All
Inherited
Externals
Menu
@planjs/utils
Event
Class Event
Hierarchy
Event
Index
Constructors
constructor
Properties
callbacks
event
Splitter
Methods
off
on
once
trigger
Constructors
constructor
new
Event
(
opts
?:
{
callbacks
:
Record
<
string
,
unknown
>
}
)
:
Event
Parameters
Optional
opts:
{
callbacks
:
Record
<
string
,
unknown
>
}
callbacks
:
Record
<
string
,
unknown
>
Returns
Event
Properties
Private
callbacks
callbacks
:
Record
<
string
,
unknown
>
= {}
Static
event
Splitter
event
Splitter
:
RegExp
= ...
Methods
off
off
(
events
?:
any
, callback
?:
any
, context
?:
any
)
:
Event
如果什么都不传就off全部事件
Parameters
Optional
events:
any
Optional
callback:
any
Optional
context:
any
Returns
Event
on
on<T>
(
event
:
string
, callback
:
Callback1
<
T
>
, context
?:
any
)
:
Event
on<T1, T2>
(
event
:
string
, callback
:
Callback2
<
T1
,
T2
>
, context
?:
any
)
:
Event
on<T1, T2, T3>
(
event
:
string
, callback
:
Callback3
<
T1
,
T2
,
T3
>
, context
?:
any
)
:
Event
on<T1, T2, T3, T4>
(
event
:
string
, callback
:
Callback4
<
T1
,
T2
,
T3
,
T4
>
, context
?:
any
)
:
Event
on<T1, T2, T3, T4, T5>
(
event
:
string
, callback
:
Callback5
<
T1
,
T2
,
T3
,
T4
,
T5
>
, context
?:
any
)
:
Event
on<T1, T2, T3, T4, T5, T6>
(
event
:
string
, callback
:
Callback6Rest
<
T1
,
T2
,
T3
,
T4
,
T5
,
T6
>
, context
?:
any
)
:
Event
Type parameters
T
Parameters
event:
string
callback:
Callback1
<
T
>
Optional
context:
any
Returns
Event
Type parameters
T1
T2
Parameters
event:
string
callback:
Callback2
<
T1
,
T2
>
Optional
context:
any
Returns
Event
Type parameters
T1
T2
T3
Parameters
event:
string
callback:
Callback3
<
T1
,
T2
,
T3
>
Optional
context:
any
Returns
Event
Type parameters
T1
T2
T3
T4
Parameters
event:
string
callback:
Callback4
<
T1
,
T2
,
T3
,
T4
>
Optional
context:
any
Returns
Event
Type parameters
T1
T2
T3
T4
T5
Parameters
event:
string
callback:
Callback5
<
T1
,
T2
,
T3
,
T4
,
T5
>
Optional
context:
any
Returns
Event
Type parameters
T1
T2
T3
T4
T5
T6
Parameters
event:
string
callback:
Callback6Rest
<
T1
,
T2
,
T3
,
T4
,
T5
,
T6
>
Optional
context:
any
Returns
Event
once
once
(
events
:
any
, callback
:
any
, context
?:
any
)
:
Event
Parameters
events:
any
callback:
any
Optional
context:
any
Returns
Event
trigger
trigger
(
event
:
string
)
:
Event
trigger<T1>
(
event
:
string
, arg
:
T1
)
:
Event
trigger<T1, T2>
(
event
:
string
, arg1
:
T1
, arg2
:
T2
)
:
Event
trigger<T1, T2, T3>
(
event
:
string
, arg1
:
T1
, arg2
:
T2
, arg3
:
T3
)
:
Event
trigger<T1, T2, T3, T4>
(
event
:
string
, arg1
:
T1
, arg2
:
T2
, arg3
:
T3
, arg4
:
T4
)
:
Event
trigger<T1, T2, T3, T4, T5>
(
event
:
string
, arg1
:
T1
, arg2
:
T2
, arg3
:
T3
, arg4
:
T4
, arg5
:
T5
)
:
Event
trigger<T1, T2, T3, T4, T5, T6>
(
event
:
string
, arg1
:
T1
, arg2
:
T2
, arg3
:
T3
, arg4
:
T4
, arg5
:
T5
, arg6
:
T6
,
...
rest
:
any
[]
)
:
Event
Parameters
event:
string
Returns
Event
Type parameters
T1
Parameters
event:
string
arg:
T1
Returns
Event
Type parameters
T1
T2
Parameters
event:
string
arg1:
T1
arg2:
T2
Returns
Event
Type parameters
T1
T2
T3
Parameters
event:
string
arg1:
T1
arg2:
T2
arg3:
T3
Returns
Event
Type parameters
T1
T2
T3
T4
Parameters
event:
string
arg1:
T1
arg2:
T2
arg3:
T3
arg4:
T4
Returns
Event
Type parameters
T1
T2
T3
T4
T5
Parameters
event:
string
arg1:
T1
arg2:
T2
arg3:
T3
arg4:
T4
arg5:
T5
Returns
Event
Type parameters
T1
T2
T3
T4
T5
T6
Parameters
event:
string
arg1:
T1
arg2:
T2
arg3:
T3
arg4:
T4
arg5:
T5
arg6:
T6
Rest
...
rest:
any
[]
Returns
Event
Exports
Event
constructor
callbacks
event
Splitter
off
on
once
trigger
如果什么都不传就off全部事件