From 41745c212ae7ad4133213b5b08e39817a6ab5ffd Mon Sep 17 00:00:00 2001 From: Sean Lee Date: Tue, 5 Jan 2016 15:50:39 -0800 Subject: [PATCH] Add callback parameter to sendPendingData method def'n --- applicationinsights/applicationinsights-tests.ts | 5 +++++ applicationinsights/applicationinsights.d.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/applicationinsights/applicationinsights-tests.ts b/applicationinsights/applicationinsights-tests.ts index 8d4d83e9dc..2a4613b019 100644 --- a/applicationinsights/applicationinsights-tests.ts +++ b/applicationinsights/applicationinsights-tests.ts @@ -24,3 +24,8 @@ appInsights.client.trackDependency("dependency name", "commandName", 500, true); appInsights.client.commonProperties = { environment: "dev" }; + +// send any pending data and log the response +appInsights.client.sendPendingData(function (response) { + console.log(response); +}); diff --git a/applicationinsights/applicationinsights.d.ts b/applicationinsights/applicationinsights.d.ts index 9fc6f494d5..f5ea9d4134 100644 --- a/applicationinsights/applicationinsights.d.ts +++ b/applicationinsights/applicationinsights.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Application Insights v0.15.7 +// Type definitions for Application Insights v0.15.8 // Project: https://github.com/Microsoft/ApplicationInsights-node.js // Definitions by: Scott Southwood // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -358,7 +358,7 @@ interface Client { /** * Immediately send all queued telemetry. */ - sendPendingData(): void; + sendPendingData(callback?: (response: string) => void): void; getEnvelope(data: ContractsModule.Data, tagOverrides?: { [key: string]: string; }): ContractsModule.Envelope;