From 558f9d9049694a59d560db20109786651b0b049f Mon Sep 17 00:00:00 2001 From: Cleison Stein Date: Fri, 15 Jun 2018 15:47:28 -0300 Subject: [PATCH 1/2] export api; import api in tests; fix doc --- types/new-relic-browser/index.d.ts | 7 ++++--- types/new-relic-browser/new-relic-browser-tests.ts | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/types/new-relic-browser/index.d.ts b/types/new-relic-browser/index.d.ts index 0064ee4ad2..6d9fc22fdc 100644 --- a/types/new-relic-browser/index.d.ts +++ b/types/new-relic-browser/index.d.ts @@ -3,8 +3,6 @@ // Definitions by: Rene Hamburger , Piotr Kubisa // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare const newrelic: NewRelic.Browser; - declare namespace NewRelic { interface Browser { /** @@ -186,7 +184,7 @@ declare namespace NewRelic { * Adds a custom SPA attribute only to the current interaction in New Relic Browser. * * @param key Used as the attribute name on the BrowserInteraction event. - * @param Used as the attribute value on the BrowserInteraction event. This can be a + * @param value Used as the attribute value on the BrowserInteraction event. This can be a * string, number, boolean, or object. If it is an object, New Relic serializes it to a JSON string. * @returns This method returns the same API object created by interaction(). * @see https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api/spa-set-attribute @@ -205,3 +203,6 @@ declare namespace NewRelic { setName(name: string, trigger?: string): BrowserInteraction; } } + +declare const api: NewRelic.Browser; +export = api; diff --git a/types/new-relic-browser/new-relic-browser-tests.ts b/types/new-relic-browser/new-relic-browser-tests.ts index b9f75b142d..4f32be267f 100644 --- a/types/new-relic-browser/new-relic-browser-tests.ts +++ b/types/new-relic-browser/new-relic-browser-tests.ts @@ -1,3 +1,5 @@ +import * as newrelic from "new-relic-browser"; + // The following tests are largely taken straight from the examples at https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api // --- NewRelic.Browser methods ---------------------------------------------- From 2ffb7eaf374a28ecbda70d35a287b3cdcca9b2d6 Mon Sep 17 00:00:00 2001 From: Cleison Stein Date: Tue, 19 Jun 2018 08:47:25 -0300 Subject: [PATCH 2/2] Fix import in test --- types/new-relic-browser/new-relic-browser-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/new-relic-browser/new-relic-browser-tests.ts b/types/new-relic-browser/new-relic-browser-tests.ts index 4f32be267f..86ce781e18 100644 --- a/types/new-relic-browser/new-relic-browser-tests.ts +++ b/types/new-relic-browser/new-relic-browser-tests.ts @@ -1,4 +1,4 @@ -import * as newrelic from "new-relic-browser"; +import newrelic = require("new-relic-browser"); // The following tests are largely taken straight from the examples at https://docs.newrelic.com/docs/browser/new-relic-browser/browser-agent-spa-api