@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 CHANGED
@@ -1,4 +1,4 @@
1
1
  # [Versions](https://github.com/Tracktor/shared-module/releases)
2
2
 
3
- ## v2.0.0-beta.8
4
- - **[fix]** : fix translateFunction type
3
+ ## v2.0.0
4
+ - **[fix]** - InitializeDaysJSConfig : loading lang & plugin
@@ -7,7 +7,7 @@ interface InitializeDaysJSConfigProps {
7
7
  /**
8
8
  * Dayjs plugin
9
9
  */
10
- dayjsPlugin?: NonNullable<InjectDependenciesContextProps["libraries"]>["dayjsPlugin"];
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<T = unknown> {
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?: T;
26
+ translateFunction?: any;
29
27
  };
30
28
  reactQuery?: {
31
- QueryClientProvider: ({ client, children }: {
32
- client: any;
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<unknown>>;
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: <T extends unknown>({ children, apiURL, libraries }: InjectDependenciesContextProps<T>) => import("react/jsx-runtime").JSX.Element;
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) => any;
13
+ dateAdapter: (date: string | number | Date | null | undefined, format?: string) => string;
18
14
  distanceAdapter: (distance?: string | number | null | undefined, metric?: string) => string;
19
- filePathAdapter: (href?: string | null | {
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;