Skip to content

Latest commit

 

History

History
108 lines (86 loc) · 2.41 KB

File metadata and controls

108 lines (86 loc) · 2.41 KB

API Report File for "@google-cloud/functions-framework"

Do not edit this file. It is a report generated by API Extractor.

/// <reference types="node" />

import * as express from 'express';

// @public
export const cloudEvent: (functionName: string, handler: CloudEventFunction) => void;

// @public
export interface CloudEventFunction {
    // (undocumented)
    (cloudEvent: CloudEventsContext): any;
}

// @public
export interface CloudEventFunctionWithCallback {
    // (undocumented)
    (cloudEvent: CloudEventsContext, callback: Function): any;
}

// @public
export interface CloudEventsContext {
    data?: any;
    datacontenttype?: string;
    dataschema?: string;
    id: string;
    source: string;
    specversion: string;
    subject?: string;
    time?: string;
    traceparent?: string;
    type: string;
}

// @public
export interface CloudFunctionsContext {
    eventId?: string;
    eventType?: string;
    resource?: string | {
        [key: string]: string;
    };
    timestamp?: string;
}

// @public
export type Context = CloudFunctionsContext | CloudEventsContext;

// @public
export interface Data {
    // (undocumented)
    data: object;
}

// @public
export interface EventFunction {
    // (undocumented)
    (data: {}, context: Context): any;
}

// @public
export interface EventFunctionWithCallback {
    // (undocumented)
    (data: {}, context: Context, callback: Function): any;
}

// @public
export type HandlerFunction = HttpFunction | EventFunction | EventFunctionWithCallback | CloudEventFunction | CloudEventFunctionWithCallback;

// @public
export const http: (functionName: string, handler: HttpFunction) => void;

// @public
export interface HttpFunction {
    // (undocumented)
    (req: Request_2, res: Response_2): any;
}

// @public
export type LegacyCloudFunctionsContext = CloudFunctionsContext | Data;

// @public
export interface LegacyEvent {
    // (undocumented)
    context: CloudFunctionsContext;
    // (undocumented)
    data: {
        [key: string]: any;
    };
}

// @public (undocumented)
interface Request_2 extends express.Request {
    rawBody?: Buffer;
}
export { Request_2 as Request }

// @public (undocumented)
type Response_2 = express.Response;
export { Response_2 as Response }

// (No @packageDocumentation comment for this package)