Skip to content

Commit

Permalink
Update typing for tracer.trace
Browse files Browse the repository at this point in the history
If options are not specified (and therefore if `options.orphanable !== false`) then `span` and the `done` callback are guaranteed to be set
  • Loading branch information
janeklb authored and Stephen Belanger committed Jan 2, 2024
1 parent 7bb99d1 commit 48f58f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export declare interface Tracer extends opentracing.Tracer {
* unless there is already an active span or `childOf` option. Note that this
* option is deprecated and has been removed in version 4.0.
*/
trace<T> (name: string, fn: (span?: Span, fn?: (error?: Error) => any) => T): T;
trace<T> (name: string, fn: (span: Span) => T): T;
trace<T> (name: string, fn: (span: Span, done: (error?: Error) => string) => T): T;
trace<T> (name: string, options: TraceOptions & SpanOptions, fn: (span?: Span, done?: (error?: Error) => string) => T): T;

/**
Expand Down

0 comments on commit 48f58f6

Please sign in to comment.