katanakit-js / IFetchApiManager
Interface: IFetchApiManager
Defined in: src/types/index.ts:472
Contract of the fetch facade.
Methods
useAddRequestInterceptor()
ts
useAddRequestInterceptor(interceptor): () => void;Defined in: src/types/index.ts:482
Parameters
| Parameter | Type |
|---|---|
interceptor | RequestInterceptor |
Returns
() => void
useBuildUrl()
ts
useBuildUrl(
apiName,
endpointName,
options?
): string;Defined in: src/types/index.ts:479
Parameters
| Parameter | Type |
|---|---|
apiName | string |
endpointName | string |
options? | UrlOptions |
Returns
string
useDelete()
ts
useDelete<T>(
apiName,
endpointName,
urlOptions?
): Promise<FetchResult<T>>;Defined in: src/types/index.ts:521
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
apiName | string |
endpointName | string |
urlOptions? | UrlOptions |
Returns
Promise<FetchResult<T>>
useFetch()
ts
useFetch<T>(
apiName,
endpointName,
options?
): Promise<FetchResult<T>>;Defined in: src/types/index.ts:483
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
apiName | string |
endpointName | string |
options? | FetchOptions<T> |
Returns
Promise<FetchResult<T>>
useFetchApi()
ts
useFetchApi<T>(
apiName,
endpointName,
options?
): Promise<FetchResult<T>>;Defined in: src/types/index.ts:488
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
apiName | string |
endpointName | string |
options? | FetchOptions<T> |
Returns
Promise<FetchResult<T>>
useGet()
ts
useGet<T>(
apiName,
endpointName,
urlOptions?
): Promise<FetchResult<T>>;Defined in: src/types/index.ts:493
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
apiName | string |
endpointName | string |
urlOptions? | UrlOptions |
Returns
Promise<FetchResult<T>>
useGetApi()
ts
useGetApi<T>(
apiName,
endpointName,
urlOptions?
): Promise<FetchResult<T>>;Defined in: src/types/index.ts:498
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
apiName | string |
endpointName | string |
urlOptions? | UrlOptions |
Returns
Promise<FetchResult<T>>
useGetApis()
ts
useGetApis(): ApisConfig;Defined in: src/types/index.ts:477
Returns
useGetApisConfig()
ts
useGetApisConfig(): ApisConfig;Defined in: src/types/index.ts:478
Returns
usePatch()
ts
usePatch<T>(
apiName,
endpointName,
body?,
urlOptions?
): Promise<FetchResult<T>>;Defined in: src/types/index.ts:515
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
apiName | string |
endpointName | string |
body? | unknown |
urlOptions? | UrlOptions |
Returns
Promise<FetchResult<T>>
usePost()
ts
usePost<T>(
apiName,
endpointName,
body?,
urlOptions?
): Promise<FetchResult<T>>;Defined in: src/types/index.ts:503
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
apiName | string |
endpointName | string |
body? | unknown |
urlOptions? | UrlOptions |
Returns
Promise<FetchResult<T>>
usePut()
ts
usePut<T>(
apiName,
endpointName,
body?,
urlOptions?
): Promise<FetchResult<T>>;Defined in: src/types/index.ts:509
Type Parameters
| Type Parameter | Default type |
|---|---|
T | unknown |
Parameters
| Parameter | Type |
|---|---|
apiName | string |
endpointName | string |
body? | unknown |
urlOptions? | UrlOptions |
Returns
Promise<FetchResult<T>>