1
- // Type definitions for Application Insights v0.15.7
1
+ // Type definitions for Application Insights v0.15.12
2
2
// Project: https://github.com/Microsoft/ApplicationInsights-node.js
3
3
// Definitions by: Scott Southwood <https://github.com/scsouthw/>
4
- // Definitions: https://github.com/borisyankov /DefinitelyTyped
4
+ // Definitions: https://github.com/DefinitelyTyped /DefinitelyTyped
5
5
6
6
interface AutoCollectConsole {
7
7
constructor ( client : Client ) : AutoCollectConsole ;
@@ -28,7 +28,7 @@ interface AutoCollectRequests {
28
28
}
29
29
30
30
31
- declare module ContractsModule {
31
+ declare namespace ContractsModule {
32
32
enum DataPointType {
33
33
Measurement = 0 ,
34
34
Aggregation = 1 ,
@@ -338,7 +338,9 @@ interface Client {
338
338
* @param max the max sample for this set
339
339
* @param stdDev the standard deviation of the set
340
340
*/
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 ;
342
344
trackRequest ( request : any /* http.ServerRequest */ , response : any /* http.ServerResponse */ , properties ?: {
343
345
[ key : string ] : string ;
344
346
} ) : void ;
@@ -352,13 +354,13 @@ interface Client {
352
354
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
353
355
* @param dependencyKind ContractsModule.DependencyKind of this dependency. Defaults to Other.
354
356
* @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.
356
358
*/
357
359
trackDependency ( name : string , commandName : string , elapsedTimeMs : number , success : boolean , dependencyTypeName ?: string , properties ?: { } , dependencyKind ?: any , async ?: boolean , dependencySource ?: number ) : void ;
358
360
/**
359
361
* Immediately send all queued telemetry.
360
362
*/
361
- sendPendingData ( ) : void ;
363
+ sendPendingData ( callback ?: ( response : string ) => void ) : void ;
362
364
getEnvelope ( data : ContractsModule . Data < ContractsModule . Domain > , tagOverrides ?: {
363
365
[ key : string ] : string ;
364
366
} ) : ContractsModule . Envelope ;
@@ -409,66 +411,58 @@ interface Sender {
409
411
* The singleton meta interface for the default client of the client. This interface is used to setup/start and configure
410
412
* the auto-collection behavior of the application insights module.
411
413
*/
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 ;
423
416
/**
424
417
* Initializes a client with the given instrumentation key, if this is not specified, the value will be
425
418
* read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY
426
419
* @returns {ApplicationInsights/Client } a new client
427
420
*/
428
- static getClient ( instrumentationKey ?: string ) : Client ;
421
+ getClient ( instrumentationKey ?: string ) : Client ;
429
422
/**
430
423
* Initializes the default client of the client and sets the default configuration
431
424
* @param instrumentationKey the instrumentation key to use. Optional, if this is not specified, the value will be
432
425
* read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY
433
426
* @returns {ApplicationInsights } this interface
434
427
*/
435
- static setup ( instrumentationKey ?: string ) : typeof ApplicationInsights ;
428
+ setup ( instrumentationKey ?: string ) : ApplicationInsights ;
436
429
/**
437
430
* Starts automatic collection of telemetry. Prior to calling start no telemetry will be collected
438
431
* @returns {ApplicationInsights } this interface
439
432
*/
440
- static start ( ) : typeof ApplicationInsights ;
433
+ start ( ) : ApplicationInsights ;
441
434
/**
442
435
* Sets the state of console tracking (enabled by default)
443
436
* @param value if true console activity will be sent to Application Insights
444
437
* @returns {ApplicationInsights } this interface
445
438
*/
446
- static setAutoCollectConsole ( value : boolean ) : typeof ApplicationInsights ;
439
+ setAutoCollectConsole ( value : boolean ) : ApplicationInsights ;
447
440
/**
448
441
* Sets the state of exception tracking (enabled by default)
449
442
* @param value if true uncaught exceptions will be sent to Application Insights
450
443
* @returns {ApplicationInsights } this interface
451
444
*/
452
- static setAutoCollectExceptions ( value : boolean ) : typeof ApplicationInsights ;
445
+ setAutoCollectExceptions ( value : boolean ) : ApplicationInsights ;
453
446
/**
454
447
* Sets the state of performance tracking (enabled by default)
455
448
* @param value if true performance counters will be collected every second and sent to Application Insights
456
449
* @returns {ApplicationInsights } this interface
457
450
*/
458
- static setAutoCollectPerformance ( value : boolean ) : typeof ApplicationInsights ;
451
+ setAutoCollectPerformance ( value : boolean ) : ApplicationInsights ;
459
452
/**
460
453
* Sets the state of request tracking (enabled by default)
461
454
* @param value if true requests will be sent to Application Insights
462
455
* @returns {ApplicationInsights } this interface
463
456
*/
464
- static setAutoCollectRequests ( value : boolean ) : typeof ApplicationInsights ;
457
+ setAutoCollectRequests ( value : boolean ) : ApplicationInsights ;
465
458
/**
466
459
* Enables verbose debug logging
467
460
* @returns {ApplicationInsights } this interface
468
461
*/
469
- static enableVerboseLogging ( ) : typeof ApplicationInsights ;
462
+ enableVerboseLogging ( ) : ApplicationInsights ;
470
463
}
471
464
472
465
declare module "applicationinsights" {
473
- export = ApplicationInsights ;
474
- }
466
+ const applicationinsights : ApplicationInsights ;
467
+ export = applicationinsights ;
468
+ }
0 commit comments