Skip to content

Commit 8d45c40

Browse files
authored
Docs pass for v2.eventarc (#1110)
* Docs pass for v2.eventarc * formats * Style pass * PR feedback
1 parent 4825fb4 commit 8d45c40

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/v2/providers/eventarc.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import * as options from '../options';
2828
/** Options that can be set on an Eventarc trigger. */
2929
export interface EventarcTriggerOptions extends options.EventHandlerOptions {
3030
/**
31-
* Type of the event.
31+
* Type of the event to trigger on.
3232
*/
3333
eventType: string;
3434

@@ -54,14 +54,26 @@ export interface EventarcTriggerOptions extends options.EventHandlerOptions {
5454
filters?: Record<string, string>;
5555
}
5656

57+
/**
58+
* A function that takes a {@link CloudEvent}.
59+
*/
5760
export type CloudEventHandler = (event: CloudEvent<any>) => any | Promise<any>;
5861

59-
/** Handle an Eventarc event published on the default channel. */
62+
/** Handles an Eventarc event published on the default channel.
63+
* @param eventType - Type of the event to trigger on.
64+
* @param handler - A function to execute when triggered.
65+
* @returns A function that you can export and deploy.
66+
*/
6067
export function onCustomEventPublished<T = any>(
6168
eventType: string,
6269
handler: CloudEventHandler
6370
): CloudFunction<CloudEvent<T>>;
6471

72+
/** Handles an Eventarc event.
73+
* @param opts - Options to set on this function
74+
* @param handler - A function to execute when triggered.
75+
* @returns A function that you can export and deploy.
76+
*/
6577
export function onCustomEventPublished<T = any>(
6678
opts: EventarcTriggerOptions,
6779
handler: CloudEventHandler

0 commit comments

Comments
 (0)