ReturnType<T> lấy return type của function T mà không cần khai báo lại: type Result = ReturnType<typeof fetchUser> tự cập nhật khi hàm thay đổi. Awaited<T> unwrap Promise đệ quy: Awaited<Promise<string>> cho ra string, Awaited<Promise<Promise<number>>> cho ra number.
Kết hợp cả hai cho async functions:
type Data = Awaited<ReturnType<typeof fetchData>>