@swishapp/react 0.89.8 → 0.89.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.
- package/dist/index.d.cts +14 -13
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +14 -13
- package/dist/index.d.mts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
-
import { ApiError, ApiResponse, CreateItemSuccessResponse, DeleteItemSuccessResponse, EditItemListsSuccessResponse, EditItemVariantSuccessResponse, EventName, Intent, IntentResponse, IntentToData, Item, PageInfo, PaginatedApiResponse, SwishApp,
|
|
4
|
-
import * as
|
|
3
|
+
import { ApiError, ApiResponse, CreateItemSuccessResponse, DeleteItemSuccessResponse, EditItemListsSuccessResponse, EditItemVariantSuccessResponse, EventName, Intent, IntentResponse, IntentToData, Item, PageInfo, PaginatedApiResponse, SwishApp, SwishOptions } from "@swishapp/sdk";
|
|
4
|
+
import * as _swishapp_api_client1 from "@swishapp/api-client";
|
|
5
|
+
export * from "@swishapp/sdk";
|
|
5
6
|
|
|
6
7
|
//#region src/types.d.ts
|
|
7
8
|
interface SwishContextValue {
|
|
8
|
-
swish: SwishApp
|
|
9
|
+
swish: SwishApp | null;
|
|
9
10
|
isLoading: boolean;
|
|
10
11
|
error: Error | null;
|
|
11
12
|
}
|
|
@@ -13,7 +14,7 @@ interface SwishContextValue {
|
|
|
13
14
|
//#region src/context.d.ts
|
|
14
15
|
interface SwishProviderProps {
|
|
15
16
|
children: ReactNode;
|
|
16
|
-
options: SwishOptions
|
|
17
|
+
options: SwishOptions & {
|
|
17
18
|
swishSdkUrl?: string;
|
|
18
19
|
};
|
|
19
20
|
}
|
|
@@ -26,10 +27,10 @@ declare function SwishProvider({
|
|
|
26
27
|
}: SwishProviderProps): react_jsx_runtime0.JSX.Element;
|
|
27
28
|
//#endregion
|
|
28
29
|
//#region src/hooks/use-swish.d.ts
|
|
29
|
-
declare function useSwish(): SwishApp
|
|
30
|
+
declare function useSwish(): SwishApp | null;
|
|
30
31
|
//#endregion
|
|
31
32
|
//#region src/hooks/use-swish-query.d.ts
|
|
32
|
-
type FetchFn<TResponse, TVariables> = (swish: SwishApp
|
|
33
|
+
type FetchFn<TResponse, TVariables> = (swish: SwishApp["api"], variables?: TVariables) => Promise<TResponse>;
|
|
33
34
|
type DataOf<T> = T extends {
|
|
34
35
|
data: infer D;
|
|
35
36
|
} ? D : never;
|
|
@@ -56,8 +57,8 @@ declare const useSwishIntent: <I extends Intent = Intent>(intent: I, ...args: In
|
|
|
56
57
|
//#region src/hooks/use-swish-lists.d.ts
|
|
57
58
|
declare const useSwishLists: () => {
|
|
58
59
|
loading: boolean;
|
|
59
|
-
lists:
|
|
60
|
-
error:
|
|
60
|
+
lists: _swishapp_api_client1.ListDetail[] | null;
|
|
61
|
+
error: _swishapp_api_client1.ApiError | null;
|
|
61
62
|
reset: () => void;
|
|
62
63
|
};
|
|
63
64
|
//#endregion
|
|
@@ -72,8 +73,8 @@ declare const useSwishItems: ({
|
|
|
72
73
|
}?: UseSwishItemsOptions) => {
|
|
73
74
|
loading: boolean;
|
|
74
75
|
data: Item[];
|
|
75
|
-
pageInfo:
|
|
76
|
-
error:
|
|
76
|
+
pageInfo: _swishapp_api_client1.PageInfo | null;
|
|
77
|
+
error: _swishapp_api_client1.ApiError | null;
|
|
77
78
|
reset: () => void;
|
|
78
79
|
hasMore: boolean;
|
|
79
80
|
loadMore: () => void;
|
|
@@ -100,7 +101,7 @@ declare const useSwishItem: ({
|
|
|
100
101
|
}: UseSwishItemProps) => {
|
|
101
102
|
saved: boolean;
|
|
102
103
|
loading: boolean;
|
|
103
|
-
error:
|
|
104
|
+
error: _swishapp_api_client1.ApiError | null;
|
|
104
105
|
save: () => Promise<void>;
|
|
105
106
|
unsave: () => Promise<void>;
|
|
106
107
|
updateLists: () => Promise<void>;
|
|
@@ -112,8 +113,8 @@ declare const useSwishItem: ({
|
|
|
112
113
|
declare const useSwishItemCount: () => {
|
|
113
114
|
count: number;
|
|
114
115
|
loading: boolean;
|
|
115
|
-
error:
|
|
116
|
+
error: _swishapp_api_client1.ApiError | null;
|
|
116
117
|
};
|
|
117
118
|
//#endregion
|
|
118
|
-
export {
|
|
119
|
+
export { SwishContextValue, SwishProvider, type SwishProviderProps, useSwish, useSwishIntent, useSwishItem, useSwishItemCount, useSwishItems, useSwishLists, useSwishQuery };
|
|
119
120
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/context.tsx","../src/hooks/use-swish.ts","../src/hooks/use-swish-query.ts","../src/hooks/use-swish-intent.ts","../src/hooks/use-swish-lists.ts","../src/hooks/use-swish-items.ts","../src/hooks/use-swish-item.ts","../src/hooks/use-swish-item-count.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/context.tsx","../src/hooks/use-swish.ts","../src/hooks/use-swish-query.ts","../src/hooks/use-swish-intent.ts","../src/hooks/use-swish-lists.ts","../src/hooks/use-swish-items.ts","../src/hooks/use-swish-item.ts","../src/hooks/use-swish-item-count.ts"],"sourcesContent":[],"mappings":";;;;;;;UAEiB,iBAAA;SACR;;SAEA;;;;UCKQ,kBAAA;YACL;WACD;;EDVM,CAAA;;iBCgBD,aAAA;;;;;;GAMb,qBAAkB,kBAAA,CAAA,GAAA,CAAA;;;iBCpBL,QAAA,CAAA,GAAY;;;KCOhB,yCACH,6BACK,eACT,QAAQ;KAeR,YAAY;;IAA8B;cAElC,kCACO,mBAAmB,8CAG9B,QAAQ,WAAW;cAEZ;;EHnCC,OAAA,CAAA,EAAA,OAAA,GGqCO,SHrCU,EACzB;;;;ECOQ,KAAA,UAAA,GAAA,IAAkB;EAQnB,OAAA,EAAA,OAAa;EAC3B,KAAA,EAAA,GAAA,GAAA,IAAA;EAEE,OAAA,EAAA,GAAA,GAAA,IAAA;EAGD,UAAA,EAAA,OAAA;CAAkB;;;cGpBR,2BAA4B,SAAS,gBACxC,YACC,aAAa,sCAAsC,aAAa;gBAUpC,QAAQ,eAAe;;;;;cCTjD;;SAyBZ,qBAAA,CAAA,UAAA;SAAA,qBAAA,CAAA,QAAA;;AL9BD,CAAA;;;UMEiB,oBAAA;;;;cAKJ;;;IAGV;;;ENVc,QAAA,mCAGH,IAAA;;;;ECKG,QAAA,EAAA,GAAA,GAAA,IAAA;AAQjB,CAAA;;;UMPU,iBAAA;;;;kBAIQ;oBACE;yBACK;EPfR,eAAA,CAAA,EAAA,CAAA,IAAiB,EOgBP,8BPbb,CAAA,MAAA,CAAA,EAAA,GAAA,IAAA;;cOgBD;;;;;;;;GAQV;;ENnBc,OAAA,EAAA,OAAA;EAQD,KAAA,EMWI,qBAAA,CAAA,QAAA,GNXS,IAAA;EAC3B,IAAA,EAAA,GAAA,UAAA,CAAA,IAAA,CAAA;EAEE,MAAA,EAAA,GAAA,UAAA,CAAA,IAAA,CAAA;EAGD,WAAA,EAAA,GAAA,UAAA,CAAA,IAAA,CAAA;EAAkB,aAAA,EAAA,GAAA,UAAA,CAAA,IAAA,CAAA;EAAA,MAAA,EAAA,GAAA,UAAA,CAAA,IAAA,CAAA;;;;cOrBR;;;SAYZ,qBAAA,CAAA,QAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
-
import { ApiError, ApiResponse, CreateItemSuccessResponse, DeleteItemSuccessResponse, EditItemListsSuccessResponse, EditItemVariantSuccessResponse, EventName, Intent, IntentResponse, IntentToData, Item, PageInfo, PaginatedApiResponse, SwishApp,
|
|
4
|
-
import * as
|
|
3
|
+
import { ApiError, ApiResponse, CreateItemSuccessResponse, DeleteItemSuccessResponse, EditItemListsSuccessResponse, EditItemVariantSuccessResponse, EventName, Intent, IntentResponse, IntentToData, Item, PageInfo, PaginatedApiResponse, SwishApp, SwishOptions } from "@swishapp/sdk";
|
|
4
|
+
import * as _swishapp_api_client3 from "@swishapp/api-client";
|
|
5
|
+
export * from "@swishapp/sdk";
|
|
5
6
|
|
|
6
7
|
//#region src/types.d.ts
|
|
7
8
|
interface SwishContextValue {
|
|
8
|
-
swish: SwishApp
|
|
9
|
+
swish: SwishApp | null;
|
|
9
10
|
isLoading: boolean;
|
|
10
11
|
error: Error | null;
|
|
11
12
|
}
|
|
@@ -13,7 +14,7 @@ interface SwishContextValue {
|
|
|
13
14
|
//#region src/context.d.ts
|
|
14
15
|
interface SwishProviderProps {
|
|
15
16
|
children: ReactNode;
|
|
16
|
-
options: SwishOptions
|
|
17
|
+
options: SwishOptions & {
|
|
17
18
|
swishSdkUrl?: string;
|
|
18
19
|
};
|
|
19
20
|
}
|
|
@@ -26,10 +27,10 @@ declare function SwishProvider({
|
|
|
26
27
|
}: SwishProviderProps): react_jsx_runtime0.JSX.Element;
|
|
27
28
|
//#endregion
|
|
28
29
|
//#region src/hooks/use-swish.d.ts
|
|
29
|
-
declare function useSwish(): SwishApp
|
|
30
|
+
declare function useSwish(): SwishApp | null;
|
|
30
31
|
//#endregion
|
|
31
32
|
//#region src/hooks/use-swish-query.d.ts
|
|
32
|
-
type FetchFn<TResponse, TVariables> = (swish: SwishApp
|
|
33
|
+
type FetchFn<TResponse, TVariables> = (swish: SwishApp["api"], variables?: TVariables) => Promise<TResponse>;
|
|
33
34
|
type DataOf<T> = T extends {
|
|
34
35
|
data: infer D;
|
|
35
36
|
} ? D : never;
|
|
@@ -56,8 +57,8 @@ declare const useSwishIntent: <I extends Intent = Intent>(intent: I, ...args: In
|
|
|
56
57
|
//#region src/hooks/use-swish-lists.d.ts
|
|
57
58
|
declare const useSwishLists: () => {
|
|
58
59
|
loading: boolean;
|
|
59
|
-
lists:
|
|
60
|
-
error:
|
|
60
|
+
lists: _swishapp_api_client3.ListDetail[] | null;
|
|
61
|
+
error: _swishapp_api_client3.ApiError | null;
|
|
61
62
|
reset: () => void;
|
|
62
63
|
};
|
|
63
64
|
//#endregion
|
|
@@ -72,8 +73,8 @@ declare const useSwishItems: ({
|
|
|
72
73
|
}?: UseSwishItemsOptions) => {
|
|
73
74
|
loading: boolean;
|
|
74
75
|
data: Item[];
|
|
75
|
-
pageInfo:
|
|
76
|
-
error:
|
|
76
|
+
pageInfo: _swishapp_api_client3.PageInfo | null;
|
|
77
|
+
error: _swishapp_api_client3.ApiError | null;
|
|
77
78
|
reset: () => void;
|
|
78
79
|
hasMore: boolean;
|
|
79
80
|
loadMore: () => void;
|
|
@@ -100,7 +101,7 @@ declare const useSwishItem: ({
|
|
|
100
101
|
}: UseSwishItemProps) => {
|
|
101
102
|
saved: boolean;
|
|
102
103
|
loading: boolean;
|
|
103
|
-
error:
|
|
104
|
+
error: _swishapp_api_client3.ApiError | null;
|
|
104
105
|
save: () => Promise<void>;
|
|
105
106
|
unsave: () => Promise<void>;
|
|
106
107
|
updateLists: () => Promise<void>;
|
|
@@ -112,8 +113,8 @@ declare const useSwishItem: ({
|
|
|
112
113
|
declare const useSwishItemCount: () => {
|
|
113
114
|
count: number;
|
|
114
115
|
loading: boolean;
|
|
115
|
-
error:
|
|
116
|
+
error: _swishapp_api_client3.ApiError | null;
|
|
116
117
|
};
|
|
117
118
|
//#endregion
|
|
118
|
-
export {
|
|
119
|
+
export { SwishContextValue, SwishProvider, type SwishProviderProps, useSwish, useSwishIntent, useSwishItem, useSwishItemCount, useSwishItems, useSwishLists, useSwishQuery };
|
|
119
120
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/context.tsx","../src/hooks/use-swish.ts","../src/hooks/use-swish-query.ts","../src/hooks/use-swish-intent.ts","../src/hooks/use-swish-lists.ts","../src/hooks/use-swish-items.ts","../src/hooks/use-swish-item.ts","../src/hooks/use-swish-item-count.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/context.tsx","../src/hooks/use-swish.ts","../src/hooks/use-swish-query.ts","../src/hooks/use-swish-intent.ts","../src/hooks/use-swish-lists.ts","../src/hooks/use-swish-items.ts","../src/hooks/use-swish-item.ts","../src/hooks/use-swish-item-count.ts"],"sourcesContent":[],"mappings":";;;;;;;UAEiB,iBAAA;SACR;;SAEA;;;;UCKQ,kBAAA;YACL;WACD;;EDVM,CAAA;;iBCgBD,aAAA;;;;;;GAMb,qBAAkB,kBAAA,CAAA,GAAA,CAAA;;;iBCpBL,QAAA,CAAA,GAAY;;;KCOhB,yCACH,6BACK,eACT,QAAQ;KAeR,YAAY;;IAA8B;cAElC,kCACO,mBAAmB,8CAG9B,QAAQ,WAAW;cAEZ;;EHnCC,OAAA,CAAA,EAAA,OAAA,GGqCO,SHrCU,EACzB;;;;ECOQ,KAAA,UAAA,GAAA,IAAkB;EAQnB,OAAA,EAAA,OAAa;EAC3B,KAAA,EAAA,GAAA,GAAA,IAAA;EAEE,OAAA,EAAA,GAAA,GAAA,IAAA;EAGD,UAAA,EAAA,OAAA;CAAkB;;;cGpBR,2BAA4B,SAAS,gBACxC,YACC,aAAa,sCAAsC,aAAa;gBAUpC,QAAQ,eAAe;;;;;cCTjD;;SAyBZ,qBAAA,CAAA,UAAA;SAAA,qBAAA,CAAA,QAAA;;AL9BD,CAAA;;;UMEiB,oBAAA;;;;cAKJ;;;IAGV;;;ENVc,QAAA,mCAGH,IAAA;;;;ECKG,QAAA,EAAA,GAAA,GAAA,IAAA;AAQjB,CAAA;;;UMPU,iBAAA;;;;kBAIQ;oBACE;yBACK;EPfR,eAAA,CAAA,EAAA,CAAA,IAAiB,EOgBP,8BPbb,CAAA,MAAA,CAAA,EAAA,GAAA,IAAA;;cOgBD;;;;;;;;GAQV;;ENnBc,OAAA,EAAA,OAAA;EAQD,KAAA,EMWI,qBAAA,CAAA,QAAA,GNXS,IAAA;EAC3B,IAAA,EAAA,GAAA,UAAA,CAAA,IAAA,CAAA;EAEE,MAAA,EAAA,GAAA,UAAA,CAAA,IAAA,CAAA;EAGD,WAAA,EAAA,GAAA,UAAA,CAAA,IAAA,CAAA;EAAkB,aAAA,EAAA,GAAA,UAAA,CAAA,IAAA,CAAA;EAAA,MAAA,EAAA,GAAA,UAAA,CAAA,IAAA,CAAA;;;;cOrBR;;;SAYZ,qBAAA,CAAA,QAAA"}
|