fastapi-rtk 2.7.1 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineFileInput.cjs +13 -4
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/MantineInputs/MantineObjectInput.cjs +23 -12
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineArrayControl/DeleteDialog.cjs +38 -7
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineArrayControl/MantineArrayControl.cjs +16 -11
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.cjs +117 -23
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/complex/MantineTableControl/TableToolbar.cjs +30 -4
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useContextProps.cjs +5 -7
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useNavigationComponent.cjs +48 -13
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/hooks/useToolbarComponent.cjs +31 -11
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/labels/MantineLabelRenderer.cjs +9 -1
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/ArrayToolbar.cjs +15 -4
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/ExpandPanelRenderer.cjs +83 -18
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/Array/MantineArrayLayout.cjs +76 -43
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/MantineHotizontalLayoutRenderer.cjs +2 -2
- package/dist/.bundled/jsonforms/cjs/packages/jsonforms/src/layouts/MantineVerticalLayoutRenderer.cjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineFileInput.mjs +16 -7
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/MantineInputs/MantineObjectInput.mjs +23 -12
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineArrayControl/DeleteDialog.mjs +40 -9
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineArrayControl/MantineArrayControl.mjs +17 -12
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineTableControl/MantineTableControl.mjs +118 -24
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/complex/MantineTableControl/TableToolbar.mjs +31 -5
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useContextProps.mjs +5 -7
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useNavigationComponent.mjs +49 -14
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/hooks/useToolbarComponent.mjs +32 -12
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/labels/MantineLabelRenderer.mjs +9 -1
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/ArrayToolbar.mjs +16 -5
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/ExpandPanelRenderer.mjs +85 -20
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/Array/MantineArrayLayout.mjs +79 -46
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/MantineHotizontalLayoutRenderer.mjs +2 -2
- package/dist/.bundled/jsonforms/esm/packages/jsonforms/src/layouts/MantineVerticalLayoutRenderer.mjs +2 -2
- package/dist/.external/cjs/yup@1.7.1/yup/index.esm.cjs +1 -435
- package/dist/.external/esm/yup@1.7.1/yup/index.esm.mjs +2 -436
- package/dist/.external/lib/type-fest/index.d.ts +95 -0
- package/dist/.external/lib/type-fest/source/async-return-type.d.ts +25 -0
- package/dist/.external/lib/type-fest/source/asyncify.d.ts +33 -0
- package/dist/.external/lib/type-fest/source/basic.d.ts +45 -0
- package/dist/.external/lib/type-fest/source/camel-case.d.ts +73 -0
- package/dist/.external/lib/type-fest/source/camel-cased-properties-deep.d.ts +54 -0
- package/dist/.external/lib/type-fest/source/camel-cased-properties.d.ts +36 -0
- package/dist/.external/lib/type-fest/source/conditional-except.d.ts +45 -0
- package/dist/.external/lib/type-fest/source/conditional-keys.d.ts +47 -0
- package/dist/.external/lib/type-fest/source/conditional-pick.d.ts +44 -0
- package/dist/.external/lib/type-fest/source/delimiter-case.d.ts +93 -0
- package/dist/.external/lib/type-fest/source/delimiter-cased-properties-deep.d.ts +60 -0
- package/dist/.external/lib/type-fest/source/delimiter-cased-properties.d.ts +37 -0
- package/dist/.external/lib/type-fest/source/entries.d.ts +62 -0
- package/dist/.external/lib/type-fest/source/entry.d.ts +65 -0
- package/dist/.external/lib/type-fest/source/exact.d.ts +73 -0
- package/dist/.external/lib/type-fest/source/except.d.ts +57 -0
- package/dist/.external/lib/type-fest/source/fixed-length-array.d.ts +43 -0
- package/dist/.external/lib/type-fest/source/get.d.ts +184 -0
- package/dist/.external/lib/type-fest/source/has-optional-keys.d.ts +21 -0
- package/dist/.external/lib/type-fest/source/has-required-keys.d.ts +59 -0
- package/dist/.external/lib/type-fest/source/includes.d.ts +22 -0
- package/dist/.external/lib/type-fest/source/internal.d.ts +59 -0
- package/dist/.external/lib/type-fest/source/invariant-of.d.ts +76 -0
- package/dist/.external/lib/type-fest/source/iterable-element.d.ts +54 -0
- package/dist/.external/lib/type-fest/source/join.d.ts +30 -0
- package/dist/.external/lib/type-fest/source/jsonify.d.ts +90 -0
- package/dist/.external/lib/type-fest/source/kebab-case.d.ts +38 -0
- package/dist/.external/lib/type-fest/source/kebab-cased-properties-deep.d.ts +47 -0
- package/dist/.external/lib/type-fest/source/kebab-cased-properties.d.ts +30 -0
- package/dist/.external/lib/type-fest/source/last-array-element.d.ts +28 -0
- package/dist/.external/lib/type-fest/source/literal-to-primitive.d.ts +36 -0
- package/dist/.external/lib/type-fest/source/literal-union.d.ts +35 -0
- package/dist/.external/lib/type-fest/source/merge-exclusive.d.ts +41 -0
- package/dist/.external/lib/type-fest/source/merge.d.ts +27 -0
- package/dist/.external/lib/type-fest/source/multidimensional-array.d.ts +43 -0
- package/dist/.external/lib/type-fest/source/multidimensional-readonly-array.d.ts +47 -0
- package/dist/.external/lib/type-fest/source/mutable.d.ts +5 -0
- package/dist/.external/lib/type-fest/source/numeric.d.ts +170 -0
- package/dist/.external/lib/type-fest/source/observable-like.d.ts +62 -0
- package/dist/.external/lib/type-fest/source/opaque.d.ts +107 -0
- package/dist/.external/lib/type-fest/source/optional-keys-of.d.ts +38 -0
- package/dist/.external/lib/type-fest/source/package-json.d.ts +663 -0
- package/dist/.external/lib/type-fest/source/partial-deep.d.ts +113 -0
- package/dist/.external/lib/type-fest/source/partial-on-undefined-deep.d.ts +70 -0
- package/dist/.external/lib/type-fest/source/pascal-case.d.ts +38 -0
- package/dist/.external/lib/type-fest/source/pascal-cased-properties-deep.d.ts +54 -0
- package/dist/.external/lib/type-fest/source/pascal-cased-properties.d.ts +34 -0
- package/dist/.external/lib/type-fest/source/primitive.d.ts +13 -0
- package/dist/.external/lib/type-fest/source/promisable.d.ts +25 -0
- package/dist/.external/lib/type-fest/source/promise-value.d.ts +29 -0
- package/dist/.external/lib/type-fest/source/readonly-deep.d.ts +85 -0
- package/dist/.external/lib/type-fest/source/readonly-tuple.d.ts +41 -0
- package/dist/.external/lib/type-fest/source/remove-index-signature.d.ts +104 -0
- package/dist/.external/lib/type-fest/source/replace.d.ts +67 -0
- package/dist/.external/lib/type-fest/source/require-all-or-none.d.ts +36 -0
- package/dist/.external/lib/type-fest/source/require-at-least-one.d.ts +35 -0
- package/dist/.external/lib/type-fest/source/require-exactly-one.d.ts +34 -0
- package/dist/.external/lib/type-fest/source/required-keys-of.d.ts +29 -0
- package/dist/.external/lib/type-fest/source/schema.d.ts +72 -0
- package/dist/.external/lib/type-fest/source/screaming-snake-case.d.ts +33 -0
- package/dist/.external/lib/type-fest/source/set-non-nullable.d.ts +35 -0
- package/dist/.external/lib/type-fest/source/set-optional.d.ts +35 -0
- package/dist/.external/lib/type-fest/source/set-required.d.ts +35 -0
- package/dist/.external/lib/type-fest/source/set-return-type.d.ts +31 -0
- package/dist/.external/lib/type-fest/source/simplify.d.ts +83 -0
- package/dist/.external/lib/type-fest/source/snake-case.d.ts +38 -0
- package/dist/.external/lib/type-fest/source/snake-cased-properties-deep.d.ts +47 -0
- package/dist/.external/lib/type-fest/source/snake-cased-properties.d.ts +30 -0
- package/dist/.external/lib/type-fest/source/split.d.ts +29 -0
- package/dist/.external/lib/type-fest/source/spread.d.ts +85 -0
- package/dist/.external/lib/type-fest/source/string-key-of.d.ts +25 -0
- package/dist/.external/lib/type-fest/source/stringified.d.ts +23 -0
- package/dist/.external/lib/type-fest/source/trim.d.ts +25 -0
- package/dist/.external/lib/type-fest/source/tsconfig-json.d.ts +1172 -0
- package/dist/.external/lib/type-fest/source/typed-array.d.ts +17 -0
- package/dist/.external/lib/type-fest/source/union-to-intersection.d.ts +60 -0
- package/dist/.external/lib/type-fest/source/value-of.d.ts +42 -0
- package/dist/.external/lib/type-fest/source/writable.d.ts +40 -0
- package/dist/api/cjs/ApiProvider/ApiProvider.cjs +80 -0
- package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/hooks/useProvideApi.cjs +26 -25
- package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/hooks/useProvideBulk.cjs +5 -3
- package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/hooks/useProvideForm.cjs +1 -1
- package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/hooks/utils/useApiActions.cjs +15 -15
- package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/hooks/utils/useStreamingData.cjs +2 -2
- package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/utils/getValidationSchema.cjs +1 -1
- package/dist/{core/cjs/Wrappers → api/cjs}/Provider/Contexts/LangContext.cjs +20 -6
- package/dist/api/cjs/Provider/Provider.cjs +51 -0
- package/dist/{core/cjs/Wrappers → api/cjs}/Provider/hooks/useProvideAuth.cjs +18 -17
- package/dist/{core/cjs/Wrappers → api/cjs}/Provider/hooks/useProvideInfo.cjs +6 -4
- package/dist/api/cjs/Provider/hooks/useProvideLang.cjs +76 -0
- package/dist/api/cjs/_virtual/_commonjsHelpers.cjs +6 -0
- package/dist/api/cjs/_virtual/index.cjs +5 -0
- package/dist/api/cjs/_virtual/index2.cjs +5 -0
- package/dist/api/cjs/_virtual/index3.cjs +6 -0
- package/dist/api/cjs/_virtual/index4.cjs +4 -0
- package/dist/api/cjs/adapters/AdaptersContext.cjs +10 -0
- package/dist/api/cjs/auth/authFetch.cjs +63 -0
- package/dist/api/cjs/auth/userCRUD.cjs +20 -0
- package/dist/api/cjs/fetchers/createItem.cjs +14 -0
- package/dist/api/cjs/fetchers/deleteItem.cjs +14 -0
- package/dist/api/cjs/fetchers/downloadItems.cjs +33 -0
- package/dist/api/cjs/fetchers/formCreateItem.cjs +18 -0
- package/dist/api/cjs/fetchers/formUpdateItem.cjs +18 -0
- package/dist/api/cjs/fetchers/getInfo.cjs +10 -0
- package/dist/api/cjs/fetchers/getItem.cjs +14 -0
- package/dist/api/cjs/fetchers/getItems.cjs +13 -0
- package/dist/api/cjs/fetchers/postBulkAction.cjs +14 -0
- package/dist/api/cjs/fetchers/request.cjs +9 -0
- package/dist/api/cjs/fetchers/updateItem.cjs +14 -0
- package/dist/api/cjs/fetchers/uploadItems.cjs +24 -0
- package/dist/{core → api}/cjs/hooks/auth/useAuth.cjs +1 -1
- package/dist/{core → api}/cjs/hooks/auth/useInfo.cjs +1 -1
- package/dist/api/cjs/hooks/useDidUpdate.cjs +20 -0
- package/dist/api/cjs/index.cjs +75 -0
- package/dist/{utils/cjs → api/cjs/utils}/convertToFormData/convertToFormData.cjs +5 -5
- package/dist/{utils/cjs → api/cjs/utils}/createFetchParams/createFetchParams.cjs +1 -3
- package/dist/api/esm/ApiProvider/ApiProvider.mjs +80 -0
- package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/hooks/useProvideApi.mjs +19 -18
- package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/hooks/useProvideBulk.mjs +5 -3
- package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/hooks/useProvideForm.mjs +1 -1
- package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/hooks/utils/useApiActions.mjs +15 -15
- package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/hooks/utils/useStreamingData.mjs +1 -1
- package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/utils/getValidationSchema.mjs +2 -2
- package/dist/{core/esm/Wrappers → api/esm}/Provider/Contexts/LangContext.mjs +21 -7
- package/dist/api/esm/Provider/Provider.mjs +51 -0
- package/dist/{core/esm/Wrappers → api/esm}/Provider/hooks/useProvideAuth.mjs +16 -15
- package/dist/{core/esm/Wrappers → api/esm}/Provider/hooks/useProvideInfo.mjs +5 -3
- package/dist/api/esm/Provider/hooks/useProvideLang.mjs +76 -0
- package/dist/api/esm/_virtual/_commonjsHelpers.mjs +6 -0
- package/dist/api/esm/_virtual/index.mjs +5 -0
- package/dist/api/esm/_virtual/index2.mjs +5 -0
- package/dist/api/esm/_virtual/index3.mjs +7 -0
- package/dist/api/esm/_virtual/index4.mjs +4 -0
- package/dist/api/esm/adapters/AdaptersContext.mjs +10 -0
- package/dist/api/esm/auth/authFetch.mjs +63 -0
- package/dist/api/esm/auth/userCRUD.mjs +20 -0
- package/dist/api/esm/fetchers/createItem.mjs +14 -0
- package/dist/api/esm/fetchers/deleteItem.mjs +14 -0
- package/dist/api/esm/fetchers/downloadItems.mjs +33 -0
- package/dist/api/esm/fetchers/formCreateItem.mjs +18 -0
- package/dist/api/esm/fetchers/formUpdateItem.mjs +18 -0
- package/dist/api/esm/fetchers/getInfo.mjs +10 -0
- package/dist/api/esm/fetchers/getItem.mjs +14 -0
- package/dist/api/esm/fetchers/getItems.mjs +13 -0
- package/dist/api/esm/fetchers/postBulkAction.mjs +14 -0
- package/dist/api/esm/fetchers/request.mjs +9 -0
- package/dist/api/esm/fetchers/updateItem.mjs +14 -0
- package/dist/api/esm/fetchers/uploadItems.mjs +24 -0
- package/dist/{core → api}/esm/hooks/auth/useAuth.mjs +1 -1
- package/dist/{core → api}/esm/hooks/auth/useInfo.mjs +1 -1
- package/dist/api/esm/hooks/useDidUpdate.mjs +20 -0
- package/dist/api/esm/index.mjs +75 -0
- package/dist/{utils/esm → api/esm/utils}/convertToFormData/convertToFormData.mjs +5 -5
- package/dist/{utils/esm → api/esm/utils}/createFetchParams/createFetchParams.mjs +1 -3
- package/dist/api/lib/ApiProvider/ApiProvider.d.ts +17 -0
- package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/Contexts/BulkActionsContext.d.ts +1 -1
- package/dist/api/lib/ApiProvider/Contexts/FormContext.d.ts +5 -0
- package/dist/api/lib/ApiProvider/hooks/types.d.ts +150 -0
- package/dist/api/lib/ApiProvider/hooks/useProvideBulk.d.ts +7 -0
- package/dist/api/lib/ApiProvider/hooks/useProvideForm.d.ts +2 -0
- package/dist/api/lib/ApiProvider/hooks/utils/useApiActions.d.ts +11 -0
- package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/hooks/utils/useStreamingData.d.ts +26 -26
- package/dist/api/lib/ApiProvider/types.d.ts +51 -0
- package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/getDefaultValues.d.ts +2 -2
- package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/getValidationSchema.d.ts +1 -1
- package/dist/{core/lib/Wrappers → api/lib}/Provider/Contexts/AuthContext.d.ts +1 -1
- package/dist/{core/lib/Wrappers → api/lib}/Provider/Contexts/InfoContext.d.ts +1 -1
- package/dist/{core/lib/Wrappers → api/lib}/Provider/Contexts/types.d.ts +5 -4
- package/dist/api/lib/Provider/Provider.d.ts +14 -0
- package/dist/api/lib/Provider/hooks/types.d.ts +22 -0
- package/dist/api/lib/Provider/hooks/useProvideAuth.d.ts +17 -0
- package/dist/{core/lib/Wrappers → api/lib}/Provider/hooks/useProvideInfo.d.ts +2 -2
- package/dist/{core/lib/Wrappers → api/lib}/Provider/hooks/useProvideLang.d.ts +1 -2
- package/dist/api/lib/Provider/types.d.ts +35 -0
- package/dist/api/lib/adapters/AdaptersContext.d.ts +10 -0
- package/dist/api/lib/adapters/types.d.ts +69 -0
- package/dist/{core/lib/Wrappers/Provider/utils → api/lib/auth}/authFetch.d.ts +13 -7
- package/dist/api/lib/auth/types.d.ts +40 -0
- package/dist/api/lib/auth/userCRUD.d.ts +22 -0
- package/dist/{core/lib/Wrappers/ApiProvider/utils/bulkActions/types.d.ts → api/lib/fetchers/bulkActions.types.d.ts} +3 -3
- package/dist/api/lib/fetchers/createItem.d.ts +4 -0
- package/dist/api/lib/fetchers/deleteItem.d.ts +4 -0
- package/dist/api/lib/fetchers/downloadItems.d.ts +4 -0
- package/dist/api/lib/fetchers/formCreateItem.d.ts +4 -0
- package/dist/api/lib/fetchers/formUpdateItem.d.ts +4 -0
- package/dist/{core/lib/Wrappers/ApiProvider/utils/api → api/lib/fetchers}/getInfo.d.ts +3 -1
- package/dist/api/lib/fetchers/getItem.d.ts +4 -0
- package/dist/{core/lib/Wrappers/ApiProvider/utils/api → api/lib/fetchers}/getItems.d.ts +3 -1
- package/dist/api/lib/fetchers/postBulkAction.d.ts +4 -0
- package/dist/api/lib/fetchers/request.d.ts +7 -0
- package/dist/{core/lib/Wrappers/ApiProvider/utils/api → api/lib/fetchers}/types.d.ts +3 -7
- package/dist/api/lib/fetchers/updateItem.d.ts +4 -0
- package/dist/api/lib/fetchers/uploadItems.d.ts +3 -0
- package/dist/api/lib/fetchers/uploadItems.test.d.ts +1 -0
- package/dist/{core → api}/lib/hooks/auth/types.d.ts +2 -39
- package/dist/api/lib/hooks/auth/useAuth.test.d.ts +1 -0
- package/dist/api/lib/hooks/auth/useInfo.test.d.ts +1 -0
- package/dist/api/lib/hooks/useDidUpdate.d.ts +3 -0
- package/dist/api/lib/index.d.ts +35 -0
- package/dist/api/lib/utils/convertToFormData/convertToFormData.d.ts +17 -0
- package/dist/api/lib/utils/convertToFormData/convertToFormData.test.d.ts +1 -0
- package/dist/{utils/lib → api/lib/utils}/createFetchParams/createFetchParams.d.ts +3 -4
- package/dist/api/lib/utils/createFetchParams/createFetchParams.test.d.ts +1 -0
- package/dist/{utils/lib → api/lib/utils}/parseResponse/parseResponse.d.ts +1 -2
- package/dist/api/lib/utils/parseResponse/parseResponse.test.d.ts +1 -0
- package/dist/constants/cjs/index.cjs +16 -2
- package/dist/constants/esm/index.mjs +16 -2
- package/dist/core/cjs/Dialogs/AddDialog.cjs +2 -2
- package/dist/core/cjs/Dialogs/EditDialog.cjs +2 -2
- package/dist/core/cjs/Menu/UserMenu/UserMenu.cjs +2 -2
- package/dist/core/cjs/Modals/CommonModal.cjs +2 -2
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useActions.cjs +5 -5
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/Cell.cjs +4 -4
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter.cjs +4 -4
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/HeaderAdvancedFiltersMenuButton.cjs +4 -4
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/useColumns.cjs +5 -5
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useToolbar/useToolbar.cjs +9 -9
- package/dist/core/cjs/Wrappers/ApiProvider/ApiProvider.cjs +8 -74
- package/dist/core/cjs/Wrappers/Provider/Provider.cjs +18 -47
- package/dist/core/cjs/adapters/web/cookieTransport.cjs +15 -0
- package/dist/core/cjs/adapters/web/index.cjs +23 -0
- package/dist/core/cjs/adapters/web/webFileDownloadAdapter.cjs +16 -0
- package/dist/core/cjs/adapters/web/webFormDataAdapter.cjs +8 -0
- package/dist/core/cjs/adapters/web/webNetworkAdapter.cjs +6 -0
- package/dist/core/cjs/adapters/web/webOAuthOpener.cjs +26 -0
- package/dist/core/cjs/adapters/web/webStorageAdapter.cjs +21 -0
- package/dist/core/cjs/fab-react-toolkit-patch/api/hooks/useProvideApi.cjs +7 -12
- package/dist/core/cjs/fab-react-toolkit-patch/api/hooks/useProvideBulk.cjs +2 -2
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/downloadItems.cjs +5 -3
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/getItems.cjs +6 -5
- package/dist/core/cjs/fab-react-toolkit-patch/auth/utils/authFetch.cjs +19 -15
- package/dist/core/cjs/fab-react-toolkit-patch/auth/utils/userCRUD.cjs +9 -6
- package/dist/core/cjs/hooks/api/useBulkActions.cjs +2 -5
- package/dist/core/cjs/hooks/api/useForms.cjs +5 -5
- package/dist/core/cjs/index.cjs +83 -6
- package/dist/core/esm/Dialogs/AddDialog.mjs +1 -1
- package/dist/core/esm/Dialogs/EditDialog.mjs +1 -1
- package/dist/core/esm/Menu/UserMenu/UserMenu.mjs +1 -1
- package/dist/core/esm/Modals/CommonModal.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useActions.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/Cell.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilter.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/HeaderAdvancedFiltersMenuButton.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/useColumns.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useToolbar/useToolbar.mjs +1 -1
- package/dist/core/esm/Wrappers/ApiProvider/ApiProvider.mjs +5 -73
- package/dist/core/esm/Wrappers/Provider/Provider.mjs +15 -46
- package/dist/core/esm/adapters/web/cookieTransport.mjs +15 -0
- package/dist/core/esm/adapters/web/index.mjs +23 -0
- package/dist/core/esm/adapters/web/webFileDownloadAdapter.mjs +16 -0
- package/dist/core/esm/adapters/web/webFormDataAdapter.mjs +8 -0
- package/dist/core/esm/adapters/web/webNetworkAdapter.mjs +6 -0
- package/dist/core/esm/adapters/web/webOAuthOpener.mjs +26 -0
- package/dist/core/esm/adapters/web/webStorageAdapter.mjs +21 -0
- package/dist/core/esm/fab-react-toolkit-patch/api/hooks/useProvideApi.mjs +1 -6
- package/dist/core/esm/fab-react-toolkit-patch/api/hooks/useProvideBulk.mjs +1 -1
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/downloadItems.mjs +5 -3
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/getItems.mjs +4 -3
- package/dist/core/esm/fab-react-toolkit-patch/auth/utils/authFetch.mjs +15 -11
- package/dist/core/esm/fab-react-toolkit-patch/auth/utils/userCRUD.mjs +8 -5
- package/dist/core/esm/hooks/api/useBulkActions.mjs +2 -5
- package/dist/core/esm/hooks/api/useForms.mjs +1 -1
- package/dist/core/esm/index.mjs +21 -4
- package/dist/core/lib/Tables/NextGenDataGrid/types.d.ts +1 -1
- package/dist/core/lib/Wrappers/ApiProvider/ApiProvider.d.ts +4 -17
- package/dist/core/lib/Wrappers/ApiProvider/types.d.ts +3 -47
- package/dist/core/lib/Wrappers/Provider/Provider.d.ts +4 -14
- package/dist/core/lib/Wrappers/Provider/types.d.ts +6 -27
- package/dist/core/lib/adapters/web/cookieTransport.d.ts +2 -0
- package/dist/core/lib/adapters/web/index.d.ts +9 -0
- package/dist/core/lib/adapters/web/webAdapters.test.d.ts +1 -0
- package/dist/core/lib/adapters/web/webFileDownloadAdapter.d.ts +2 -0
- package/dist/core/lib/adapters/web/webFormDataAdapter.d.ts +2 -0
- package/dist/core/lib/adapters/web/webNetworkAdapter.d.ts +2 -0
- package/dist/core/lib/adapters/web/webOAuthOpener.d.ts +2 -0
- package/dist/core/lib/adapters/web/webStorageAdapter.d.ts +3 -0
- package/dist/core/lib/fab-react-toolkit-patch/api/hooks/useProvideApi.d.ts +1 -1
- package/dist/core/lib/fab-react-toolkit-patch/api/hooks/useProvideBulk.d.ts +1 -1
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/downloadItems.d.ts +2 -2
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/getItems.d.ts +3 -2
- package/dist/core/lib/fab-react-toolkit-patch/auth/utils/authFetch.d.ts +11 -6
- package/dist/core/lib/fab-react-toolkit-patch/auth/utils/userCRUD.d.ts +5 -3
- package/dist/core/lib/hooks/api/types.d.ts +1 -59
- package/dist/core/lib/hooks/api/useForms.d.ts +1 -1
- package/dist/core/lib/index.d.ts +5 -6
- package/dist/core/lib/test-helpers/types.d.ts +1 -1
- package/dist/jsonforms/cjs/MantineInputs/MantineFileInput.cjs +13 -4
- package/dist/jsonforms/cjs/MantineInputs/MantineObjectInput.cjs +23 -12
- package/dist/jsonforms/cjs/complex/MantineArrayControl/DeleteDialog.cjs +38 -7
- package/dist/jsonforms/cjs/complex/MantineArrayControl/MantineArrayControl.cjs +16 -11
- package/dist/jsonforms/cjs/complex/MantineTableControl/MantineTableControl.cjs +117 -23
- package/dist/jsonforms/cjs/complex/MantineTableControl/TableToolbar.cjs +30 -4
- package/dist/jsonforms/cjs/hooks/useContextProps.cjs +5 -7
- package/dist/jsonforms/cjs/hooks/useNavigationComponent.cjs +48 -13
- package/dist/jsonforms/cjs/hooks/useToolbarComponent.cjs +31 -11
- package/dist/jsonforms/cjs/labels/MantineLabelRenderer.cjs +9 -1
- package/dist/jsonforms/cjs/layouts/Array/ArrayToolbar.cjs +15 -4
- package/dist/jsonforms/cjs/layouts/Array/ExpandPanelRenderer.cjs +83 -18
- package/dist/jsonforms/cjs/layouts/Array/MantineArrayLayout.cjs +76 -43
- package/dist/jsonforms/cjs/layouts/MantineHotizontalLayoutRenderer.cjs +2 -2
- package/dist/jsonforms/cjs/layouts/MantineVerticalLayoutRenderer.cjs +2 -2
- package/dist/jsonforms/esm/MantineInputs/MantineFileInput.mjs +16 -7
- package/dist/jsonforms/esm/MantineInputs/MantineObjectInput.mjs +23 -12
- package/dist/jsonforms/esm/complex/MantineArrayControl/DeleteDialog.mjs +40 -9
- package/dist/jsonforms/esm/complex/MantineArrayControl/MantineArrayControl.mjs +17 -12
- package/dist/jsonforms/esm/complex/MantineTableControl/MantineTableControl.mjs +118 -24
- package/dist/jsonforms/esm/complex/MantineTableControl/TableToolbar.mjs +31 -5
- package/dist/jsonforms/esm/hooks/useContextProps.mjs +5 -7
- package/dist/jsonforms/esm/hooks/useNavigationComponent.mjs +49 -14
- package/dist/jsonforms/esm/hooks/useToolbarComponent.mjs +32 -12
- package/dist/jsonforms/esm/labels/MantineLabelRenderer.mjs +9 -1
- package/dist/jsonforms/esm/layouts/Array/ArrayToolbar.mjs +16 -5
- package/dist/jsonforms/esm/layouts/Array/ExpandPanelRenderer.mjs +85 -20
- package/dist/jsonforms/esm/layouts/Array/MantineArrayLayout.mjs +79 -46
- package/dist/jsonforms/esm/layouts/MantineHotizontalLayoutRenderer.mjs +2 -2
- package/dist/jsonforms/esm/layouts/MantineVerticalLayoutRenderer.mjs +2 -2
- package/dist/jsonforms/lib/MantineInputs/MantineObjectInput.d.ts +1 -1
- package/dist/jsonforms/lib/complex/MantineTableControl/MantineTableControl.customizer.test.d.ts +1 -0
- package/dist/jsonforms/lib/complex/MantineTableControl/types.d.ts +1 -0
- package/dist/jsonforms/lib/hooks/useContextProps.d.ts +3 -1
- package/dist/jsonforms/lib/hooks/useNavigationComponent.d.ts +1 -1
- package/dist/jsonforms/lib/layouts/Array/ExpandPanelRenderer.d.ts +1 -1
- package/dist/jsonforms/lib/layouts/Array/MantineArrayLayout.d.ts +1 -1
- package/dist/jsonforms/lib/test-helpers/inputWrap.d.ts +2 -2
- package/dist/react-native-adapters/cjs/asyncStorageAdapter.cjs +8 -0
- package/dist/react-native-adapters/cjs/bearerTransport.cjs +29 -0
- package/dist/react-native-adapters/cjs/createReactNativeAdapters.cjs +24 -0
- package/dist/react-native-adapters/cjs/index.cjs +16 -0
- package/dist/react-native-adapters/cjs/rnFileDownloadAdapter.cjs +24 -0
- package/dist/react-native-adapters/cjs/rnFormDataAdapter.cjs +15 -0
- package/dist/react-native-adapters/cjs/rnNetworkAdapter.cjs +9 -0
- package/dist/react-native-adapters/cjs/rnOAuthOpener.cjs +9 -0
- package/dist/react-native-adapters/esm/asyncStorageAdapter.mjs +8 -0
- package/dist/react-native-adapters/esm/bearerTransport.mjs +29 -0
- package/dist/react-native-adapters/esm/createReactNativeAdapters.mjs +24 -0
- package/dist/react-native-adapters/esm/index.mjs +16 -0
- package/dist/react-native-adapters/esm/rnFileDownloadAdapter.mjs +24 -0
- package/dist/react-native-adapters/esm/rnFormDataAdapter.mjs +15 -0
- package/dist/react-native-adapters/esm/rnNetworkAdapter.mjs +9 -0
- package/dist/react-native-adapters/esm/rnOAuthOpener.mjs +9 -0
- package/dist/react-native-adapters/lib/asyncStorageAdapter.d.ts +7 -0
- package/dist/react-native-adapters/lib/asyncStorageAdapter.test.d.ts +1 -0
- package/dist/react-native-adapters/lib/bearerTransport.d.ts +5 -0
- package/dist/react-native-adapters/lib/bearerTransport.test.d.ts +1 -0
- package/dist/react-native-adapters/lib/createReactNativeAdapters.d.ts +11 -0
- package/dist/react-native-adapters/lib/createReactNativeAdapters.test.d.ts +1 -0
- package/dist/react-native-adapters/lib/index.d.ts +8 -0
- package/dist/react-native-adapters/lib/rnFileDownloadAdapter.d.ts +7 -0
- package/dist/react-native-adapters/lib/rnFileDownloadAdapter.test.d.ts +1 -0
- package/dist/react-native-adapters/lib/rnFormDataAdapter.d.ts +2 -0
- package/dist/react-native-adapters/lib/rnFormDataAdapter.test.d.ts +1 -0
- package/dist/react-native-adapters/lib/rnNetworkAdapter.d.ts +4 -0
- package/dist/react-native-adapters/lib/rnNetworkAdapter.test.d.ts +1 -0
- package/dist/react-native-adapters/lib/rnOAuthOpener.d.ts +5 -0
- package/dist/react-native-adapters/lib/rnOAuthOpener.test.d.ts +1 -0
- package/dist/react-native-adapters/lib/types.d.ts +23 -0
- package/dist/utils/cjs/Memoizer/MemoWrapper.cjs +2 -2
- package/dist/utils/cjs/Memoizer/RenderWrapper.cjs +2 -2
- package/dist/utils/cjs/deepMerge/deepMerge.cjs +1 -1
- package/dist/utils/cjs/index.cjs +2 -6
- package/dist/utils/cjs/randomId/randomId.cjs +4 -0
- package/dist/utils/esm/Memoizer/MemoWrapper.mjs +1 -1
- package/dist/utils/esm/Memoizer/RenderWrapper.mjs +1 -1
- package/dist/utils/esm/deepMerge/deepMerge.mjs +1 -1
- package/dist/utils/esm/index.mjs +2 -6
- package/dist/utils/esm/randomId/randomId.mjs +4 -0
- package/dist/utils/lib/deepMerge/deepMerge.d.ts +2 -0
- package/dist/utils/lib/index.d.ts +1 -3
- package/dist/utils/lib/randomId/index.d.ts +1 -0
- package/dist/utils/lib/randomId/randomId.d.ts +2 -0
- package/dist/utils/lib/randomId/randomId.test.d.ts +1 -0
- package/package.json +11 -1
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/createItem.cjs +0 -14
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/deleteItem.cjs +0 -13
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/downloadItems.cjs +0 -39
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/formCreateItem.cjs +0 -12
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/formUpdateItem.cjs +0 -16
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/getInfo.cjs +0 -9
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/getItem.cjs +0 -13
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/getItems.cjs +0 -9
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/updateItem.cjs +0 -14
- package/dist/core/cjs/Wrappers/ApiProvider/utils/api/uploadItems.cjs +0 -26
- package/dist/core/cjs/Wrappers/ApiProvider/utils/bulkActions/postBulkAction.cjs +0 -14
- package/dist/core/cjs/Wrappers/Provider/hooks/useProvideLang.cjs +0 -45
- package/dist/core/cjs/Wrappers/Provider/utils/authFetch.cjs +0 -99
- package/dist/core/cjs/Wrappers/Provider/utils/userCRUD.cjs +0 -32
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/createItem.mjs +0 -14
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/deleteItem.mjs +0 -13
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/downloadItems.mjs +0 -39
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/formCreateItem.mjs +0 -12
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/formUpdateItem.mjs +0 -16
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/getInfo.mjs +0 -9
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/getItem.mjs +0 -13
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/getItems.mjs +0 -9
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/updateItem.mjs +0 -14
- package/dist/core/esm/Wrappers/ApiProvider/utils/api/uploadItems.mjs +0 -26
- package/dist/core/esm/Wrappers/ApiProvider/utils/bulkActions/postBulkAction.mjs +0 -14
- package/dist/core/esm/Wrappers/Provider/hooks/useProvideLang.mjs +0 -45
- package/dist/core/esm/Wrappers/Provider/utils/authFetch.mjs +0 -99
- package/dist/core/esm/Wrappers/Provider/utils/userCRUD.mjs +0 -32
- package/dist/core/lib/Wrappers/ApiProvider/Contexts/FormContext.d.ts +0 -5
- package/dist/core/lib/Wrappers/ApiProvider/hooks/types.d.ts +0 -90
- package/dist/core/lib/Wrappers/ApiProvider/hooks/useProvideBulk.d.ts +0 -8
- package/dist/core/lib/Wrappers/ApiProvider/hooks/useProvideForm.d.ts +0 -2
- package/dist/core/lib/Wrappers/ApiProvider/hooks/utils/useApiActions.d.ts +0 -11
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/createItem.d.ts +0 -3
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/deleteItem.d.ts +0 -3
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/downloadItems.d.ts +0 -3
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/formCreateItem.d.ts +0 -3
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/formUpdateItem.d.ts +0 -3
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/getItem.d.ts +0 -3
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/updateItem.d.ts +0 -3
- package/dist/core/lib/Wrappers/ApiProvider/utils/api/uploadItems.d.ts +0 -2
- package/dist/core/lib/Wrappers/ApiProvider/utils/bulkActions/postBulkAction.d.ts +0 -3
- package/dist/core/lib/Wrappers/Provider/hooks/types.d.ts +0 -24
- package/dist/core/lib/Wrappers/Provider/hooks/useProvideAuth.d.ts +0 -17
- package/dist/core/lib/Wrappers/Provider/utils/userCRUD.d.ts +0 -19
- package/dist/utils/lib/convertToFormData/convertToFormData.d.ts +0 -15
- /package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/Contexts/BulkActionsContext.cjs +0 -0
- /package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/Contexts/FormContext.cjs +0 -0
- /package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/hooks/utils/useLatest.cjs +0 -0
- /package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/utils/convertInfo.cjs +0 -0
- /package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/utils/createQueryParams.cjs +0 -0
- /package/dist/{core/cjs/Wrappers → api/cjs}/ApiProvider/utils/getDefaultValues.cjs +0 -0
- /package/dist/{core/cjs/Wrappers → api/cjs}/Provider/Contexts/AuthContext.cjs +0 -0
- /package/dist/{core/cjs/Wrappers → api/cjs}/Provider/Contexts/InfoContext.cjs +0 -0
- /package/dist/{core → api}/cjs/translations/de.cjs +0 -0
- /package/dist/{utils/cjs → api/cjs/utils}/parseResponse/parseResponse.cjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/Contexts/BulkActionsContext.mjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/Contexts/FormContext.mjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/hooks/utils/useLatest.mjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/utils/convertInfo.mjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/utils/createQueryParams.mjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/ApiProvider/utils/getDefaultValues.mjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/Provider/Contexts/AuthContext.mjs +0 -0
- /package/dist/{core/esm/Wrappers → api/esm}/Provider/Contexts/InfoContext.mjs +0 -0
- /package/dist/{core → api}/esm/translations/de.mjs +0 -0
- /package/dist/{utils/esm → api/esm/utils}/parseResponse/parseResponse.mjs +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/hooks/useProvideApi.test.d.ts → api/lib/ApiProvider/ApiProvider.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/Contexts/ApiContext.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/hooks/useProvideApi.d.ts +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/hooks/useProvideBulk.test.d.ts → api/lib/ApiProvider/hooks/useProvideApi.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/hooks/useProvideForm.test.d.ts → api/lib/ApiProvider/hooks/useProvideBulk.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/hooks/utils/useApiActions.test.d.ts → api/lib/ApiProvider/hooks/useProvideForm.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/hooks/utils/useLatest.test.d.ts → api/lib/ApiProvider/hooks/utils/useApiActions.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/hooks/utils/useLatest.d.ts +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/hooks/utils/useStreamingData.test.d.ts → api/lib/ApiProvider/hooks/utils/useLatest.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/createItem.test.d.ts → api/lib/ApiProvider/hooks/utils/useStreamingData.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/convertInfo.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/convertInfo.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/createQueryParams.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/createQueryParams.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/getDefaultValues.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/getValidationSchema.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/ApiProvider/utils/types.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/Provider/Contexts/LangContext.d.ts +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/deleteItem.test.d.ts → api/lib/Provider/Provider.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/Provider/hooks/useProvideAuth.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/Provider/hooks/useProvideInfo.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers → api/lib}/Provider/hooks/useProvideLang.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/downloadItems.test.d.ts → api/lib/__tests__/purity.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/formCreateItem.test.d.ts → api/lib/__tests__/smoke.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/formUpdateItem.test.d.ts → api/lib/adapters/AdaptersContext.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/Provider/utils → api/lib/auth}/authFetch.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers/Provider/utils → api/lib/auth}/userCRUD.test.d.ts +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/getInfo.test.d.ts → api/lib/fetchers/createItem.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/getItem.test.d.ts → api/lib/fetchers/deleteItem.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/getItems.test.d.ts → api/lib/fetchers/downloadItems.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/updateItem.test.d.ts → api/lib/fetchers/formCreateItem.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/api/uploadItems.test.d.ts → api/lib/fetchers/formUpdateItem.test.d.ts} +0 -0
- /package/dist/{core/lib/Wrappers/ApiProvider/utils/bulkActions/postBulkAction.test.d.ts → api/lib/fetchers/getInfo.test.d.ts} +0 -0
- /package/dist/{core/lib/hooks/auth/useAuth.test.d.ts → api/lib/fetchers/getItem.test.d.ts} +0 -0
- /package/dist/{core/lib/hooks/auth/useInfo.test.d.ts → api/lib/fetchers/getItems.test.d.ts} +0 -0
- /package/dist/{utils/lib/convertToFormData/convertToFormData.test.d.ts → api/lib/fetchers/postBulkAction.test.d.ts} +0 -0
- /package/dist/{utils/lib/createFetchParams/createFetchParams.test.d.ts → api/lib/fetchers/request.test.d.ts} +0 -0
- /package/dist/{utils/lib/parseResponse/parseResponse.test.d.ts → api/lib/fetchers/updateItem.test.d.ts} +0 -0
- /package/dist/{core → api}/lib/hooks/auth/useAuth.d.ts +0 -0
- /package/dist/{core → api}/lib/hooks/auth/useInfo.d.ts +0 -0
- /package/dist/{core → api}/lib/translations/de.d.ts +0 -0
- /package/dist/{utils/lib → api/lib/utils}/convertToFormData/index.d.ts +0 -0
- /package/dist/{utils/lib → api/lib/utils}/createFetchParams/index.d.ts +0 -0
- /package/dist/{utils/lib → api/lib/utils}/parseResponse/index.d.ts +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type {JsonPrimitive, JsonValue} from './basic';
|
|
2
|
+
import {Finite, NegativeInfinity, PositiveInfinity} from './numeric';
|
|
3
|
+
import {TypedArray} from './typed-array';
|
|
4
|
+
|
|
5
|
+
// Note: The return value has to be `any` and not `unknown` so it can match `void`.
|
|
6
|
+
type NotJsonable = ((...args: any[]) => any) | undefined | symbol;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
Transform a type to one that is assignable to the `JsonValue` type.
|
|
10
|
+
|
|
11
|
+
This includes:
|
|
12
|
+
1. Transforming JSON `interface` to a `type` that is assignable to `JsonValue`.
|
|
13
|
+
2. Transforming non-JSON value that is *jsonable* to a type that is assignable to `JsonValue`, where *jsonable* means the non-JSON value implements the `.toJSON()` method that returns a value that is assignable to `JsonValue`.
|
|
14
|
+
|
|
15
|
+
@remarks
|
|
16
|
+
|
|
17
|
+
An interface cannot be structurally compared to `JsonValue` because an interface can be re-opened to add properties that may not be satisfy `JsonValue`.
|
|
18
|
+
|
|
19
|
+
@example
|
|
20
|
+
```
|
|
21
|
+
import type {Jsonify} from '..';
|
|
22
|
+
|
|
23
|
+
interface Geometry {
|
|
24
|
+
type: 'Point' | 'Polygon';
|
|
25
|
+
coordinates: [number, number];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const point: Geometry = {
|
|
29
|
+
type: 'Point',
|
|
30
|
+
coordinates: [1, 1]
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const problemFn = (data: JsonValue) => {
|
|
34
|
+
// Does something with data
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
problemFn(point); // Error: type Geometry is not assignable to parameter of type JsonValue because it is an interface
|
|
38
|
+
|
|
39
|
+
const fixedFn = <T>(data: Jsonify<T>) => {
|
|
40
|
+
// Does something with data
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
fixedFn(point); // Good: point is assignable. Jsonify<T> transforms Geometry into value assignable to JsonValue
|
|
44
|
+
fixedFn(new Date()); // Error: As expected, Date is not assignable. Jsonify<T> cannot transforms Date into value assignable to JsonValue
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Non-JSON values such as `Date` implement `.toJSON()`, so they can be transformed to a value assignable to `JsonValue`:
|
|
48
|
+
|
|
49
|
+
@example
|
|
50
|
+
```
|
|
51
|
+
import type {Jsonify} from '..';
|
|
52
|
+
|
|
53
|
+
const time = {
|
|
54
|
+
timeValue: new Date()
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// `Jsonify<typeof time>` is equivalent to `{timeValue: string}`
|
|
58
|
+
const timeJson = JSON.parse(JSON.stringify(time)) as Jsonify<typeof time>;
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
@link https://github.com/Microsoft/TypeScript/issues/1897#issuecomment-710744173
|
|
62
|
+
|
|
63
|
+
@category JSON
|
|
64
|
+
*/
|
|
65
|
+
type Jsonify<T> =
|
|
66
|
+
// Check if there are any non-JSONable types represented in the union.
|
|
67
|
+
// Note: The use of tuples in this first condition side-steps distributive conditional types
|
|
68
|
+
// (see https://github.com/microsoft/TypeScript/issues/29368#issuecomment-453529532)
|
|
69
|
+
[Extract<T, NotJsonable | bigint>] extends [never]
|
|
70
|
+
? T extends PositiveInfinity | NegativeInfinity ? null
|
|
71
|
+
: T extends JsonPrimitive ? T // Primitive is acceptable
|
|
72
|
+
: T extends object
|
|
73
|
+
// Any object with toJSON is special case
|
|
74
|
+
? T extends {toJSON(): infer J} ? (() => J) extends (() => JsonValue) // Is J assignable to JsonValue?
|
|
75
|
+
? J // Then T is Jsonable and its Jsonable value is J
|
|
76
|
+
: never // Not Jsonable because its toJSON() method does not return JsonValue
|
|
77
|
+
// Instanced primitives are objects
|
|
78
|
+
: T extends Number ? number
|
|
79
|
+
: T extends String ? string
|
|
80
|
+
: T extends Boolean ? boolean
|
|
81
|
+
: T extends Map<any, any> | Set<any> ? {}
|
|
82
|
+
: T extends TypedArray ? Record<string, number>
|
|
83
|
+
: T extends any[]
|
|
84
|
+
? {[I in keyof T]: T[I] extends NotJsonable ? null : Jsonify<T[I]>}
|
|
85
|
+
: {[P in keyof T as P extends symbol ? never
|
|
86
|
+
: T[P] extends NotJsonable ? never
|
|
87
|
+
: P
|
|
88
|
+
]: Jsonify<Required<T>[P]>} // Recursive call for its children
|
|
89
|
+
: never // Otherwise any other non-object is removed
|
|
90
|
+
: never; // Otherwise non-JSONable type union was found not empty
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type {DelimiterCase} from './delimiter-case';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
Convert a string literal to kebab-case.
|
|
5
|
+
|
|
6
|
+
This can be useful when, for example, converting a camel-cased object property to a kebab-cased CSS class name or a command-line flag.
|
|
7
|
+
|
|
8
|
+
@example
|
|
9
|
+
```
|
|
10
|
+
import type {KebabCase} from '..';
|
|
11
|
+
|
|
12
|
+
// Simple
|
|
13
|
+
|
|
14
|
+
const someVariable: KebabCase<'fooBar'> = 'foo-bar';
|
|
15
|
+
|
|
16
|
+
// Advanced
|
|
17
|
+
|
|
18
|
+
type KebabCasedProperties<T> = {
|
|
19
|
+
[K in keyof T as KebabCase<K>]: T[K]
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
interface CliOptions {
|
|
23
|
+
dryRun: boolean;
|
|
24
|
+
includeFile: string;
|
|
25
|
+
foo: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const rawCliOptions: KebabCasedProperties<CliOptions> = {
|
|
29
|
+
'dry-run': true,
|
|
30
|
+
'include-file': 'bar.js',
|
|
31
|
+
foo: 123
|
|
32
|
+
};
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
@category Change case
|
|
36
|
+
@category Template literal
|
|
37
|
+
*/
|
|
38
|
+
export type KebabCase<Value> = DelimiterCase<Value, '-'>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type {DelimiterCasedPropertiesDeep} from './delimiter-cased-properties-deep';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
Convert object properties to kebab case recursively.
|
|
5
|
+
|
|
6
|
+
This can be useful when, for example, converting some API types from a different style.
|
|
7
|
+
|
|
8
|
+
@see KebabCase
|
|
9
|
+
@see KebabCasedProperties
|
|
10
|
+
|
|
11
|
+
@example
|
|
12
|
+
```
|
|
13
|
+
import type [KebabCasedPropertiesDeep] from '..';
|
|
14
|
+
|
|
15
|
+
interface User {
|
|
16
|
+
userId: number;
|
|
17
|
+
userName: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface UserWithFriends {
|
|
21
|
+
userInfo: User;
|
|
22
|
+
userFriends: User[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const result: KebabCasedPropertiesDeep<UserWithFriends> = {
|
|
26
|
+
'user-info': {
|
|
27
|
+
'user-id': 1,
|
|
28
|
+
'user-name': 'Tom',
|
|
29
|
+
},
|
|
30
|
+
'user-friends': [
|
|
31
|
+
{
|
|
32
|
+
'user-id': 2,
|
|
33
|
+
'user-name': 'Jerry',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
'user-id': 3,
|
|
37
|
+
'user-name': 'Spike',
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
@category Change case
|
|
44
|
+
@category Template literal
|
|
45
|
+
@category Object
|
|
46
|
+
*/
|
|
47
|
+
export type KebabCasedPropertiesDeep<Value> = DelimiterCasedPropertiesDeep<Value, '-'>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type {DelimiterCasedProperties} from './delimiter-cased-properties';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
Convert object properties to kebab case but not recursively.
|
|
5
|
+
|
|
6
|
+
This can be useful when, for example, converting some API types from a different style.
|
|
7
|
+
|
|
8
|
+
@see KebabCase
|
|
9
|
+
@see KebabCasedPropertiesDeep
|
|
10
|
+
|
|
11
|
+
@example
|
|
12
|
+
```
|
|
13
|
+
import type {KebabCasedProperties} from '..';
|
|
14
|
+
|
|
15
|
+
interface User {
|
|
16
|
+
userId: number;
|
|
17
|
+
userName: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const result: KebabCasedProperties<User> = {
|
|
21
|
+
'user-id': 1,
|
|
22
|
+
'user-name': 'Tom',
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
@category Change case
|
|
27
|
+
@category Template literal
|
|
28
|
+
@category Object
|
|
29
|
+
*/
|
|
30
|
+
export type KebabCasedProperties<Value> = DelimiterCasedProperties<Value, '-'>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Extracts the type of the last element of an array.
|
|
3
|
+
|
|
4
|
+
Use-case: Defining the return type of functions that extract the last element of an array, for example [`lodash.last`](https://lodash.com/docs/4.17.15#last).
|
|
5
|
+
|
|
6
|
+
@example
|
|
7
|
+
```
|
|
8
|
+
import type {LastArrayElement} from '..';
|
|
9
|
+
|
|
10
|
+
declare function lastOf<V extends readonly any[]>(array: V): LastArrayElement<V>;
|
|
11
|
+
|
|
12
|
+
const array = ['foo', 2];
|
|
13
|
+
|
|
14
|
+
typeof lastOf(array);
|
|
15
|
+
//=> number
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
@category Array
|
|
19
|
+
@category Template literal
|
|
20
|
+
*/
|
|
21
|
+
export type LastArrayElement<ValueType extends readonly unknown[]> =
|
|
22
|
+
ValueType extends readonly [infer ElementType]
|
|
23
|
+
? ElementType
|
|
24
|
+
: ValueType extends readonly [infer _, ...infer Tail]
|
|
25
|
+
? LastArrayElement<Tail>
|
|
26
|
+
: ValueType extends ReadonlyArray<infer ElementType>
|
|
27
|
+
? ElementType
|
|
28
|
+
: never;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Given a [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types) return the {@link Primitive | primitive type} it belongs to, or `never` if it's not a primitive.
|
|
3
|
+
|
|
4
|
+
Use-case: Working with generic types that may be literal types.
|
|
5
|
+
|
|
6
|
+
@example
|
|
7
|
+
```
|
|
8
|
+
import type {LiteralToPrimitive} from '..';
|
|
9
|
+
|
|
10
|
+
// No overloads needed to get the correct return type
|
|
11
|
+
function plus<T extends number | bigint | string>(x: T, y: T): LiteralToPrimitive<T> {
|
|
12
|
+
return x + (y as any);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
plus('a', 'b'); // string
|
|
16
|
+
plus(1, 2); // number
|
|
17
|
+
plus(1n, 2n); // bigint
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
@category Type
|
|
21
|
+
*/
|
|
22
|
+
export type LiteralToPrimitive<T> = T extends number
|
|
23
|
+
? number
|
|
24
|
+
: T extends bigint
|
|
25
|
+
? bigint
|
|
26
|
+
: T extends string
|
|
27
|
+
? string
|
|
28
|
+
: T extends boolean
|
|
29
|
+
? boolean
|
|
30
|
+
: T extends symbol
|
|
31
|
+
? symbol
|
|
32
|
+
: T extends null
|
|
33
|
+
? null
|
|
34
|
+
: T extends undefined
|
|
35
|
+
? undefined
|
|
36
|
+
: never;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type {Primitive} from './primitive';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
|
|
5
|
+
|
|
6
|
+
Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals.
|
|
7
|
+
|
|
8
|
+
This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore.
|
|
9
|
+
|
|
10
|
+
@example
|
|
11
|
+
```
|
|
12
|
+
import type {LiteralUnion} from '..';
|
|
13
|
+
|
|
14
|
+
// Before
|
|
15
|
+
|
|
16
|
+
type Pet = 'dog' | 'cat' | string;
|
|
17
|
+
|
|
18
|
+
const pet: Pet = '';
|
|
19
|
+
// Start typing in your TypeScript-enabled IDE.
|
|
20
|
+
// You **will not** get auto-completion for `dog` and `cat` literals.
|
|
21
|
+
|
|
22
|
+
// After
|
|
23
|
+
|
|
24
|
+
type Pet2 = LiteralUnion<'dog' | 'cat', string>;
|
|
25
|
+
|
|
26
|
+
const pet: Pet2 = '';
|
|
27
|
+
// You **will** get auto-completion for `dog` and `cat` literals.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
@category Type
|
|
31
|
+
*/
|
|
32
|
+
export type LiteralUnion<
|
|
33
|
+
LiteralType,
|
|
34
|
+
BaseType extends Primitive,
|
|
35
|
+
> = LiteralType | (BaseType & Record<never, never>);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Helper type. Not useful on its own.
|
|
2
|
+
type Without<FirstType, SecondType> = {[KeyType in Exclude<keyof FirstType, keyof SecondType>]?: never};
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
Create a type that has mutually exclusive keys.
|
|
6
|
+
|
|
7
|
+
This type was inspired by [this comment](https://github.com/Microsoft/TypeScript/issues/14094#issuecomment-373782604).
|
|
8
|
+
|
|
9
|
+
This type works with a helper type, called `Without`. `Without<FirstType, SecondType>` produces a type that has only keys from `FirstType` which are not present on `SecondType` and sets the value type for these keys to `never`. This helper type is then used in `MergeExclusive` to remove keys from either `FirstType` or `SecondType`.
|
|
10
|
+
|
|
11
|
+
@example
|
|
12
|
+
```
|
|
13
|
+
import type {MergeExclusive} from '..';
|
|
14
|
+
|
|
15
|
+
interface ExclusiveVariation1 {
|
|
16
|
+
exclusive1: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface ExclusiveVariation2 {
|
|
20
|
+
exclusive2: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type ExclusiveOptions = MergeExclusive<ExclusiveVariation1, ExclusiveVariation2>;
|
|
24
|
+
|
|
25
|
+
let exclusiveOptions: ExclusiveOptions;
|
|
26
|
+
|
|
27
|
+
exclusiveOptions = {exclusive1: true};
|
|
28
|
+
//=> Works
|
|
29
|
+
exclusiveOptions = {exclusive2: 'hi'};
|
|
30
|
+
//=> Works
|
|
31
|
+
exclusiveOptions = {exclusive1: true, exclusive2: 'hi'};
|
|
32
|
+
//=> Error
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
@category Object
|
|
36
|
+
*/
|
|
37
|
+
export type MergeExclusive<FirstType, SecondType> =
|
|
38
|
+
(FirstType | SecondType) extends object ?
|
|
39
|
+
(Without<FirstType, SecondType> & SecondType) | (Without<SecondType, FirstType> & FirstType) :
|
|
40
|
+
FirstType | SecondType;
|
|
41
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type {Except} from './except';
|
|
2
|
+
import type {Simplify} from './simplify';
|
|
3
|
+
|
|
4
|
+
type Merge_<FirstType, SecondType> = Except<FirstType, Extract<keyof FirstType, keyof SecondType>> & SecondType;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
Merge two types into a new type. Keys of the second type overrides keys of the first type.
|
|
8
|
+
|
|
9
|
+
@example
|
|
10
|
+
```
|
|
11
|
+
import type {Merge} from '..';
|
|
12
|
+
|
|
13
|
+
type Foo = {
|
|
14
|
+
a: number;
|
|
15
|
+
b: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type Bar = {
|
|
19
|
+
b: number;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const ab: Merge<Foo, Bar> = {a: 1, b: 2};
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
@category Object
|
|
26
|
+
*/
|
|
27
|
+
export type Merge<FirstType, SecondType> = Simplify<Merge_<FirstType, SecondType>>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type {IsEqual, Subtract} from './internal';
|
|
2
|
+
|
|
3
|
+
type Recursive<T> = Array<Recursive<T>>;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
Creates a type that represents a multidimensional array of the given type and dimension.
|
|
7
|
+
|
|
8
|
+
Use-cases:
|
|
9
|
+
- Return a n-dimensional array from functions.
|
|
10
|
+
- Declare a n-dimensional array by defining its dimensions rather than declaring `[]` repetitively.
|
|
11
|
+
- Infer the dimensions of a n-dimensional array automatically from function arguments.
|
|
12
|
+
- Avoid the need to know in advance the dimensions of a n-dimensional array allowing them to be dynamic.
|
|
13
|
+
|
|
14
|
+
@example
|
|
15
|
+
```
|
|
16
|
+
import type {MultidimensionalArray} from '..';
|
|
17
|
+
|
|
18
|
+
function emptyMatrix<T extends number>(dimensions: T): MultidimensionalArray<unknown, T> {
|
|
19
|
+
const matrix: unknown[] = [];
|
|
20
|
+
|
|
21
|
+
let subMatrix = matrix;
|
|
22
|
+
for (let dimension = 1; dimension < dimensions; ++dimension) {
|
|
23
|
+
console.log(`Initializing dimension #${dimension}`);
|
|
24
|
+
|
|
25
|
+
subMatrix[0] = [];
|
|
26
|
+
subMatrix = subMatrix[0] as unknown[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return matrix as MultidimensionalArray<unknown, T>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const matrix = emptyMatrix(3);
|
|
33
|
+
|
|
34
|
+
matrix[0][0][0] = 42;
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
@category Array
|
|
38
|
+
*/
|
|
39
|
+
export type MultidimensionalArray<Element, Dimensions extends number> = number extends Dimensions
|
|
40
|
+
? Recursive<Element>
|
|
41
|
+
: IsEqual<Dimensions, 0> extends true
|
|
42
|
+
? Element
|
|
43
|
+
: Array<MultidimensionalArray<Element, Subtract<Dimensions, 1>>>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type {IsEqual, Subtract} from './internal';
|
|
2
|
+
|
|
3
|
+
type Recursive<T> = ReadonlyArray<Recursive<T>>;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
Creates a type that represents a multidimensional readonly array that of the given type and dimension.
|
|
7
|
+
|
|
8
|
+
Use-cases:
|
|
9
|
+
- Return a n-dimensional array from functions.
|
|
10
|
+
- Declare a n-dimensional array by defining its dimensions rather than declaring `[]` repetitively.
|
|
11
|
+
- Infer the dimensions of a n-dimensional array automatically from function arguments.
|
|
12
|
+
- Avoid the need to know in advance the dimensions of a n-dimensional array allowing them to be dynamic.
|
|
13
|
+
|
|
14
|
+
@example
|
|
15
|
+
```
|
|
16
|
+
import type {MultidimensionalReadonlyArray} from '..';
|
|
17
|
+
|
|
18
|
+
function emptyMatrix<T extends number>(dimensions: T): MultidimensionalReadonlyArray<unknown, T> {
|
|
19
|
+
const matrix: unknown[] = [];
|
|
20
|
+
|
|
21
|
+
let subMatrix = matrix;
|
|
22
|
+
for (let dimension = 1; dimension < dimensions; ++dimension) {
|
|
23
|
+
console.log(`Initializing dimension #${dimension}`);
|
|
24
|
+
|
|
25
|
+
subMatrix[0] = [];
|
|
26
|
+
if (dimension < dimensions - 1) {
|
|
27
|
+
subMatrix = subMatrix[0] as unknown[];
|
|
28
|
+
} else {
|
|
29
|
+
subMatrix[0] = 42;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return matrix as MultidimensionalReadonlyArray<unknown, T>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const matrix = emptyMatrix(3);
|
|
37
|
+
|
|
38
|
+
const answer = matrix[0][0][0]; // 42
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
@category Array
|
|
42
|
+
*/
|
|
43
|
+
export type MultidimensionalReadonlyArray<Element, Dimensions extends number> = number extends Dimensions
|
|
44
|
+
? Recursive<Element>
|
|
45
|
+
: IsEqual<Dimensions, 0> extends true
|
|
46
|
+
? Element
|
|
47
|
+
: ReadonlyArray<MultidimensionalReadonlyArray<Element, Subtract<Dimensions, 1>>>;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
type Numeric = number | bigint;
|
|
2
|
+
|
|
3
|
+
type Zero = 0 | 0n;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
Matches the hidden `Infinity` type.
|
|
7
|
+
|
|
8
|
+
Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/32277) if you want to have this type as a built-in in TypeScript.
|
|
9
|
+
|
|
10
|
+
@see NegativeInfinity
|
|
11
|
+
|
|
12
|
+
@category Numeric
|
|
13
|
+
*/
|
|
14
|
+
// See https://github.com/microsoft/TypeScript/issues/31752
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision
|
|
16
|
+
export type PositiveInfinity = 1e999;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
Matches the hidden `-Infinity` type.
|
|
20
|
+
|
|
21
|
+
Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/32277) if you want to have this type as a built-in in TypeScript.
|
|
22
|
+
|
|
23
|
+
@see PositiveInfinity
|
|
24
|
+
|
|
25
|
+
@category Numeric
|
|
26
|
+
*/
|
|
27
|
+
// See https://github.com/microsoft/TypeScript/issues/31752
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision
|
|
29
|
+
export type NegativeInfinity = -1e999;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
A finite `number`.
|
|
33
|
+
You can't pass a `bigint` as they are already guaranteed to be finite.
|
|
34
|
+
|
|
35
|
+
Use-case: Validating and documenting parameters.
|
|
36
|
+
|
|
37
|
+
Note: This can't detect `NaN`, please upvote [this issue](https://github.com/microsoft/TypeScript/issues/28682) if you want to have this type as a built-in in TypeScript.
|
|
38
|
+
|
|
39
|
+
@example
|
|
40
|
+
```
|
|
41
|
+
import type {Finite} from '..';
|
|
42
|
+
|
|
43
|
+
declare function setScore<T extends number>(length: Finite<T>): void;
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
@category Numeric
|
|
47
|
+
*/
|
|
48
|
+
export type Finite<T extends number> = T extends PositiveInfinity | NegativeInfinity ? never : T;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
A `number` that is an integer.
|
|
52
|
+
You can't pass a `bigint` as they are already guaranteed to be integers.
|
|
53
|
+
|
|
54
|
+
Use-case: Validating and documenting parameters.
|
|
55
|
+
|
|
56
|
+
@example
|
|
57
|
+
```
|
|
58
|
+
import type {Integer} from '..';
|
|
59
|
+
|
|
60
|
+
declare function setYear<T extends number>(length: Integer<T>): void;
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
@see NegativeInteger
|
|
64
|
+
@see NonNegativeInteger
|
|
65
|
+
|
|
66
|
+
@category Numeric
|
|
67
|
+
*/
|
|
68
|
+
// `${bigint}` is a type that matches a valid bigint literal without the `n` (ex. 1, 0b1, 0o1, 0x1)
|
|
69
|
+
// Because T is a number and not a string we can effectively use this to filter out any numbers containing decimal points
|
|
70
|
+
export type Integer<T extends number> = `${T}` extends `${bigint}` ? T : never;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
A `number` that is not an integer.
|
|
74
|
+
You can't pass a `bigint` as they are already guaranteed to be integers.
|
|
75
|
+
|
|
76
|
+
Use-case: Validating and documenting parameters.
|
|
77
|
+
|
|
78
|
+
@example
|
|
79
|
+
```
|
|
80
|
+
import type {Float} from '..';
|
|
81
|
+
|
|
82
|
+
declare function setPercentage<T extends number>(length: Float<T>): void;
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
@see Integer
|
|
86
|
+
|
|
87
|
+
@category Numeric
|
|
88
|
+
*/
|
|
89
|
+
export type Float<T extends number> = T extends Integer<T> ? never : T;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
A negative (`-∞ < x < 0`) `number` that is not an integer.
|
|
93
|
+
Equivalent to `Negative<Float<T>>`.
|
|
94
|
+
|
|
95
|
+
Use-case: Validating and documenting parameters.
|
|
96
|
+
|
|
97
|
+
@see Negative
|
|
98
|
+
@see Float
|
|
99
|
+
|
|
100
|
+
@category Numeric
|
|
101
|
+
*/
|
|
102
|
+
export type NegativeFloat<T extends number> = Negative<Float<T>>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
A negative `number`/`bigint` (`-∞ < x < 0`)
|
|
106
|
+
|
|
107
|
+
Use-case: Validating and documenting parameters.
|
|
108
|
+
|
|
109
|
+
@see NegativeInteger
|
|
110
|
+
@see NonNegative
|
|
111
|
+
|
|
112
|
+
@category Numeric
|
|
113
|
+
*/
|
|
114
|
+
export type Negative<T extends Numeric> = T extends Zero ? never : `${T}` extends `-${string}` ? T : never;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
A negative (`-∞ < x < 0`) `number` that is an integer.
|
|
118
|
+
Equivalent to `Negative<Integer<T>>`.
|
|
119
|
+
|
|
120
|
+
You can't pass a `bigint` as they are already guaranteed to be integers, instead use `Negative<T>`.
|
|
121
|
+
|
|
122
|
+
Use-case: Validating and documenting parameters.
|
|
123
|
+
|
|
124
|
+
@see Negative
|
|
125
|
+
@see Integer
|
|
126
|
+
|
|
127
|
+
@category Numeric
|
|
128
|
+
*/
|
|
129
|
+
export type NegativeInteger<T extends number> = Negative<Integer<T>>;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
A non-negative `number`/`bigint` (`0 <= x < ∞`).
|
|
133
|
+
|
|
134
|
+
Use-case: Validating and documenting parameters.
|
|
135
|
+
|
|
136
|
+
@see NonNegativeInteger
|
|
137
|
+
@see Negative
|
|
138
|
+
|
|
139
|
+
@example
|
|
140
|
+
```
|
|
141
|
+
import type {NonNegative} from '..';
|
|
142
|
+
|
|
143
|
+
declare function setLength<T extends number>(length: NonNegative<T>): void;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
@category Numeric
|
|
147
|
+
*/
|
|
148
|
+
export type NonNegative<T extends Numeric> = T extends Zero ? T : Negative<T> extends never ? T : never;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
A non-negative (`0 <= x < ∞`) `number` that is an integer.
|
|
152
|
+
Equivalent to `NonNegative<Integer<T>>`.
|
|
153
|
+
|
|
154
|
+
You can't pass a `bigint` as they are already guaranteed to be integers, instead use `NonNegative<T>`.
|
|
155
|
+
|
|
156
|
+
Use-case: Validating and documenting parameters.
|
|
157
|
+
|
|
158
|
+
@see NonNegative
|
|
159
|
+
@see Integer
|
|
160
|
+
|
|
161
|
+
@example
|
|
162
|
+
```
|
|
163
|
+
import type {NonNegativeInteger} from '..';
|
|
164
|
+
|
|
165
|
+
declare function setLength<T extends number>(length: NonNegativeInteger<T>): void;
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
@category Numeric
|
|
169
|
+
*/
|
|
170
|
+
export type NonNegativeInteger<T extends number> = NonNegative<Integer<T>>;
|