0

is it possible change my type dynamically based on a function call, like the URLSearchParams has?

here's what i am triyng to:

interface X<T> {
  get: (Uparams?: URLSearchParams) => Promise<
    Uparams.has('page') extends true ? T[] : PaginatedReturn<T>
  >;
}
Neto Braghetto
  • 1,371
  • 1
  • 15
  • 30

0 Answers0