diff --git a/src/utils/functions/async-func.ts b/src/utils/functions/async-func.ts new file mode 100644 index 0000000..0ce92ca --- /dev/null +++ b/src/utils/functions/async-func.ts @@ -0,0 +1,16 @@ +/** + * Represents an async function that takes any number of arguments of type `P` and returns a value of type `R`. + * + * @template P - An array of parameter types. + * @template R - The return type of the function. + */ +export interface AsyncFunc
{
+ /**
+ * Calls the function with the specified arguments.
+ *
+ * @param args The arguments to pass to the function.
+ *
+ * @returns A promise resolving to the result of calling the function.
+ */
+ (...args: P): Promise {
+ /**
+ * Calls the function with the specified arguments.
+ *
+ * @param args The arguments to pass to the function.
+ *
+ * @returns The result of calling the function.
+ */
+ (...args: P): R;
+}