Firebase Functions 服务。
函数
函数 | 说明 |
---|---|
getFunctions(应用) | 获取默认应用或指定应用的 Functions 服务。可调用 getFunctions() (不使用任何参数)以访问默认应用的 Functions 服务,或者以 getFunctions(app) 的形式调用 getFunctions() ,以访问与特定应用相关联的 Functions 服务。 |
类
类 | 说明 |
---|---|
函数 | Firebase Functions 服务接口。 |
TaskQueue | TaskQueue 接口。 |
接口
接口 | 说明 |
---|---|
AbsoluteDelivery | 显示绝对传送的任务选项的界面。 |
DelayDelivery | 显示延迟传递的任务选项的界面。 |
noindexExperimental | 表示实验性(Beta 版)任务选项的类型。 |
类型别名
类型别名 | 说明 |
---|---|
DeliverySchedule [发送时间安排] | 表示投放时间安排选项的类型。DeliverySchedule 是 DelayDelivery 和 AbsoluteDelivery 类型的并集类型。 |
TaskOptions | 表示任务选项的类型。 |
getFunctions(应用)
获取默认应用或指定应用的 Functions 服务。
可以不使用任何参数调用 getFunctions()
,以访问默认应用的 Functions
服务,或者以 getFunctions(app)
的形式调用,以访问与特定应用相关联的 Functions
服务。
签名:
export declare function getFunctions(app?: App): Functions;
参数
参数 | 类型 | 说明 |
---|---|---|
app | 应用 | 可选应用,要为其返回 Functions 服务。如果未提供,则返回默认的 Functions 服务。 |
返回:
默认的 Functions
服务(如果未提供应用),或与提供的应用关联的 Functions
服务。
示例 1
// Get the `Functions` service for the default app
const defaultFunctions = getFunctions();
示例 2
// Get the `Functions` service for a given app
const otherFunctions = getFunctions(otherApp);
交付时间表
表示投放时间安排选项的类型。DeliverySchedule
是 DelayDelivery 和 AbsoluteDelivery 类型的并集类型。
签名:
export type DeliverySchedule = DelayDelivery | AbsoluteDelivery;
TaskOptions
表示任务选项的类型。
签名:
export type TaskOptions = DeliverySchedule & TaskOptionsExperimental & {
dispatchDeadlineSeconds?: number;
id?: string;
headers?: Record<string, string>;
};