From 98b769b9e1703fd794bf885c4061b2b4115be205 Mon Sep 17 00:00:00 2001 From: sean Date: Tue, 5 Jan 2016 23:46:04 -0800 Subject: [PATCH] Fix issue with es6 style import --- .../applicationinsights-tests.ts | 2 +- applicationinsights/applicationinsights.d.ts | 32 +++++++------------ 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/applicationinsights/applicationinsights-tests.ts b/applicationinsights/applicationinsights-tests.ts index 2a4613b01..eb9d5e701 100644 --- a/applicationinsights/applicationinsights-tests.ts +++ b/applicationinsights/applicationinsights-tests.ts @@ -1,5 +1,5 @@ /// -import appInsights = require("applicationinsights"); +import * as appInsights from "applicationinsights"; // basic use appInsights.setup("").start(); diff --git a/applicationinsights/applicationinsights.d.ts b/applicationinsights/applicationinsights.d.ts index f5ea9d413..d5c895466 100644 --- a/applicationinsights/applicationinsights.d.ts +++ b/applicationinsights/applicationinsights.d.ts @@ -409,66 +409,58 @@ interface Sender { * The singleton meta interface for the default client of the client. This interface is used to setup/start and configure * the auto-collection behavior of the application insights module. */ -declare class ApplicationInsights { - static client: Client; - private static _isConsole; - private static _isExceptions; - private static _isPerformance; - private static _isRequests; - private static _console; - private static _exceptions; - private static _performance; - private static _requests; - private static _isStarted; +interface ApplicationInsights { + client: Client; /** * Initializes a client with the given instrumentation key, if this is not specified, the value will be * read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY * @returns {ApplicationInsights/Client} a new client */ - static getClient(instrumentationKey?: string): Client; + getClient(instrumentationKey?: string): Client; /** * Initializes the default client of the client and sets the default configuration * @param instrumentationKey the instrumentation key to use. Optional, if this is not specified, the value will be * read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY * @returns {ApplicationInsights} this interface */ - static setup(instrumentationKey?: string): typeof ApplicationInsights; + setup(instrumentationKey?: string): ApplicationInsights; /** * Starts automatic collection of telemetry. Prior to calling start no telemetry will be collected * @returns {ApplicationInsights} this interface */ - static start(): typeof ApplicationInsights; + start(): ApplicationInsights; /** * Sets the state of console tracking (enabled by default) * @param value if true console activity will be sent to Application Insights * @returns {ApplicationInsights} this interface */ - static setAutoCollectConsole(value: boolean): typeof ApplicationInsights; + setAutoCollectConsole(value: boolean): ApplicationInsights; /** * Sets the state of exception tracking (enabled by default) * @param value if true uncaught exceptions will be sent to Application Insights * @returns {ApplicationInsights} this interface */ - static setAutoCollectExceptions(value: boolean): typeof ApplicationInsights; + setAutoCollectExceptions(value: boolean): ApplicationInsights; /** * Sets the state of performance tracking (enabled by default) * @param value if true performance counters will be collected every second and sent to Application Insights * @returns {ApplicationInsights} this interface */ - static setAutoCollectPerformance(value: boolean): typeof ApplicationInsights; + setAutoCollectPerformance(value: boolean): ApplicationInsights; /** * Sets the state of request tracking (enabled by default) * @param value if true requests will be sent to Application Insights * @returns {ApplicationInsights} this interface */ - static setAutoCollectRequests(value: boolean): typeof ApplicationInsights; + setAutoCollectRequests(value: boolean): ApplicationInsights; /** * Enables verbose debug logging * @returns {ApplicationInsights} this interface */ - static enableVerboseLogging(): typeof ApplicationInsights; + enableVerboseLogging(): ApplicationInsights; } declare module "applicationinsights" { - export = ApplicationInsights; + const applicationinsights: ApplicationInsights; + export = applicationinsights; } \ No newline at end of file