@@ -6,7 +6,7 @@ export = agent;
6
6
7
7
declare const agent : Agent ;
8
8
9
- declare class Agent implements Taggable , StartSpanFn {
9
+ export declare class Agent implements Taggable , StartSpanFn {
10
10
// Configuration
11
11
start ( options ?: AgentConfigOptions ) : Agent ;
12
12
isStarted ( ) : boolean ;
@@ -40,11 +40,6 @@ declare class Agent implements Taggable, StartSpanFn {
40
40
41
41
// Distributed Tracing
42
42
currentTraceparent : string | null ;
43
- currentTraceIds : {
44
- 'trace.id' ?: string ;
45
- 'transaction.id' ?: string ;
46
- 'span.id' ?: string ;
47
- }
48
43
49
44
// Transactions
50
45
startTransaction (
@@ -120,7 +115,7 @@ declare class Agent implements Taggable, StartSpanFn {
120
115
registerMetric ( name : string , labels : Labels , callback : Function ) : void ;
121
116
}
122
117
123
- declare class GenericSpan implements Taggable {
118
+ export declare class GenericSpan implements Taggable {
124
119
// The following properties and methods are currently not documented as their API isn't considered official:
125
120
// timestamp, ended, id, traceId, parentId, sampled, duration()
126
121
@@ -134,7 +129,7 @@ declare class GenericSpan implements Taggable {
134
129
addLabels ( labels : Labels ) : boolean ;
135
130
}
136
131
137
- declare class Transaction extends GenericSpan implements StartSpanFn {
132
+ export declare class Transaction extends GenericSpan implements StartSpanFn {
138
133
// The following properties and methods are currently not documented as their API isn't considered official:
139
134
// setUserContext(), setCustomContext(), toJSON(), setDefaultName(), setDefaultNameFromRequest()
140
135
@@ -167,7 +162,7 @@ declare class Transaction extends GenericSpan implements StartSpanFn {
167
162
end ( result ?: string | number | null , endTime ?: number ) : void ;
168
163
}
169
164
170
- declare class Span extends GenericSpan {
165
+ export declare class Span extends GenericSpan {
171
166
// The following properties and methods are currently not documented as their API isn't considered official:
172
167
// customStackTrace(), setDbContext()
173
168
@@ -177,7 +172,7 @@ declare class Span extends GenericSpan {
177
172
end ( endTime ?: number ) : void ;
178
173
}
179
174
180
- interface AgentConfigOptions {
175
+ export interface AgentConfigOptions {
181
176
abortedErrorThreshold ?: string ; // Also support `number`, but as we're removing this functionality soon, there's no need to advertise it
182
177
active ?: boolean ;
183
178
addPatch ?: KeyValueConfig ;
@@ -230,7 +225,7 @@ interface AgentConfigOptions {
230
225
verifyServerCert ?: boolean ;
231
226
}
232
227
233
- interface CaptureErrorOptions {
228
+ export interface CaptureErrorOptions {
234
229
request ?: IncomingMessage ;
235
230
response ?: ServerResponse ;
236
231
timestamp ?: number ;
@@ -242,22 +237,22 @@ interface CaptureErrorOptions {
242
237
message ?: string ;
243
238
}
244
239
245
- interface Labels {
240
+ export interface Labels {
246
241
[ key : string ] : LabelValue ;
247
242
}
248
243
249
- interface UserObject {
244
+ export interface UserObject {
250
245
id ?: string | number ;
251
246
username ?: string ;
252
247
email ?: string ;
253
248
}
254
249
255
- interface ParameterizedMessageObject {
250
+ export interface ParameterizedMessageObject {
256
251
message : string ;
257
252
params : Array < any > ;
258
253
}
259
254
260
- interface Logger {
255
+ export interface Logger {
261
256
fatal ( msg : string , ...args : any [ ] ) : void ;
262
257
fatal ( obj : { } , msg ?: string , ...args : any [ ] ) : void ;
263
258
error ( msg : string , ...args : any [ ] ) : void ;
@@ -273,39 +268,39 @@ interface Logger {
273
268
[ propName : string ] : any ;
274
269
}
275
270
276
- interface TransactionOptions {
271
+ export interface TransactionOptions {
277
272
startTime ?: number ;
278
273
childOf ?: Transaction | Span | string ;
279
274
}
280
275
281
- interface SpanOptions {
276
+ export interface SpanOptions {
282
277
childOf ?: Transaction | Span | string ;
283
278
}
284
279
285
- type CaptureBody = 'off' | 'errors' | 'transactions' | 'all' ;
286
- type CaptureErrorLogStackTraces = 'never' | 'messages' | 'always' ;
287
- type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal' ;
280
+ export type CaptureBody = 'off' | 'errors' | 'transactions' | 'all' ;
281
+ export type CaptureErrorLogStackTraces = 'never' | 'messages' | 'always' ;
282
+ export type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal' ;
288
283
289
- type CaptureErrorCallback = ( err : Error | null , id : string ) => void ;
290
- type FilterFn = ( payload : Payload ) => Payload | boolean | void ;
291
- type LabelValue = string | number | boolean | null | undefined ;
292
- type KeyValueConfig = string | Labels | Array < Array < LabelValue > >
284
+ export type CaptureErrorCallback = ( err : Error | null , id : string ) => void ;
285
+ export type FilterFn = ( payload : Payload ) => Payload | boolean | void ;
286
+ export type LabelValue = string | number | boolean | null | undefined ;
287
+ export type KeyValueConfig = string | Labels | Array < Array < LabelValue > >
293
288
294
- type Payload = { [ propName : string ] : any }
289
+ export type Payload = { [ propName : string ] : any }
295
290
296
- type PatchHandler = ( exports : any , agent : Agent , options : PatchOptions ) => any ;
291
+ export type PatchHandler = ( exports : any , agent : Agent , options : PatchOptions ) => any ;
297
292
298
- interface PatchOptions {
293
+ export interface PatchOptions {
299
294
version : string | undefined ,
300
295
enabled : boolean
301
296
}
302
297
303
- interface Taggable {
298
+ export interface Taggable {
304
299
setLabel ( name : string , value : LabelValue ) : boolean ;
305
300
addLabels ( labels : Labels ) : boolean ;
306
301
}
307
302
308
- interface StartSpanFn {
303
+ export interface StartSpanFn {
309
304
startSpan (
310
305
name ?: string | null ,
311
306
options ?: SpanOptions
@@ -331,37 +326,37 @@ interface StartSpanFn {
331
326
}
332
327
333
328
// Inlined from @types /aws-lambda - start
334
- declare namespace AwsLambda {
335
- interface CognitoIdentity {
329
+ export declare namespace AwsLambda {
330
+ export interface CognitoIdentity {
336
331
cognitoIdentityId : string ;
337
332
cognitoIdentityPoolId : string ;
338
333
}
339
334
340
- interface ClientContext {
335
+ export interface ClientContext {
341
336
client : ClientContextClient ;
342
337
custom ?: any ;
343
338
env : ClientContextEnv ;
344
339
}
345
340
346
- interface ClientContextClient {
341
+ export interface ClientContextClient {
347
342
installationId : string ;
348
343
appTitle : string ;
349
344
appVersionName : string ;
350
345
appVersionCode : string ;
351
346
appPackageName : string ;
352
347
}
353
348
354
- interface ClientContextEnv {
349
+ export interface ClientContextEnv {
355
350
platformVersion : string ;
356
351
platform : string ;
357
352
make : string ;
358
353
model : string ;
359
354
locale : string ;
360
355
}
361
356
362
- type Callback < TResult = any > = ( error ?: Error | null | string , result ?: TResult ) => void ;
357
+ export type Callback < TResult = any > = ( error ?: Error | null | string , result ?: TResult ) => void ;
363
358
364
- interface Context {
359
+ export interface Context {
365
360
// Properties
366
361
callbackWaitsForEmptyEventLoop : boolean ;
367
362
functionName : string ;
@@ -385,15 +380,15 @@ declare namespace AwsLambda {
385
380
succeed ( message : string , object : any ) : void ;
386
381
}
387
382
388
- type Handler < TEvent = any , TResult = any > = (
383
+ export type Handler < TEvent = any , TResult = any > = (
389
384
event : TEvent ,
390
385
context : Context ,
391
386
callback : Callback < TResult > ,
392
387
) => void | Promise < TResult > ;
393
388
}
394
389
395
390
// Inlined from @types /connect - start
396
- declare namespace Connect {
397
- type NextFunction = ( err ?: any ) => void ;
398
- type ErrorHandleFunction = ( err : any , req : IncomingMessage , res : ServerResponse , next : NextFunction ) => void ;
391
+ export declare namespace Connect {
392
+ export type NextFunction = ( err ?: any ) => void ;
393
+ export type ErrorHandleFunction = ( err : any , req : IncomingMessage , res : ServerResponse , next : NextFunction ) => void ;
399
394
}
0 commit comments