Skip to content

PromptScript API


Function: bindParams()

bindParams(args, defs, templatePath, callLocation?): Map\<string, Value>

Defined in: core/src/template.ts:126

Bind parameter arguments to parameter definitions.

Parameters

args

Arguments provided at the call site

ParamArgument[] | undefined

defs

Parameter definitions from the template

ParamDefinition[] | undefined

templatePath

string

Path to the template file (for error messages)

callLocation?

SourceLocation

Location of the @inherit/@use call (for error messages)

Returns

Map\<string, Value>

Map of parameter names to their bound values

Throws

MissingParamError if a required parameter is not provided

Throws

UnknownParamError if an unknown parameter is provided

Throws

ParamTypeMismatchError if a parameter value has the wrong type