akanjs 2.2.4 → 2.2.6
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 +9 -0
- package/base/base.ts +1 -1
- package/base/primitiveRegistry.ts +6 -10
- package/base/types.ts +1 -4
- package/capacitor.base.config.ts +1 -1
- package/client/capacitor.ts +1 -1
- package/client/cookie.ts +2 -4
- package/client/createFont.ts +2 -2
- package/client/csrTypes.ts +2 -8
- package/client/makePageProto.tsx +4 -10
- package/client/router.ts +3 -8
- package/client/translator.ts +4 -12
- package/common/Logger.ts +1 -4
- package/common/formatNumber.ts +2 -5
- package/common/hmrPhase.ts +1 -1
- package/common/isValidDate.ts +0 -3
- package/constant/fieldInfo.ts +3 -3
- package/constant/purify.ts +1 -2
- package/constant/types.ts +0 -4
- package/constant/via.ts +6 -12
- package/document/databaseRegistry.ts +0 -8
- package/document/into.ts +0 -1
- package/fetch/client/fetchClient.ts +1 -6
- package/fetch/client/httpClient.ts +1 -2
- package/fetch/fetchType/appliedReturn.type.ts +0 -1
- package/fetch/fetchType/endpointFetch.type.ts +0 -3
- package/fetch/fetchType/sliceFetch.type.ts +0 -8
- package/fetch/requestStorage.ts +2 -10
- package/package.json +67 -24
- package/server/akanApp.ts +2 -5
- package/server/akanLib.ts +0 -1
- package/server/akanServer.ts +3 -4
- package/server/artifact/builderRpc.ts +2 -2
- package/server/artifact/ipcTypes.ts +0 -4
- package/server/decorators.ts +1 -1
- package/server/di/diLifecycle.ts +3 -6
- package/server/hmr/clientScript.ts +2 -20
- package/server/hmr/devHmrController.ts +0 -4
- package/server/processMetricsCollector.ts +1 -1
- package/server/resolver/database.resolver.ts +2 -2
- package/server/resolver/resolver.contract.fixture.ts +0 -1
- package/server/resolver/signal.resolver.ts +2 -10
- package/server/routing/apiRouter.ts +2 -4
- package/server/rscClient.tsx +1 -7
- package/server/rscWorkerHost.ts +11 -33
- package/server/ssrFromRscRenderer.tsx +3 -35
- package/server/types/react-server-dom-webpack.d.ts +1 -7
- package/server/vendor/react-dom-client.ts +1 -1
- package/server/vendor/react-dom.ts +2 -3
- package/server/vendor/react-jsx-dev-runtime.ts +1 -1
- package/server/vendor/react-jsx-runtime.ts +1 -1
- package/server/vendor/react-refresh-runtime.ts +2 -2
- package/server/vendor/react-server-dom-webpack-client-browser.ts +1 -1
- package/server/vendor/react.ts +2 -9
- package/server/vendor/scheduler.ts +2 -3
- package/server/webRouter.ts +2 -3
- package/service/adapt.ts +1 -5
- package/service/predefinedAdaptor/cache.adaptor.ts +1 -2
- package/service/predefinedAdaptor/database.adaptor.ts +2 -2
- package/service/predefinedAdaptor/solidSqlite.ts +1 -2
- package/service/predefinedAdaptor/websocket.adaptor.ts +3 -15
- package/service/serve.ts +3 -7
- package/signal/base.signal.ts +0 -1
- package/signal/endpointInfo.ts +0 -7
- package/signal/intercept.ts +0 -2
- package/signal/middleware.ts +1 -2
- package/signal/serverSignal.ts +1 -15
- package/signal/signalContext.ts +1 -1
- package/signal/signalRegistry.ts +0 -5
- package/signal/sliceInfo.ts +0 -3
- package/signal/trace.ts +0 -11
- package/signal/types.ts +2 -11
- package/store/action.ts +3 -5
- package/store/stateBuilder.ts +0 -2
- package/store/stateInfo.ts +1 -2
- package/store/types.ts +1 -1
- package/test/playwright.config.base.ts +5 -28
- package/test/playwright.pageAgent.ts +1 -1
- package/test/sampleOf.ts +1 -1
- package/test/testServer.ts +1 -1
- package/types/base/base.d.ts +53 -0
- package/types/base/baseEnv.d.ts +68 -0
- package/types/base/index.d.ts +6 -0
- package/types/base/primitiveRegistry.d.ts +134 -0
- package/types/base/symbols.d.ts +11 -0
- package/types/base/types.d.ts +68 -0
- package/types/base/utils.d.ts +4 -0
- package/types/base.d.ts +1 -0
- package/types/capacitor.base.config.d.ts +3 -0
- package/types/client/capacitor.d.ts +233 -0
- package/types/client/clientRuntime.d.ts +63 -0
- package/types/client/cookie.d.ts +33 -0
- package/types/client/createFont.d.ts +6 -0
- package/types/client/csrTypes.d.ts +262 -0
- package/types/client/decorators.d.ts +7 -0
- package/types/client/device.d.ts +41 -0
- package/types/client/fetch.d.ts +1 -0
- package/types/client/index.d.ts +14 -0
- package/types/client/locale.d.ts +5 -0
- package/types/client/makePageProto.d.ts +17002 -0
- package/types/client/router.d.ts +66 -0
- package/types/client/rscNavigation.d.ts +19 -0
- package/types/client/storage.d.ts +5 -0
- package/types/client/translator.d.ts +18 -0
- package/types/client/types.d.ts +145 -0
- package/types/client/useClient.d.ts +1 -0
- package/types/client.d.ts +1 -0
- package/types/common/Logger.d.ts +41 -0
- package/types/common/applyMixins.d.ts +3 -0
- package/types/common/capitalize.d.ts +2 -0
- package/types/common/deepObjectify.d.ts +4 -0
- package/types/common/fileUpload.d.ts +28 -0
- package/types/common/formatNumber.d.ts +1 -0
- package/types/common/formatPhone.d.ts +2 -0
- package/types/common/getAllPropertyDescriptors.d.ts +5 -0
- package/types/common/hmrPhase.d.ts +6 -0
- package/types/common/httpClient.d.ts +20 -0
- package/types/common/index.d.ts +29 -0
- package/types/common/isDayjs.d.ts +2 -0
- package/types/common/isEmail.d.ts +2 -0
- package/types/common/isPhoneNumber.d.ts +2 -0
- package/types/common/isQueryEqual.d.ts +1 -0
- package/types/common/isValidDate.d.ts +2 -0
- package/types/common/jwtDecode.d.ts +2 -0
- package/types/common/localeConfig.d.ts +11 -0
- package/types/common/lowerlize.d.ts +2 -0
- package/types/common/mergeVersion.d.ts +10 -0
- package/types/common/objectify.d.ts +1 -0
- package/types/common/pathGet.d.ts +1 -0
- package/types/common/pathSet.d.ts +3 -0
- package/types/common/randomPick.d.ts +1 -0
- package/types/common/randomPicks.d.ts +1 -0
- package/types/common/routeConvention.d.ts +35 -0
- package/types/common/sleep.d.ts +2 -0
- package/types/common/splitVersion.d.ts +11 -0
- package/types/common/subRoute.d.ts +7 -0
- package/types/common/types.d.ts +14 -0
- package/types/common.d.ts +1 -0
- package/types/constant/constantRegistry.d.ts +89 -0
- package/types/constant/crystalize.d.ts +4 -0
- package/types/constant/deserialize.d.ts +7 -0
- package/types/constant/fieldInfo.d.ts +153 -0
- package/types/constant/getDefault.d.ts +3 -0
- package/types/constant/immerify.d.ts +2 -0
- package/types/constant/index.d.ts +10 -0
- package/types/constant/purify.d.ts +12 -0
- package/types/constant/serialize.d.ts +11 -0
- package/types/constant/types.d.ts +77 -0
- package/types/constant/via.d.ts +52 -0
- package/types/constant.d.ts +1 -0
- package/types/dictionary/base.dictionary.d.ts +1 -0
- package/types/dictionary/dictInfo.d.ts +206 -0
- package/types/dictionary/dictionary.d.ts +11 -0
- package/types/dictionary/index.d.ts +4 -0
- package/types/dictionary/locale.d.ts +128 -0
- package/types/dictionary/trans.d.ts +82 -0
- package/types/dictionary.d.ts +1 -0
- package/types/document/by.d.ts +20 -0
- package/types/document/dataLoader.d.ts +36 -0
- package/types/document/database.d.ts +96 -0
- package/types/document/databaseRegistry.d.ts +36 -0
- package/types/document/documentQuery.d.ts +105 -0
- package/types/document/documentSchema.d.ts +33 -0
- package/types/document/filterMeta.d.ts +84 -0
- package/types/document/index.d.ts +11 -0
- package/types/document/into.d.ts +65 -0
- package/types/document/loaderInfo.d.ts +35 -0
- package/types/document/schema.d.ts +5 -0
- package/types/document/types.d.ts +36 -0
- package/types/document.d.ts +1 -0
- package/types/fetch/client/fetchClient.d.ts +78 -0
- package/types/fetch/client/httpClient.d.ts +39 -0
- package/types/fetch/client/index.d.ts +3 -0
- package/types/fetch/client/wsClient.d.ts +37 -0
- package/types/fetch/client.d.ts +1 -0
- package/types/fetch/fetchType/appliedReturn.type.d.ts +67 -0
- package/types/fetch/fetchType/buildFetch.type.d.ts +11 -0
- package/types/fetch/fetchType/clientSignal.type.d.ts +16 -0
- package/types/fetch/fetchType/endpointFetch.type.d.ts +29 -0
- package/types/fetch/fetchType/index.d.ts +5 -0
- package/types/fetch/fetchType/sliceFetch.type.d.ts +76 -0
- package/types/fetch/fetchType.d.ts +1 -0
- package/types/fetch/index.d.ts +4 -0
- package/types/fetch/requestStorage.d.ts +29 -0
- package/types/fetch/serializer/fetch.serializer.d.ts +14 -0
- package/types/fetch/serializer/index.d.ts +1 -0
- package/types/fetch/serializer.d.ts +1 -0
- package/types/fetch/types.d.ts +19 -0
- package/types/fetch.d.ts +1 -0
- package/types/index.d.ts +213 -0
- package/types/server/akanApp.d.ts +17 -0
- package/types/server/akanAppHeaders.d.ts +1 -0
- package/types/server/akanLib.d.ts +33 -0
- package/types/server/akanOption.d.ts +15 -0
- package/types/server/akanServer.d.ts +47 -0
- package/types/server/artifact/builderRpc.d.ts +42 -0
- package/types/server/artifact/index.d.ts +6 -0
- package/types/server/artifact/ipcTypes.d.ts +73 -0
- package/types/server/artifact/manifestTypes.d.ts +16 -0
- package/types/server/artifact/routeClientCache.d.ts +45 -0
- package/types/server/artifact/routeSeedIndexStore.d.ts +43 -0
- package/types/server/artifact/routesManifestStore.d.ts +16 -0
- package/types/server/artifact.d.ts +1 -0
- package/types/server/decorators.d.ts +6 -0
- package/types/server/di/diLifecycle.d.ts +45 -0
- package/types/server/di/index.d.ts +4 -0
- package/types/server/di/predefinedAdaptor.d.ts +33 -0
- package/types/server/di/resolveAdaptorHierarchy.d.ts +21 -0
- package/types/server/di/resolveHierarchy.d.ts +11 -0
- package/types/server/di/resolveServiceHierarchy.d.ts +13 -0
- package/types/server/di/utils.d.ts +14 -0
- package/types/server/di.d.ts +1 -0
- package/types/server/hmr/changeBatch.d.ts +13 -0
- package/types/server/hmr/clientScript.d.ts +1 -0
- package/types/server/hmr/devHmrController.d.ts +24 -0
- package/types/server/hmr/index.d.ts +4 -0
- package/types/server/hmr/wsHub.d.ts +45 -0
- package/types/server/hmr.d.ts +1 -0
- package/types/server/imageOptimizer.d.ts +12 -0
- package/types/server/imageOptimizerError.d.ts +4 -0
- package/types/server/index.d.ts +14 -0
- package/types/server/lifecycle/shutdownManager.d.ts +13 -0
- package/types/server/logging/rotatingLogWriter.d.ts +20 -0
- package/types/server/processMetricsCollector.d.ts +10 -0
- package/types/server/proxy/akanResponse.d.ts +7 -0
- package/types/server/proxy/bunRequestFields.d.ts +1 -0
- package/types/server/proxy/hostBasePathWebProxy.d.ts +6 -0
- package/types/server/proxy/index.d.ts +6 -0
- package/types/server/proxy/localeWebProxy.d.ts +5 -0
- package/types/server/proxy/types.d.ts +37 -0
- package/types/server/proxy/webProxyRunner.d.ts +7 -0
- package/types/server/proxy.d.ts +1 -0
- package/types/server/resolver/database.resolver.d.ts +6 -0
- package/types/server/resolver/index.d.ts +3 -0
- package/types/server/resolver/service.resolver.d.ts +7 -0
- package/types/server/resolver/signal.resolver.d.ts +29 -0
- package/types/server/resolver.d.ts +1 -0
- package/types/server/robots.d.ts +1 -0
- package/types/server/routeElementComposer.d.ts +41 -0
- package/types/server/routeTreeBuilder.d.ts +28 -0
- package/types/server/routing/apiRouter.d.ts +61 -0
- package/types/server/rscClient.d.ts +15 -0
- package/types/server/rscWorker.d.ts +3 -0
- package/types/server/rscWorkerHost.d.ts +83 -0
- package/types/server/sitemap.d.ts +13 -0
- package/types/server/ssrFromRscRenderer.d.ts +6 -0
- package/types/server/ssrTypes.d.ts +47 -0
- package/types/server/systemPages.d.ts +27 -0
- package/types/server/types/react-server-dom-webpack.d.ts +91 -0
- package/types/server/types.d.ts +67 -0
- package/types/server/vendor/akanjs-base.d.ts +1 -0
- package/types/server/vendor/akanjs-common.d.ts +1 -0
- package/types/server/vendor/akanjs-constant.d.ts +1 -0
- package/types/server/vendor/akanjs-store.d.ts +1 -0
- package/types/server/vendor/react-dom-client.d.ts +3 -0
- package/types/server/vendor/react-dom.d.ts +3 -0
- package/types/server/vendor/react-jsx-dev-runtime.d.ts +3 -0
- package/types/server/vendor/react-jsx-runtime.d.ts +3 -0
- package/types/server/vendor/react-refresh-runtime.d.ts +3 -0
- package/types/server/vendor/react-server-dom-webpack-client-browser.d.ts +3 -0
- package/types/server/vendor/react.d.ts +11 -0
- package/types/server/vendor/scheduler.d.ts +3 -0
- package/types/server/webRouter.d.ts +44 -0
- package/types/server.d.ts +1 -0
- package/types/service/adapt.d.ts +15 -0
- package/types/service/base.service.d.ts +18 -0
- package/types/service/index.d.ts +10 -0
- package/types/service/injectInfo.d.ts +102 -0
- package/types/service/ipcTypes.d.ts +194 -0
- package/types/service/predefinedAdaptor/cache.adaptor.d.ts +46 -0
- package/types/service/predefinedAdaptor/compress.adaptor.d.ts +22 -0
- package/types/service/predefinedAdaptor/database.adaptor.d.ts +329 -0
- package/types/service/predefinedAdaptor/index.d.ts +13 -0
- package/types/service/predefinedAdaptor/logging.adaptor.d.ts +20 -0
- package/types/service/predefinedAdaptor/queue.adaptor.d.ts +22 -0
- package/types/service/predefinedAdaptor/role.adaptor.d.ts +17 -0
- package/types/service/predefinedAdaptor/schedule.adaptor.d.ts +60 -0
- package/types/service/predefinedAdaptor/solidCache.adaptor.d.ts +25 -0
- package/types/service/predefinedAdaptor/solidPubsub.adaptor.d.ts +20 -0
- package/types/service/predefinedAdaptor/solidQueue.adaptor.d.ts +19 -0
- package/types/service/predefinedAdaptor/solidSqlite.d.ts +24 -0
- package/types/service/predefinedAdaptor/sqlitePath.d.ts +9 -0
- package/types/service/predefinedAdaptor/storage.adaptor.d.ts +80 -0
- package/types/service/predefinedAdaptor/websocket.adaptor.d.ts +49 -0
- package/types/service/predefinedAdaptor.d.ts +1 -0
- package/types/service/serve.d.ts +31 -0
- package/types/service/serviceModule.d.ts +50 -0
- package/types/service/serviceRegistry.d.ts +9 -0
- package/types/service/types.d.ts +55 -0
- package/types/service.d.ts +1 -0
- package/types/signal/base.signal.d.ts +41 -0
- package/types/signal/endpoint.d.ts +28 -0
- package/types/signal/endpointInfo.d.ts +77 -0
- package/types/signal/exception.d.ts +54786 -0
- package/types/signal/guard.d.ts +10 -0
- package/types/signal/guards.d.ts +10 -0
- package/types/signal/index.d.ts +19 -0
- package/types/signal/intercept.d.ts +17 -0
- package/types/signal/internal.d.ts +18 -0
- package/types/signal/internalArg.d.ts +31 -0
- package/types/signal/internalInfo.d.ts +45 -0
- package/types/signal/middleware.d.ts +51 -0
- package/types/signal/serializer/fetch.serializer.d.ts +14 -0
- package/types/signal/serializer/index.d.ts +1 -0
- package/types/signal/serializer.d.ts +1 -0
- package/types/signal/serverSignal.d.ts +36 -0
- package/types/signal/signalContext.d.ts +96 -0
- package/types/signal/signalRegistry.d.ts +49 -0
- package/types/signal/slice.d.ts +42 -0
- package/types/signal/sliceInfo.d.ts +51 -0
- package/types/signal/trace.d.ts +97 -0
- package/types/signal/types.d.ts +142 -0
- package/types/signal.d.ts +1 -0
- package/types/store/action.d.ts +145 -0
- package/types/store/baseSt.d.ts +412 -0
- package/types/store/hooks.d.ts +1 -0
- package/types/store/index.d.ts +8 -0
- package/types/store/rootStore.d.ts +22 -0
- package/types/store/state.d.ts +91 -0
- package/types/store/stateBuilder.d.ts +141 -0
- package/types/store/stateInfo.d.ts +23 -0
- package/types/store/store.d.ts +36 -0
- package/types/store/storeInstance.d.ts +38 -0
- package/types/store/storeRegistry.d.ts +13 -0
- package/types/store/types.d.ts +42 -0
- package/types/store/withSelector.d.ts +42 -0
- package/types/store.d.ts +1 -0
- package/types/test/index.d.ts +4 -0
- package/types/test/playwright.config.base.d.ts +9 -0
- package/types/test/playwright.pageAgent.d.ts +12 -0
- package/types/test/sample.d.ts +15 -0
- package/types/test/sampleOf.d.ts +5 -0
- package/types/test/signalTest.preload.d.ts +1 -0
- package/types/test/signalTestRuntime.d.ts +29 -0
- package/types/test/testServer.d.ts +26 -0
- package/types/test.d.ts +1 -0
- package/types/ui/BottomSheet.d.ts +13 -0
- package/types/ui/Button.d.ts +11 -0
- package/types/ui/ClientSide.d.ts +8 -0
- package/types/ui/Clipboard.d.ts +7 -0
- package/types/ui/Constant/Doc.d.ts +29 -0
- package/types/ui/Constant/Mermaid.d.ts +8 -0
- package/types/ui/Constant/index.d.ts +6 -0
- package/types/ui/Constant/schemaDoc.d.ts +84 -0
- package/types/ui/Constant.d.ts +1 -0
- package/types/ui/Copy.d.ts +10 -0
- package/types/ui/CsrImage.d.ts +18 -0
- package/types/ui/Data/CardList.d.ts +36 -0
- package/types/ui/Data/Dashboard.d.ts +11 -0
- package/types/ui/Data/Insight.d.ts +9 -0
- package/types/ui/Data/Item.d.ts +75 -0
- package/types/ui/Data/ListContainer.d.ts +49 -0
- package/types/ui/Data/Pagination.d.ts +9 -0
- package/types/ui/Data/QueryMaker.d.ts +8 -0
- package/types/ui/Data/TableList.d.ts +26 -0
- package/types/ui/Data/index.d.ts +9 -0
- package/types/ui/Data/index_.d.ts +8 -0
- package/types/ui/Data.d.ts +1 -0
- package/types/ui/DatePicker.d.ts +36 -0
- package/types/ui/Dialog/Action.d.ts +5 -0
- package/types/ui/Dialog/Close.d.ts +6 -0
- package/types/ui/Dialog/Content.d.ts +6 -0
- package/types/ui/Dialog/Modal.d.ts +9 -0
- package/types/ui/Dialog/Provider.d.ts +11 -0
- package/types/ui/Dialog/Title.d.ts +5 -0
- package/types/ui/Dialog/Trigger.d.ts +6 -0
- package/types/ui/Dialog/context.d.ts +10 -0
- package/types/ui/Dialog/index.d.ts +9 -0
- package/types/ui/Dialog.d.ts +1 -0
- package/types/ui/DragAction.d.ts +24 -0
- package/types/ui/DraggableList.d.ts +31 -0
- package/types/ui/Dropdown.d.ts +14 -0
- package/types/ui/Empty.d.ts +12 -0
- package/types/ui/Field.d.ts +411 -0
- package/types/ui/FontFace.d.ts +6 -0
- package/types/ui/Image.d.ts +49 -0
- package/types/ui/InfiniteScroll.d.ts +10 -0
- package/types/ui/Input.d.ts +95 -0
- package/types/ui/KeyboardAvoiding.d.ts +8 -0
- package/types/ui/Layout/BottomAction.d.ts +6 -0
- package/types/ui/Layout/BottomInset.d.ts +7 -0
- package/types/ui/Layout/BottomTab.d.ts +14 -0
- package/types/ui/Layout/Header.d.ts +8 -0
- package/types/ui/Layout/LeftSider.d.ts +9 -0
- package/types/ui/Layout/Navbar.d.ts +11 -0
- package/types/ui/Layout/RightSider.d.ts +10 -0
- package/types/ui/Layout/Sider.d.ts +7 -0
- package/types/ui/Layout/Template.d.ts +7 -0
- package/types/ui/Layout/TopLeftAction.d.ts +6 -0
- package/types/ui/Layout/Unit.d.ts +9 -0
- package/types/ui/Layout/View.d.ts +8 -0
- package/types/ui/Layout/Zone.d.ts +6 -0
- package/types/ui/Layout/index.d.ts +14 -0
- package/types/ui/Layout.d.ts +1 -0
- package/types/ui/Link/Back.d.ts +7 -0
- package/types/ui/Link/Close.d.ts +7 -0
- package/types/ui/Link/CsrLink.d.ts +2 -0
- package/types/ui/Link/Lang.d.ts +8 -0
- package/types/ui/Link/SsrLink.d.ts +2 -0
- package/types/ui/Link/index.d.ts +10 -0
- package/types/ui/Link/types.d.ts +42 -0
- package/types/ui/Link.d.ts +1 -0
- package/types/ui/Load/Edit.d.ts +4 -0
- package/types/ui/Load/Edit_Client.d.ts +27 -0
- package/types/ui/Load/Page.d.ts +15 -0
- package/types/ui/Load/PageCSR.d.ts +3 -0
- package/types/ui/Load/Pagination.d.ts +8 -0
- package/types/ui/Load/Units.d.ts +30 -0
- package/types/ui/Load/View.d.ts +22 -0
- package/types/ui/Load/index.d.ts +8 -0
- package/types/ui/Load/index_.d.ts +3 -0
- package/types/ui/Load.d.ts +1 -0
- package/types/ui/Loading/Area.d.ts +1 -0
- package/types/ui/Loading/Button.d.ts +7 -0
- package/types/ui/Loading/Input.d.ts +7 -0
- package/types/ui/Loading/ProgressBar.d.ts +6 -0
- package/types/ui/Loading/Skeleton.d.ts +7 -0
- package/types/ui/Loading/Spin.d.ts +7 -0
- package/types/ui/Loading/index.d.ts +8 -0
- package/types/ui/Loading.d.ts +1 -0
- package/types/ui/Menu.d.ts +26 -0
- package/types/ui/Modal.d.ts +19 -0
- package/types/ui/Model/AdminPanel.d.ts +31 -0
- package/types/ui/Model/Edit.d.ts +16 -0
- package/types/ui/Model/EditModal.d.ts +52 -0
- package/types/ui/Model/EditWrapper.d.ts +13 -0
- package/types/ui/Model/LoadInit.d.ts +10 -0
- package/types/ui/Model/New.d.ts +16 -0
- package/types/ui/Model/NewWrapper.d.ts +13 -0
- package/types/ui/Model/NewWrapper_Client.d.ts +13 -0
- package/types/ui/Model/Remove.d.ts +13 -0
- package/types/ui/Model/RemoveWrapper.d.ts +12 -0
- package/types/ui/Model/SureToRemove.d.ts +11 -0
- package/types/ui/Model/View.d.ts +19 -0
- package/types/ui/Model/ViewEditModal.d.ts +12 -0
- package/types/ui/Model/ViewModal.d.ts +14 -0
- package/types/ui/Model/ViewWrapper.d.ts +12 -0
- package/types/ui/Model/index.d.ts +16 -0
- package/types/ui/Model/index_.d.ts +14 -0
- package/types/ui/Model.d.ts +1 -0
- package/types/ui/More.d.ts +12 -0
- package/types/ui/ObjectId.d.ts +5 -0
- package/types/ui/Pagination.d.ts +20 -0
- package/types/ui/Popconfirm.d.ts +28 -0
- package/types/ui/Portal.d.ts +6 -0
- package/types/ui/Radio.d.ts +19 -0
- package/types/ui/RecentTime.d.ts +12 -0
- package/types/ui/Refresh.d.ts +7 -0
- package/types/ui/ScreenNavigator.d.ts +18 -0
- package/types/ui/Select.d.ts +43 -0
- package/types/ui/Signal/Arg.d.ts +78 -0
- package/types/ui/Signal/Doc.d.ts +33 -0
- package/types/ui/Signal/Listener.d.ts +9 -0
- package/types/ui/Signal/Message.d.ts +23 -0
- package/types/ui/Signal/Object.d.ts +20 -0
- package/types/ui/Signal/PubSub.d.ts +24 -0
- package/types/ui/Signal/Request.d.ts +8 -0
- package/types/ui/Signal/Response.d.ts +14 -0
- package/types/ui/Signal/RestApi.d.ts +40 -0
- package/types/ui/Signal/WebSocket.d.ts +11 -0
- package/types/ui/Signal/index.d.ts +18 -0
- package/types/ui/Signal/makeExample.d.ts +4 -0
- package/types/ui/Signal/style.d.ts +15 -0
- package/types/ui/Signal.d.ts +1 -0
- package/types/ui/System/CSR.d.ts +32 -0
- package/types/ui/System/Client.d.ts +47 -0
- package/types/ui/System/Common.d.ts +47 -0
- package/types/ui/System/DevModeToggle.d.ts +1 -0
- package/types/ui/System/Gtag.d.ts +4 -0
- package/types/ui/System/Messages.d.ts +1 -0
- package/types/ui/System/Reconnect.d.ts +1 -0
- package/types/ui/System/Root.d.ts +6 -0
- package/types/ui/System/SSR.d.ts +24 -0
- package/types/ui/System/SelectLanguage.d.ts +5 -0
- package/types/ui/System/ThemeToggle.d.ts +4 -0
- package/types/ui/System/index.d.ts +12 -0
- package/types/ui/System.d.ts +1 -0
- package/types/ui/Tab/Menu.d.ts +12 -0
- package/types/ui/Tab/Menus.d.ts +6 -0
- package/types/ui/Tab/Panel.d.ts +8 -0
- package/types/ui/Tab/Provider.d.ts +10 -0
- package/types/ui/Tab/context.d.ts +9 -0
- package/types/ui/Tab/index.d.ts +7 -0
- package/types/ui/Tab.d.ts +1 -0
- package/types/ui/Table.d.ts +41 -0
- package/types/ui/ToggleSelect.d.ts +33 -0
- package/types/ui/Unauthorized.d.ts +9 -0
- package/types/ui/animated.d.ts +5 -0
- package/types/ui/fontCss.d.ts +11 -0
- package/types/ui/index.d.ts +44 -0
- package/types/ui.d.ts +1 -0
- package/types/webkit/bootCsr.d.ts +16 -0
- package/types/webkit/createRobotPage.d.ts +15 -0
- package/types/webkit/createSitemapPage.d.ts +4 -0
- package/types/webkit/index.d.ts +17 -0
- package/types/webkit/lazy.d.ts +11 -0
- package/types/webkit/types.d.ts +7 -0
- package/types/webkit/useCamera.d.ts +19 -0
- package/types/webkit/useCodepush.d.ts +16 -0
- package/types/webkit/useContact.d.ts +11 -0
- package/types/webkit/useCsrValues.d.ts +30 -0
- package/types/webkit/useDebounce.d.ts +2 -0
- package/types/webkit/useFetch.d.ts +18 -0
- package/types/webkit/useGeoLocation.d.ts +8 -0
- package/types/webkit/useHistory.d.ts +23 -0
- package/types/webkit/useInterval.d.ts +2 -0
- package/types/webkit/useLocation.d.ts +8 -0
- package/types/webkit/usePurchase.d.ts +19 -0
- package/types/webkit/usePushNoti.d.ts +7 -0
- package/types/webkit/useThrottle.d.ts +2 -0
- package/types/webkit.d.ts +1 -0
- package/ui/BottomSheet.tsx +1 -1
- package/ui/Clipboard.tsx +1 -1
- package/ui/CsrImage.tsx +3 -14
- package/ui/Data/ListContainer.tsx +1 -1
- package/ui/Data/Pagination.tsx +1 -1
- package/ui/Data/QueryMaker.tsx +0 -339
- package/ui/Data/index.ts +0 -1
- package/ui/DatePicker.tsx +1 -95
- package/ui/Dialog/Modal.tsx +1 -1
- package/ui/DraggableList.tsx +5 -5
- package/ui/Field.tsx +2 -3
- package/ui/Image.tsx +2 -3
- package/ui/InfiniteScroll.tsx +0 -1
- package/ui/Input.tsx +1 -8
- package/ui/Layout/BottomTab.tsx +2 -2
- package/ui/Link/SsrLink.tsx +1 -2
- package/ui/Load/Page.tsx +1 -1
- package/ui/Load/PageCSR.tsx +0 -1
- package/ui/Load/Units.tsx +1 -2
- package/ui/Load/View.tsx +1 -2
- package/ui/Menu.tsx +5 -8
- package/ui/Model/EditModal.tsx +2 -5
- package/ui/Popconfirm.tsx +2 -4
- package/ui/ScreenNavigator.tsx +2 -3
- package/ui/Signal/Message.tsx +2 -3
- package/ui/Signal/PubSub.tsx +0 -2
- package/ui/Signal/Response.tsx +1 -1
- package/ui/Signal/WebSocket.tsx +2 -11
- package/ui/System/Client.tsx +7 -41
- package/ui/System/Gtag.tsx +2 -5
- package/ui/System/Messages.tsx +2 -2
- package/ui/System/Reconnect.tsx +5 -6
- package/ui/System/Root.tsx +0 -1
- package/ui/System/SSR.tsx +1 -7
- package/ui/ToggleSelect.tsx +3 -8
- package/ui/Unauthorized.tsx +1 -1
- package/webkit/bootCsr.tsx +3 -6
- package/webkit/lazy.tsx +1 -8
- package/webkit/useCamera.tsx +0 -1
- package/webkit/useCodepush.tsx +4 -9
- package/webkit/useContact.tsx +0 -1
- package/webkit/useCsrValues.ts +6 -10
- package/webkit/useDebounce.ts +2 -2
- package/webkit/usePurchase.tsx +5 -9
- package/webkit/usePushNoti.tsx +0 -1
- package/base/base.test.ts +0 -135
- package/base/baseEnv.test.ts +0 -146
- package/base/primitiveRegistry.test.ts +0 -127
- package/base/symbols.test.ts +0 -29
- package/base/utils.test.ts +0 -30
- package/build.ts +0 -318
- package/capacitor.base.config.test.ts +0 -83
- package/client/client.auth-storage.test.ts +0 -210
- package/client/client.decorators.test.ts +0 -74
- package/client/client.device.test.ts +0 -181
- package/client/client.page.test.tsx +0 -175
- package/client/client.pure.test.ts +0 -146
- package/client/client.router.test.ts +0 -290
- package/common/Logger.test.ts +0 -45
- package/common/formatAndValidation.test.ts +0 -61
- package/common/httpClient.test.ts +0 -91
- package/common/objectPath.test.ts +0 -108
- package/common/routeConvention.test.ts +0 -132
- package/common/runtimeConfig.test.ts +0 -84
- package/constant/constant.test.ts +0 -374
- package/dictionary/dictionary.test.ts +0 -352
- package/document/document.test.ts +0 -698
- package/fetch/fetch.test.ts +0 -838
- package/server/akanApp.test.ts +0 -130
- package/server/akanServer.test.ts +0 -157
- package/server/artifact/routeClientCache.test.ts +0 -265
- package/server/artifact/routeSeedIndex.test.ts +0 -56
- package/server/artifact/routesManifest.test.ts +0 -64
- package/server/di/diLifecycle.contract.test.ts +0 -168
- package/server/logging/rotatingLogWriter.test.ts +0 -119
- package/server/processMetrics.test.ts +0 -24
- package/server/proxy/webProxyRunner.test.ts +0 -66
- package/server/resolver/resolver.contract.test.ts +0 -594
- package/server/robots.test.ts +0 -16
- package/server/routeTree.test.tsx +0 -198
- package/server/routing/apiRouter.test.ts +0 -136
- package/server/sitemap.test.ts +0 -61
- package/server/systemPages.test.tsx +0 -93
- package/server/webRouter.test.ts +0 -49
- package/service/predefinedAdaptor/compress.adaptor.test.ts +0 -184
- package/service/predefinedAdaptor/solidCache.adaptor.test.ts +0 -107
- package/service/predefinedAdaptor/solidSqlite.test.ts +0 -457
- package/service/service.test.ts +0 -732
- package/signal/signal.test.ts +0 -892
- package/store/stateBuilder.test.ts +0 -168
- package/store/store.test.ts +0 -427
- package/tsconfig.json +0 -5
- package/ui/Constant/schemaDoc.test.ts +0 -113
- package/ui/InfiniteScroll.test.tsx +0 -155
- package/ui/System/Common.test.ts +0 -37
- package/webkit/bootCsr.test.tsx +0 -153
- package/webkit/native.test.tsx +0 -341
- package/webkit/webkit.test.tsx +0 -531
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import type { GetStateObject } from "akanjs/base";
|
|
2
|
+
import type { BaseInsight, BaseObject } from "akanjs/constant";
|
|
3
|
+
import type { BaseFilterQueryKey, BaseFilterSortKey, FilterInfo, FilterInstance } from "akanjs/document";
|
|
4
|
+
import type { EndpointInfo, SliceInfo } from "akanjs/signal";
|
|
5
|
+
import type { RootDictionary } from "./trans.d.ts";
|
|
6
|
+
type EnumValueKey = string | number;
|
|
7
|
+
declare class FieldTranslation<Languages extends [string, ...string[]]> {
|
|
8
|
+
static translate: <Languages_1 extends [string, ...string[]]>(trans: Languages_1) => FieldTranslation<Languages_1>;
|
|
9
|
+
trans: Languages;
|
|
10
|
+
descTrans?: Languages;
|
|
11
|
+
constructor(trans: Languages);
|
|
12
|
+
desc(descTrans: Languages): this;
|
|
13
|
+
}
|
|
14
|
+
declare class FunctionTranslation<Languages extends [string, ...string[]], ArgName extends string = never> {
|
|
15
|
+
trans: Languages;
|
|
16
|
+
descTrans?: Languages;
|
|
17
|
+
argTrans: {
|
|
18
|
+
[key in ArgName]: FieldTranslation<Languages>;
|
|
19
|
+
};
|
|
20
|
+
constructor(trans: Languages);
|
|
21
|
+
desc(descTrans: Languages): this;
|
|
22
|
+
arg<TransMap extends {
|
|
23
|
+
[key: string]: FieldTranslation<Languages>;
|
|
24
|
+
}>(translate: (t: (trans: Languages) => FieldTranslation<Languages>) => TransMap): FunctionTranslation<Languages, keyof TransMap & string>;
|
|
25
|
+
}
|
|
26
|
+
type BaseModelCrudGetSignalTranslation<T extends string, Languages extends [string, ...string[]] = [string], _CapitalizedRefName extends string = Capitalize<T>> = {
|
|
27
|
+
[K in T]: FunctionTranslation<Languages, `${T}Id`>;
|
|
28
|
+
} & {
|
|
29
|
+
[K in `light${_CapitalizedRefName}`]: FunctionTranslation<Languages, `${T}Id`>;
|
|
30
|
+
} & {
|
|
31
|
+
[K in `create${_CapitalizedRefName}`]: FunctionTranslation<Languages, "data">;
|
|
32
|
+
} & {
|
|
33
|
+
[K in `update${_CapitalizedRefName}`]: FunctionTranslation<Languages, `${T}Id` | "data">;
|
|
34
|
+
} & {
|
|
35
|
+
[K in `remove${_CapitalizedRefName}`]: FunctionTranslation<Languages, `${T}Id`>;
|
|
36
|
+
};
|
|
37
|
+
type GetBaseSignalKey<T extends string> = keyof BaseModelCrudGetSignalTranslation<T>;
|
|
38
|
+
export declare class ModelDictInfo<Languages extends [string, ...string[]] = [string], ModelKey extends string = keyof BaseObject, InsightKey extends string = keyof BaseInsight, QueryKey extends string = BaseFilterQueryKey, SortKey extends string = BaseFilterSortKey, EnumKey extends string = never, BaseSignalKey extends string = never, SliceKey extends string = never, EndpointKey extends string = never, ErrorKey extends string = never, EtcKey extends string = never> {
|
|
39
|
+
#private;
|
|
40
|
+
static baseModelDictionary: {
|
|
41
|
+
[key in keyof BaseObject]: FieldTranslation<[string, string]>;
|
|
42
|
+
};
|
|
43
|
+
static baseInsightDictionary: {
|
|
44
|
+
[key in keyof BaseInsight]: FieldTranslation<[string, string]>;
|
|
45
|
+
};
|
|
46
|
+
static baseQueryDictionary: {
|
|
47
|
+
[key in BaseFilterQueryKey]: FieldTranslation<[string, string]>;
|
|
48
|
+
};
|
|
49
|
+
static baseSortDictionary: {
|
|
50
|
+
[key in BaseFilterSortKey]: FieldTranslation<[string, string]>;
|
|
51
|
+
};
|
|
52
|
+
static getBaseSignalDictionary<T extends string>(refName: T): BaseModelCrudGetSignalTranslation<T, [string, string]>;
|
|
53
|
+
static baseSliceDictionary: {
|
|
54
|
+
[key in ""]: FunctionTranslation<[string, string], "query">;
|
|
55
|
+
};
|
|
56
|
+
languages: Languages;
|
|
57
|
+
modelTranslation?: FieldTranslation<Languages>;
|
|
58
|
+
modelDictionary: {
|
|
59
|
+
[K in ModelKey]: FieldTranslation<Languages>;
|
|
60
|
+
};
|
|
61
|
+
insightDictionary: {
|
|
62
|
+
[K in InsightKey]: FieldTranslation<Languages>;
|
|
63
|
+
};
|
|
64
|
+
queryDictionary: {
|
|
65
|
+
[K in QueryKey]: FunctionTranslation<Languages>;
|
|
66
|
+
};
|
|
67
|
+
sortDictionary: {
|
|
68
|
+
[K in SortKey]: FieldTranslation<Languages>;
|
|
69
|
+
};
|
|
70
|
+
enumDictionary: {
|
|
71
|
+
[K in EnumKey]: {
|
|
72
|
+
[key: string]: FieldTranslation<Languages>;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
baseSignalDictionary: {
|
|
76
|
+
[K in BaseSignalKey]: FunctionTranslation<Languages>;
|
|
77
|
+
};
|
|
78
|
+
sliceDictionary: {
|
|
79
|
+
[K in SliceKey]: FunctionTranslation<Languages>;
|
|
80
|
+
};
|
|
81
|
+
endpointDictionary: {
|
|
82
|
+
[K in EndpointKey]: FunctionTranslation<Languages>;
|
|
83
|
+
};
|
|
84
|
+
errorDictionary: {
|
|
85
|
+
[K in ErrorKey]: Languages;
|
|
86
|
+
};
|
|
87
|
+
etcDictionary: {
|
|
88
|
+
[K in EtcKey]: Languages;
|
|
89
|
+
};
|
|
90
|
+
constructor(languages: Languages);
|
|
91
|
+
of(translate: (t: (trans: Languages) => FieldTranslation<Languages>) => FieldTranslation<Languages>): this;
|
|
92
|
+
model<Model extends object>(translate: (t: (trans: Languages) => FieldTranslation<Languages>) => {
|
|
93
|
+
[K in Exclude<keyof GetStateObject<Model>, ModelKey>]: FieldTranslation<Languages>;
|
|
94
|
+
}): ModelDictInfo<Languages, keyof GetStateObject<Model> & string, InsightKey, QueryKey, SortKey, EnumKey, BaseSignalKey, SliceKey, EndpointKey, ErrorKey, EtcKey>;
|
|
95
|
+
insight<Insight extends object>(translate: (t: (trans: Languages) => FieldTranslation<Languages>) => {
|
|
96
|
+
[K in Exclude<keyof GetStateObject<Insight>, InsightKey>]: FieldTranslation<Languages>;
|
|
97
|
+
}): ModelDictInfo<Languages, ModelKey, keyof GetStateObject<Insight> & string, QueryKey, SortKey, EnumKey, BaseSignalKey, SliceKey, EndpointKey, ErrorKey, EtcKey>;
|
|
98
|
+
query<Filter extends FilterInstance>(translate: (fn: (trans: Languages) => FunctionTranslation<Languages>) => {
|
|
99
|
+
[K in Exclude<keyof Filter["query"], QueryKey>]: Filter["query"][K] extends FilterInfo<infer ArgNames, any> ? FunctionTranslation<Languages, ArgNames[number]> : never;
|
|
100
|
+
}): ModelDictInfo<Languages, ModelKey, InsightKey, keyof Filter["query"] & string, SortKey, EnumKey, BaseSignalKey, SliceKey, EndpointKey, ErrorKey, EtcKey>;
|
|
101
|
+
sort<Filter extends FilterInstance>(translate: (t: (trans: Languages) => FieldTranslation<Languages>) => {
|
|
102
|
+
[K in Exclude<keyof Filter["sort"], SortKey>]: FieldTranslation<Languages>;
|
|
103
|
+
}): ModelDictInfo<Languages, ModelKey, InsightKey, QueryKey, keyof Filter["sort"] & string, EnumKey, BaseSignalKey, SliceKey, EndpointKey, ErrorKey, EtcKey>;
|
|
104
|
+
enum<Enum extends {
|
|
105
|
+
refName: string;
|
|
106
|
+
value: EnumValueKey;
|
|
107
|
+
}>(enumName: Enum["refName"], translate: (t: (trans: Languages) => FieldTranslation<Languages>) => {
|
|
108
|
+
[K in Enum["value"]]: FieldTranslation<Languages>;
|
|
109
|
+
}): ModelDictInfo<Languages, ModelKey, InsightKey, QueryKey, SortKey, EnumKey | Enum["refName"], BaseSignalKey, SliceKey, EndpointKey, ErrorKey, EtcKey>;
|
|
110
|
+
slice<Slice>(translate: (fn: (trans: Languages) => FunctionTranslation<Languages>) => {
|
|
111
|
+
[K in Exclude<keyof Slice, SliceKey>]: Slice[K] extends SliceInfo<any, any, any, any, any, any, any, infer ArgNames, any, any, any> ? FunctionTranslation<Languages, ArgNames[number]> : never;
|
|
112
|
+
}): ModelDictInfo<Languages, ModelKey, InsightKey, QueryKey, SortKey, EnumKey, BaseSignalKey, keyof Slice & string, EndpointKey, ErrorKey, EtcKey>;
|
|
113
|
+
endpoint<Endpoint>(translate: (fn: (trans: Languages) => FunctionTranslation<Languages>) => {
|
|
114
|
+
[K in Exclude<keyof Endpoint, EndpointKey>]: Endpoint[K] extends EndpointInfo<any, any, infer ArgNames, any, any, any, any, any, any, any> ? FunctionTranslation<Languages, ArgNames[number]> : never;
|
|
115
|
+
}): ModelDictInfo<Languages, ModelKey, InsightKey, QueryKey, SortKey, EnumKey, BaseSignalKey, SliceKey, keyof Endpoint & string, ErrorKey, EtcKey>;
|
|
116
|
+
error<ErrorDict extends {
|
|
117
|
+
[key: string]: Languages;
|
|
118
|
+
}>(errorDictionary: ErrorDict): ModelDictInfo<Languages, ModelKey, InsightKey, QueryKey, SortKey, EnumKey, BaseSignalKey, SliceKey, EndpointKey, ErrorKey | (keyof ErrorDict & string), EtcKey>;
|
|
119
|
+
translate<EtcDict extends {
|
|
120
|
+
[key: string]: Languages;
|
|
121
|
+
}>(etcDictionary: EtcDict): ModelDictInfo<Languages, ModelKey, InsightKey, QueryKey, SortKey, EnumKey, BaseSignalKey, SliceKey, EndpointKey, ErrorKey, EtcKey | (keyof EtcDict & string)>;
|
|
122
|
+
applyBaseSignal<RefName extends string>(refName: RefName): ModelDictInfo<Languages, ModelKey, InsightKey, QueryKey, SortKey, EnumKey, GetBaseSignalKey<RefName>, SliceKey, EndpointKey, ErrorKey, EtcKey>;
|
|
123
|
+
_registerToRoot(refName: string, rootDict: RootDictionary): void;
|
|
124
|
+
getEnum<Enum extends {
|
|
125
|
+
refName: string;
|
|
126
|
+
value: EnumValueKey;
|
|
127
|
+
}>(enumName: EnumKey): {
|
|
128
|
+
[K in Enum["value"]]: FieldTranslation<Languages>;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
type AnyModelDictInfo = ModelDictInfo<any, any, any, any, any, any, any, any, any, any, any>;
|
|
132
|
+
type MergeTwoModelDicts<ModelDict1, ModelDict2> = ModelDict1 extends ModelDictInfo<infer Languages1, infer ModelKey1, infer InsightKey1, infer QueryKey1, infer SortKey1, infer EnumKey1, infer BaseSignalKey1, infer SliceKey1, infer EndpointKey1, infer ErrorKey1, infer EtcKey1> ? ModelDict2 extends ModelDictInfo<any, infer ModelKey2, infer InsightKey2, infer QueryKey2, infer SortKey2, infer EnumKey2, infer BaseSignalKey2, infer SliceKey2, infer EndpointKey2, infer ErrorKey2, infer EtcKey2> ? ModelDictInfo<Languages1, ModelKey1 | ModelKey2, InsightKey1 | InsightKey2, QueryKey1 | QueryKey2, SortKey1 | SortKey2, EnumKey1 | EnumKey2, BaseSignalKey1 | BaseSignalKey2, SliceKey1 | SliceKey2, EndpointKey1 | EndpointKey2, ErrorKey1 | ErrorKey2, EtcKey1 | EtcKey2> : ModelDict1 : never;
|
|
133
|
+
type MergeModelDicts<ModelDicts extends AnyModelDictInfo[]> = ModelDicts extends [
|
|
134
|
+
infer First extends AnyModelDictInfo,
|
|
135
|
+
...infer Rest extends AnyModelDictInfo[]
|
|
136
|
+
] ? Rest extends [] ? First : MergeTwoModelDicts<First, MergeModelDicts<Rest>> : never;
|
|
137
|
+
export declare const modelDictionary: <Languages extends [string, ...string[]] = [string], ExtendModelDicts extends AnyModelDictInfo[] = []>(languages?: Languages, ...extendModelDicts: ExtendModelDicts) => MergeModelDicts<[ModelDictInfo<Languages>, ...ExtendModelDicts]>;
|
|
138
|
+
export declare class ScalarDictInfo<Languages extends [string, ...string[]] = [string], ModelKey extends string = keyof BaseObject, EnumKey extends string = never, ErrorKey extends string = never, EtcKey extends string = never> {
|
|
139
|
+
#private;
|
|
140
|
+
languages: Languages;
|
|
141
|
+
modelTranslation?: FieldTranslation<Languages>;
|
|
142
|
+
modelDictionary: {
|
|
143
|
+
[K in ModelKey]: FieldTranslation<Languages>;
|
|
144
|
+
};
|
|
145
|
+
enumDictionary: {
|
|
146
|
+
[K in EnumKey]: {
|
|
147
|
+
[key: string]: FieldTranslation<Languages>;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
errorDictionary: {
|
|
151
|
+
[K in ErrorKey]: Languages;
|
|
152
|
+
};
|
|
153
|
+
etcDictionary: {
|
|
154
|
+
[K in EtcKey]: Languages;
|
|
155
|
+
};
|
|
156
|
+
constructor(languages: Languages);
|
|
157
|
+
of(translate: (t: (trans: Languages) => FieldTranslation<Languages>) => FieldTranslation<Languages>): this;
|
|
158
|
+
model<Model>(translate: (t: (trans: Languages) => FieldTranslation<Languages>) => {
|
|
159
|
+
[K in keyof GetStateObject<Model>]: FieldTranslation<Languages>;
|
|
160
|
+
}): ScalarDictInfo<Languages, keyof GetStateObject<Model> & string, EnumKey, ErrorKey, EtcKey>;
|
|
161
|
+
enum<Enum extends {
|
|
162
|
+
refName: string;
|
|
163
|
+
value: EnumValueKey;
|
|
164
|
+
}>(enumName: Enum["refName"], translate: (t: (trans: Languages) => FieldTranslation<Languages>) => {
|
|
165
|
+
[K in Enum["value"]]: FieldTranslation<Languages>;
|
|
166
|
+
}): ScalarDictInfo<Languages, ModelKey, EnumKey | Enum["refName"], ErrorKey, EtcKey>;
|
|
167
|
+
error<ErrorDict extends {
|
|
168
|
+
[key: string]: Languages;
|
|
169
|
+
}>(errorDictionary: ErrorDict): ScalarDictInfo<Languages, ModelKey, EnumKey, keyof ErrorDict & string, EtcKey>;
|
|
170
|
+
translate<EtcDict extends {
|
|
171
|
+
[key: string]: Languages;
|
|
172
|
+
}>(etcDictionary: EtcDict): ScalarDictInfo<Languages, ModelKey, EnumKey, ErrorKey, keyof EtcDict & string>;
|
|
173
|
+
_registerToRoot(refName: string, rootDict: RootDictionary): void;
|
|
174
|
+
}
|
|
175
|
+
export declare const scalarDictionary: <Languages extends [string, ...string[]] = [string]>(languages?: Languages) => ScalarDictInfo<Languages, keyof BaseObject, never, never, never>;
|
|
176
|
+
export declare class ServiceDictInfo<Languages extends [string, ...string[]] = [string], EndpointKey extends string = never, ErrorKey extends string = never, EtcKey extends string = never> {
|
|
177
|
+
#private;
|
|
178
|
+
languages: Languages;
|
|
179
|
+
endpointDictionary: {
|
|
180
|
+
[K in EndpointKey]: FunctionTranslation<Languages>;
|
|
181
|
+
};
|
|
182
|
+
errorDictionary: {
|
|
183
|
+
[K in ErrorKey]: Languages;
|
|
184
|
+
};
|
|
185
|
+
etcDictionary: {
|
|
186
|
+
[K in EtcKey]: Languages;
|
|
187
|
+
};
|
|
188
|
+
constructor(languages: Languages);
|
|
189
|
+
endpoint<Endpoint extends {
|
|
190
|
+
[key: string]: EndpointInfo;
|
|
191
|
+
}>(translate: (fn: (trans: Languages) => FunctionTranslation<Languages>) => {
|
|
192
|
+
[K in keyof Endpoint]: FunctionTranslation<Languages, Endpoint[K]["argNames"][number]>;
|
|
193
|
+
}): ServiceDictInfo<Languages, keyof Endpoint & string, ErrorKey, EtcKey>;
|
|
194
|
+
error<ErrorDict extends {
|
|
195
|
+
[key: string]: Languages;
|
|
196
|
+
}>(errorDictionary: ErrorDict): ServiceDictInfo<Languages, EndpointKey, keyof ErrorDict & string, EtcKey>;
|
|
197
|
+
translate<EtcDict extends {
|
|
198
|
+
[key: string]: Languages;
|
|
199
|
+
}>(etcDictionary: EtcDict): ServiceDictInfo<Languages, EndpointKey, ErrorKey, keyof EtcDict & string>;
|
|
200
|
+
_toTranslation(): {
|
|
201
|
+
[key: string]: string[];
|
|
202
|
+
};
|
|
203
|
+
_registerToRoot(refName: string, rootDict: RootDictionary): void;
|
|
204
|
+
}
|
|
205
|
+
export declare const serviceDictionary: <Languages extends [string, ...string[]] = [string]>(languages?: Languages) => ServiceDictInfo<Languages, never, never, never>;
|
|
206
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BaseEndpoint } from "akanjs/signal";
|
|
2
|
+
export declare const dictionary: {
|
|
3
|
+
base: import("./locale.d.ts").DictModule<import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "ok" | "connecting" | "failed" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, never>;
|
|
4
|
+
};
|
|
5
|
+
export declare const Err: import("./trans.d.ts").ErrConstructor<never>, translate: (lang: "en" | "ko" | "zhChs" | "zhCht" | "ja", key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "ok" | "connecting" | "failed" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, data?: import("./trans.d.ts").TranslationData) => string, msg: {
|
|
6
|
+
info: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "ok" | "connecting" | "failed" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, option?: import("./trans.d.ts").TransMessageOption) => void;
|
|
7
|
+
success: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "ok" | "connecting" | "failed" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, option?: import("./trans.d.ts").TransMessageOption) => void;
|
|
8
|
+
error: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "ok" | "connecting" | "failed" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, option?: import("./trans.d.ts").TransMessageOption) => void;
|
|
9
|
+
warning: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "ok" | "connecting" | "failed" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, option?: import("./trans.d.ts").TransMessageOption) => void;
|
|
10
|
+
loading: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "ok" | "connecting" | "failed" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, option?: import("./trans.d.ts").TransMessageOption) => void;
|
|
11
|
+
}, getDictionary: (lang: "en" | "ko" | "zhChs" | "zhCht" | "ja") => object, getAllDictionary: () => import("./trans.d.ts").RootDictionary, __Dict_Key__: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "save" | "password" | "remove" | "ok" | "connecting" | "failed" | "success" | "edit" | "view" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "actions" | "new">, __Error_Key__: never;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { GetStateObject, MergedValues } from "akanjs/base";
|
|
2
|
+
import type { BaseInsight, BaseObject } from "akanjs/constant";
|
|
3
|
+
import type { FilterInfo, FilterInstance } from "akanjs/document";
|
|
4
|
+
import type { EndpointInfo, SliceInfo } from "akanjs/signal";
|
|
5
|
+
import type { ModelDictInfo, ScalarDictInfo, ServiceDictInfo } from ".";
|
|
6
|
+
interface Trans {
|
|
7
|
+
t: string;
|
|
8
|
+
}
|
|
9
|
+
interface FieldTrans {
|
|
10
|
+
t: string;
|
|
11
|
+
desc?: string;
|
|
12
|
+
}
|
|
13
|
+
interface FnTrans<ArgKey extends string> {
|
|
14
|
+
t: string;
|
|
15
|
+
desc?: string;
|
|
16
|
+
arg?: {
|
|
17
|
+
[key in ArgKey]: FieldTrans;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
type FilterTranslatorKey<Filter extends FilterInstance> = {
|
|
21
|
+
[Key in keyof Filter["query"] & string]: `${Key}` | `${Key}.desc` | (Filter["query"][Key] extends FilterInfo<infer ArgNames, any> ? ArgNames[number] extends string ? `${Key}.arg.${ArgNames[number]}` | `${Key}.arg.${ArgNames[number]}.desc` : never : never);
|
|
22
|
+
}[keyof Filter["query"] & string];
|
|
23
|
+
type EndpointTranslatorKey<Endpoint extends {
|
|
24
|
+
[key: string]: EndpointInfo;
|
|
25
|
+
}> = {
|
|
26
|
+
[Key in keyof Endpoint & string]: `${Key}` | `${Key}.desc` | `${Key}.arg.${Endpoint[Key]["argNames"][number]}` | `${Key}.arg.${Endpoint[Key]["argNames"][number]}.desc`;
|
|
27
|
+
}[keyof Endpoint & string];
|
|
28
|
+
type SliceTranslatorKey<Slice> = {
|
|
29
|
+
[Key in keyof Slice & string]: Slice[Key] extends SliceInfo<infer T, any, any, any, any, any, any, infer ArgNames, any, any, any> ? `${T}List${Capitalize<Key>}` | `${T}List${Capitalize<Key>}.desc` | `${T}List${Capitalize<Key>}.arg.${ArgNames[number] | "skip" | "limit" | "sort"}` | `${T}List${Capitalize<Key>}.arg.${ArgNames[number] | "skip" | "limit" | "sort"}.desc` | `${T}Insight${Capitalize<Key>}` | `${T}Insight${Capitalize<Key>}.desc` | `${T}Insight${Capitalize<Key>}.arg.${ArgNames[number]}` | `${T}Insight${Capitalize<Key>}.arg.${ArgNames[number]}.desc` : never;
|
|
30
|
+
}[keyof Slice & string];
|
|
31
|
+
type SliceApiTrans<T extends string, Suffix extends string, ArgName extends string, _CapitalizedSuffix extends string = Capitalize<Suffix>> = {
|
|
32
|
+
[K in `${T}List${_CapitalizedSuffix}`]: FnTrans<ArgName | "skip" | "limit" | "sort">;
|
|
33
|
+
} & {
|
|
34
|
+
[K in `${T}Insight${_CapitalizedSuffix}`]: FnTrans<ArgName>;
|
|
35
|
+
};
|
|
36
|
+
type BaseModelCrudGetApiTrans<T extends string> = {
|
|
37
|
+
[K in T]: FnTrans<`${T}Id`>;
|
|
38
|
+
} & {
|
|
39
|
+
[K in `light${T}`]: FnTrans<`${T}Id`>;
|
|
40
|
+
} & {
|
|
41
|
+
[K in `create${T}`]: FnTrans<"data">;
|
|
42
|
+
} & {
|
|
43
|
+
[K in `update${T}`]: FnTrans<`${T}Id` | "data">;
|
|
44
|
+
} & {
|
|
45
|
+
[K in `remove${T}`]: FnTrans<`${T}Id`>;
|
|
46
|
+
};
|
|
47
|
+
export type ModelTrans<T extends string, Model extends BaseObject, Insight extends BaseInsight, Filter extends FilterInstance, Slice extends {
|
|
48
|
+
[key: string]: SliceInfo;
|
|
49
|
+
}, Endpoint extends {
|
|
50
|
+
[key: string]: EndpointInfo;
|
|
51
|
+
}, ErrorKey extends string, EtcKey extends string> = {
|
|
52
|
+
modelName: Trans;
|
|
53
|
+
modelDesc: Trans;
|
|
54
|
+
model: {
|
|
55
|
+
[K in keyof GetStateObject<Model>]: FieldTrans;
|
|
56
|
+
};
|
|
57
|
+
insight: {
|
|
58
|
+
[K in keyof GetStateObject<Insight>]: FieldTrans;
|
|
59
|
+
};
|
|
60
|
+
query: {
|
|
61
|
+
[K in keyof Filter["query"]]: Filter["query"][K] extends FilterInfo<infer ArgNames, any> ? FnTrans<ArgNames[number]> : never;
|
|
62
|
+
};
|
|
63
|
+
sort: {
|
|
64
|
+
[K in keyof Filter["sort"]]: FieldTrans;
|
|
65
|
+
};
|
|
66
|
+
api: {
|
|
67
|
+
[K in keyof Endpoint]: FnTrans<Endpoint[K]["argNames"][number]>;
|
|
68
|
+
} & BaseModelCrudGetApiTrans<T> & MergedValues<{
|
|
69
|
+
[K in keyof Slice]: SliceApiTrans<Slice[K]["refName"], K & string, Slice[K]["argNames"][number]>;
|
|
70
|
+
}>;
|
|
71
|
+
error: {
|
|
72
|
+
[K in ErrorKey]: Trans;
|
|
73
|
+
};
|
|
74
|
+
} & {
|
|
75
|
+
[K in EtcKey]: Trans;
|
|
76
|
+
};
|
|
77
|
+
export type ModelTranslatorKey<T extends string, Model, Insight, Filter extends FilterInstance, Slice extends {
|
|
78
|
+
[key: string]: SliceInfo;
|
|
79
|
+
}, Endpoint extends {
|
|
80
|
+
[key: string]: EndpointInfo;
|
|
81
|
+
}, EtcKey extends string> = `${T}.modelName` | `${T}.modelDesc` | `${T}.${keyof GetStateObject<Model> & string}${"" | ".desc"}` | `${T}.insight.${keyof GetStateObject<Insight> & string}${"" | ".desc"}` | `${T}.query.${FilterTranslatorKey<Filter>}` | `${T}.sort.${keyof Filter["sort"] & string}${"" | ".desc"}` | `${T}.signal.${EndpointTranslatorKey<Endpoint> | SliceTranslatorKey<Slice>}` | `${T}.${EtcKey}`;
|
|
82
|
+
export type ScalarTrans<T extends string, Model, ErrorKey extends string, EtcKey extends string> = {
|
|
83
|
+
name: Trans;
|
|
84
|
+
desc: Trans;
|
|
85
|
+
model: {
|
|
86
|
+
[K in keyof GetStateObject<Model>]: FieldTrans;
|
|
87
|
+
};
|
|
88
|
+
error: {
|
|
89
|
+
[K in ErrorKey]: Trans;
|
|
90
|
+
};
|
|
91
|
+
} & {
|
|
92
|
+
[K in EtcKey]: Trans;
|
|
93
|
+
};
|
|
94
|
+
export type ScalarTranslatorKey<T extends string, Model, EtcKey extends string> = `${T}.modelName` | `${T}.modelDesc` | `${T}.${keyof GetStateObject<Model> & string}${"" | ".desc"}` | `${T}.${EtcKey}`;
|
|
95
|
+
export type ServiceTrans<T extends string, Endpoint extends {
|
|
96
|
+
[key: string]: EndpointInfo;
|
|
97
|
+
}, ErrorKey extends string, EtcKey extends string> = {
|
|
98
|
+
api: {
|
|
99
|
+
[K in keyof Endpoint]: FnTrans<Endpoint[K]["argNames"][number]>;
|
|
100
|
+
};
|
|
101
|
+
error: {
|
|
102
|
+
[K in ErrorKey]: Trans;
|
|
103
|
+
};
|
|
104
|
+
} & {
|
|
105
|
+
[K in EtcKey]: Trans;
|
|
106
|
+
};
|
|
107
|
+
export type ServiceTranslatorKey<T extends string, Endpoint extends {
|
|
108
|
+
[key: string]: EndpointInfo;
|
|
109
|
+
}, EtcKey extends string> = `${T}.signal.${EndpointTranslatorKey<Endpoint>}` | `${T}.${EtcKey}`;
|
|
110
|
+
export type EnumTrans<EnumValue extends string | number> = {
|
|
111
|
+
[key in EnumValue]: Trans;
|
|
112
|
+
};
|
|
113
|
+
export type EnumTranslatorKey<EnumKey extends string> = `${EnumKey}.${string}${"" | ".desc"}`;
|
|
114
|
+
export interface DictModule<DictKey extends string, ErrorKey extends string> {
|
|
115
|
+
__Dict_Key__: DictKey;
|
|
116
|
+
__Error_Key__: ErrorKey;
|
|
117
|
+
dict: ModelDictInfo<any> | ScalarDictInfo<any> | ServiceDictInfo<any>;
|
|
118
|
+
}
|
|
119
|
+
export declare const registerModelTrans: <RefName extends string, Model extends BaseObject, Insight extends BaseInsight, Filter extends FilterInstance, Slice extends {
|
|
120
|
+
[key: string]: SliceInfo;
|
|
121
|
+
}, Endpoint extends {
|
|
122
|
+
[key: string]: EndpointInfo;
|
|
123
|
+
}, ModelDict extends ModelDictInfo<any>>(modelDict: ModelDict) => ModelDict extends ModelDictInfo<any, any, any, any, any, infer EnumKey, any, any, any, infer ErrorKey, infer EtcKey> ? DictModule<ModelTranslatorKey<RefName, Model, Insight, Filter, Slice, Endpoint, EtcKey> | EnumTranslatorKey<EnumKey>, `${RefName}.error.${ErrorKey}`> : never;
|
|
124
|
+
export declare const registerScalarTrans: <T extends string, Model, ScalarDict>(scalarDict: ScalarDict) => ScalarDict extends ScalarDictInfo<any, any, infer EnumKey, infer ErrorKey, infer EtcKey> ? DictModule<ScalarTranslatorKey<T, Model, EtcKey> | EnumTranslatorKey<EnumKey>, `${T}.error.${ErrorKey}`> : never;
|
|
125
|
+
export declare const registerServiceTrans: <T extends string, Endpoint extends {
|
|
126
|
+
[key: string]: EndpointInfo;
|
|
127
|
+
}, ServiceDict>(serviceDict: ServiceDict) => ServiceDict extends ServiceDictInfo<any, any, infer ErrorKey, infer EtcKey> ? DictModule<ServiceTranslatorKey<T, Endpoint, EtcKey>, `${T}.error.${ErrorKey}`> : never;
|
|
128
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { GetStateObject, ObjectAssign, Prettify } from "akanjs/base";
|
|
2
|
+
import type { DictModule } from "./locale.d.ts";
|
|
3
|
+
type TranslationSingle = readonly [string, string] | readonly [string, string, string, string];
|
|
4
|
+
type TranslationWithParam = readonly [string, string, {
|
|
5
|
+
[key: string]: string | number;
|
|
6
|
+
}];
|
|
7
|
+
export type Translation = TranslationSingle | TranslationWithParam;
|
|
8
|
+
export type TranslationData = Record<string, unknown>;
|
|
9
|
+
export type DictionaryNode = Record<string, unknown>;
|
|
10
|
+
export type RootDictionary = Record<string, Record<string, DictionaryNode>>;
|
|
11
|
+
export type Translate<Checker> = {
|
|
12
|
+
[K in keyof GetStateObject<Checker>]: Translation;
|
|
13
|
+
} & Record<string, Translation> & {
|
|
14
|
+
modelName: Translation;
|
|
15
|
+
};
|
|
16
|
+
export type TransMessage<Locale extends Record<string, unknown>> = {
|
|
17
|
+
[K in keyof Locale]-?: `${K & string}${Locale[K] extends Record<string, unknown> ? `.${keyof Locale[K] extends string ? keyof Locale[K] : never}` : ""}`;
|
|
18
|
+
}[keyof Locale];
|
|
19
|
+
export declare const makeDictionary: <Dicts extends Record<string, unknown>[]>(...dicts: Dicts) => Prettify<ObjectAssign<Dicts>>;
|
|
20
|
+
declare const languages: readonly ["en", "ko", "zhChs", "zhCht", "ja"];
|
|
21
|
+
type Language = (typeof languages)[number];
|
|
22
|
+
export interface TransMessageOption {
|
|
23
|
+
key?: string;
|
|
24
|
+
duration?: number;
|
|
25
|
+
data?: TranslationData;
|
|
26
|
+
}
|
|
27
|
+
export interface ErrRestoreOption {
|
|
28
|
+
statusCode?: number;
|
|
29
|
+
details?: unknown;
|
|
30
|
+
path?: string;
|
|
31
|
+
timestamp?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ErrPayload extends ErrRestoreOption {
|
|
34
|
+
error: string;
|
|
35
|
+
data?: TranslationData;
|
|
36
|
+
}
|
|
37
|
+
export type ErrInstance = Error & {
|
|
38
|
+
readonly error: string;
|
|
39
|
+
readonly statusCode: number;
|
|
40
|
+
readonly details?: unknown;
|
|
41
|
+
readonly data?: TranslationData;
|
|
42
|
+
readonly path?: string;
|
|
43
|
+
readonly timestamp?: string;
|
|
44
|
+
toJSON(): ErrPayload & {
|
|
45
|
+
statusCode: number;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export type ErrConstructor<ErrorKey extends string> = {
|
|
49
|
+
new (key: ErrorKey, data?: TranslationData, option?: ErrRestoreOption): ErrInstance;
|
|
50
|
+
prototype: ErrInstance;
|
|
51
|
+
fromJSON(payload: ErrPayload): ErrInstance;
|
|
52
|
+
BadRequest: new (key: ErrorKey, data?: TranslationData, option?: ErrRestoreOption) => ErrInstance;
|
|
53
|
+
Unauthorized: new (key: ErrorKey, data?: TranslationData, option?: ErrRestoreOption) => ErrInstance;
|
|
54
|
+
Forbidden: new (key: ErrorKey, data?: TranslationData, option?: ErrRestoreOption) => ErrInstance;
|
|
55
|
+
NotFound: new (key: ErrorKey, data?: TranslationData, option?: ErrRestoreOption) => ErrInstance;
|
|
56
|
+
Conflict: new (key: ErrorKey, data?: TranslationData, option?: ErrRestoreOption) => ErrInstance;
|
|
57
|
+
};
|
|
58
|
+
export declare const msg: {
|
|
59
|
+
info: (key: TransMessage<Record<string, unknown>>, option?: TransMessageOption) => void;
|
|
60
|
+
success: (key: TransMessage<Record<string, unknown>>, option?: TransMessageOption) => void;
|
|
61
|
+
error: (key: TransMessage<Record<string, unknown>>, option?: TransMessageOption) => void;
|
|
62
|
+
warning: (key: TransMessage<Record<string, unknown>>, option?: TransMessageOption) => void;
|
|
63
|
+
loading: (key: TransMessage<Record<string, unknown>>, option?: TransMessageOption) => void;
|
|
64
|
+
};
|
|
65
|
+
export declare const makeTrans: <GlobalTransMap extends Record<string, DictModule<string, string>>, _DictKey extends string = GlobalTransMap[keyof GlobalTransMap]["__Dict_Key__"], _ErrorKey extends string = GlobalTransMap[keyof GlobalTransMap]["__Error_Key__"]>(transMap: GlobalTransMap, { build }?: {
|
|
66
|
+
build?: boolean;
|
|
67
|
+
}) => {
|
|
68
|
+
Err: ErrConstructor<_ErrorKey>;
|
|
69
|
+
translate: (lang: Language, key: _DictKey, data?: TranslationData) => string;
|
|
70
|
+
msg: {
|
|
71
|
+
info: (key: _DictKey, option?: TransMessageOption) => void;
|
|
72
|
+
success: (key: _DictKey, option?: TransMessageOption) => void;
|
|
73
|
+
error: (key: _DictKey, option?: TransMessageOption) => void;
|
|
74
|
+
warning: (key: _DictKey, option?: TransMessageOption) => void;
|
|
75
|
+
loading: (key: _DictKey, option?: TransMessageOption) => void;
|
|
76
|
+
};
|
|
77
|
+
getDictionary: (lang: Language) => object;
|
|
78
|
+
getAllDictionary: () => RootDictionary;
|
|
79
|
+
__Dict_Key__: _DictKey;
|
|
80
|
+
__Error_Key__: _ErrorKey;
|
|
81
|
+
};
|
|
82
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dictionary/index.d.ts";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Cls, FIELD_META, type MergeAllActionTypes, type UnCls } from "akanjs/base";
|
|
2
|
+
import { type BaseObject, type DocumentModel, type FieldObject } from "akanjs/constant";
|
|
3
|
+
export type DatabaseCls<Schema = any> = Cls<Schema, {
|
|
4
|
+
refName: string;
|
|
5
|
+
[FIELD_META]: FieldObject;
|
|
6
|
+
}>;
|
|
7
|
+
export interface DefaultDocMtds<TDocument> {
|
|
8
|
+
refresh(): Promise<this>;
|
|
9
|
+
isModified(field?: keyof TDocument & string): boolean;
|
|
10
|
+
set(data: Partial<TDocument>): this;
|
|
11
|
+
save(): Promise<this>;
|
|
12
|
+
toJSON(): DocumentModel<TDocument>;
|
|
13
|
+
toObject(): DocumentModel<TDocument>;
|
|
14
|
+
}
|
|
15
|
+
type HydratedDocumentWithId<TDocument> = TDocument & {
|
|
16
|
+
id: string;
|
|
17
|
+
} & DefaultDocMtds<TDocument>;
|
|
18
|
+
export type Doc<M = any> = HydratedDocumentWithId<DocumentModel<M>>;
|
|
19
|
+
export declare const by: <ModelCls, AddDbModels extends DatabaseCls[], _DocModel = UnCls<ModelCls> extends BaseObject ? Doc<UnCls<ModelCls>> : DocumentModel<UnCls<ModelCls>>>(modelRef: ModelCls, ...addRefs: AddDbModels) => DatabaseCls<MergeAllActionTypes<AddDbModels, keyof _DocModel & string> & _DocModel>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { QueryOf } from "akanjs/constant";
|
|
2
|
+
export declare const Id: StringConstructor;
|
|
3
|
+
export declare const ObjectId: StringConstructor;
|
|
4
|
+
export declare const Mixed: ObjectConstructor;
|
|
5
|
+
type LoaderItem = Record<string, unknown>;
|
|
6
|
+
type LoaderModel = {
|
|
7
|
+
find: (query: QueryOf<unknown>) => Promise<LoaderItem[]> | {
|
|
8
|
+
then: Promise<LoaderItem[]>["then"];
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
type BatchLoadFn<Key, Value> = (keys: readonly Key[]) => PromiseLike<ReadonlyArray<Value | Error>> | ReadonlyArray<Value | Error>;
|
|
12
|
+
interface DataLoaderOptions<Key, CacheKey> {
|
|
13
|
+
cache?: boolean;
|
|
14
|
+
cacheKeyFn?: (key: Key) => CacheKey;
|
|
15
|
+
batch?: boolean;
|
|
16
|
+
batchScheduleFn?: (callback: () => void) => void;
|
|
17
|
+
maxBatchSize?: number;
|
|
18
|
+
name?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Minimal DataLoader-compatible batch loader used by Akan document resolvers. */
|
|
21
|
+
export declare class DataLoader<Key, Value, CacheKey = Key> {
|
|
22
|
+
#private;
|
|
23
|
+
readonly name?: string;
|
|
24
|
+
constructor(batchLoadFn: BatchLoadFn<Key, Value>, options?: DataLoaderOptions<Key, CacheKey>);
|
|
25
|
+
load(key: Key): Promise<Value>;
|
|
26
|
+
loadMany(keys: readonly Key[]): Promise<Array<Value | Error>>;
|
|
27
|
+
clear(key: Key): this;
|
|
28
|
+
clearAll(): this;
|
|
29
|
+
prime(key: Key, value: Value | Error): this;
|
|
30
|
+
}
|
|
31
|
+
export declare const createLoader: <Key, Value>(model: LoaderModel, fieldName?: string, defaultQuery?: QueryOf<unknown>) => DataLoader<Key, Value, Key>;
|
|
32
|
+
export declare const createArrayLoader: <K, V>(model: LoaderModel, fieldName?: string, defaultQuery?: QueryOf<unknown>) => DataLoader<K, V, K>;
|
|
33
|
+
export declare const createArrayElementLoader: <K, V>(model: LoaderModel, fieldName?: string, defaultQuery?: QueryOf<unknown>) => DataLoader<K, V, K>;
|
|
34
|
+
export declare const createQueryLoader: <Key, Value>(model: LoaderModel, queryKeys: string[], defaultQuery?: QueryOf<unknown>) => DataLoader<Key, Value, Key>;
|
|
35
|
+
export type Loader<Field, Value> = DataLoader<Field, Value | null>;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { Dayjs, MergedValues, PromiseOrObject } from "akanjs/base";
|
|
2
|
+
import { Logger } from "akanjs/common";
|
|
3
|
+
import type { DocumentModel, QueryOf } from "akanjs/constant";
|
|
4
|
+
import type { CacheAdaptor } from "akanjs/service";
|
|
5
|
+
import type { DataLoader } from "./dataLoader.d.ts";
|
|
6
|
+
import type { ExtractQuery, ExtractSort, FilterInstance } from "./filterMeta.d.ts";
|
|
7
|
+
import type { CRUDEventType, Mdl, SaveEventType } from "./into.d.ts";
|
|
8
|
+
import type { DataInputOf, FindQueryOption, ListQueryOption } from "./types.d.ts";
|
|
9
|
+
export interface RedisSetOptions {
|
|
10
|
+
expireAt?: Dayjs;
|
|
11
|
+
}
|
|
12
|
+
export declare class CacheDatabase<T = unknown> {
|
|
13
|
+
private readonly refName;
|
|
14
|
+
private readonly cache;
|
|
15
|
+
private logger;
|
|
16
|
+
constructor(refName: string, cache: CacheAdaptor);
|
|
17
|
+
set(topic: string, key: string, value: string | number | Buffer, option?: RedisSetOptions): Promise<void>;
|
|
18
|
+
get<T extends string | number | Buffer>(topic: string, key: string): Promise<T | undefined>;
|
|
19
|
+
delete(topic: string, key: string): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
type QueryMethodOfKey<CapitalizedK extends string, Doc, Insight, _Args extends any[], _ListArgs extends any[], _FindArgs extends any[], _QueryOfDoc = QueryOf<Doc>> = {
|
|
22
|
+
[K in `list${CapitalizedK}`]: (...args: _ListArgs) => Promise<Doc[]>;
|
|
23
|
+
} & {
|
|
24
|
+
[K in `listIds${CapitalizedK}`]: (...args: _ListArgs) => Promise<string[]>;
|
|
25
|
+
} & {
|
|
26
|
+
[K in `find${CapitalizedK}`]: (...args: _FindArgs) => Promise<Doc | null>;
|
|
27
|
+
} & {
|
|
28
|
+
[K in `findId${CapitalizedK}`]: (...args: _FindArgs) => Promise<string | null>;
|
|
29
|
+
} & {
|
|
30
|
+
[K in `pick${CapitalizedK}`]: (...args: _FindArgs) => Promise<Doc>;
|
|
31
|
+
} & {
|
|
32
|
+
[K in `pickId${CapitalizedK}`]: (...args: _FindArgs) => Promise<string>;
|
|
33
|
+
} & {
|
|
34
|
+
[K in `exists${CapitalizedK}`]: (...args: _Args) => Promise<string | null>;
|
|
35
|
+
} & {
|
|
36
|
+
[K in `count${CapitalizedK}`]: (...args: _Args) => Promise<number>;
|
|
37
|
+
} & {
|
|
38
|
+
[K in `insight${CapitalizedK}`]: (...args: _Args) => Promise<Insight>;
|
|
39
|
+
} & {
|
|
40
|
+
[K in `query${CapitalizedK}`]: (...args: _Args) => _QueryOfDoc;
|
|
41
|
+
};
|
|
42
|
+
export type QueryMethodPart<Query, Sort, Obj, Doc, Insight, _FindQueryOption = FindQueryOption<Sort, Obj>, _ListQueryOption = ListQueryOption<Sort, Obj>, _QueryOfDoc = QueryOf<Doc>> = MergedValues<{
|
|
43
|
+
[K in keyof Query]: K extends string ? Query[K] extends (...args: infer Args) => any ? QueryMethodOfKey<Capitalize<K>, Doc, Insight, Args, [
|
|
44
|
+
...Args,
|
|
45
|
+
queryOption?: _ListQueryOption
|
|
46
|
+
], [
|
|
47
|
+
...Args,
|
|
48
|
+
queryOption?: _FindQueryOption
|
|
49
|
+
]> : never : never;
|
|
50
|
+
}>;
|
|
51
|
+
type DatabaseModelWithQuerySort<T extends string, Input, Doc, Obj, Insight, Query, Sort, _CapitalizedRefName extends string = Capitalize<T>, _QueryOfDoc = QueryOf<Doc>, _DataInput = DataInputOf<Input, DocumentModel<Obj>>, _FindQueryOption = FindQueryOption<Sort, Obj>, _ListQueryOption = ListQueryOption<Sort, Obj>> = {
|
|
52
|
+
logger: Logger;
|
|
53
|
+
__model: Mdl<Doc, Obj>;
|
|
54
|
+
__cache: CacheDatabase<T>;
|
|
55
|
+
__loader: DataLoader<string, Doc, string>;
|
|
56
|
+
__get: (id: string) => Promise<Doc>;
|
|
57
|
+
__load: (id?: string) => Promise<Doc | null>;
|
|
58
|
+
__loadMany: (ids: string[]) => Promise<Doc[]>;
|
|
59
|
+
__create: (data: _DataInput) => Promise<Doc>;
|
|
60
|
+
__update: (id: string, data: Partial<Doc>) => Promise<Doc>;
|
|
61
|
+
__remove: (id: string) => Promise<Doc>;
|
|
62
|
+
__list(query: _QueryOfDoc, queryOption?: _ListQueryOption): Promise<Doc[]>;
|
|
63
|
+
__listIds(query: _QueryOfDoc, queryOption?: _ListQueryOption): Promise<string[]>;
|
|
64
|
+
__find(query: _QueryOfDoc, queryOption?: _FindQueryOption): Promise<Doc | null>;
|
|
65
|
+
__findId(query: _QueryOfDoc, queryOption?: _FindQueryOption): Promise<string | null>;
|
|
66
|
+
__pick(query: _QueryOfDoc, queryOption?: _FindQueryOption): Promise<Doc>;
|
|
67
|
+
__pickId(query: _QueryOfDoc, queryOption?: _FindQueryOption): Promise<string>;
|
|
68
|
+
__exists(query: _QueryOfDoc): Promise<string | null>;
|
|
69
|
+
__count(query: _QueryOfDoc): Promise<number>;
|
|
70
|
+
__insight(query: _QueryOfDoc): Promise<Insight>;
|
|
71
|
+
clone(data: _DataInput & {
|
|
72
|
+
id: string;
|
|
73
|
+
}): Promise<Doc>;
|
|
74
|
+
listenPre: (type: SaveEventType, listener: (doc: Doc, type: CRUDEventType) => PromiseOrObject<void>) => () => void;
|
|
75
|
+
listenPost: (type: SaveEventType, listener: (doc: Doc, type: CRUDEventType) => PromiseOrObject<void>) => () => void;
|
|
76
|
+
} & {
|
|
77
|
+
[key in _CapitalizedRefName]: Mdl<Doc, Obj>;
|
|
78
|
+
} & {
|
|
79
|
+
[key in `${T}Loader`]: DataLoader<string, Doc, string>;
|
|
80
|
+
} & {
|
|
81
|
+
[key in `${T}Cache`]: CacheDatabase<T>;
|
|
82
|
+
} & {
|
|
83
|
+
[K in `get${_CapitalizedRefName}`]: (id: string) => Promise<Doc>;
|
|
84
|
+
} & {
|
|
85
|
+
[K in `load${_CapitalizedRefName}`]: (id?: string) => Promise<Doc | null>;
|
|
86
|
+
} & {
|
|
87
|
+
[K in `load${_CapitalizedRefName}Many`]: (ids: string[]) => Promise<Doc[]>;
|
|
88
|
+
} & {
|
|
89
|
+
[K in `create${_CapitalizedRefName}`]: (data: _DataInput) => Promise<Doc>;
|
|
90
|
+
} & {
|
|
91
|
+
[K in `update${_CapitalizedRefName}`]: (id: string, data: _DataInput) => Promise<Doc>;
|
|
92
|
+
} & {
|
|
93
|
+
[K in `remove${_CapitalizedRefName}`]: (id: string) => Promise<Doc>;
|
|
94
|
+
} & QueryMethodPart<Query, Sort, Obj, Doc, Insight, _FindQueryOption, _ListQueryOption, _QueryOfDoc>;
|
|
95
|
+
export type DatabaseInstance<T extends string = string, Input = any, Doc = any, Obj = any, Insight = any, Filter extends FilterInstance = FilterInstance, _CapitalizedRefName extends string = Capitalize<T>, _QueryOfDoc = QueryOf<Doc>, _Query = ExtractQuery<Filter>, _Sort = ExtractSort<Filter>, _DataInput = DataInputOf<Input, DocumentModel<Obj>>, _FindQueryOption = FindQueryOption<_Sort, Obj>, _ListQueryOption = ListQueryOption<_Sort, Obj>> = DatabaseModelWithQuerySort<T, Input, Doc, Obj, Insight, _Query, _Sort, _CapitalizedRefName, _QueryOfDoc, _DataInput, _FindQueryOption, _ListQueryOption>;
|
|
96
|
+
export {};
|