diff --git a/src/v2/providers/eventarc.ts b/src/v2/providers/eventarc.ts index fd56e714f..17750d34a 100644 --- a/src/v2/providers/eventarc.ts +++ b/src/v2/providers/eventarc.ts @@ -28,7 +28,7 @@ import * as options from '../options'; /** Options that can be set on an Eventarc trigger. */ export interface EventarcTriggerOptions extends options.EventHandlerOptions { /** - * Type of the event. + * Type of the event to trigger on. */ eventType: string; @@ -54,14 +54,26 @@ export interface EventarcTriggerOptions extends options.EventHandlerOptions { filters?: Record; } +/** + * A function that takes a {@link CloudEvent}. + */ export type CloudEventHandler = (event: CloudEvent) => any | Promise; -/** Handle an Eventarc event published on the default channel. */ +/** Handles an Eventarc event published on the default channel. + * @param eventType - Type of the event to trigger on. + * @param handler - A function to execute when triggered. + * @returns A function that you can export and deploy. + */ export function onCustomEventPublished( eventType: string, handler: CloudEventHandler ): CloudFunction>; +/** Handles an Eventarc event. + * @param opts - Options to set on this function + * @param handler - A function to execute when triggered. + * @returns A function that you can export and deploy. + */ export function onCustomEventPublished( opts: EventarcTriggerOptions, handler: CloudEventHandler