Documents / @faasjs/test / Func
Class: Func<TEvent, TContext, TResult>
Type Parameters
• TEvent = any
• TContext = any
• TResult = any
Indexable
[key
: string
]: any
Constructors
new Func()
new Func<
TEvent
,TContext
,TResult
>(config
):Func
<TEvent
,TContext
,TResult
>
Create a cloud function
Parameters
• config: FuncConfig
<TEvent
, TContext
, any
>
{object} config
Returns
Func
<TEvent
, TContext
, TResult
>
Methods
export()
export():
object
Export the function
Returns
object
handler
handler:
ExportedHandler
<TEvent
,TContext
,TResult
>
invoke()
invoke(
data
):Promise
<void
>
Invoke the function
Parameters
• data: InvokeData
<TEvent
, TContext
, TResult
>
{object} data
Returns
Promise
<void
>
mount()
mount(
data
):Promise
<void
>
First time mount the function
Parameters
• data = ...
• data.config?: Config
• data.context: TContext
• data.event: TEvent
• data.logger?: Logger
Returns
Promise
<void
>
Properties
config
config:
Config
filename?
optional
filename:string
handler?
optional
handler:Handler
<TEvent
,TContext
,TResult
>
mounted
mounted:
boolean
=false
plugins
plugins:
Plugin
[]