From e7615ef16b3d92ca1c31ece6850a66bdf0027eae Mon Sep 17 00:00:00 2001 From: Pascal Corpet Date: Wed, 26 Jun 2019 20:10:34 +0200 Subject: [PATCH] [amplitude-js] Give access to Identify and Revenue classes through AmplitudeClient. (#36313) --- types/amplitude-js/amplitude-js-tests.ts | 3 +++ types/amplitude-js/index.d.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/types/amplitude-js/amplitude-js-tests.ts b/types/amplitude-js/amplitude-js-tests.ts index 0b6bb49751..da6d30c548 100644 --- a/types/amplitude-js/amplitude-js-tests.ts +++ b/types/amplitude-js/amplitude-js-tests.ts @@ -107,6 +107,9 @@ module Amplitude.Tests { revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99).setEventProperties({ 'city': 'San Francisco' }); revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99).setQuantity(5); revenue = new amplitude.Revenue().setProductId('productIdentifier').setPrice(10.99).setRevenueType('purchase'); + + identify = new client.Identify() + revenue = new client.Revenue() } } diff --git a/types/amplitude-js/index.d.ts b/types/amplitude-js/index.d.ts index 10465f6647..1569cec705 100644 --- a/types/amplitude-js/index.d.ts +++ b/types/amplitude-js/index.d.ts @@ -104,6 +104,9 @@ export class AmplitudeClient { logRevenueV2(revenue_obj: Revenue): LogReturn; logRevenue(pric: number, quantity: number, product: string): LogReturn; logEventWithTimestamp(event: string, data?: any, timestamp?: number, callback?: Callback): LogReturn; + + Identify: typeof Identify + Revenue: typeof Revenue } // Proxy methods that get executed on the default AmplitudeClient instance (not all client methods are proxied)