Skip to content

Commit

Permalink
Patch(functions): improved tracing function type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Akalanka47000 authored Jan 10, 2024
1 parent 1aca789 commit af282e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/functions/types/traced.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function trace(fn: Function, loggable?: Record<any, any>): Promise<void>;
* @param loggable Object with extra information to be logged
* @returns Returns the new function
*/
export function traced(fn: Function, loggable?: Record<any, any>): Function;
export function traced<T extends (...args: any[]) => any>(fn: T, loggable?: Record<any, any>): T;

/**
* @description Invokes the given function with tracing. Tracing is however ignored if the function is an anonymous function
Expand All @@ -28,7 +28,7 @@ export function cleanTrace(fn: Function, loggable?: Record<any, any>): Promise<v
* @param loggable Object with extra information to be logged
* @returns Returns the new function
*/
export function cleanTraced(fn: Function, loggable?: Record<any, any>): Function;
export function cleanTraced<T extends (...args: any[]) => any>(fn: T, loggable?: Record<any, any>): T;

export default {
traced,
Expand Down

0 comments on commit af282e7

Please sign in to comment.