From 8b4e0026a53c16b0aca245869c5cd6d826fefc86 Mon Sep 17 00:00:00 2001 From: naseemkullah Date: Sun, 2 May 2021 12:58:32 -0400 Subject: [PATCH] fix: types Signed-off-by: naseemkullah --- src/trace/tracer.ts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/trace/tracer.ts b/src/trace/tracer.ts index 2779a1d0..3b97cbb0 100644 --- a/src/trace/tracer.ts +++ b/src/trace/tracer.ts @@ -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 ReturnType>( + startActiveSpan ReturnType>( name: string, - callback: F + fn: F ): ReturnType; - startActiveSpan ReturnType>( + startActiveSpan ReturnType>( name: string, options: SpanOptions, - callback: F + fn: F ): ReturnType; - startActiveSpan ReturnType>( + startActiveSpan ReturnType>( name: string, options: SpanOptions, context: Context, - callback: F + fn: F ): ReturnType; }