Dagger NodeJS SDK
api/client.gen.Function_
Function represents a resolver provided by a Module.
A function always evaluates against a parent object and is given a set of named arguments.
Hierarchy
-
BaseClient
↳
Function_
Constructors
constructor
new Function_(parent?
, _id?
, _description?
, _name?
): Function_
Constructor is used for internal usage only, do not create object from it.
Parameters
Name | Type |
---|---|
parent? | Object |
parent.ctx | Context |
parent.queryTree? | QueryTree [] |
_id? | FunctionID |
_description? | string |
_name? | string |
Returns
Overrides
BaseClient.constructor
Properties
_description
Private
Optional
Readonly
_description: string
= undefined
_id
Private
Optional
Readonly
_id: FunctionID
= undefined
_name
Private
Optional
Readonly
_name: string
= undefined
Methods
args
args(): Promise
<FunctionArg
[]>
Arguments accepted by the function, if any.
Returns
Promise
<FunctionArg
[]>
description
description(): Promise
<string
>
A doc string for the function, if any.
Returns
Promise
<string
>
id
id(): Promise
<FunctionID
>
A unique identifier for this Function.
Returns
Promise
<FunctionID
>
name
name(): Promise
<string
>
The name of the function.
Returns
Promise
<string
>
returnType
returnType(): TypeDef
The type returned by the function.
Returns
with
with(arg
): Function_
Call the provided function with current Function.
This is useful for reusability and readability by not breaking the calling chain.
Parameters
Name | Type |
---|---|
arg | (param : Function_ ) => Function_ |
Returns
withArg
withArg(name
, typeDef
, opts?
): Function_
Returns the function with the provided argument
Parameters
Name | Type | Description |
---|---|---|
name | string | The name of the argument |
typeDef | TypeDef | The type of the argument |
opts? | FunctionWithArgOpts | - |
Returns
withDescription
withDescription(description
): Function_
Returns the function with the given doc string.
Parameters
Name | Type | Description |
---|---|---|
description | string | The doc string to set. |