|
1 | 1 | import Vue from 'vue' |
2 | | -import { ResponsePromise, Options, BeforeRequestHook, AfterResponseHook, HTTPError, JSONValue } from 'ky' |
| 2 | +import { ResponsePromise, Options, BeforeRequestHook, AfterResponseHook, HTTPError } from 'ky' |
3 | 3 | import './vuex' |
4 | 4 |
|
5 | 5 | type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; |
@@ -61,60 +61,60 @@ interface NuxtHTTPInstance { |
61 | 61 | * @param url - `Request` object, `URL` object, or URL string. |
62 | 62 | * @returns Promise that resolves to JSON parsed value. |
63 | 63 | */ |
64 | | - $get<T = JSONValue>(url: Request | URL | string, options?: Omit<Options, 'body'>): Promise<T>; |
| 64 | + $get<T = unknown>(url: Request | URL | string, options?: Omit<Options, 'body'>): Promise<T>; |
65 | 65 |
|
66 | 66 | /** |
67 | 67 | * Fetches the `url` with the option `{method: 'post'}`. |
68 | 68 | * |
69 | 69 | * @param url - `Request` object, `URL` object, or URL string. |
70 | 70 | * @returns Promise that resolves to JSON parsed value. |
71 | 71 | */ |
72 | | - $post<T = JSONValue>(url: Request | URL | string, body?: RequestBody, options?: Options): Promise<T>; |
| 72 | + $post<T = unknown>(url: Request | URL | string, body?: RequestBody, options?: Options): Promise<T>; |
73 | 73 |
|
74 | 74 | /** |
75 | 75 | * Fetches the `url` with the option `{method: 'put'}`. |
76 | 76 | * |
77 | 77 | * @param url - `Request` object, `URL` object, or URL string. |
78 | 78 | * @returns Promise that resolves to JSON parsed value. |
79 | 79 | */ |
80 | | - $put<T = JSONValue>(url: Request | URL | string, body?: RequestBody, options?: Options): Promise<T>; |
| 80 | + $put<T = unknown>(url: Request | URL | string, body?: RequestBody, options?: Options): Promise<T>; |
81 | 81 |
|
82 | 82 | /** |
83 | 83 | * Fetches the `url` with the option `{method: 'patch'}`. |
84 | 84 | * |
85 | 85 | * @param url - `Request` object, `URL` object, or URL string. |
86 | 86 | * @returns Promise that resolves to JSON parsed value. |
87 | 87 | */ |
88 | | - $patch<T = JSONValue>(url: Request | URL | string, body?: RequestBody, options?: Options): Promise<T>; |
| 88 | + $patch<T = unknown>(url: Request | URL | string, body?: RequestBody, options?: Options): Promise<T>; |
89 | 89 |
|
90 | 90 | /** |
91 | 91 | * Fetches the `url` with the option `{method: 'head'}`. |
92 | 92 | * |
93 | 93 | * @param url - `Request` object, `URL` object, or URL string. |
94 | 94 | * @returns Promise that resolves to JSON parsed value. |
95 | 95 | */ |
96 | | - $head<T = JSONValue>(url: Request | URL | string, options?: Omit<Options, 'body'>): Promise<T>; |
| 96 | + $head<T = unknown>(url: Request | URL | string, options?: Omit<Options, 'body'>): Promise<T>; |
97 | 97 |
|
98 | 98 | /** |
99 | 99 | * Fetches the `url` with the option `{method: 'delete'}`. |
100 | 100 | * |
101 | 101 | * @param url - `Request` object, `URL` object, or URL string. |
102 | 102 | * @returns Promise that resolves to JSON parsed value. |
103 | 103 | */ |
104 | | - $delete<T = JSONValue>(url: Request | URL | string, options?: Options): Promise<T>; |
| 104 | + $delete<T = unknown>(url: Request | URL | string, options?: Options): Promise<T>; |
105 | 105 |
|
106 | 106 |
|
107 | 107 | /** |
108 | 108 | * Set a header on all subsequent requests. |
109 | 109 | * @param name - Header name. |
110 | | - * @param value - Heade value. |
| 110 | + * @param value - Header value. |
111 | 111 | */ |
112 | 112 | setHeader(name: string, value?: string | false): void |
113 | 113 |
|
114 | 114 | /** |
115 | 115 | * Set `Authorization` header on all subsequent requests. |
116 | 116 | * @param name - Header name. |
117 | | - * @param value - Heade value. |
| 117 | + * @param value - Header value. |
118 | 118 | */ |
119 | 119 | setToken(token: string | false, type?: string): void |
120 | 120 |
|
|
0 commit comments