diff --git a/types/index.d.ts b/types/index.d.ts index 63e9b37..b124fc5 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,5 +1,5 @@ import Vue from 'vue' -import { ResponsePromise, Options, BeforeRequestHook, AfterResponseHook, HTTPError, JSONValue } from 'ky' +import { ResponsePromise, Options, BeforeRequestHook, AfterResponseHook, HTTPError } from 'ky' import './vuex' type Omit = Pick>; @@ -61,7 +61,7 @@ interface NuxtHTTPInstance { * @param url - `Request` object, `URL` object, or URL string. * @returns Promise that resolves to JSON parsed value. */ - $get(url: Request | URL | string, options?: Omit): Promise; + $get(url: Request | URL | string, options?: Omit): Promise; /** * Fetches the `url` with the option `{method: 'post'}`. @@ -69,7 +69,7 @@ interface NuxtHTTPInstance { * @param url - `Request` object, `URL` object, or URL string. * @returns Promise that resolves to JSON parsed value. */ - $post(url: Request | URL | string, body?: RequestBody, options?: Options): Promise; + $post(url: Request | URL | string, body?: RequestBody, options?: Options): Promise; /** * Fetches the `url` with the option `{method: 'put'}`. @@ -77,7 +77,7 @@ interface NuxtHTTPInstance { * @param url - `Request` object, `URL` object, or URL string. * @returns Promise that resolves to JSON parsed value. */ - $put(url: Request | URL | string, body?: RequestBody, options?: Options): Promise; + $put(url: Request | URL | string, body?: RequestBody, options?: Options): Promise; /** * Fetches the `url` with the option `{method: 'patch'}`. @@ -85,7 +85,7 @@ interface NuxtHTTPInstance { * @param url - `Request` object, `URL` object, or URL string. * @returns Promise that resolves to JSON parsed value. */ - $patch(url: Request | URL | string, body?: RequestBody, options?: Options): Promise; + $patch(url: Request | URL | string, body?: RequestBody, options?: Options): Promise; /** * Fetches the `url` with the option `{method: 'head'}`. @@ -93,7 +93,7 @@ interface NuxtHTTPInstance { * @param url - `Request` object, `URL` object, or URL string. * @returns Promise that resolves to JSON parsed value. */ - $head(url: Request | URL | string, options?: Omit): Promise; + $head(url: Request | URL | string, options?: Omit): Promise; /** * Fetches the `url` with the option `{method: 'delete'}`. @@ -101,20 +101,20 @@ interface NuxtHTTPInstance { * @param url - `Request` object, `URL` object, or URL string. * @returns Promise that resolves to JSON parsed value. */ - $delete(url: Request | URL | string, options?: Options): Promise; + $delete(url: Request | URL | string, options?: Options): Promise; /** * Set a header on all subsequent requests. * @param name - Header name. - * @param value - Heade value. + * @param value - Header value. */ setHeader(name: string, value?: string | false): void /** * Set `Authorization` header on all subsequent requests. * @param name - Header name. - * @param value - Heade value. + * @param value - Header value. */ setToken(token: string | false, type?: string): void