From 6e27f6c85170b599f7b421fda34d3c290c1f5db8 Mon Sep 17 00:00:00 2001 From: Kir_Antipov Date: Fri, 23 Dec 2022 09:15:42 +0000 Subject: [PATCH] Made a type to indicate that `await` should be used --- src/utils/types/awaitable.ts | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/utils/types/awaitable.ts diff --git a/src/utils/types/awaitable.ts b/src/utils/types/awaitable.ts new file mode 100644 index 0000000..d7a4a84 --- /dev/null +++ b/src/utils/types/awaitable.ts @@ -0,0 +1,6 @@ +/** + * Represents a type that can either be a value of type `T` or a promise of type `T`. + * + * @template T - The type of value that may be awaited. + */ +export type Awaitable = T | Promise;