UNPKG

827 BTypeScriptView Raw
1import * as express from "express";
2import { CallableContext, FunctionsErrorCode, HttpsError, Request } from "../../common/providers/https";
3import { HttpsFunction, Runnable } from "../cloud-functions";
4export { Request, CallableContext, FunctionsErrorCode, HttpsError };
5/**
6 * Handle HTTP requests.
7 * @param handler A function that takes a request and response object,
8 * same signature as an Express app.
9 */
10export declare function onRequest(handler: (req: Request, resp: express.Response) => void | Promise<void>): HttpsFunction;
11/**
12 * Declares a callable method for clients to call using a Firebase SDK.
13 * @param handler A method that takes a data and context and returns a value.
14 */
15export declare function onCall(handler: (data: any, context: CallableContext) => any | Promise<any>): HttpsFunction & Runnable<any>;