diff --git a/src/utils/types/promise-type.ts b/src/utils/types/promise-type.ts new file mode 100644 index 0000000..233d7c0 --- /dev/null +++ b/src/utils/types/promise-type.ts @@ -0,0 +1,6 @@ +/** + * Obtains the underlying type of a {@link Promise}. + * + * @template T - A `Promise` type to extract the underlying type from. + */ +export type PromiseType> = T extends Promise ? U : never;