Comparing version 1.0.24 to 1.0.25
@@ -95,3 +95,3 @@ import { ReactNode } from 'react'; | ||
export declare type NoArgs = () => Promise<any>; | ||
export declare type FetchData = (routeOrBody?: string | BodyInit | object, body?: BodyInit | object) => Promise<any>; | ||
export declare type FetchData<TData> = (routeOrBody?: string | BodyInit | object, body?: BodyInit | object) => Promise<TData>; | ||
export declare type RequestInitJSON = RequestInit & { | ||
@@ -102,11 +102,11 @@ headers: { | ||
}; | ||
export interface ReqMethods { | ||
get: (route?: string) => Promise<any>; | ||
post: FetchData; | ||
patch: FetchData; | ||
put: FetchData; | ||
del: FetchData; | ||
delete: FetchData; | ||
query: (query: string, variables?: BodyInit | object) => Promise<any>; | ||
mutate: (mutation: string, variables?: BodyInit | object) => Promise<any>; | ||
export interface ReqMethods<TData> { | ||
get: (route?: string) => Promise<TData>; | ||
post: FetchData<TData>; | ||
patch: FetchData<TData>; | ||
put: FetchData<TData>; | ||
del: FetchData<TData>; | ||
delete: FetchData<TData>; | ||
query: (query: string, variables?: BodyInit | object) => Promise<TData>; | ||
mutate: (mutation: string, variables?: BodyInit | object) => Promise<TData>; | ||
abort: () => void; | ||
@@ -126,6 +126,6 @@ } | ||
} | ||
export declare type Req<TData = any> = ReqMethods & ReqBase<TData>; | ||
export declare type Req<TData = any> = ReqMethods<TData> & ReqBase<TData>; | ||
export declare type UseFetchArgs = [(string | IncomingOptions | OverwriteGlobalOptions)?, (IncomingOptions | OverwriteGlobalOptions | any[])?, any[]?]; | ||
export declare type UseFetchArrayReturn<TData> = [Req<TData>, Res<TData>, boolean, Error]; | ||
export declare type UseFetchObjectReturn<TData> = ReqBase<TData> & ReqMethods & { | ||
export declare type UseFetchObjectReturn<TData> = ReqBase<TData> & ReqMethods<TData> & { | ||
request: Req<TData>; | ||
@@ -132,0 +132,0 @@ response: Res<TData>; |
@@ -95,3 +95,3 @@ import { ReactNode } from 'react'; | ||
export declare type NoArgs = () => Promise<any>; | ||
export declare type FetchData = (routeOrBody?: string | BodyInit | object, body?: BodyInit | object) => Promise<any>; | ||
export declare type FetchData<TData> = (routeOrBody?: string | BodyInit | object, body?: BodyInit | object) => Promise<TData>; | ||
export declare type RequestInitJSON = RequestInit & { | ||
@@ -102,11 +102,11 @@ headers: { | ||
}; | ||
export interface ReqMethods { | ||
get: (route?: string) => Promise<any>; | ||
post: FetchData; | ||
patch: FetchData; | ||
put: FetchData; | ||
del: FetchData; | ||
delete: FetchData; | ||
query: (query: string, variables?: BodyInit | object) => Promise<any>; | ||
mutate: (mutation: string, variables?: BodyInit | object) => Promise<any>; | ||
export interface ReqMethods<TData> { | ||
get: (route?: string) => Promise<TData>; | ||
post: FetchData<TData>; | ||
patch: FetchData<TData>; | ||
put: FetchData<TData>; | ||
del: FetchData<TData>; | ||
delete: FetchData<TData>; | ||
query: (query: string, variables?: BodyInit | object) => Promise<TData>; | ||
mutate: (mutation: string, variables?: BodyInit | object) => Promise<TData>; | ||
abort: () => void; | ||
@@ -126,6 +126,6 @@ } | ||
} | ||
export declare type Req<TData = any> = ReqMethods & ReqBase<TData>; | ||
export declare type Req<TData = any> = ReqMethods<TData> & ReqBase<TData>; | ||
export declare type UseFetchArgs = [(string | IncomingOptions | OverwriteGlobalOptions)?, (IncomingOptions | OverwriteGlobalOptions | any[])?, any[]?]; | ||
export declare type UseFetchArrayReturn<TData> = [Req<TData>, Res<TData>, boolean, Error]; | ||
export declare type UseFetchObjectReturn<TData> = ReqBase<TData> & ReqMethods & { | ||
export declare type UseFetchObjectReturn<TData> = ReqBase<TData> & ReqMethods<TData> & { | ||
request: Req<TData>; | ||
@@ -132,0 +132,0 @@ response: Res<TData>; |
{ | ||
"name": "use-http", | ||
"version": "1.0.24", | ||
"version": "1.0.25", | ||
"homepage": "https://use-http.com", | ||
@@ -14,3 +14,3 @@ "main": "dist/cjs/index.js", | ||
"urs": "^0.0.8", | ||
"use-ssr": "^1.0.24", | ||
"use-ssr": "^1.0.25", | ||
"utility-types": "^3.10.0" | ||
@@ -17,0 +17,0 @@ }, |
226395
Updateduse-ssr@^1.0.25