1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Improved translation response

This commit is contained in:
Zhiyuan Zheng
2022-02-08 22:19:24 +01:00
parent 11c22907af
commit 311020285d
5 changed files with 35 additions and 14 deletions

View File

@ -3,11 +3,19 @@ import haptics from '@components/haptics'
import { AxiosError } from 'axios'
import { QueryFunctionContext, useQuery, UseQueryOptions } from 'react-query'
type Translations = {
provider: string
sourceLanguage: string
text: string[]
}
type Translations =
| {
error: undefined
provider: string
sourceLanguage: string
text: string[]
}
| {
error: string
provider: undefined
sourceLanguage: undefined
text: undefined
}
export type QueryKeyTranslate = [
'Translate',