Functions
Function | Description |
---|---|
defineBoolean(name, options) | Declare a boolean param. |
defineInt(name, options) | Declare an integer param. |
defineList(name, options) | Declare a list param. |
defineSecret(name) | Declares a secret param, that will persist values only in Cloud Secret Manager. Secrets are stored interally as bytestrings. Use ParamOptions.as to provide type hinting during parameter resolution. |
defineString(name, options) | Declare a string param. |
Classes
Class | Description |
---|---|
Expression |
Variables
Variable | Description |
---|---|
databaseURL | A builtin param that resolves to the default RTDB database URL associated with the project, without prompting the deployer. Empty string if none exists. |
declaredParams | |
gcloudProject | A builtin param that resolves to the Cloud project ID, without prompting the deployer. |
projectID | A builtin param that resolves to the Cloud project ID associated with the project, without prompting the deployer. |
storageBucket | A builtin param that resolves to the Cloud storage bucket associated with the function, without prompting the deployer. Empty string if not defined. |
Type Aliases
Type Alias | Description |
---|---|
ParamOptions | Configuration options which can be used to customize the prompting behavior of a Param. |
params.defineBoolean()
Declare a boolean param.
Signature:
export declare function defineBoolean(name: string, options?: ParamOptions<boolean>): BooleanParam;
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name of the environment variable to use to load the param. |
options | ParamOptions<boolean> | Configuration options for the param. |
Returns:
BooleanParam
A Param with a boolean
return type for .value
.
params.defineInt()
Declare an integer param.
Signature:
export declare function defineInt(name: string, options?: ParamOptions<number>): IntParam;
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name of the environment variable to use to load the param. |
options | ParamOptions<number> | Configuration options for the param. |
Returns:
IntParam
A Param with a number
return type for .value
.
params.defineList()
Declare a list param.
Signature:
export declare function defineList(name: string, options?: ParamOptions<string[]>): ListParam;
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name of the environment variable to use to load the param. |
options | ParamOptions<string[]> | Configuration options for the param. |
Returns:
ListParam
A Param with a string[]
return type for .value
.
params.defineSecret()
Declares a secret param, that will persist values only in Cloud Secret Manager. Secrets are stored interally as bytestrings. Use ParamOptions.as
to provide type hinting during parameter resolution.
Signature:
export declare function defineSecret(name: string): SecretParam;
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name of the environment variable to use to load the param. |
Returns:
SecretParam
A Param with a string
return type for .value
.
params.defineString()
Declare a string param.
Signature:
export declare function defineString(name: string, options?: ParamOptions<string>): StringParam;
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name of the environment variable to use to load the param. |
options | ParamOptions<string> | Configuration options for the param. |
Returns:
StringParam
A Param with a string
return type for .value
.
params.databaseURL
A builtin param that resolves to the default RTDB database URL associated with the project, without prompting the deployer. Empty string if none exists.
Signature:
databaseURL: Param<string>
params.declaredParams
Signature:
declaredParams: SecretOrExpr[]
params.gcloudProject
A builtin param that resolves to the Cloud project ID, without prompting the deployer.
Signature:
gcloudProject: Param<string>
params.projectID
A builtin param that resolves to the Cloud project ID associated with the project, without prompting the deployer.
Signature:
projectID: Param<string>
params.storageBucket
A builtin param that resolves to the Cloud storage bucket associated with the function, without prompting the deployer. Empty string if not defined.
Signature:
storageBucket: Param<string>
params.ParamOptions
Configuration options which can be used to customize the prompting behavior of a Param.
Signature:
export type ParamOptions<T extends string | number | boolean | string[]> = Omit<ParamSpec<T>, "name" | "type">;