diff --git a/types/newrelic/index.d.ts b/types/newrelic/index.d.ts index 0c674e4646..a5fd434d99 100644 --- a/types/newrelic/index.d.ts +++ b/types/newrelic/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for newrelic 3.3 +// Type definitions for newrelic 3.4 // Project: http://github.com/newrelic/node-newrelic // Definitions by: Matt R. Wilson +// Brooks Patton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // https://docs.newrelic.com/docs/agents/nodejs-agent/api-guides/nodejs-agent-api @@ -64,14 +65,14 @@ export function setControllerName(name: string, action: string): void; * * Most recently set value wins. */ -export function addCustomAttribute(key: string, value: string): void; +export function addCustomAttribute(key: string, value: string|number): void; /** * Adds all custom attributes in an object to the current transaction. * * See documentation for `addCustomAttribute` for more information on setting custom attributes. */ -export function addCustomAttributes(atts: { [key: string]: string }): void; +export function addCustomAttributes(atts: { [key: string]: string|number }): void; /** * Tell the tracer whether to ignore the current transaction. diff --git a/types/newrelic/newrelic-tests.ts b/types/newrelic/newrelic-tests.ts index 3f99152c66..29eabfeb21 100644 --- a/types/newrelic/newrelic-tests.ts +++ b/types/newrelic/newrelic-tests.ts @@ -14,7 +14,9 @@ newrelic.setDispatcher("foo", "42"); // $ExpectType void newrelic.setControllerName("foo", "GET"); // $ExpectType void newrelic.addCustomAttribute("foo", "bar"); // $ExpectType void +newrelic.addCustomAttribute("foo", 42); // $ExpectType void newrelic.addCustomAttributes({ foo: "bar", baz: "bang" }); // $ExpectType void +newrelic.addCustomAttributes({ foo: "bar", baz: 42 }); // $ExpectType void newrelic.setIgnoreTransaction(true); // $ExpectType void