Class: CloudFunction
Implements
Plugin
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new CloudFunction(config?
)
创建云函数配置
Parameters
Name | Type | Description |
---|---|---|
config? | CloudFunctionConfig | {object} 配置项,这些配置将强制覆盖默认配置 |
Properties
config
• config: Object
Index signature
▪ [key: string
]: any
Type declaration
Name | Type |
---|---|
memorySize? | number |
name? | string |
timeout? | number |
triggers? | { name : string ; type : string ; value : string }[] |
context
• context: any
event
• event: any
name
• Readonly
name: string
= Name
Implementation of
Plugin.name
type
• Readonly
type: string
= Name
Implementation of
Plugin.type
Methods
invoke
▸ invoke<TData
>(name
, data?
, options?
): Promise
<void
>
异步触发云函数
Type parameters
Name | Type |
---|---|
TData | any |
Parameters
Name | Type | Description |
---|---|---|
name | string | {string} 云函数文件名或云函数名 |
data? | TData | {any} 参数 |
options? | Object | {object} 额外配置项 |
Returns
Promise
<void
>
invokeSync
▸ invokeSync<TResult
, TData
>(name
, data?
, options?
): Promise
<TResult
>
同步调用云函数
Type parameters
Name | Type |
---|---|
TResult | any |
TData | any |
Parameters
Name | Type | Description |
---|---|---|
name | string | {string} 云函数文件名或云函数名 |
data? | TData | {any} 参数 |
options? | Object | {object} 额外配置项 |
Returns
Promise
<TResult
>
onDeploy
▸ onDeploy(data
, next
): Promise
<void
>
Parameters
Name | Type |
---|---|
data | DeployData |
next | Next |
Returns
Promise
<void
>
Implementation of
Plugin.onDeploy
onInvoke
▸ onInvoke(data
, next
): Promise
<void
>
Parameters
Name | Type |
---|---|
data | InvokeData <any , any , any > |
next | Next |
Returns
Promise
<void
>
Implementation of
Plugin.onInvoke
onMount
▸ onMount(data
, next
): Promise
<void
>
Parameters
Name | Type |
---|---|
data | MountData |
next | Next |
Returns
Promise
<void
>
Implementation of
Plugin.onMount