@acrool/react-fetcher 0.0.2-alpha.7 → 0.0.2-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { AxiosInstance } from 'axios';
2
2
  import { IUseFetcherArgs } from './types';
3
3
  import { TFileMapVariables } from './utils';
4
4
  /**
5
- * GrqpahQL 的查詢氣
5
+ * GrqpahQL 的查詢器
6
6
  * @param axiosInstance
7
7
  * @param query
8
8
  */
@@ -1,4 +1,4 @@
1
- export declare enum ERequestHeader {
1
+ export declare enum ERequestHeaderContentType {
2
2
  formData = "multipart/form-data",
3
3
  formUrlDecode = "application/x-www-form-urlencoded",
4
4
  json = "application/json"
@@ -1,2 +1,3 @@
1
1
  export { default as createRestFulFetcher } from './createRestFulFetcher';
2
2
  export type { IUseFetcherArgs as IUseRestFulFetcherArgs } from './types';
3
+ export type { ERequestHeaderContentType } from './config';
@@ -1,15 +1,7 @@
1
1
  import { IRequestConfig } from '../types';
2
- export interface IUseFetcherArgs<TVariables extends IObjectArgs> {
3
- params?: TVariables['params'];
4
- body?: TVariables['body'];
5
- variables?: TVariables['variables'];
2
+ export type IUseFetcherArgs<TVariables> = TVariables | (TVariables & {
6
3
  fetchOptions?: IRequestConfig;
7
- }
8
- export interface IObjectArgs {
9
- params?: unknown;
10
- variables?: unknown;
11
- body?: unknown;
12
- }
4
+ });
13
5
  export interface IDocument {
14
6
  url: string;
15
7
  method?: string;
@@ -1,10 +1,10 @@
1
- import { ERequestHeader } from './config';
1
+ import { ERequestHeaderContentType } from './config';
2
2
  /**
3
3
  *
4
4
  * @param obj 送出物件
5
5
  * @param contentType
6
6
  */
7
- export declare function flattenObjectToFormData(obj: Record<string, any>, contentType: ERequestHeader): {
7
+ export declare function flattenObjectToFormData(obj: Record<string, any>, contentType: ERequestHeaderContentType): {
8
8
  body: FormData | string;
9
9
  contentType: string;
10
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acrool/react-fetcher",
3
- "version": "0.0.2-alpha.7",
3
+ "version": "0.0.2-alpha.9",
4
4
  "description": "Fetcher library based for Reactjs",
5
5
  "keywords": [
6
6
  "acrool",