@tealca/core-components 1.0.17 → 1.0.19

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.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  import { AnchorHTMLAttributes } from 'react';
2
- import { AuthState } from './slices/authSlice';
3
2
  import { AxiosInstance } from 'axios';
4
3
  import { ButtonHTMLAttributes } from 'react';
5
4
  import { Context } from 'react';
6
5
  import { default as default_2 } from 'react';
7
- import { EnhancedStore } from '@reduxjs/toolkit';
8
6
  import { FC } from 'react';
9
7
  import { FormikHelpers } from 'formik';
10
8
  import { FormikProps } from 'formik';
@@ -16,10 +14,7 @@ import { InputHTMLAttributes } from 'react';
16
14
  import { JSX as JSX_2 } from 'react/jsx-runtime';
17
15
  import { ReactNode } from 'react';
18
16
  import { RefAttributes } from 'react';
19
- import { StoreEnhancer } from 'redux';
20
- import { ThunkDispatch } from 'redux-thunk';
21
- import { Tuple } from '@reduxjs/toolkit';
22
- import { UnknownAction } from 'redux';
17
+ import { TypedUseSelectorHook } from 'react-redux';
23
18
 
24
19
  export declare interface Account {
25
20
  id: string;
@@ -138,7 +133,7 @@ export declare interface AppContextProps {
138
133
  basicApi: AxiosInstance;
139
134
  }
140
135
 
141
- export declare type AppDispatch = typeof store.dispatch;
136
+ export declare type AppDispatch = AppStore["dispatch"];
142
137
 
143
138
  export declare interface Application {
144
139
  applicationId: number;
@@ -153,6 +148,8 @@ export declare const AppProvider: FC<{
153
148
  applicationId: number;
154
149
  }>;
155
150
 
151
+ export declare type AppStore = ReturnType<typeof makeStore>;
152
+
156
153
  /**
157
154
  * React context for managing authentication state throughout the application.
158
155
  *
@@ -797,6 +794,8 @@ declare interface LoginProps {
797
794
  onSuccess?: () => void;
798
795
  }
799
796
 
797
+ export declare const makeStore: () => any;
798
+
800
799
  declare interface MenuItem {
801
800
  id: string;
802
801
  label: string;
@@ -1111,7 +1110,7 @@ declare interface Response_2<_TModelType> {
1111
1110
  }
1112
1111
  export { Response_2 as Response }
1113
1112
 
1114
- export declare type RootState = ReturnType<typeof store.getState>;
1113
+ export declare type RootState = ReturnType<AppStore["getState"]>;
1115
1114
 
1116
1115
  /**
1117
1116
  * A secondary button component with predefined styles.
@@ -1512,14 +1511,6 @@ export declare interface Store {
1512
1511
  address: Address;
1513
1512
  }
1514
1513
 
1515
- export declare const store: EnhancedStore< {
1516
- auth: AuthState;
1517
- }, UnknownAction, Tuple<[StoreEnhancer< {
1518
- dispatch: ThunkDispatch< {
1519
- auth: AuthState;
1520
- }, undefined, UnknownAction>;
1521
- }>, StoreEnhancer]>>;
1522
-
1523
1514
  /**
1524
1515
  * A base switch (toggle) component.
1525
1516
  * Inherits all props from the standard HTML input[type="checkbox"] element.
@@ -1583,24 +1574,14 @@ declare interface TrackingTableProps {
1583
1574
  wrapperClassName?: string;
1584
1575
  }
1585
1576
 
1586
- /**
1587
- * `api` is an instance of `axios` configured for interacting with the backend API.
1588
- *
1589
- * It has interceptors to standardize requests and responses.
1590
- *
1591
- * Request Interceptor:
1592
- * 1. Adds the `Authorization` header with the JWT token if available.
1593
- * 2. Converts the keys of the request `data` from camelCase to snake_case.
1594
- * 3. Converts the keys of the request `params` from camelCase to snake_case.
1595
- *
1596
- * Response Interceptor:
1597
- * 1. Converts the keys of the response `data` from snake_case to camelCase.
1598
- * 2. If a 401 Unauthorized error occurs, it attempts to refresh the token.
1599
- * - If token refresh is successful, it retries the original request with the new token.
1600
- * - If token refresh fails, it rejects the promise.
1601
- */
1602
1577
  export declare const useApi: (apiUri: string, basicApi: AxiosInstance) => AxiosInstance;
1603
1578
 
1579
+ export declare const useAppDispatch: () => AppDispatch;
1580
+
1581
+ export declare const useAppSelector: TypedUseSelectorHook<RootState>;
1582
+
1583
+ export declare const useAppStore: () => AppStore;
1584
+
1604
1585
  /**
1605
1586
  * `basicApi` is an instance of `axios` configured with a base URL and a response interceptor.
1606
1587
  *