mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
786 B
27 lines
786 B
2 years ago
|
import type { Api } from 'nocodb-sdk'
|
||
|
import type { Ref } from 'vue'
|
||
|
import type { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'
|
||
|
import type { EventHook, MaybeRef } from '@vueuse/core'
|
||
|
|
||
|
export interface UseApiReturn<D = any, R = any> {
|
||
|
api: Api<any>
|
||
|
isLoading: Ref<boolean>
|
||
|
error: Ref<AxiosError<D, R> | null>
|
||
|
response: Ref<AxiosResponse<D, R> | null>
|
||
|
onError: EventHook<AxiosError<D, R>>['on']
|
||
|
onResponse: EventHook<AxiosResponse<D, R>>['on']
|
||
|
}
|
||
|
|
||
|
/** {@link Api} options */
|
||
|
export interface CreateApiOptions {
|
||
|
baseURL?: string
|
||
|
}
|
||
|
|
||
|
export interface UseApiProps<D = any> {
|
||
|
/** additional axios config for requests */
|
||
|
axiosConfig?: MaybeRef<AxiosRequestConfig<D>>
|
||
|
/** {@link Api} options */
|
||
|
apiOptions?: CreateApiOptions
|
||
2 years ago
|
useGlobalInstance?: boolean
|
||
2 years ago
|
}
|