Skip to content

Commit 4dc47f6

Browse files
committed
update ApplicationInsights to 0.15.12
1 parent c770370 commit 4dc47f6

File tree

1 file changed

+21
-27
lines changed

1 file changed

+21
-27
lines changed

applicationinsights/applicationinsights.d.ts

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// Type definitions for Application Insights v0.15.7
1+
// Type definitions for Application Insights v0.15.12
22
// Project: https://github.com/Microsoft/ApplicationInsights-node.js
33
// Definitions by: Scott Southwood <https://github.com/scsouthw/>
4-
// Definitions: https://github.com/borisyankov/DefinitelyTyped
4+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
55

66
interface AutoCollectConsole {
77
constructor(client: Client): AutoCollectConsole;
@@ -28,7 +28,7 @@ interface AutoCollectRequests {
2828
}
2929

3030

31-
declare module ContractsModule {
31+
declare namespace ContractsModule {
3232
enum DataPointType {
3333
Measurement = 0,
3434
Aggregation = 1,
@@ -338,7 +338,9 @@ interface Client {
338338
* @param max the max sample for this set
339339
* @param stdDev the standard deviation of the set
340340
*/
341-
trackMetric(name: string, value: number, count?:number, min?: number, max?: number, stdDev?: number): void;
341+
trackMetric(name: string, value: number, count?:number, min?: number, max?: number, stdDev?: number, properties?: {
342+
[key: string]: string;
343+
}): void;
342344
trackRequest(request: any /* http.ServerRequest */, response: any /* http.ServerResponse */, properties?: {
343345
[key: string]: string;
344346
}): void;
@@ -352,13 +354,13 @@ interface Client {
352354
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
353355
* @param dependencyKind ContractsModule.DependencyKind of this dependency. Defaults to Other.
354356
* @param async True if the dependency was executed asynchronously, false otherwise. Defaults to false
355-
* @param dependencySource ContractsModule.DependencySourceType of this dependency. Defaults to Undefined.
357+
* @param dependencySource ContractsModule.DependencySourceType of this dependency. Defaults to Undefined.
356358
*/
357359
trackDependency(name: string, commandName: string, elapsedTimeMs: number, success: boolean, dependencyTypeName?: string, properties?: {}, dependencyKind?: any, async?: boolean, dependencySource?: number): void;
358360
/**
359361
* Immediately send all queued telemetry.
360362
*/
361-
sendPendingData(): void;
363+
sendPendingData(callback?: (response: string) => void): void;
362364
getEnvelope(data: ContractsModule.Data<ContractsModule.Domain>, tagOverrides?: {
363365
[key: string]: string;
364366
}): ContractsModule.Envelope;
@@ -409,66 +411,58 @@ interface Sender {
409411
* The singleton meta interface for the default client of the client. This interface is used to setup/start and configure
410412
* the auto-collection behavior of the application insights module.
411413
*/
412-
declare class ApplicationInsights {
413-
static client: Client;
414-
private static _isConsole;
415-
private static _isExceptions;
416-
private static _isPerformance;
417-
private static _isRequests;
418-
private static _console;
419-
private static _exceptions;
420-
private static _performance;
421-
private static _requests;
422-
private static _isStarted;
414+
interface ApplicationInsights {
415+
client: Client;
423416
/**
424417
* Initializes a client with the given instrumentation key, if this is not specified, the value will be
425418
* read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY
426419
* @returns {ApplicationInsights/Client} a new client
427420
*/
428-
static getClient(instrumentationKey?: string): Client;
421+
getClient(instrumentationKey?: string): Client;
429422
/**
430423
* Initializes the default client of the client and sets the default configuration
431424
* @param instrumentationKey the instrumentation key to use. Optional, if this is not specified, the value will be
432425
* read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY
433426
* @returns {ApplicationInsights} this interface
434427
*/
435-
static setup(instrumentationKey?: string): typeof ApplicationInsights;
428+
setup(instrumentationKey?: string): ApplicationInsights;
436429
/**
437430
* Starts automatic collection of telemetry. Prior to calling start no telemetry will be collected
438431
* @returns {ApplicationInsights} this interface
439432
*/
440-
static start(): typeof ApplicationInsights;
433+
start(): ApplicationInsights;
441434
/**
442435
* Sets the state of console tracking (enabled by default)
443436
* @param value if true console activity will be sent to Application Insights
444437
* @returns {ApplicationInsights} this interface
445438
*/
446-
static setAutoCollectConsole(value: boolean): typeof ApplicationInsights;
439+
setAutoCollectConsole(value: boolean): ApplicationInsights;
447440
/**
448441
* Sets the state of exception tracking (enabled by default)
449442
* @param value if true uncaught exceptions will be sent to Application Insights
450443
* @returns {ApplicationInsights} this interface
451444
*/
452-
static setAutoCollectExceptions(value: boolean): typeof ApplicationInsights;
445+
setAutoCollectExceptions(value: boolean): ApplicationInsights;
453446
/**
454447
* Sets the state of performance tracking (enabled by default)
455448
* @param value if true performance counters will be collected every second and sent to Application Insights
456449
* @returns {ApplicationInsights} this interface
457450
*/
458-
static setAutoCollectPerformance(value: boolean): typeof ApplicationInsights;
451+
setAutoCollectPerformance(value: boolean): ApplicationInsights;
459452
/**
460453
* Sets the state of request tracking (enabled by default)
461454
* @param value if true requests will be sent to Application Insights
462455
* @returns {ApplicationInsights} this interface
463456
*/
464-
static setAutoCollectRequests(value: boolean): typeof ApplicationInsights;
457+
setAutoCollectRequests(value: boolean): ApplicationInsights;
465458
/**
466459
* Enables verbose debug logging
467460
* @returns {ApplicationInsights} this interface
468461
*/
469-
static enableVerboseLogging(): typeof ApplicationInsights;
462+
enableVerboseLogging(): ApplicationInsights;
470463
}
471464

472465
declare module "applicationinsights" {
473-
export = ApplicationInsights;
474-
}
466+
const applicationinsights: ApplicationInsights;
467+
export = applicationinsights;
468+
}

0 commit comments

Comments
 (0)