Skip to content

Commit

Permalink
fix: simplify the Response utility type
Browse files Browse the repository at this point in the history
  • Loading branch information
sandros94 committed May 28, 2024
1 parent dbf4171 commit 23634d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/runtime/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface Overrides {
token?: string
}

type OKResponse<T = unknown[]> = {
type OKResponse<T> = {
result: T
status: 'OK'
time: string
Expand All @@ -23,4 +23,5 @@ type ErrorResponse = {
time: string
}

export type Response<T> = OKResponse<T> | ErrorResponse
export type Response<T> = Array<(OKResponse<T> | ErrorResponse)>
export type Res<T> = Response<T>

0 comments on commit 23634d4

Please sign in to comment.