feat: custom get response data

This commit is contained in:
Innei
2024-03-22 23:10:33 +08:00
parent 3f0a330112
commit 1d1e3c580f
2 changed files with 9 additions and 4 deletions

View File

@@ -11,5 +11,10 @@ interface IClientOptions {
}
customThrowResponseError: <T extends Error = Error>(err: any) => T
transformResponse: <T = any>(data: any) => T
/**
*
* @default (res) => res.data
*/
getDataFromResponse: <T = any>(response: unknown) => T
}
export type ClientOptions = Partial<IClientOptions>