@tracktor/shared-module 2.0.0-beta.9 → 2.0.1

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,5 +1,4 @@
1
1
  # [Versions](https://github.com/Tracktor/shared-module/releases)
2
2
 
3
- ## v2.0.0-beta.9
4
- - **[fix]** : dateAdapter type injection improved
5
- - **[type]** : improved types for dependencies injection
3
+ ## v2.0.1
4
+ - **[fix]** - i18n : change param `bindI18n` to `languageChanged loaded` instead of `false`
@@ -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
  */
@@ -12,26 +12,26 @@ export interface InjectDependenciesContextProps<T = unknown> {
12
12
  * List of dependencies for libraries
13
13
  */
14
14
  libraries?: {
15
- axios?: T;
16
- dayjs?: T;
17
- dayjsPlugin?: T[];
18
- gtm?: T;
19
- mapbox?: T;
20
- reactRouter?: T;
15
+ axios?: any;
16
+ dayjs?: any;
17
+ dayjsPlugin?: any[];
18
+ gtm?: any;
19
+ mapbox?: any;
20
+ reactRouter?: any;
21
21
  sentry?: any;
22
22
  i18?: {
23
23
  i18next?: any;
24
- initReactI18next?: T;
25
- languageDetector?: T;
26
- translateFunction?: T;
24
+ initReactI18next?: any;
25
+ languageDetector?: any;
26
+ translateFunction?: any;
27
27
  };
28
28
  reactQuery?: {
29
- QueryClientProvider: T;
30
- QueryClient: T;
29
+ QueryClientProvider: any;
30
+ QueryClient: any;
31
31
  };
32
32
  };
33
33
  }
34
- export declare const InjectDependenciesContext: import("react").Context<InjectDependenciesContextProps<unknown>>;
34
+ export declare const InjectDependenciesContext: import("react").Context<InjectDependenciesContextProps>;
35
35
  /**
36
36
  * This provider is used to inject major dependencies
37
37
  * @param children
@@ -39,5 +39,5 @@ export declare const InjectDependenciesContext: import("react").Context<InjectDe
39
39
  * @param apiURL
40
40
  * @constructor
41
41
  */
42
- 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;
43
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;