File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -367,21 +367,28 @@ export function shouldTrace<TContext = unknown>(
367367 /* c8 ignore stop */
368368}
369369
370+ interface TraceLifecycleContext {
371+ error ?: unknown ;
372+ result ?: unknown ;
373+ }
374+
375+ type TraceStartContext < TContext extends TraceLifecycleContext > = Omit <
376+ TContext ,
377+ 'error' | 'result'
378+ > ;
379+
370380/**
371381 * Publish a mixed sync-or-promise operation through `channel`. Caller has
372382 * already verified that a subscriber is attached.
373383 *
374384 * @internal
375385 */
376- export function traceMixed < TResult , TContext = unknown > (
386+ export function traceMixed < TResult , TContext extends TraceLifecycleContext > (
377387 channel : MinimalTracingChannel < TContext > ,
378- contextInput : TContext extends object ? TContext : object ,
388+ contextInput : TraceStartContext < TContext > ,
379389 fn : ( ) => TResult ,
380390) : TResult {
381- const context = contextInput as TContext & {
382- error ?: unknown ;
383- result ?: unknown ;
384- } ;
391+ const context = contextInput as TContext ;
385392
386393 return channel . start . runStores ( context , ( ) => {
387394 let result : TResult ;
You can’t perform that action at this time.
0 commit comments