andoncloud-sdk 1.4.49 → 1.4.51

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.
@@ -1,2 +1,2 @@
1
1
  export default useFetch;
2
- declare function useFetch(url: any, options?: {}): (url: any, options?: {}) => Promise<void | Response>;
2
+ declare function useFetch(): (url: any, options?: {}) => Promise<void | Response>;
@@ -1,3 +1,6 @@
1
+ export namespace rootStore {
2
+ export { sessionStore };
3
+ }
1
4
  export const StoreContext: React.Context<{
2
5
  sessionStore: {
3
6
  loading: boolean;
@@ -50,9 +53,7 @@ export const StoreContext: React.Context<{
50
53
  removeCurrentUser(): void;
51
54
  };
52
55
  }>;
53
- export function StoreProvider({ children }: {
54
- children: any;
55
- }): React.JSX.Element;
56
+ export const StoreProvider: React.FunctionComponent<object>;
56
57
  export function useStore(): {
57
58
  sessionStore: {
58
59
  loading: boolean;
@@ -106,8 +107,5 @@ export function useStore(): {
106
107
  };
107
108
  };
108
109
  export default rootStore;
109
- import React from "react";
110
- declare namespace rootStore {
111
- export { sessionStore };
112
- }
113
110
  import sessionStore from "../stores/sessionStore";
111
+ import React from "react";
package/dist/index.d.ts CHANGED
@@ -69,8 +69,6 @@ declare module 'andoncloud-sdk' {
69
69
  }
70
70
  export const Container: React.FC<ContainerProps>;
71
71
 
72
- export const useStore: () => Record<string, unknown>;
73
-
74
72
  interface UserData {
75
73
  id: number;
76
74
  companyId: number;
@@ -110,6 +108,16 @@ declare module 'andoncloud-sdk' {
110
108
  };
111
109
  }
112
110
 
111
+ interface SessionStore {
112
+ loginStatus: LoginStatus;
113
+ }
114
+
115
+ interface RootStore {
116
+ sessionStore: SessionStore;
117
+ }
118
+
119
+ export const useStore: () => RootStore;
120
+
113
121
  type ServiceWorkerRegistrationConfig = {
114
122
  onSuccess?: (registration: ServiceWorkerRegistration) => void;
115
123
  onUpdate?: (registration: ServiceWorkerRegistration, version?: string) => void;
@@ -123,10 +131,6 @@ declare module 'andoncloud-sdk' {
123
131
  registrationConfig?: ServiceWorkerRegistrationConfig;
124
132
  }
125
133
 
126
- interface FetchOptions {
127
- headers: RequestInit['headers'];
128
- }
129
-
130
134
  export const useLoginStatus: () => LoginStatus;
131
135
 
132
136
  export const logout: () => void;
@@ -139,7 +143,7 @@ declare module 'andoncloud-sdk' {
139
143
 
140
144
  export const fetch: typeof global.fetch;
141
145
 
142
- export const useFetch: (url: string, options?: FetchOptions) => () => Promise<Response>;
146
+ export const useFetch: () => typeof global.fetch;
143
147
 
144
148
  export const registerServiceWorker: (config: ServiceWorkerConfig) => void;
145
149
 
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const LIBRARY_VERSION = "1.4.49";
1
+ export declare const LIBRARY_VERSION = "1.4.51";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "andoncloud-sdk",
3
- "version": "1.4.49",
3
+ "version": "1.4.51",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "source": "src/index.js",