Skip to content

Commit fe19f81

Browse files
committed
Type defs fix
1 parent 1126f2f commit fe19f81

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

Diff for: packages/analytics/lib/modular/index.d.ts

+15-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ export declare function initializeAnalytics(
2323
options?: FirebaseAnalyticsTypes.AnalyticsSettings,
2424
): Analytics;
2525

26+
/**
27+
* Retrieves a unique Google Analytics identifier for the web client.
28+
*
29+
* @param analyticsInstance - Instance of analytics (web - only)
30+
*
31+
*/
32+
export declare function getGoogleAnalyticsClientId(analyticsInstance: Analytics): Promise<string>;
33+
2634
/**
2735
* Log a custom event with optional params. Note that there are various limits that applied
2836
* to event parameters (total parameter count, etc), but analytics applies the limits during
@@ -605,10 +613,14 @@ export function getAppInstanceId(analytics: Analytics): Promise<string | null>;
605613
* Gives a user a unique identification.
606614
*
607615
* @param analytics Analytics instance.
608-
* @param id Set to null to remove a previously assigned ID from analytics
609-
* events
616+
* @param id Set to null to remove a previously assigned ID from analytics events
617+
* @param options Additional options that can be passed to Analytics method calls such as logEvent, etc.
610618
*/
611-
export function setUserId(analytics: Analytics, id: string | null): Promise<void>;
619+
export function setUserId(
620+
analytics: Analytics,
621+
id: string | null,
622+
options?: AnalyticsCallOptions,
623+
): Promise<void>;
612624

613625
/**
614626
* Sets a key/value pair of data on the current user. Each Firebase project can have up to 25 uniquely named (case-sensitive) user properties.

Diff for: packages/analytics/lib/modular/index.js

+9
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ export function initializeAnalytics(app, options) {
6464
return getApp(app.name).analytics();
6565
}
6666

67+
/**
68+
* Retrieves a unique Google Analytics identifier for the web client.
69+
*
70+
* @param {AnalyticsInstance} analyticsInstance - Instance of analytics (web - only)
71+
* @returns {string}
72+
*/
73+
export function getGoogleAnalyticsClientId(analyticsInstance) {
74+
throw new Error('getGoogleAnalyticsClientId is only supported on Web');
75+
}
6776
/**
6877
* Log a custom event with optional params.
6978
* @param {FirebaseAnalytics} analytics - Analytics instance.

0 commit comments

Comments
 (0)