From 3dca396263125d066912eb5e1899e20dc53c49ca Mon Sep 17 00:00:00 2001 From: Calvin Huang Date: Tue, 30 Jan 2018 04:38:32 +0800 Subject: [PATCH] Since the official document said: "Hit type is the type of hit", it would be much clear if we use type to define HitType instead of an enum. (#23184) --- types/google.analytics/index.d.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/types/google.analytics/index.d.ts b/types/google.analytics/index.d.ts index b0412a362f..b7d4a8a6f4 100644 --- a/types/google.analytics/index.d.ts +++ b/types/google.analytics/index.d.ts @@ -39,9 +39,8 @@ interface GoogleAnalytics { declare namespace UniversalAnalytics { // https://developers.google.com/analytics/devguides/collection/analyticsjs/method-reference - enum HitType { - 'pageview', 'screenview', 'event', 'transaction', 'item', 'social', 'exception', 'timing' - } + // https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#hitType + type HitType = 'pageview' | 'screenview' | 'event' | 'transaction' | 'item' | 'social' | 'exception' | 'timing'; // https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference @@ -294,7 +293,7 @@ declare namespace UniversalAnalytics { flashVersion?: string; forceSSL?: boolean; hitCallback?(): void; - hitType?: string; + hitType?: HitType; hostname?: string; id?: string; javaEnabled?: boolean;