@m4l/core 0.0.0 → 0.0.3

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.
Files changed (33) hide show
  1. package/dist/{lib/contexts → contexts}/EnvironmentContext/index.d.ts +0 -0
  2. package/dist/{lib/contexts → contexts}/EnvironmentContext/types.d.ts +0 -0
  3. package/dist/contexts/FlagsContext/index.d.ts +5 -0
  4. package/dist/contexts/FlagsContext/types.d.ts +10 -0
  5. package/dist/{lib/contexts → contexts}/HostToolsContext/index.d.ts +0 -0
  6. package/dist/{lib/contexts → contexts}/HostToolsContext/types.d.ts +0 -0
  7. package/dist/contexts/ModuleDictionaryContext/index.d.ts +5 -0
  8. package/dist/contexts/ModuleDictionaryContext/types.d.ts +15 -0
  9. package/dist/{lib/contexts → contexts}/NetworkContext/index.d.ts +0 -0
  10. package/dist/{lib/contexts → contexts}/NetworkContext/types.d.ts +0 -0
  11. package/dist/{lib/contexts → contexts}/index.d.ts +2 -0
  12. package/dist/{lib/hooks → hooks}/index.d.ts +2 -0
  13. package/dist/{lib/hooks → hooks}/useEnvironment/index.d.ts +0 -0
  14. package/dist/hooks/useFlags/index.d.ts +3 -0
  15. package/dist/{lib/hooks → hooks}/useHostTools/index.d.ts +1 -1
  16. package/dist/{lib/hooks → hooks}/useLocalStorage/useLocalStorage.d.ts +0 -0
  17. package/dist/hooks/useModuleDictionary/index.d.ts +1 -0
  18. package/dist/{lib/hooks → hooks}/useNetwork/index.d.ts +0 -0
  19. package/dist/index.d.ts +5 -3
  20. package/dist/index.js +1567 -0
  21. package/dist/types/dictionary.d.ts +13 -0
  22. package/dist/{lib/types → types}/index.d.ts +0 -0
  23. package/dist/utils/axiosOperation/index.d.ts +2 -0
  24. package/dist/utils/axiosOperation/types.d.ts +5 -0
  25. package/dist/{lib/utils → utils}/getLocalStorage.d.ts +0 -0
  26. package/dist/{lib/utils → utils}/getPropertyByString.d.ts +0 -0
  27. package/dist/{lib/utils → utils}/index.d.ts +1 -0
  28. package/dist/{lib/utils → utils}/setLocalStorage.d.ts +0 -0
  29. package/dist/{lib/utils → utils}/voidFunction.d.ts +0 -0
  30. package/package.json +12 -18
  31. package/dist/lib/index.d.ts +0 -5
  32. package/dist/m4l_core.es.js +0 -114
  33. package/dist/manifest.json +0 -7
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { FlagsContextProps, FlagsProviderProps } from './types';
3
+ declare const FlagsContext: import("react").Context<FlagsContextProps>;
4
+ declare function FlagsProvider({ children }: FlagsProviderProps): JSX.Element;
5
+ export { FlagsProvider, FlagsContext };
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ export interface FlagsProviderProps {
3
+ children: ReactNode;
4
+ }
5
+ export declare type Flag = string;
6
+ export interface FlagsContextProps {
7
+ flags: Array<Flag>;
8
+ clearFlags: () => void;
9
+ addFlag: (flag: Flag) => void;
10
+ }
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { ModuleDictionaryContextProps, ModuleDictionaryProviderProps } from './types';
3
+ declare const ModuleDictionaryContext: import("react").Context<ModuleDictionaryContextProps>;
4
+ declare function ModuleDictionaryProvider(props: ModuleDictionaryProviderProps): JSX.Element;
5
+ export { ModuleDictionaryProvider, ModuleDictionaryContext };
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ import type { GetLabelType, ModuleDictionary } from 'src/types/dictionary';
3
+ export interface ModuleDictionaryProviderProps {
4
+ currentLang?: string;
5
+ isAuth?: boolean;
6
+ moduleId: number;
7
+ moduleName?: string;
8
+ componentsDictionary: string[];
9
+ children: ReactNode;
10
+ }
11
+ export interface ModuleDictionaryContextProps {
12
+ moduleDictionary?: ModuleDictionary;
13
+ getLabel: GetLabelType;
14
+ getModuleLabel: () => string;
15
+ }
@@ -1,3 +1,5 @@
1
1
  export { EnvironmentContext } from './EnvironmentContext';
2
2
  export { HostToolsContext } from './HostToolsContext';
3
3
  export { NetworkContext } from './NetworkContext';
4
+ export { FlagsContext } from './FlagsContext';
5
+ export { ModuleDictionaryContext } from './ModuleDictionaryContext';
@@ -2,3 +2,5 @@ export { useLocalStorage } from './useLocalStorage/useLocalStorage';
2
2
  export { useHostTools } from './useHostTools';
3
3
  export { useNetwork } from './useNetwork';
4
4
  export { useEnvironment } from './useEnvironment';
5
+ export { useFlags } from './useFlags';
6
+ export { useModuleDictionary } from './useModuleDictionary';
@@ -0,0 +1,3 @@
1
+ import type { Flag, FlagsContextProps } from '../../contexts/FlagsContext/types';
2
+ export declare const useFlags: () => FlagsContextProps;
3
+ export declare const useFlagsPresent: (compareFlags: Array<Flag>) => boolean;
@@ -1,2 +1,2 @@
1
- export declare const useHostTools: () => import("../..").HostTools;
1
+ export declare const useHostTools: () => import("../..").HostToolsType;
2
2
  export default useHostTools;
@@ -0,0 +1 @@
1
+ export declare const useModuleDictionary: () => import("../../contexts/ModuleDictionaryContext/types").ModuleDictionaryContextProps;
File without changes
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
- import m4l_core from './lib/index'
2
- export default m4l_core
3
- export * from './lib/index'
1
+ export * from './contexts';
2
+ export * from './hooks';
3
+ export { EmitEvents } from './types';
4
+ export type { Maybe, HostToolsType, NetworkProps, EnvironmentType } from './types';
5
+ export * from './utils';