@@ -257,45 +257,33 @@ export interface Resource {
257257}
258258
259259/**
260- * @hidden
261- * TriggerAnnotated is used internally by the firebase CLI to understand what
260+ * TriggerAnnotion is used internally by the firebase CLI to understand what
262261 * type of Cloud Function to deploy.
263262 */
264- export interface TriggerAnnotated {
265- __trigger : {
266- availableMemoryMb ?: number ;
267- blockingTrigger ?: {
268- eventType : string ;
269- options ?: Record < string , unknown > ;
270- } ;
271- eventTrigger ?: {
272- eventType : string ;
273- resource : string ;
274- service : string ;
275- } ;
276- failurePolicy ?: FailurePolicy ;
277- httpsTrigger ?: {
278- invoker ?: string [ ] ;
279- } ;
280- labels ?: { [ key : string ] : string } ;
281- regions ?: string [ ] ;
282- schedule ?: Schedule ;
283- timeout ?: Duration ;
284- vpcConnector ?: string ;
285- vpcConnectorEgressSettings ?: string ;
286- serviceAccountEmail ?: string ;
287- ingressSettings ?: string ;
288- secrets ?: string [ ] ;
263+ interface TriggerAnnotation {
264+ availableMemoryMb ?: number ;
265+ blockingTrigger ?: {
266+ eventType : string ;
267+ options ?: Record < string , unknown > ;
289268 } ;
290- }
291-
292- /**
293- * @hidden
294- * EndpointAnnotated is used to generate the manifest that conforms to the container contract.
295- */
296- export interface EndpointAnnotated {
297- __endpoint : ManifestEndpoint ;
298- __requiredAPIs ?: ManifestRequiredAPI [ ] ;
269+ eventTrigger ?: {
270+ eventType : string ;
271+ resource : string ;
272+ service : string ;
273+ } ;
274+ failurePolicy ?: FailurePolicy ;
275+ httpsTrigger ?: {
276+ invoker ?: string [ ] ;
277+ } ;
278+ labels ?: { [ key : string ] : string } ;
279+ regions ?: string [ ] ;
280+ schedule ?: Schedule ;
281+ timeout ?: Duration ;
282+ vpcConnector ?: string ;
283+ vpcConnectorEgressSettings ?: string ;
284+ serviceAccountEmail ?: string ;
285+ ingressSettings ?: string ;
286+ secrets ?: string [ ] ;
299287}
300288
301289/**
@@ -315,14 +303,34 @@ export interface Runnable<T> {
315303 * [`Response`](https://expressjs.com/en/api.html#res) objects as its only
316304 * arguments.
317305 */
318- export type HttpsFunction = TriggerAnnotated &
319- EndpointAnnotated &
320- ( ( req : Request , resp : Response ) => void | Promise < void > ) ;
306+ export interface HttpsFunction {
307+ ( req : Request , resp : Response ) : void | Promise < void > ;
308+
309+ /** @alpha */
310+ __trigger : TriggerAnnotation ;
311+
312+ /** @alpha */
313+ __endpoint : ManifestEndpoint ;
314+
315+ /** @alpha */
316+ __requiredAPIs ?: ManifestRequiredAPI [ ] ;
317+ }
321318
322319/**
323320 * The Cloud Function type for Blocking triggers.
324321 */
325- export type BlockingFunction = HttpsFunction ;
322+ export interface BlockingFunction {
323+ ( req : Request , resp : Response ) : void | Promise < void > ;
324+
325+ /** @alpha */
326+ __trigger : TriggerAnnotation ;
327+
328+ /** @alpha */
329+ __endpoint : ManifestEndpoint ;
330+
331+ /** @alpha */
332+ __requiredAPIs ?: ManifestRequiredAPI [ ] ;
333+ }
326334
327335/**
328336 * The Cloud Function type for all non-HTTPS triggers. This should be exported
@@ -331,10 +339,18 @@ export type BlockingFunction = HttpsFunction;
331339 * This type is a special JavaScript function which takes a templated
332340 * `Event` object as its only argument.
333341 */
334- export type CloudFunction < T > = Runnable < T > &
335- TriggerAnnotated &
336- EndpointAnnotated &
337- ( ( input : any , context ?: any ) => PromiseLike < any > | any ) ;
342+ export interface CloudFunction < T > extends Runnable < T > {
343+ ( input : any , context ?: any ) : PromiseLike < any > | any ;
344+
345+ /** @alpha */
346+ __trigger : TriggerAnnotation ;
347+
348+ /** @alpha */
349+ __endpoint : ManifestEndpoint ;
350+
351+ /** @alpha */
352+ __requiredAPIs ?: ManifestRequiredAPI [ ] ;
353+ }
338354
339355/** @hidden */
340356export interface MakeCloudFunctionArgs < EventData > {
0 commit comments