Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
Signed-off-by: naseemkullah <naseem@transit.app>
  • Loading branch information
naseemkullah committed May 2, 2021
1 parent 1a3afad commit 8b4e002
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/trace/tracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,29 @@ export interface Tracer {
* @param name The name of the span
* @param [options] SpanOptions used for span creation
* @param [context] Context to use to extract parent
* @param callback called in the context of the span and receives the newly created span as an argument
* @returns what is returned by the callback
* @param fn function called in the context of the span and receives the newly created span as an argument
* @param thisArg optional receiver to be used for calling fn
* @param args optional arguments forwarded to fn
* @returns return value of fn
* @example
* const span = tracer.startActiveSpan('op', {}, undefined, (err, span) => {
* const span = tracer.startActiveSpan('op', span => {
* span.setAttribute('key', 'value');
* span.end();
* });
*/
startActiveSpan<F extends (err: Error, span: Span) => ReturnType<F>>(
startActiveSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
callback: F
fn: F
): ReturnType<F>;
startActiveSpan<F extends (err: Error, span: Span) => ReturnType<F>>(
startActiveSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
options: SpanOptions,
callback: F
fn: F
): ReturnType<F>;
startActiveSpan<F extends (err: Error, span: Span) => ReturnType<F>>(
startActiveSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
options: SpanOptions,
context: Context,
callback: F
fn: F
): ReturnType<F>;
}

0 comments on commit 8b4e002

Please sign in to comment.