From 7b6b3555f3fd5931d7d6bd6e6bc401158cc78873 Mon Sep 17 00:00:00 2001 From: Dimitri Mitropoulos Date: Mon, 17 Aug 2020 15:54:08 -0400 Subject: [PATCH 1/2] adds types for Segment Integration Settings --- lib/index.d.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/index.d.ts b/lib/index.d.ts index 855a58af..576e6e36 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -6,8 +6,14 @@ export declare namespace SegmentAnalytics { } interface IntegrationsSettings { - // TODO remove `any` - [key: string]: any; + addBundledMetadata: boolean; + apiHost?: string; + apiKey?: string; + crossDomainIdServers?: string[]; + deleteCrossDomainId?: boolean; + retryQueue: boolean; + saveCrossDomainIdInLocalStorage: boolean; + unbundledIntegrations: any[]; } interface CookieOptions { From 78f2fe221335067d0e323b82d5c724e25a2dffe1 Mon Sep 17 00:00:00 2001 From: Bryan Mikaelian Date: Tue, 22 Sep 2020 07:27:16 -0400 Subject: [PATCH 2/2] Be a little more explicit on the types --- lib/index.d.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/index.d.ts b/lib/index.d.ts index 576e6e36..1c2bc3fe 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -5,7 +5,14 @@ export declare namespace SegmentAnalytics { context?: object; } - interface IntegrationsSettings { + type IntegrationsSettings = IntegrationSettings | SegmentIOIntegrationSettings + + interface IntegrationSettings { + [key: string]: unknown + } + + // TODO: Long term, this should probably live in analytics.js-integrations + interface SegmentIOIntegrationSettings { addBundledMetadata: boolean; apiHost?: string; apiKey?: string;