@@ -28,14 +28,13 @@ export interface PlanAutomatedUpdatePayload {
2828 notificationType : string ;
2929}
3030
31- interface WithAlertType {
32- /** The type of the alerts that got triggered. */
33- alertType : string ;
34- }
3531/**
3632 * A custom CloudEvent for billing Firebase Alerts (with custom extension attributes).
3733 */
38- export type BillingEvent < T > = CloudEvent < FirebaseAlertData < T > , WithAlertType > ;
34+ export interface BillingEvent < T > extends CloudEvent < FirebaseAlertData < T > > {
35+ /** The type of the alerts that got triggered. */
36+ alertType : string ;
37+ }
3938
4039/** @internal */
4140export const planUpdateAlert = 'billing.planUpdate' ;
@@ -47,17 +46,17 @@ export const planAutomatedUpdateAlert = 'billing.planAutomatedUpdate';
4746 */
4847export function onPlanUpdatePublished (
4948 handler : ( event : BillingEvent < PlanUpdatePayload > ) => any | Promise < any >
50- ) : CloudFunction < FirebaseAlertData < PlanUpdatePayload > > ;
49+ ) : CloudFunction < BillingEvent < PlanUpdatePayload > > ;
5150export function onPlanUpdatePublished (
5251 opts : options . EventHandlerOptions ,
5352 handler : ( event : BillingEvent < PlanUpdatePayload > ) => any | Promise < any >
54- ) : CloudFunction < FirebaseAlertData < PlanUpdatePayload > > ;
53+ ) : CloudFunction < BillingEvent < PlanUpdatePayload > > ;
5554export function onPlanUpdatePublished (
5655 optsOrHandler :
5756 | options . EventHandlerOptions
5857 | ( ( event : BillingEvent < PlanUpdatePayload > ) => any | Promise < any > ) ,
5958 handler ?: ( event : BillingEvent < PlanUpdatePayload > ) => any | Promise < any >
60- ) : CloudFunction < FirebaseAlertData < PlanUpdatePayload > > {
59+ ) : CloudFunction < BillingEvent < PlanUpdatePayload > > {
6160 return onOperation < PlanUpdatePayload > (
6261 planUpdateAlert ,
6362 optsOrHandler ,
@@ -72,21 +71,21 @@ export function onPlanAutomatedUpdatePublished(
7271 handler : (
7372 event : BillingEvent < PlanAutomatedUpdatePayload >
7473 ) => any | Promise < any >
75- ) : CloudFunction < FirebaseAlertData < PlanAutomatedUpdatePayload > > ;
74+ ) : CloudFunction < BillingEvent < PlanAutomatedUpdatePayload > > ;
7675export function onPlanAutomatedUpdatePublished (
7776 opts : options . EventHandlerOptions ,
7877 handler : (
7978 event : BillingEvent < PlanAutomatedUpdatePayload >
8079 ) => any | Promise < any >
81- ) : CloudFunction < FirebaseAlertData < PlanAutomatedUpdatePayload > > ;
80+ ) : CloudFunction < BillingEvent < PlanAutomatedUpdatePayload > > ;
8281export function onPlanAutomatedUpdatePublished (
8382 optsOrHandler :
8483 | options . EventHandlerOptions
8584 | ( ( event : BillingEvent < PlanAutomatedUpdatePayload > ) => any | Promise < any > ) ,
8685 handler ?: (
8786 event : BillingEvent < PlanAutomatedUpdatePayload >
8887 ) => any | Promise < any >
89- ) : CloudFunction < FirebaseAlertData < PlanAutomatedUpdatePayload > > {
88+ ) : CloudFunction < BillingEvent < PlanAutomatedUpdatePayload > > {
9089 return onOperation < PlanAutomatedUpdatePayload > (
9190 planAutomatedUpdateAlert ,
9291 optsOrHandler ,
@@ -101,7 +100,7 @@ export function onOperation<T>(
101100 | options . EventHandlerOptions
102101 | ( ( event : BillingEvent < T > ) => any | Promise < any > ) ,
103102 handler : ( event : BillingEvent < T > ) => any | Promise < any >
104- ) : CloudFunction < FirebaseAlertData < T > > {
103+ ) : CloudFunction < BillingEvent < T > > {
105104 if ( typeof optsOrHandler === 'function' ) {
106105 handler = optsOrHandler as ( event : BillingEvent < T > ) => any | Promise < any > ;
107106 optsOrHandler = { } ;
0 commit comments