2018-09-21 07:07:46 +00:00
|
|
|
import { AxiosInstance, AxiosRequestConfig } from 'axios'
|
2018-05-21 08:40:31 +00:00
|
|
|
import Vue from 'vue'
|
|
|
|
|
|
|
|
interface NuxtAxiosInstance extends AxiosInstance {
|
2018-09-21 07:07:46 +00:00
|
|
|
$request<T = any>(config: AxiosRequestConfig): Promise<T>
|
|
|
|
$get<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>
|
|
|
|
$delete<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>
|
|
|
|
$head<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>
|
|
|
|
$options<T = any>(url: string, config?: AxiosRequestConfig): Promise<T>
|
|
|
|
$post<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>
|
|
|
|
$put<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>
|
|
|
|
$patch<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T>
|
2018-05-21 08:40:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
declare module 'vue/types/vue' {
|
|
|
|
interface Vue {
|
|
|
|
$axios: NuxtAxiosInstance
|
|
|
|
}
|
|
|
|
}
|