Skip to content

Commit aff7a35

Browse files
Lisiaditopi0
authored andcommitted
fix(types): replace JSONValue import from ky to unknown` (#63)
1 parent a56ca2f commit aff7a35

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

types/index.d.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Vue from 'vue'
2-
import { ResponsePromise, Options, BeforeRequestHook, AfterResponseHook, HTTPError, JSONValue } from 'ky'
2+
import { ResponsePromise, Options, BeforeRequestHook, AfterResponseHook, HTTPError } from 'ky'
33
import './vuex'
44

55
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
@@ -61,60 +61,60 @@ interface NuxtHTTPInstance {
6161
* @param url - `Request` object, `URL` object, or URL string.
6262
* @returns Promise that resolves to JSON parsed value.
6363
*/
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>;
6565

6666
/**
6767
* Fetches the `url` with the option `{method: 'post'}`.
6868
*
6969
* @param url - `Request` object, `URL` object, or URL string.
7070
* @returns Promise that resolves to JSON parsed value.
7171
*/
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>;
7373

7474
/**
7575
* Fetches the `url` with the option `{method: 'put'}`.
7676
*
7777
* @param url - `Request` object, `URL` object, or URL string.
7878
* @returns Promise that resolves to JSON parsed value.
7979
*/
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>;
8181

8282
/**
8383
* Fetches the `url` with the option `{method: 'patch'}`.
8484
*
8585
* @param url - `Request` object, `URL` object, or URL string.
8686
* @returns Promise that resolves to JSON parsed value.
8787
*/
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>;
8989

9090
/**
9191
* Fetches the `url` with the option `{method: 'head'}`.
9292
*
9393
* @param url - `Request` object, `URL` object, or URL string.
9494
* @returns Promise that resolves to JSON parsed value.
9595
*/
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>;
9797

9898
/**
9999
* Fetches the `url` with the option `{method: 'delete'}`.
100100
*
101101
* @param url - `Request` object, `URL` object, or URL string.
102102
* @returns Promise that resolves to JSON parsed value.
103103
*/
104-
$delete<T = JSONValue>(url: Request | URL | string, options?: Options): Promise<T>;
104+
$delete<T = unknown>(url: Request | URL | string, options?: Options): Promise<T>;
105105

106106

107107
/**
108108
* Set a header on all subsequent requests.
109109
* @param name - Header name.
110-
* @param value - Heade value.
110+
* @param value - Header value.
111111
*/
112112
setHeader(name: string, value?: string | false): void
113113

114114
/**
115115
* Set `Authorization` header on all subsequent requests.
116116
* @param name - Header name.
117-
* @param value - Heade value.
117+
* @param value - Header value.
118118
*/
119119
setToken(token: string | false, type?: string): void
120120

0 commit comments

Comments
 (0)