/** * Importing npm packages */ /** * Importing user defined packages */ /** * Defining types */ export type TryResult = { success: true; data: TResult; } | { success: false; error: TError; }; /** * Declaring the constants */ export declare function throwError(error: Error): never; export declare function tryCatch(fn: () => Promise): Promise>; export declare function tryCatch(fn: () => TResult): TryResult; export declare function withThis(fn: (context: T, ...args: A) => R): (this: T, ...args: A) => R;