@tracktor/shared-module 0.12.0 → 0.13.0
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/CHANGELOG.md +3 -3
- package/dist/components/Inputs/MaskTextField.d.ts +1 -1
- package/dist/config/orval/orval.d.ts +3 -0
- package/dist/hooks/useAuth/index.d.ts +2 -0
- package/dist/hooks/useAuth/useAuth.d.ts +21 -0
- package/dist/hooks/useInfiniteDataGrid/useInfiniteDataGrid.d.ts +2 -2
- package/dist/main.d.ts +2 -0
- package/dist/main.js +301 -287
- package/dist/main.umd.cjs +10 -10
- package/package.json +11 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# [Versions](https://github.com/Tracktor/shared-module/releases)
|
|
2
2
|
|
|
3
|
-
## v0.
|
|
4
|
-
- **[
|
|
5
|
-
- **[feat]** :
|
|
3
|
+
## v0.13.0
|
|
4
|
+
- **[feat]** : add `useAuth` hook
|
|
5
|
+
- **[feat]** : type improvements
|
|
@@ -28,5 +28,5 @@ interface MaskTextFieldProps<T> {
|
|
|
28
28
|
*/
|
|
29
29
|
IMaskMixin: (param: (props: any) => any) => any;
|
|
30
30
|
}
|
|
31
|
-
declare const MaskTextField: <T extends ComponentType
|
|
31
|
+
declare const MaskTextField: <T extends ComponentType>({ IMaskMixin, ...props }: MaskTextFieldProps<T> & ComponentProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
export default MaskTextField;
|
|
@@ -31,6 +31,9 @@ export declare const getOrvalOperationName: (_: any, route: string, method: stri
|
|
|
31
31
|
*/
|
|
32
32
|
export declare const getOrvalConfig: (config?: CustomOrvalConfig) => {
|
|
33
33
|
readonly api: {
|
|
34
|
+
readonly hooks: {
|
|
35
|
+
readonly afterAllFilesWrite: "prettier src/api/ --write";
|
|
36
|
+
};
|
|
34
37
|
readonly input: string;
|
|
35
38
|
readonly output: {
|
|
36
39
|
readonly client: "react-query";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface useAuthParams {
|
|
2
|
+
/**
|
|
3
|
+
* Axios instance
|
|
4
|
+
*/
|
|
5
|
+
defaults: {
|
|
6
|
+
baseURL?: string;
|
|
7
|
+
headers: {
|
|
8
|
+
common: {
|
|
9
|
+
Authorization?: any;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
declare const useAuth: <T>(axios: useAuthParams & T) => {
|
|
15
|
+
clearAuthenticationToken: () => void;
|
|
16
|
+
setAuthenticationToken: ({ tokenType, accessToken }: {
|
|
17
|
+
tokenType: string;
|
|
18
|
+
accessToken: string;
|
|
19
|
+
}) => void;
|
|
20
|
+
};
|
|
21
|
+
export default useAuth;
|
|
@@ -23,10 +23,10 @@ interface GridRowScrollEndParams {
|
|
|
23
23
|
* @param isLoading
|
|
24
24
|
* @param enabled
|
|
25
25
|
*/
|
|
26
|
-
declare const useInfiniteDataGrid: <T
|
|
26
|
+
declare const useInfiniteDataGrid: <T>({ data, fetchNextPage, isFetchingNextPage, isInitialLoading, isLoading, enabled, }: useInfiniteDataGridParams<T>) => {
|
|
27
27
|
fetchNextPageOnRowsScrollEnd: (params: GridRowScrollEndParams) => Promise<void>;
|
|
28
28
|
isLoading: boolean;
|
|
29
29
|
loadingVariant: "skeleton" | "linear";
|
|
30
|
-
rows: T
|
|
30
|
+
rows: T[];
|
|
31
31
|
};
|
|
32
32
|
export default useInfiniteDataGrid;
|
package/dist/main.d.ts
CHANGED
|
@@ -20,5 +20,7 @@ export { default as useResponseError } from './hooks/useResponseError';
|
|
|
20
20
|
export * from './hooks/useResponseError';
|
|
21
21
|
export { default as useInfiniteDataGrid } from './hooks/useInfiniteDataGrid';
|
|
22
22
|
export * from './hooks/useInfiniteDataGrid';
|
|
23
|
+
export { default as useAuth } from './hooks/useAuth';
|
|
24
|
+
export * from './hooks/useAuth';
|
|
23
25
|
export { default as getOrvalConfig } from './config/orval';
|
|
24
26
|
export * from './config/orval';
|