@tracktor/shared-module 2.0.0-beta.8 → 2.0.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 +2 -2
- package/dist/components/Utils/InitializeDaysJSConfig.d.ts +1 -1
- package/dist/context/InjectDependenciesProvider.d.ts +7 -25
- package/dist/hooks/useAdapter/useAdapter.d.ts +2 -9
- package/dist/main.js +418 -401
- package/dist/main.umd.cjs +10 -10
- package/dist/utils/adapter/dateAdapter.d.ts +12 -4
- package/dist/utils/adapter/filePathAdapter.d.ts +7 -4
- package/package.json +1 -1
- package/dist/utils/adapter/index.d.ts +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,7 @@ interface InitializeDaysJSConfigProps {
|
|
|
7
7
|
/**
|
|
8
8
|
* Dayjs plugin
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
plugin?: NonNullable<InjectDependenciesContextProps["libraries"]>["dayjsPlugin"];
|
|
11
11
|
/**
|
|
12
12
|
* Language
|
|
13
13
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
|
-
export interface InjectDependenciesContextProps
|
|
2
|
+
export interface InjectDependenciesContextProps {
|
|
3
3
|
/**
|
|
4
4
|
* Children
|
|
5
5
|
*/
|
|
@@ -15,9 +15,7 @@ export interface InjectDependenciesContextProps<T = unknown> {
|
|
|
15
15
|
axios?: any;
|
|
16
16
|
dayjs?: any;
|
|
17
17
|
dayjsPlugin?: any[];
|
|
18
|
-
gtm?:
|
|
19
|
-
useGoogleTagManager: () => any;
|
|
20
|
-
};
|
|
18
|
+
gtm?: any;
|
|
21
19
|
mapbox?: any;
|
|
22
20
|
reactRouter?: any;
|
|
23
21
|
sentry?: any;
|
|
@@ -25,31 +23,15 @@ export interface InjectDependenciesContextProps<T = unknown> {
|
|
|
25
23
|
i18next?: any;
|
|
26
24
|
initReactI18next?: any;
|
|
27
25
|
languageDetector?: any;
|
|
28
|
-
translateFunction?:
|
|
26
|
+
translateFunction?: any;
|
|
29
27
|
};
|
|
30
28
|
reactQuery?: {
|
|
31
|
-
QueryClientProvider:
|
|
32
|
-
|
|
33
|
-
children: ReactNode;
|
|
34
|
-
}) => any;
|
|
35
|
-
QueryClient: {
|
|
36
|
-
new (config: {
|
|
37
|
-
defaultOptions: {
|
|
38
|
-
queries: {
|
|
39
|
-
refetchOnWindowFocus: boolean;
|
|
40
|
-
retry: number;
|
|
41
|
-
getNextPageParam: (lastPage: [], allPages: [], lastPageParam: number) => number;
|
|
42
|
-
};
|
|
43
|
-
mutations: {
|
|
44
|
-
[key: string]: any;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
}): any;
|
|
48
|
-
};
|
|
29
|
+
QueryClientProvider: any;
|
|
30
|
+
QueryClient: any;
|
|
49
31
|
};
|
|
50
32
|
};
|
|
51
33
|
}
|
|
52
|
-
export declare const InjectDependenciesContext: import("react").Context<InjectDependenciesContextProps
|
|
34
|
+
export declare const InjectDependenciesContext: import("react").Context<InjectDependenciesContextProps>;
|
|
53
35
|
/**
|
|
54
36
|
* This provider is used to inject major dependencies
|
|
55
37
|
* @param children
|
|
@@ -57,5 +39,5 @@ export declare const InjectDependenciesContext: import("react").Context<InjectDe
|
|
|
57
39
|
* @param apiURL
|
|
58
40
|
* @constructor
|
|
59
41
|
*/
|
|
60
|
-
declare const InjectDependenciesProvider:
|
|
42
|
+
declare const InjectDependenciesProvider: ({ children, apiURL, libraries }: InjectDependenciesContextProps) => import("react/jsx-runtime").JSX.Element;
|
|
61
43
|
export default InjectDependenciesProvider;
|
|
@@ -4,21 +4,14 @@ export interface useAdapterParams {
|
|
|
4
4
|
* Dayjs library
|
|
5
5
|
*/
|
|
6
6
|
dayjs?: NonNullable<InjectDependenciesContextProps["libraries"]>["dayjs"];
|
|
7
|
-
/**
|
|
8
|
-
* Translation key returned for the unknown error
|
|
9
|
-
*/
|
|
10
|
-
unknownErrorTranslationKey?: string;
|
|
11
7
|
}
|
|
12
8
|
/**
|
|
13
9
|
* Use adapter
|
|
14
10
|
* @returns
|
|
15
11
|
*/
|
|
16
12
|
export declare const useAdapter: (params?: useAdapterParams) => {
|
|
17
|
-
dateAdapter: (date: string | number | Date | null | undefined, format?: string) =>
|
|
13
|
+
dateAdapter: (date: string | number | Date | null | undefined, format?: string) => string;
|
|
18
14
|
distanceAdapter: (distance?: string | number | null | undefined, metric?: string) => string;
|
|
19
|
-
filePathAdapter: (
|
|
20
|
-
pathname: string;
|
|
21
|
-
origin: string;
|
|
22
|
-
}, size?: number | "full") => string;
|
|
15
|
+
filePathAdapter: (path?: string | null, size?: number | "full") => string;
|
|
23
16
|
};
|
|
24
17
|
export default useAdapter;
|