m-cloud API Documentation - v1.0.1-beta.5
Docs
GitHub
Preparing search index...
PluginLifecycleHooks
Interface PluginLifecycleHooks
插件生命周期钩子
interface
PluginLifecycleHooks
{
onInstall
?:
(
plugin
:
Plugin
,
config
?:
Record
<
string
,
any
>
,
)
=>
void
|
Promise
<
void
>
;
onUninstall
?:
(
plugin
:
Plugin
)
=>
void
|
Promise
<
void
>
;
onAppStart
?:
(
context
:
Context
)
=>
void
|
Promise
<
void
>
;
onAppStop
?:
(
context
:
Context
)
=>
void
|
Promise
<
void
>
;
onRequest
?:
(
context
:
Context
)
=>
void
|
Promise
<
void
>
;
onResponse
?:
(
context
:
Context
)
=>
void
|
Promise
<
void
>
;
onError
?:
(
error
:
Error
,
context
:
Context
)
=>
void
|
Promise
<
void
>
;
}
Index
Properties
on
Install?
on
Uninstall?
on
App
Start?
on
App
Stop?
on
Request?
on
Response?
on
Error?
Properties
Optional
on
Install
onInstall
?:
(
plugin
:
Plugin
,
config
?:
Record
<
string
,
any
>
,
)
=>
void
|
Promise
<
void
>
插件安装时调用
Optional
on
Uninstall
onUninstall
?:
(
plugin
:
Plugin
)
=>
void
|
Promise
<
void
>
插件卸载时调用
Optional
on
App
Start
onAppStart
?:
(
context
:
Context
)
=>
void
|
Promise
<
void
>
应用启动时调用
Optional
on
App
Stop
onAppStop
?:
(
context
:
Context
)
=>
void
|
Promise
<
void
>
应用关闭时调用
Optional
on
Request
onRequest
?:
(
context
:
Context
)
=>
void
|
Promise
<
void
>
请求处理前调用
Optional
on
Response
onResponse
?:
(
context
:
Context
)
=>
void
|
Promise
<
void
>
响应发送前调用
Optional
on
Error
onError
?:
(
error
:
Error
,
context
:
Context
)
=>
void
|
Promise
<
void
>
错误发生时调用
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Properties
on
Install
on
Uninstall
on
App
Start
on
App
Stop
on
Request
on
Response
on
Error
Docs
GitHub
m-cloud API Documentation - v1.0.1-beta.5
Loading...
插件生命周期钩子