@beinformed/ui 1.66.0 → 1.67.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 +21 -0
- package/esm/hooks/useI18n.js +5 -1
- package/esm/hooks/useI18n.js.flow +14 -1
- package/esm/hooks/useI18n.js.map +1 -1
- package/esm/redux/_i18n/types.js.flow +0 -2
- package/esm/redux/_i18n/types.js.map +1 -1
- package/esm/redux/_modularui/types.js.flow +0 -9
- package/esm/redux/_modularui/types.js.map +1 -1
- package/esm/redux/_router/types.js.flow +0 -6
- package/esm/redux/_router/types.js.map +1 -1
- package/esm/redux/types.js.flow +0 -143
- package/esm/redux/types.js.map +1 -1
- package/lib/hooks/useI18n.js +6 -1
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/redux/_i18n/types.js.map +1 -1
- package/lib/redux/_modularui/types.js.map +1 -1
- package/lib/redux/_router/types.js.map +1 -1
- package/lib/redux/types.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.67.1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.67.0...v1.67.1) (2026-02-16)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **hooks:** add hook to retrieve Locales ([46a77c3](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/46a77c3cd6272e9a1fa972f703dc135a453c35e9))
|
|
11
|
+
|
|
12
|
+
## [1.67.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.65.29...v1.67.0) (2026-02-14)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **hooks:** add hooks for update locale and retrieval of application ([25cbb98](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/25cbb98c17eea37d91b6cee9623e263b61068d51))
|
|
18
|
+
* **hooks:** add useErrorHandler hook to dispatch error handle actions ([be2a7a1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/be2a7a193038c91fbbdf948fd9c55cbf6b0c20e6))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* **redux:** deprecated too much ([4d6b99b](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/4d6b99b4a4bb7ea23615f765ae72a3a2e8caafb3))
|
|
24
|
+
* **selector:** retrieve models for active local ([c91b49f](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/c91b49f58973f1d69169f17e964dd107259cf4b7))
|
|
25
|
+
|
|
5
26
|
## [1.66.0](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.65.29...v1.66.0) (2026-02-14)
|
|
6
27
|
|
|
7
28
|
|
package/esm/hooks/useI18n.js
CHANGED
|
@@ -19,6 +19,10 @@ const useTranslate = () => useSelector(getMessage);
|
|
|
19
19
|
/**
|
|
20
20
|
*/
|
|
21
21
|
const useLocale = () => useSelector(getLocale);
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
*/
|
|
25
|
+
const useLocales = () => useSelector(getLocales);
|
|
22
26
|
const getLocaleCodes = createSelector(state => state.i18n.locales, locales => _mapInstanceProperty(locales).call(locales, locale => locale.code));
|
|
23
27
|
|
|
24
28
|
/**
|
|
@@ -37,5 +41,5 @@ const useUpdateLocale = () => {
|
|
|
37
41
|
dispatch(updateLocale(locale));
|
|
38
42
|
}, [dispatch]);
|
|
39
43
|
};
|
|
40
|
-
export { useTranslate, useMessage, useLocale, useLocaleCodes, useUpdateLocale };
|
|
44
|
+
export { useTranslate, useMessage, useLocale, useLocales, useLocaleCodes, useUpdateLocale };
|
|
41
45
|
//# sourceMappingURL=useI18n.js.map
|
|
@@ -8,6 +8,8 @@ import memoize from "lodash/memoize";
|
|
|
8
8
|
import { getLocales, getLocale } from "../redux/selectors/i18n";
|
|
9
9
|
import { updateLocale } from "../redux/_i18n/I18nActions";
|
|
10
10
|
|
|
11
|
+
import type Locales from "../i18n/Locales";
|
|
12
|
+
|
|
11
13
|
const getMessage = createSelector(
|
|
12
14
|
[getLocales, getLocale],
|
|
13
15
|
(locales, localeCode) =>
|
|
@@ -36,6 +38,10 @@ const useTranslate = (): ((...any) => any) => useSelector(getMessage);
|
|
|
36
38
|
*/
|
|
37
39
|
const useLocale = (): string => useSelector(getLocale);
|
|
38
40
|
|
|
41
|
+
/**
|
|
42
|
+
*/
|
|
43
|
+
const useLocales = (): Locales => useSelector(getLocales);
|
|
44
|
+
|
|
39
45
|
const getLocaleCodes = createSelector(
|
|
40
46
|
(state) => state.i18n.locales,
|
|
41
47
|
(locales) => locales.map((locale) => locale.code),
|
|
@@ -62,4 +68,11 @@ const useUpdateLocale = (): ((locale: string) => void) => {
|
|
|
62
68
|
);
|
|
63
69
|
};
|
|
64
70
|
|
|
65
|
-
export {
|
|
71
|
+
export {
|
|
72
|
+
useTranslate,
|
|
73
|
+
useMessage,
|
|
74
|
+
useLocale,
|
|
75
|
+
useLocales,
|
|
76
|
+
useLocaleCodes,
|
|
77
|
+
useUpdateLocale,
|
|
78
|
+
};
|
package/esm/hooks/useI18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useI18n.js","names":["useCallback","useDispatch","useSelector","createSelector","memoize","getLocales","getLocale","updateLocale","getMessage","locales","localeCode","id","defaultMessage","placeholders","args","_JSON$stringify","useMessage","useTranslate","useLocale","getLocaleCodes","state","i18n","_mapInstanceProperty","call","locale","code","useLocaleCodes","useUpdateLocale","dispatch"],"sources":["../../src/hooks/useI18n.js"],"sourcesContent":["// @flow\nimport { useCallback } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { createSelector } from \"reselect\";\n\nimport memoize from \"lodash/memoize\";\n\nimport { getLocales, getLocale } from \"../redux/selectors/i18n\";\nimport { updateLocale } from \"../redux/_i18n/I18nActions\";\n\nconst getMessage = createSelector(\n [getLocales, getLocale],\n (locales, localeCode) =>\n memoize(\n (id: string, defaultMessage?: string, placeholders?: Object) =>\n locales\n .getLocale(localeCode)\n .getMessage(id, defaultMessage, placeholders),\n (...args) => JSON.stringify(args),\n ),\n);\n\n/**\n */\nconst useMessage = (\n id: string,\n defaultMessage?: string,\n placeholders?: Object | null,\n): any => useSelector(getMessage)(id, defaultMessage, placeholders);\n\n/**\n */\nconst useTranslate = (): ((...any) => any) => useSelector(getMessage);\n\n/**\n */\nconst useLocale = (): string => useSelector(getLocale);\n\nconst getLocaleCodes = createSelector(\n (state) => state.i18n.locales,\n (locales) => locales.map((locale) => locale.code),\n);\n\n/**\n * Retrieve all available locale codes\n */\nconst useLocaleCodes = (): Array<string> => useSelector(getLocaleCodes);\n\n/**\n * A hook that returns a memoized function to update the application locale.\n *\n * @returns {(locale: string) => void} A memoized function to update the locale.\n */\nconst useUpdateLocale = (): ((locale: string) => void) => {\n const dispatch = useDispatch();\n\n return useCallback(\n (locale: string) => {\n dispatch(updateLocale(locale));\n },\n [dispatch],\n );\n};\n\nexport {
|
|
1
|
+
{"version":3,"file":"useI18n.js","names":["useCallback","useDispatch","useSelector","createSelector","memoize","getLocales","getLocale","updateLocale","getMessage","locales","localeCode","id","defaultMessage","placeholders","args","_JSON$stringify","useMessage","useTranslate","useLocale","useLocales","getLocaleCodes","state","i18n","_mapInstanceProperty","call","locale","code","useLocaleCodes","useUpdateLocale","dispatch"],"sources":["../../src/hooks/useI18n.js"],"sourcesContent":["// @flow\nimport { useCallback } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { createSelector } from \"reselect\";\n\nimport memoize from \"lodash/memoize\";\n\nimport { getLocales, getLocale } from \"../redux/selectors/i18n\";\nimport { updateLocale } from \"../redux/_i18n/I18nActions\";\n\nimport type Locales from \"../i18n/Locales\";\n\nconst getMessage = createSelector(\n [getLocales, getLocale],\n (locales, localeCode) =>\n memoize(\n (id: string, defaultMessage?: string, placeholders?: Object) =>\n locales\n .getLocale(localeCode)\n .getMessage(id, defaultMessage, placeholders),\n (...args) => JSON.stringify(args),\n ),\n);\n\n/**\n */\nconst useMessage = (\n id: string,\n defaultMessage?: string,\n placeholders?: Object | null,\n): any => useSelector(getMessage)(id, defaultMessage, placeholders);\n\n/**\n */\nconst useTranslate = (): ((...any) => any) => useSelector(getMessage);\n\n/**\n */\nconst useLocale = (): string => useSelector(getLocale);\n\n/**\n */\nconst useLocales = (): Locales => useSelector(getLocales);\n\nconst getLocaleCodes = createSelector(\n (state) => state.i18n.locales,\n (locales) => locales.map((locale) => locale.code),\n);\n\n/**\n * Retrieve all available locale codes\n */\nconst useLocaleCodes = (): Array<string> => useSelector(getLocaleCodes);\n\n/**\n * A hook that returns a memoized function to update the application locale.\n *\n * @returns {(locale: string) => void} A memoized function to update the locale.\n */\nconst useUpdateLocale = (): ((locale: string) => void) => {\n const dispatch = useDispatch();\n\n return useCallback(\n (locale: string) => {\n dispatch(updateLocale(locale));\n },\n [dispatch],\n );\n};\n\nexport {\n useTranslate,\n useMessage,\n useLocale,\n useLocales,\n useLocaleCodes,\n useUpdateLocale,\n};\n"],"mappings":";;AACA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,WAAW,EAAEC,WAAW,QAAQ,aAAa;AACtD,SAASC,cAAc,QAAQ,UAAU;AAEzC,OAAOC,OAAO,MAAM,gBAAgB;AAEpC,SAASC,UAAU,EAAEC,SAAS,QAAQ,yBAAyB;AAC/D,SAASC,YAAY,QAAQ,4BAA4B;AAIzD,MAAMC,UAAU,GAAGL,cAAc,CAC/B,CAACE,UAAU,EAAEC,SAAS,CAAC,EACvB,CAACG,OAAO,EAAEC,UAAU,KAClBN,OAAO,CACL,CAACO,EAAU,EAAEC,cAAuB,EAAEC,YAAqB,KACzDJ,OAAO,CACJH,SAAS,CAACI,UAAU,CAAC,CACrBF,UAAU,CAACG,EAAE,EAAEC,cAAc,EAAEC,YAAY,CAAC,EACjD,CAAC,GAAGC,IAAI,KAAKC,eAAA,CAAeD,IAAI,CAClC,CACJ,CAAC;;AAED;AACA;AACA,MAAME,UAAU,GAAGA,CACjBL,EAAU,EACVC,cAAuB,EACvBC,YAA4B,KACpBX,WAAW,CAACM,UAAU,CAAC,CAACG,EAAE,EAAEC,cAAc,EAAEC,YAAY,CAAC;;AAEnE;AACA;AACA,MAAMI,YAAY,GAAGA,CAAA,KAAyBf,WAAW,CAACM,UAAU,CAAC;;AAErE;AACA;AACA,MAAMU,SAAS,GAAGA,CAAA,KAAchB,WAAW,CAACI,SAAS,CAAC;;AAEtD;AACA;AACA,MAAMa,UAAU,GAAGA,CAAA,KAAejB,WAAW,CAACG,UAAU,CAAC;AAEzD,MAAMe,cAAc,GAAGjB,cAAc,CAClCkB,KAAK,IAAKA,KAAK,CAACC,IAAI,CAACb,OAAO,EAC5BA,OAAO,IAAKc,oBAAA,CAAAd,OAAO,EAAAe,IAAA,CAAPf,OAAO,EAAMgB,MAAM,IAAKA,MAAM,CAACC,IAAI,CAClD,CAAC;;AAED;AACA;AACA;AACA,MAAMC,cAAc,GAAGA,CAAA,KAAqBzB,WAAW,CAACkB,cAAc,CAAC;;AAEvE;AACA;AACA;AACA;AACA;AACA,MAAMQ,eAAe,GAAGA,CAAA,KAAkC;EACxD,MAAMC,QAAQ,GAAG5B,WAAW,CAAC,CAAC;EAE9B,OAAOD,WAAW,CACfyB,MAAc,IAAK;IAClBI,QAAQ,CAACtB,YAAY,CAACkB,MAAM,CAAC,CAAC;EAChC,CAAC,EACD,CAACI,QAAQ,CACX,CAAC;AACH,CAAC;AAED,SACEZ,YAAY,EACZD,UAAU,EACVE,SAAS,EACTC,UAAU,EACVQ,cAAc,EACdC,eAAe","ignoreList":[]}
|
|
@@ -8,7 +8,6 @@ export type I18nState = {
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated This manual action type will be removed in a future major release.
|
|
11
|
-
*
|
|
12
11
|
* Recommended fixes:
|
|
13
12
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
14
13
|
* - Use the appropriate hook (useUpdateLocale) to encapsulate this logic.
|
|
@@ -21,7 +20,6 @@ export type UpdateLocaleAction = {
|
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* @deprecated This manual action type will be removed in a future major release.
|
|
24
|
-
*
|
|
25
23
|
* Recommended fixes:
|
|
26
24
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
27
25
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_i18n/types.js"],"sourcesContent":["// @flow\nimport type Locales from \"../../i18n/Locales\";\n\nexport type I18nState = {\n +locales: Locales,\n +locale: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_i18n/types.js"],"sourcesContent":["// @flow\nimport type Locales from \"../../i18n/Locales\";\n\nexport type I18nState = {\n +locales: Locales,\n +locale: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useUpdateLocale) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateLocaleAction = {\n type: \"UPDATE_LOCALE\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetLocalesAction = {\n type: \"SET_LOCALES\",\n payload: {\n locales: Locales,\n locale: string,\n },\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -31,7 +31,6 @@ export type ModularUIState = {
|
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* @deprecated This manual action type will be removed in a future major release.
|
|
34
|
-
*
|
|
35
34
|
* Recommended fixes:
|
|
36
35
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
37
36
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -47,7 +46,6 @@ export type SetModelAction = {
|
|
|
47
46
|
|
|
48
47
|
/**
|
|
49
48
|
* @deprecated This manual action type will be removed in a future major release.
|
|
50
|
-
*
|
|
51
49
|
* Recommended fixes:
|
|
52
50
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
53
51
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -63,7 +61,6 @@ export type InitModelAction = {
|
|
|
63
61
|
|
|
64
62
|
/**
|
|
65
63
|
* @deprecated This manual action type will be removed in a future major release.
|
|
66
|
-
*
|
|
67
64
|
* Recommended fixes:
|
|
68
65
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
69
66
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -76,7 +73,6 @@ export type UpdateModelAction = {
|
|
|
76
73
|
|
|
77
74
|
/**
|
|
78
75
|
* @deprecated This manual action type will be removed in a future major release.
|
|
79
|
-
*
|
|
80
76
|
* Recommended fixes:
|
|
81
77
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
82
78
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -89,7 +85,6 @@ export type UpdateFormAction = {
|
|
|
89
85
|
|
|
90
86
|
/**
|
|
91
87
|
* @deprecated This manual action type will be removed in a future major release.
|
|
92
|
-
*
|
|
93
88
|
* Recommended fixes:
|
|
94
89
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
95
90
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -105,7 +100,6 @@ export type ErrorAction = (
|
|
|
105
100
|
|
|
106
101
|
/**
|
|
107
102
|
* @deprecated This manual action type will be removed in a future major release.
|
|
108
|
-
*
|
|
109
103
|
* Recommended fixes:
|
|
110
104
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
111
105
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -148,7 +142,6 @@ export type ModularUIAction = {
|
|
|
148
142
|
|
|
149
143
|
/**
|
|
150
144
|
* @deprecated This manual action type will be removed in a future major release.
|
|
151
|
-
*
|
|
152
145
|
* Recommended fixes:
|
|
153
146
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
154
147
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -161,7 +154,6 @@ export type RemoveModelByKeyAction = {
|
|
|
161
154
|
|
|
162
155
|
/**
|
|
163
156
|
* @deprecated This manual action type will be removed in a future major release.
|
|
164
|
-
*
|
|
165
157
|
* Recommended fixes:
|
|
166
158
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
167
159
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -173,7 +165,6 @@ export type ResetModularUIAction = {
|
|
|
173
165
|
|
|
174
166
|
/**
|
|
175
167
|
* @deprecated This manual action type will be removed in a future major release.
|
|
176
|
-
*
|
|
177
168
|
* Recommended fixes:
|
|
178
169
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
179
170
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_modularui/types.js"],"sourcesContent":["// @flow\nimport type { ModularUIModel } from \"../../models/types\";\nimport type Href from \"../../models/href/Href\";\nimport type { FetchException } from \"../../exceptions\";\nimport type { NoAction } from \"../types\";\nimport typeof {\n HTTP_METHODS,\n MODULARUI_STATUS,\n} from \"../../constants/Constants\";\nimport type { ComponentType } from \"react\";\nimport type { TargetModel } from \"../../modularui/types\";\nimport type { RequestModularUIOptions } from \"../../utils/fetch/types\";\n\nexport type ModularUIOptions = {\n propName?: string,\n removeOnUnmount?: boolean,\n ...RequestModularUIOptions,\n};\n\nexport type ModelEntry = {\n +status: string,\n +model: ModularUIModel,\n +lastModification: number,\n +requestOptions?: any,\n};\n\nexport type ModularUIState = {\n [string]: ModelEntry,\n ...\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_modularui/types.js"],"sourcesContent":["// @flow\nimport type { ModularUIModel } from \"../../models/types\";\nimport type Href from \"../../models/href/Href\";\nimport type { FetchException } from \"../../exceptions\";\nimport type { NoAction } from \"../types\";\nimport typeof {\n HTTP_METHODS,\n MODULARUI_STATUS,\n} from \"../../constants/Constants\";\nimport type { ComponentType } from \"react\";\nimport type { TargetModel } from \"../../modularui/types\";\nimport type { RequestModularUIOptions } from \"../../utils/fetch/types\";\n\nexport type ModularUIOptions = {\n propName?: string,\n removeOnUnmount?: boolean,\n ...RequestModularUIOptions,\n};\n\nexport type ModelEntry = {\n +status: string,\n +model: ModularUIModel,\n +lastModification: number,\n +requestOptions?: any,\n};\n\nexport type ModularUIState = {\n [string]: ModelEntry,\n ...\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetModelAction = {\n type: \"MODULARUI/SET\",\n payload: {\n key: string,\n model: ?ModularUIModel,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type InitModelAction = {\n type: \"MODULARUI/INIT\",\n payload: Array<{\n key: string,\n model: ModularUIModel,\n }>,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateModelAction = {\n type: \"MODULARUI/UPDATE\",\n payload: ModularUIModel,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateFormAction = {\n type: \"MODULARUI/UPDATE_FORM\",\n payload: ModularUIModel,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SuccessAction = (\n model: ModularUIModel,\n) => UpdateModelAction | SetModelAction;\n\nexport type ErrorAction = (\n error: FetchException,\n) => UpdateStatusAction | RemoveModelByKeyAction | NoAction;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ModularUIAction = {\n type: \"MODULARUI/FETCH\",\n payload: {\n key: string,\n origin?: string,\n contextPath?: string,\n href: Href,\n method?: $Keys<HTTP_METHODS>,\n params?: string,\n data?: any,\n timeout?: number,\n headers?: {\n [headerName: string]: string,\n Accept?: string,\n \"Accept-Language\"?: string,\n \"Content-Type\"?: string,\n \"x-filename\"?: string,\n \"x-filesize\"?: string,\n },\n events?: { [eventName: string]: () => void },\n onProgress?: ProgressEventHandler,\n locale: string,\n childmodels?: boolean,\n targetModel?: TargetModel,\n forceTargetModel?: boolean,\n cache?: boolean,\n isReload?: boolean,\n withCredentials?: boolean,\n successAction: (\n model: ModularUIModel,\n ) => UpdateModelAction | SetModelAction,\n errorAction?: ErrorAction,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type RemoveModelByKeyAction = {\n type: \"MODULARUI/REMOVE_KEY\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ResetModularUIAction = {\n type: \"MODULARUI/RESET\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateStatusAction = {\n type: \"MODULARUI/STATUS\",\n payload: {\n key: string,\n status: $Keys<MODULARUI_STATUS>,\n requestOptions: any,\n },\n};\n\nexport type ModularUIConnector = (\n Component: ComponentType<any>,\n) => ComponentType<any>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -8,7 +8,6 @@ export type RouterState = {
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated This manual action type will be removed in a future major release.
|
|
11
|
-
*
|
|
12
11
|
* Recommended fixes:
|
|
13
12
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
14
13
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -24,7 +23,6 @@ export type LocationChangeAction = {
|
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
25
|
* @deprecated This manual action type will be removed in a future major release.
|
|
27
|
-
*
|
|
28
26
|
* Recommended fixes:
|
|
29
27
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
30
28
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -40,7 +38,6 @@ export type PushAction = {
|
|
|
40
38
|
|
|
41
39
|
/**
|
|
42
40
|
* @deprecated This manual action type will be removed in a future major release.
|
|
43
|
-
*
|
|
44
41
|
* Recommended fixes:
|
|
45
42
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
46
43
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -56,7 +53,6 @@ export type ReplaceAction = {
|
|
|
56
53
|
|
|
57
54
|
/**
|
|
58
55
|
* @deprecated This manual action type will be removed in a future major release.
|
|
59
|
-
*
|
|
60
56
|
* Recommended fixes:
|
|
61
57
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
62
58
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -71,7 +67,6 @@ export type GoAction = {
|
|
|
71
67
|
|
|
72
68
|
/**
|
|
73
69
|
* @deprecated This manual action type will be removed in a future major release.
|
|
74
|
-
*
|
|
75
70
|
* Recommended fixes:
|
|
76
71
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
77
72
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -83,7 +78,6 @@ export type GoBackAction = {
|
|
|
83
78
|
|
|
84
79
|
/**
|
|
85
80
|
* @deprecated This manual action type will be removed in a future major release.
|
|
86
|
-
*
|
|
87
81
|
* Recommended fixes:
|
|
88
82
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
89
83
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_router/types.js"],"sourcesContent":["// @flow\nimport type { HistoryAction, Location, LocationShape } from \"react-router\";\n\nexport type RouterState = {\n +location: Location,\n +action: HistoryAction,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_router/types.js"],"sourcesContent":["// @flow\nimport type { HistoryAction, Location, LocationShape } from \"react-router\";\n\nexport type RouterState = {\n +location: Location,\n +action: HistoryAction,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type LocationChangeAction = {\n type: \"ROUTER/LOCATION_CHANGE\",\n payload: {\n location: Location,\n action: HistoryAction,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type PushAction = {\n type: \"ROUTER/PUSH\",\n payload: {\n location: string | LocationShape,\n state?: { ... },\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ReplaceAction = {\n type: \"ROUTER/REPLACE\",\n payload: {\n location: string | LocationShape,\n state?: { ... },\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type GoAction = {\n type: \"ROUTER/GO\",\n payload: {\n delta: number,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type GoBackAction = {\n type: \"ROUTER/GOBACK\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type GoForwardAction = {\n type: \"ROUTER/GOFORWARD\",\n};\n"],"mappings":"","ignoreList":[]}
|
package/esm/redux/types.js.flow
CHANGED
|
@@ -61,7 +61,6 @@ export type NoAction = {
|
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* @deprecated This manual action type will be removed in a future major release.
|
|
64
|
-
*
|
|
65
64
|
* Recommended fixes:
|
|
66
65
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
67
66
|
* - Use the appropriate hook (useErrorHandler) to encapsulate this logic.
|
|
@@ -74,7 +73,6 @@ export type SaveErrorAction = {
|
|
|
74
73
|
|
|
75
74
|
/**
|
|
76
75
|
* @deprecated This manual action type will be removed in a future major release.
|
|
77
|
-
*
|
|
78
76
|
* Recommended fixes:
|
|
79
77
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
80
78
|
* - Use the appropriate hook (useModal) to encapsulate this logic.
|
|
@@ -87,7 +85,6 @@ export type ShowModalAction = {
|
|
|
87
85
|
|
|
88
86
|
/**
|
|
89
87
|
* @deprecated This manual action type will be removed in a future major release.
|
|
90
|
-
*
|
|
91
88
|
* Recommended fixes:
|
|
92
89
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
93
90
|
* - Use the appropriate hook (useModal) to encapsulate this logic.
|
|
@@ -100,7 +97,6 @@ export type CloseModalAction = {
|
|
|
100
97
|
|
|
101
98
|
/**
|
|
102
99
|
* @deprecated This manual action type will be removed in a future major release.
|
|
103
|
-
*
|
|
104
100
|
* Recommended fixes:
|
|
105
101
|
* - Type component props as a simple callback: e.g. onDismiss: () => void`.
|
|
106
102
|
* - Use the appropriate hook (useNotification) to encapsulate this logic.
|
|
@@ -111,7 +107,6 @@ export type DismissNotificationAction = {
|
|
|
111
107
|
};
|
|
112
108
|
/**
|
|
113
109
|
* @deprecated This manual action type will be removed in a future major release.
|
|
114
|
-
*
|
|
115
110
|
* Recommended fixes:
|
|
116
111
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
117
112
|
* - Use the appropriate hook (useNotification) to encapsulate this logic.
|
|
@@ -128,7 +123,6 @@ export type ShowNotificationAction = {
|
|
|
128
123
|
|
|
129
124
|
/**
|
|
130
125
|
* @deprecated This manual action type will be removed in a future major release.
|
|
131
|
-
*
|
|
132
126
|
* Recommended fixes:
|
|
133
127
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
134
128
|
* - Use the appropriate hook (usePreference) to encapsulate this logic.
|
|
@@ -140,7 +134,6 @@ export type SetPreferenceAction = {
|
|
|
140
134
|
};
|
|
141
135
|
/**
|
|
142
136
|
* @deprecated This manual action type will be removed in a future major release.
|
|
143
|
-
*
|
|
144
137
|
* Recommended fixes:
|
|
145
138
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
146
139
|
* - Use the appropriate hook (usePreference) to encapsulate this logic.
|
|
@@ -153,7 +146,6 @@ export type SetPreferencesAction = {
|
|
|
153
146
|
|
|
154
147
|
/**
|
|
155
148
|
* @deprecated This manual action type will be removed in a future major release.
|
|
156
|
-
*
|
|
157
149
|
* Recommended fixes:
|
|
158
150
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
159
151
|
* - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.
|
|
@@ -164,7 +156,6 @@ export type StartProgressAction = {
|
|
|
164
156
|
};
|
|
165
157
|
/**
|
|
166
158
|
* @deprecated This manual action type will be removed in a future major release.
|
|
167
|
-
*
|
|
168
159
|
* Recommended fixes:
|
|
169
160
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
170
161
|
* - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.
|
|
@@ -175,7 +166,6 @@ export type FinishProgressAction = {
|
|
|
175
166
|
};
|
|
176
167
|
/**
|
|
177
168
|
* @deprecated This manual action type will be removed in a future major release.
|
|
178
|
-
*
|
|
179
169
|
* Recommended fixes:
|
|
180
170
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
181
171
|
* - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.
|
|
@@ -186,7 +176,6 @@ export type ResetProgressAction = {
|
|
|
186
176
|
};
|
|
187
177
|
/**
|
|
188
178
|
* @deprecated This manual action type will be removed in a future major release.
|
|
189
|
-
*
|
|
190
179
|
* Recommended fixes:
|
|
191
180
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
192
181
|
* - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.
|
|
@@ -199,7 +188,6 @@ export type UpdateProgressAction = {
|
|
|
199
188
|
|
|
200
189
|
/**
|
|
201
190
|
* @deprecated This manual action type will be removed in a future major release.
|
|
202
|
-
*
|
|
203
191
|
* Recommended fixes:
|
|
204
192
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
205
193
|
* - Use the appropriate hook (useAuthentication) to encapsulate this logic.
|
|
@@ -212,7 +200,6 @@ export type SendAuthenticationErrorAction = {
|
|
|
212
200
|
|
|
213
201
|
/**
|
|
214
202
|
* @deprecated This manual action type will be removed in a future major release.
|
|
215
|
-
*
|
|
216
203
|
* Recommended fixes:
|
|
217
204
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
218
205
|
* - Use the appropriate hook (useAuthentication) to encapsulate this logic.
|
|
@@ -224,7 +211,6 @@ export type ResetAuthErrorsAction = {
|
|
|
224
211
|
|
|
225
212
|
/**
|
|
226
213
|
* @deprecated This manual action type will be removed in a future major release.
|
|
227
|
-
*
|
|
228
214
|
* Recommended fixes:
|
|
229
215
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
230
216
|
* - Use the appropriate hook (useAuthentication) to encapsulate this logic.
|
|
@@ -236,7 +222,6 @@ export type LoginSuccessAction = {
|
|
|
236
222
|
|
|
237
223
|
/**
|
|
238
224
|
* @deprecated This manual action type will be removed in a future major release.
|
|
239
|
-
*
|
|
240
225
|
* Recommended fixes:
|
|
241
226
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
242
227
|
* - Use the appropriate hook (useAuthentication) to encapsulate this logic.
|
|
@@ -248,7 +233,6 @@ export type ChangePasswordAction = {
|
|
|
248
233
|
|
|
249
234
|
/**
|
|
250
235
|
* @deprecated This manual action type will be removed in a future major release.
|
|
251
|
-
*
|
|
252
236
|
* Recommended fixes:
|
|
253
237
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
254
238
|
* - Use the appropriate hook (useAuthentication) to encapsulate this logic.
|
|
@@ -260,7 +244,6 @@ export type LogoutSuccessAction = {
|
|
|
260
244
|
|
|
261
245
|
/**
|
|
262
246
|
* @deprecated This manual action type will be removed in a future major release.
|
|
263
|
-
*
|
|
264
247
|
* Recommended fixes:
|
|
265
248
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
266
249
|
* - Use the appropriate hook (useFormNavigation) to encapsulate this logic.
|
|
@@ -276,7 +259,6 @@ export type UpdateAutosaveAction = {
|
|
|
276
259
|
|
|
277
260
|
/**
|
|
278
261
|
* @deprecated This manual action type will be removed in a future major release.
|
|
279
|
-
*
|
|
280
262
|
* Recommended fixes:
|
|
281
263
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
282
264
|
* - Use the appropriate hook to encapsulate this logic.
|
|
@@ -327,58 +309,23 @@ export type ReduxAction =
|
|
|
327
309
|
| ModularUIAction
|
|
328
310
|
| NoAction;
|
|
329
311
|
|
|
330
|
-
/**
|
|
331
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
332
|
-
*
|
|
333
|
-
* Recommended fixes:
|
|
334
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
335
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
336
|
-
*/
|
|
337
312
|
export type AuthState = {
|
|
338
313
|
+mustChangePassword: boolean,
|
|
339
314
|
+error: ?string,
|
|
340
315
|
};
|
|
341
316
|
|
|
342
|
-
/**
|
|
343
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
344
|
-
*
|
|
345
|
-
* Recommended fixes:
|
|
346
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
347
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
348
|
-
*/
|
|
349
317
|
export type ErrorState = null | ErrorResponse;
|
|
350
318
|
|
|
351
|
-
/**
|
|
352
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
353
|
-
*
|
|
354
|
-
* Recommended fixes:
|
|
355
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
356
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
357
|
-
*/
|
|
358
319
|
export type ModalState = {
|
|
359
320
|
+key: string,
|
|
360
321
|
+visible: boolean,
|
|
361
322
|
+size?: string,
|
|
362
323
|
};
|
|
363
324
|
|
|
364
|
-
/**
|
|
365
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
366
|
-
*
|
|
367
|
-
* Recommended fixes:
|
|
368
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
369
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
370
|
-
*/
|
|
371
325
|
export type ModalsState = {
|
|
372
326
|
+modals: Array<ModalState>,
|
|
373
327
|
};
|
|
374
328
|
|
|
375
|
-
/**
|
|
376
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
377
|
-
*
|
|
378
|
-
* Recommended fixes:
|
|
379
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
380
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
381
|
-
*/
|
|
382
329
|
export type NotificationState = {
|
|
383
330
|
+render: boolean,
|
|
384
331
|
+messageType: string | null,
|
|
@@ -386,48 +333,20 @@ export type NotificationState = {
|
|
|
386
333
|
+error: ?ErrorResponse | null,
|
|
387
334
|
};
|
|
388
335
|
|
|
389
|
-
/**
|
|
390
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
391
|
-
*
|
|
392
|
-
* Recommended fixes:
|
|
393
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
394
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
395
|
-
*/
|
|
396
336
|
export type PreferencesState = {
|
|
397
337
|
+[name: string]: PreferenceValue,
|
|
398
338
|
};
|
|
399
339
|
|
|
400
|
-
/**
|
|
401
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
402
|
-
*
|
|
403
|
-
* Recommended fixes:
|
|
404
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
405
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
406
|
-
*/
|
|
407
340
|
export type ProgressIndicatorState = {
|
|
408
341
|
+count: number,
|
|
409
342
|
+timestamp: number,
|
|
410
343
|
+percentComplete: number,
|
|
411
344
|
};
|
|
412
345
|
|
|
413
|
-
/**
|
|
414
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
415
|
-
*
|
|
416
|
-
* Recommended fixes:
|
|
417
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
418
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
419
|
-
*/
|
|
420
346
|
export type ModelCatalogState = {
|
|
421
347
|
entryDate: ISO_DATE | null,
|
|
422
348
|
};
|
|
423
349
|
|
|
424
|
-
/**
|
|
425
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
426
|
-
*
|
|
427
|
-
* Recommended fixes:
|
|
428
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
429
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
430
|
-
*/
|
|
431
350
|
export type ReduxState = {
|
|
432
351
|
+router: RouterState,
|
|
433
352
|
+modularui: ModularUIState,
|
|
@@ -442,49 +361,15 @@ export type ReduxState = {
|
|
|
442
361
|
...
|
|
443
362
|
};
|
|
444
363
|
|
|
445
|
-
/**
|
|
446
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
447
|
-
*
|
|
448
|
-
* Recommended fixes:
|
|
449
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
450
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
451
|
-
*/
|
|
452
364
|
export type GetState = () => ReduxState;
|
|
453
365
|
|
|
454
|
-
/**
|
|
455
|
-
* A function that accepts a listener callback and returns an unsubscribe function.
|
|
456
|
-
*/
|
|
457
|
-
/**
|
|
458
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
459
|
-
*
|
|
460
|
-
* Recommended fixes:
|
|
461
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
462
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
463
|
-
*/
|
|
464
366
|
export type Subscribe = (listener: () => void) => () => void;
|
|
465
367
|
|
|
466
|
-
/**
|
|
467
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
468
|
-
*
|
|
469
|
-
* Recommended fixes:
|
|
470
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
471
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
472
|
-
*/
|
|
473
368
|
export type ThunkExtra = {
|
|
474
369
|
subscribe: Subscribe,
|
|
475
370
|
...
|
|
476
371
|
};
|
|
477
372
|
|
|
478
|
-
// 1. Define ThunkAction first.
|
|
479
|
-
// We use 'any' for Dispatch here temporarily to break the circularity
|
|
480
|
-
// or use the specialized function type.
|
|
481
|
-
/**
|
|
482
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
483
|
-
*
|
|
484
|
-
* Recommended fixes:
|
|
485
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
486
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
487
|
-
*/
|
|
488
373
|
export type ThunkAction<R = any> = (
|
|
489
374
|
dispatch: Dispatch,
|
|
490
375
|
getState: GetState,
|
|
@@ -493,52 +378,24 @@ export type ThunkAction<R = any> = (
|
|
|
493
378
|
|
|
494
379
|
/**
|
|
495
380
|
* @deprecated This manual action type will be removed in a future major release.
|
|
496
|
-
*
|
|
497
381
|
* Recommended fixes:
|
|
498
382
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
499
383
|
* - Use the appropriate hook to encapsulate this logic.
|
|
500
384
|
*/
|
|
501
385
|
export type PromiseAction = Promise<ReduxAction | ThunkAction<any>>;
|
|
502
386
|
|
|
503
|
-
// 2. Define Dispatch as a naked function type.
|
|
504
|
-
// This is much more reliable in modern Flow than DispatchAPI<...>.
|
|
505
|
-
/**
|
|
506
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
507
|
-
*
|
|
508
|
-
* Recommended fixes:
|
|
509
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
510
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
511
|
-
*/
|
|
512
387
|
export type Dispatch = (
|
|
513
388
|
action: ReduxAction | ThunkAction<any> | PromiseAction,
|
|
514
389
|
) => any;
|
|
515
390
|
|
|
516
|
-
// 3. Update ReduxStore to use the ReduxAction for the base reducer
|
|
517
|
-
// but our custom Dispatch for the store instance.
|
|
518
|
-
/**
|
|
519
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
520
|
-
*
|
|
521
|
-
* Recommended fixes:
|
|
522
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
523
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
524
|
-
*/
|
|
525
391
|
export type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;
|
|
526
392
|
|
|
527
|
-
// 4. Clean up PossibleAction if you still use it elsewhere
|
|
528
393
|
/**
|
|
529
394
|
* @deprecated This manual action type will be removed in a future major release.
|
|
530
|
-
*
|
|
531
395
|
* Recommended fixes:
|
|
532
396
|
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
533
397
|
* - Use the appropriate hook to encapsulate this logic.
|
|
534
398
|
*/
|
|
535
399
|
export type PossibleAction = ReduxAction | ThunkAction<any> | PromiseAction;
|
|
536
400
|
|
|
537
|
-
/**
|
|
538
|
-
* @deprecated This manual action type will be removed in a future major release.
|
|
539
|
-
*
|
|
540
|
-
* Recommended fixes:
|
|
541
|
-
* - Type component props as a simple callback: e.g. `onDismiss: () => void`.
|
|
542
|
-
* - Use the appropriate hook to encapsulate this logic.
|
|
543
|
-
*/
|
|
544
401
|
export type CustomReducers = { [reducerKey: string]: any };
|
package/esm/redux/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n UpdateFormAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n InitModelAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n autoupdate: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n */\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useErrorHandler) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useModal) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useModal) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. onDismiss: () => void`.\n * - Use the appropriate hook (useNotification) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useNotification) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (usePreference) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (usePreference) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SendAuthenticationErrorAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useFormNavigation) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateEntryDateAction = {\n type: \"UPDATE_ENTRYDATE\",\n payload: ISO_DATE,\n};\n\n/**\n * @deprecated This union type is a legacy pattern and is not maintained for new actions.\n */\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | InitModelAction\n | UpdateModelAction\n | UpdateFormAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | ResetAuthErrorsAction\n | SendAuthenticationErrorAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | UpdateEntryDateAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type AuthState = {\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ErrorState = null | ErrorResponse;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ModelCatalogState = {\n entryDate: ISO_DATE | null,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +modelcatalog: ModelCatalogState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type GetState = () => ReduxState;\n\n/**\n * A function that accepts a listener callback and returns an unsubscribe function.\n */\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type Subscribe = (listener: () => void) => () => void;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ThunkExtra = {\n subscribe: Subscribe,\n ...\n};\n\n// 1. Define ThunkAction first.\n// We use 'any' for Dispatch here temporarily to break the circularity\n// or use the specialized function type.\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ThunkAction<R = any> = (\n dispatch: Dispatch,\n getState: GetState,\n extra: ThunkExtra,\n) => R;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type PromiseAction = Promise<ReduxAction | ThunkAction<any>>;\n\n// 2. Define Dispatch as a naked function type.\n// This is much more reliable in modern Flow than DispatchAPI<...>.\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type Dispatch = (\n action: ReduxAction | ThunkAction<any> | PromiseAction,\n) => any;\n\n// 3. Update ReduxStore to use the ReduxAction for the base reducer\n// but our custom Dispatch for the store instance.\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\n// 4. Clean up PossibleAction if you still use it elsewhere\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type PossibleAction = ReduxAction | ThunkAction<any> | PromiseAction;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n UpdateFormAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n InitModelAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n autoupdate: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n */\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useErrorHandler) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useModal) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useModal) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. onDismiss: () => void`.\n * - Use the appropriate hook (useNotification) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useNotification) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (usePreference) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (usePreference) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SendAuthenticationErrorAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useFormNavigation) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateEntryDateAction = {\n type: \"UPDATE_ENTRYDATE\",\n payload: ISO_DATE,\n};\n\n/**\n * @deprecated This union type is a legacy pattern and is not maintained for new actions.\n */\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | InitModelAction\n | UpdateModelAction\n | UpdateFormAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | ResetAuthErrorsAction\n | SendAuthenticationErrorAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | UpdateEntryDateAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\nexport type AuthState = {\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\nexport type ErrorState = null | ErrorResponse;\n\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\nexport type ModelCatalogState = {\n entryDate: ISO_DATE | null,\n};\n\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +modelcatalog: ModelCatalogState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\nexport type GetState = () => ReduxState;\n\nexport type Subscribe = (listener: () => void) => () => void;\n\nexport type ThunkExtra = {\n subscribe: Subscribe,\n ...\n};\n\nexport type ThunkAction<R = any> = (\n dispatch: Dispatch,\n getState: GetState,\n extra: ThunkExtra,\n) => R;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type PromiseAction = Promise<ReduxAction | ThunkAction<any>>;\n\nexport type Dispatch = (\n action: ReduxAction | ThunkAction<any> | PromiseAction,\n) => any;\n\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type PossibleAction = ReduxAction | ThunkAction<any> | PromiseAction;\n\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":"","ignoreList":[]}
|
package/lib/hooks/useI18n.js
CHANGED
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.useUpdateLocale = exports.useTranslate = exports.useMessage = exports.useLocaleCodes = exports.useLocale = void 0;
|
|
7
|
+
exports.useUpdateLocale = exports.useTranslate = exports.useMessage = exports.useLocales = exports.useLocaleCodes = exports.useLocale = void 0;
|
|
8
8
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
9
9
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
10
10
|
var _react = require("react");
|
|
@@ -28,7 +28,12 @@ const useTranslate = () => (0, _reactRedux.useSelector)(getMessage);
|
|
|
28
28
|
*/
|
|
29
29
|
exports.useTranslate = useTranslate;
|
|
30
30
|
const useLocale = () => (0, _reactRedux.useSelector)(_i18n.getLocale);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
*/
|
|
31
34
|
exports.useLocale = useLocale;
|
|
35
|
+
const useLocales = () => (0, _reactRedux.useSelector)(_i18n.getLocales);
|
|
36
|
+
exports.useLocales = useLocales;
|
|
32
37
|
const getLocaleCodes = (0, _reselect.createSelector)(state => state.i18n.locales, locales => (0, _map.default)(locales).call(locales, locale => locale.code));
|
|
33
38
|
|
|
34
39
|
/**
|
package/lib/hooks/useI18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useI18n.js","names":["_react","require","_reactRedux","_reselect","_memoize","_interopRequireDefault","_i18n","_I18nActions","getMessage","createSelector","getLocales","getLocale","locales","localeCode","memoize","id","defaultMessage","placeholders","args","_stringify","default","useMessage","useSelector","exports","useTranslate","useLocale","getLocaleCodes","state","i18n","_map","call","locale","code","useLocaleCodes","useUpdateLocale","dispatch","useDispatch","useCallback","updateLocale"],"sources":["../../src/hooks/useI18n.js"],"sourcesContent":["// @flow\nimport { useCallback } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { createSelector } from \"reselect\";\n\nimport memoize from \"lodash/memoize\";\n\nimport { getLocales, getLocale } from \"../redux/selectors/i18n\";\nimport { updateLocale } from \"../redux/_i18n/I18nActions\";\n\nconst getMessage = createSelector(\n [getLocales, getLocale],\n (locales, localeCode) =>\n memoize(\n (id: string, defaultMessage?: string, placeholders?: Object) =>\n locales\n .getLocale(localeCode)\n .getMessage(id, defaultMessage, placeholders),\n (...args) => JSON.stringify(args),\n ),\n);\n\n/**\n */\nconst useMessage = (\n id: string,\n defaultMessage?: string,\n placeholders?: Object | null,\n): any => useSelector(getMessage)(id, defaultMessage, placeholders);\n\n/**\n */\nconst useTranslate = (): ((...any) => any) => useSelector(getMessage);\n\n/**\n */\nconst useLocale = (): string => useSelector(getLocale);\n\nconst getLocaleCodes = createSelector(\n (state) => state.i18n.locales,\n (locales) => locales.map((locale) => locale.code),\n);\n\n/**\n * Retrieve all available locale codes\n */\nconst useLocaleCodes = (): Array<string> => useSelector(getLocaleCodes);\n\n/**\n * A hook that returns a memoized function to update the application locale.\n *\n * @returns {(locale: string) => void} A memoized function to update the locale.\n */\nconst useUpdateLocale = (): ((locale: string) => void) => {\n const dispatch = useDispatch();\n\n return useCallback(\n (locale: string) => {\n dispatch(updateLocale(locale));\n },\n [dispatch],\n );\n};\n\nexport {
|
|
1
|
+
{"version":3,"file":"useI18n.js","names":["_react","require","_reactRedux","_reselect","_memoize","_interopRequireDefault","_i18n","_I18nActions","getMessage","createSelector","getLocales","getLocale","locales","localeCode","memoize","id","defaultMessage","placeholders","args","_stringify","default","useMessage","useSelector","exports","useTranslate","useLocale","useLocales","getLocaleCodes","state","i18n","_map","call","locale","code","useLocaleCodes","useUpdateLocale","dispatch","useDispatch","useCallback","updateLocale"],"sources":["../../src/hooks/useI18n.js"],"sourcesContent":["// @flow\nimport { useCallback } from \"react\";\nimport { useDispatch, useSelector } from \"react-redux\";\nimport { createSelector } from \"reselect\";\n\nimport memoize from \"lodash/memoize\";\n\nimport { getLocales, getLocale } from \"../redux/selectors/i18n\";\nimport { updateLocale } from \"../redux/_i18n/I18nActions\";\n\nimport type Locales from \"../i18n/Locales\";\n\nconst getMessage = createSelector(\n [getLocales, getLocale],\n (locales, localeCode) =>\n memoize(\n (id: string, defaultMessage?: string, placeholders?: Object) =>\n locales\n .getLocale(localeCode)\n .getMessage(id, defaultMessage, placeholders),\n (...args) => JSON.stringify(args),\n ),\n);\n\n/**\n */\nconst useMessage = (\n id: string,\n defaultMessage?: string,\n placeholders?: Object | null,\n): any => useSelector(getMessage)(id, defaultMessage, placeholders);\n\n/**\n */\nconst useTranslate = (): ((...any) => any) => useSelector(getMessage);\n\n/**\n */\nconst useLocale = (): string => useSelector(getLocale);\n\n/**\n */\nconst useLocales = (): Locales => useSelector(getLocales);\n\nconst getLocaleCodes = createSelector(\n (state) => state.i18n.locales,\n (locales) => locales.map((locale) => locale.code),\n);\n\n/**\n * Retrieve all available locale codes\n */\nconst useLocaleCodes = (): Array<string> => useSelector(getLocaleCodes);\n\n/**\n * A hook that returns a memoized function to update the application locale.\n *\n * @returns {(locale: string) => void} A memoized function to update the locale.\n */\nconst useUpdateLocale = (): ((locale: string) => void) => {\n const dispatch = useDispatch();\n\n return useCallback(\n (locale: string) => {\n dispatch(updateLocale(locale));\n },\n [dispatch],\n );\n};\n\nexport {\n useTranslate,\n useMessage,\n useLocale,\n useLocales,\n useLocaleCodes,\n useUpdateLocale,\n};\n"],"mappings":";;;;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAIA,MAAMO,UAAU,GAAG,IAAAC,wBAAc,EAC/B,CAACC,gBAAU,EAAEC,eAAS,CAAC,EACvB,CAACC,OAAO,EAAEC,UAAU,KAClB,IAAAC,gBAAO,EACL,CAACC,EAAU,EAAEC,cAAuB,EAAEC,YAAqB,KACzDL,OAAO,CACJD,SAAS,CAACE,UAAU,CAAC,CACrBL,UAAU,CAACO,EAAE,EAAEC,cAAc,EAAEC,YAAY,CAAC,EACjD,CAAC,GAAGC,IAAI,KAAK,IAAAC,UAAA,CAAAC,OAAA,EAAeF,IAAI,CAClC,CACJ,CAAC;;AAED;AACA;AACA,MAAMG,UAAU,GAAGA,CACjBN,EAAU,EACVC,cAAuB,EACvBC,YAA4B,KACpB,IAAAK,uBAAW,EAACd,UAAU,CAAC,CAACO,EAAE,EAAEC,cAAc,EAAEC,YAAY,CAAC;;AAEnE;AACA;AADAM,OAAA,CAAAF,UAAA,GAAAA,UAAA;AAEA,MAAMG,YAAY,GAAGA,CAAA,KAAyB,IAAAF,uBAAW,EAACd,UAAU,CAAC;;AAErE;AACA;AADAe,OAAA,CAAAC,YAAA,GAAAA,YAAA;AAEA,MAAMC,SAAS,GAAGA,CAAA,KAAc,IAAAH,uBAAW,EAACX,eAAS,CAAC;;AAEtD;AACA;AADAY,OAAA,CAAAE,SAAA,GAAAA,SAAA;AAEA,MAAMC,UAAU,GAAGA,CAAA,KAAe,IAAAJ,uBAAW,EAACZ,gBAAU,CAAC;AAACa,OAAA,CAAAG,UAAA,GAAAA,UAAA;AAE1D,MAAMC,cAAc,GAAG,IAAAlB,wBAAc,EAClCmB,KAAK,IAAKA,KAAK,CAACC,IAAI,CAACjB,OAAO,EAC5BA,OAAO,IAAK,IAAAkB,IAAA,CAAAV,OAAA,EAAAR,OAAO,EAAAmB,IAAA,CAAPnB,OAAO,EAAMoB,MAAM,IAAKA,MAAM,CAACC,IAAI,CAClD,CAAC;;AAED;AACA;AACA;AACA,MAAMC,cAAc,GAAGA,CAAA,KAAqB,IAAAZ,uBAAW,EAACK,cAAc,CAAC;;AAEvE;AACA;AACA;AACA;AACA;AAJAJ,OAAA,CAAAW,cAAA,GAAAA,cAAA;AAKA,MAAMC,eAAe,GAAGA,CAAA,KAAkC;EACxD,MAAMC,QAAQ,GAAG,IAAAC,uBAAW,EAAC,CAAC;EAE9B,OAAO,IAAAC,kBAAW,EACfN,MAAc,IAAK;IAClBI,QAAQ,CAAC,IAAAG,yBAAY,EAACP,MAAM,CAAC,CAAC;EAChC,CAAC,EACD,CAACI,QAAQ,CACX,CAAC;AACH,CAAC;AAACb,OAAA,CAAAY,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_i18n/types.js"],"sourcesContent":["// @flow\nimport type Locales from \"../../i18n/Locales\";\n\nexport type I18nState = {\n +locales: Locales,\n +locale: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_i18n/types.js"],"sourcesContent":["// @flow\nimport type Locales from \"../../i18n/Locales\";\n\nexport type I18nState = {\n +locales: Locales,\n +locale: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useUpdateLocale) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateLocaleAction = {\n type: \"UPDATE_LOCALE\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetLocalesAction = {\n type: \"SET_LOCALES\",\n payload: {\n locales: Locales,\n locale: string,\n },\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_modularui/types.js"],"sourcesContent":["// @flow\nimport type { ModularUIModel } from \"../../models/types\";\nimport type Href from \"../../models/href/Href\";\nimport type { FetchException } from \"../../exceptions\";\nimport type { NoAction } from \"../types\";\nimport typeof {\n HTTP_METHODS,\n MODULARUI_STATUS,\n} from \"../../constants/Constants\";\nimport type { ComponentType } from \"react\";\nimport type { TargetModel } from \"../../modularui/types\";\nimport type { RequestModularUIOptions } from \"../../utils/fetch/types\";\n\nexport type ModularUIOptions = {\n propName?: string,\n removeOnUnmount?: boolean,\n ...RequestModularUIOptions,\n};\n\nexport type ModelEntry = {\n +status: string,\n +model: ModularUIModel,\n +lastModification: number,\n +requestOptions?: any,\n};\n\nexport type ModularUIState = {\n [string]: ModelEntry,\n ...\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_modularui/types.js"],"sourcesContent":["// @flow\nimport type { ModularUIModel } from \"../../models/types\";\nimport type Href from \"../../models/href/Href\";\nimport type { FetchException } from \"../../exceptions\";\nimport type { NoAction } from \"../types\";\nimport typeof {\n HTTP_METHODS,\n MODULARUI_STATUS,\n} from \"../../constants/Constants\";\nimport type { ComponentType } from \"react\";\nimport type { TargetModel } from \"../../modularui/types\";\nimport type { RequestModularUIOptions } from \"../../utils/fetch/types\";\n\nexport type ModularUIOptions = {\n propName?: string,\n removeOnUnmount?: boolean,\n ...RequestModularUIOptions,\n};\n\nexport type ModelEntry = {\n +status: string,\n +model: ModularUIModel,\n +lastModification: number,\n +requestOptions?: any,\n};\n\nexport type ModularUIState = {\n [string]: ModelEntry,\n ...\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetModelAction = {\n type: \"MODULARUI/SET\",\n payload: {\n key: string,\n model: ?ModularUIModel,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type InitModelAction = {\n type: \"MODULARUI/INIT\",\n payload: Array<{\n key: string,\n model: ModularUIModel,\n }>,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateModelAction = {\n type: \"MODULARUI/UPDATE\",\n payload: ModularUIModel,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateFormAction = {\n type: \"MODULARUI/UPDATE_FORM\",\n payload: ModularUIModel,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SuccessAction = (\n model: ModularUIModel,\n) => UpdateModelAction | SetModelAction;\n\nexport type ErrorAction = (\n error: FetchException,\n) => UpdateStatusAction | RemoveModelByKeyAction | NoAction;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ModularUIAction = {\n type: \"MODULARUI/FETCH\",\n payload: {\n key: string,\n origin?: string,\n contextPath?: string,\n href: Href,\n method?: $Keys<HTTP_METHODS>,\n params?: string,\n data?: any,\n timeout?: number,\n headers?: {\n [headerName: string]: string,\n Accept?: string,\n \"Accept-Language\"?: string,\n \"Content-Type\"?: string,\n \"x-filename\"?: string,\n \"x-filesize\"?: string,\n },\n events?: { [eventName: string]: () => void },\n onProgress?: ProgressEventHandler,\n locale: string,\n childmodels?: boolean,\n targetModel?: TargetModel,\n forceTargetModel?: boolean,\n cache?: boolean,\n isReload?: boolean,\n withCredentials?: boolean,\n successAction: (\n model: ModularUIModel,\n ) => UpdateModelAction | SetModelAction,\n errorAction?: ErrorAction,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type RemoveModelByKeyAction = {\n type: \"MODULARUI/REMOVE_KEY\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ResetModularUIAction = {\n type: \"MODULARUI/RESET\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateStatusAction = {\n type: \"MODULARUI/STATUS\",\n payload: {\n key: string,\n status: $Keys<MODULARUI_STATUS>,\n requestOptions: any,\n },\n};\n\nexport type ModularUIConnector = (\n Component: ComponentType<any>,\n) => ComponentType<any>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_router/types.js"],"sourcesContent":["// @flow\nimport type { HistoryAction, Location, LocationShape } from \"react-router\";\n\nexport type RouterState = {\n +location: Location,\n +action: HistoryAction,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/redux/_router/types.js"],"sourcesContent":["// @flow\nimport type { HistoryAction, Location, LocationShape } from \"react-router\";\n\nexport type RouterState = {\n +location: Location,\n +action: HistoryAction,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type LocationChangeAction = {\n type: \"ROUTER/LOCATION_CHANGE\",\n payload: {\n location: Location,\n action: HistoryAction,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type PushAction = {\n type: \"ROUTER/PUSH\",\n payload: {\n location: string | LocationShape,\n state?: { ... },\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ReplaceAction = {\n type: \"ROUTER/REPLACE\",\n payload: {\n location: string | LocationShape,\n state?: { ... },\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type GoAction = {\n type: \"ROUTER/GO\",\n payload: {\n delta: number,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type GoBackAction = {\n type: \"ROUTER/GOBACK\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type GoForwardAction = {\n type: \"ROUTER/GOFORWARD\",\n};\n"],"mappings":"","ignoreList":[]}
|
package/lib/redux/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n UpdateFormAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n InitModelAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n autoupdate: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n */\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useErrorHandler) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useModal) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useModal) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. onDismiss: () => void`.\n * - Use the appropriate hook (useNotification) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useNotification) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (usePreference) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (usePreference) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SendAuthenticationErrorAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useFormNavigation) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateEntryDateAction = {\n type: \"UPDATE_ENTRYDATE\",\n payload: ISO_DATE,\n};\n\n/**\n * @deprecated This union type is a legacy pattern and is not maintained for new actions.\n */\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | InitModelAction\n | UpdateModelAction\n | UpdateFormAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | ResetAuthErrorsAction\n | SendAuthenticationErrorAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | UpdateEntryDateAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type AuthState = {\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ErrorState = null | ErrorResponse;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ModelCatalogState = {\n entryDate: ISO_DATE | null,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +modelcatalog: ModelCatalogState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type GetState = () => ReduxState;\n\n/**\n * A function that accepts a listener callback and returns an unsubscribe function.\n */\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type Subscribe = (listener: () => void) => () => void;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ThunkExtra = {\n subscribe: Subscribe,\n ...\n};\n\n// 1. Define ThunkAction first.\n// We use 'any' for Dispatch here temporarily to break the circularity\n// or use the specialized function type.\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ThunkAction<R = any> = (\n dispatch: Dispatch,\n getState: GetState,\n extra: ThunkExtra,\n) => R;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type PromiseAction = Promise<ReduxAction | ThunkAction<any>>;\n\n// 2. Define Dispatch as a naked function type.\n// This is much more reliable in modern Flow than DispatchAPI<...>.\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type Dispatch = (\n action: ReduxAction | ThunkAction<any> | PromiseAction,\n) => any;\n\n// 3. Update ReduxStore to use the ReduxAction for the base reducer\n// but our custom Dispatch for the store instance.\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\n// 4. Clean up PossibleAction if you still use it elsewhere\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type PossibleAction = ReduxAction | ThunkAction<any> | PromiseAction;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n *\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n UpdateFormAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n InitModelAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n autoupdate: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n */\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useErrorHandler) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useModal) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useModal) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. onDismiss: () => void`.\n * - Use the appropriate hook (useNotification) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useNotification) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (usePreference) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (usePreference) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useProgressIndicator) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type SendAuthenticationErrorAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useAuthentication) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook (useFormNavigation) to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n * - Reference the action object type for middleware, use ReturnType<typeof actionCreator>.\n */\nexport type UpdateEntryDateAction = {\n type: \"UPDATE_ENTRYDATE\",\n payload: ISO_DATE,\n};\n\n/**\n * @deprecated This union type is a legacy pattern and is not maintained for new actions.\n */\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | InitModelAction\n | UpdateModelAction\n | UpdateFormAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | ResetAuthErrorsAction\n | SendAuthenticationErrorAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | UpdateEntryDateAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\nexport type AuthState = {\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\nexport type ErrorState = null | ErrorResponse;\n\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\nexport type ModelCatalogState = {\n entryDate: ISO_DATE | null,\n};\n\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +modelcatalog: ModelCatalogState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\nexport type GetState = () => ReduxState;\n\nexport type Subscribe = (listener: () => void) => () => void;\n\nexport type ThunkExtra = {\n subscribe: Subscribe,\n ...\n};\n\nexport type ThunkAction<R = any> = (\n dispatch: Dispatch,\n getState: GetState,\n extra: ThunkExtra,\n) => R;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type PromiseAction = Promise<ReduxAction | ThunkAction<any>>;\n\nexport type Dispatch = (\n action: ReduxAction | ThunkAction<any> | PromiseAction,\n) => any;\n\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\n/**\n * @deprecated This manual action type will be removed in a future major release.\n * Recommended fixes:\n * - Type component props as a simple callback: e.g. `onDismiss: () => void`.\n * - Use the appropriate hook to encapsulate this logic.\n */\nexport type PossibleAction = ReduxAction | ThunkAction<any> | PromiseAction;\n\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":"","ignoreList":[]}
|