@done-coding/admin-core 0.18.0 → 0.19.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/README.md +77 -1
- package/es/_virtual/_plugin-vue_export-helper.mjs +7 -6
- package/es/bridge/config-hook.mjs +49 -37
- package/es/bridge/index.mjs +152 -109
- package/es/bridge/layout.mjs +45 -31
- package/es/bridge/plugin.mjs +22 -12
- package/es/bridge/route.mjs +59 -50
- package/es/bridge/state.mjs +54 -39
- package/es/bridge/storage.mjs +18 -8
- package/es/bridge/theme/index.mjs +200 -97
- package/es/bridge/theme/persist.mjs +11 -7
- package/es/bridge/theme/system-dark.mjs +13 -6
- package/es/components/app-layout/AppAside.vue.mjs +4 -4
- package/es/components/app-layout/AppAside.vue2.mjs +37 -30
- package/es/components/app-layout/AppBody.vue.mjs +4 -4
- package/es/components/app-layout/AppBody.vue2.mjs +97 -60
- package/es/components/app-layout/AppBreadcrumb.vue.mjs +4 -4
- package/es/components/app-layout/AppBreadcrumb.vue2.mjs +59 -38
- package/es/components/app-layout/AppCollapseToggle.vue.mjs +4 -4
- package/es/components/app-layout/AppCollapseToggle.vue2.mjs +51 -42
- package/es/components/app-layout/AppFooter.vue.mjs +4 -4
- package/es/components/app-layout/AppFooter.vue2.mjs +15 -12
- package/es/components/app-layout/AppHeader.vue.mjs +4 -4
- package/es/components/app-layout/AppHeader.vue2.mjs +81 -58
- package/es/components/app-layout/AppLayout.vue.mjs +4 -4
- package/es/components/app-layout/AppLayout.vue2.mjs +148 -112
- package/es/components/app-layout/AppPage.vue.mjs +4 -4
- package/es/components/app-layout/AppPage.vue2.mjs +254 -197
- package/es/components/app-layout/AppShell.vue.mjs +44 -42
- package/es/components/app-layout/AppShell.vue2.mjs +2 -2
- package/es/components/app-layout/AppSidebar.vue.mjs +4 -4
- package/es/components/app-layout/AppSidebar.vue2.mjs +76 -59
- package/es/components/app-layout/AppTheme.vue.mjs +4 -4
- package/es/components/app-layout/AppTheme.vue2.mjs +69 -57
- package/es/components/app-layout/app-page-geometry.mjs +44 -42
- package/es/components/app-layout/keep-alive.mjs +27 -19
- package/es/components/app-layout/viewport.mjs +4 -3
- package/es/components/data-view/DataListView.vue.mjs +4 -4
- package/es/components/data-view/DataListView.vue2.mjs +133 -93
- package/es/components/data-view/DataListViewItem.vue.mjs +4 -4
- package/es/components/data-view/DataListViewItem.vue2.mjs +11 -9
- package/es/components/data-view/utils.mjs +36 -34
- package/es/components/display/ActionBtn.vue.mjs +94 -71
- package/es/components/display/ActionBtn.vue2.mjs +2 -2
- package/es/components/display/ActionBtnGroup.vue.mjs +54 -48
- package/es/components/display/ActionBtnGroup.vue2.mjs +2 -2
- package/es/components/display/ActionConfirm.vue.mjs +4 -4
- package/es/components/display/ActionConfirm.vue2.mjs +116 -92
- package/es/components/display/BooleanTag.vue.mjs +24 -18
- package/es/components/display/BooleanTag.vue2.mjs +2 -2
- package/es/components/display/HeightProvider.vue.mjs +37 -27
- package/es/components/display/HeightProvider.vue2.mjs +2 -2
- package/es/components/display/TabsHeader.vue.mjs +4 -4
- package/es/components/display/TabsHeader.vue2.mjs +86 -57
- package/es/components/display/TabsMain.vue.mjs +156 -125
- package/es/components/display/TabsMain.vue2.mjs +2 -2
- package/es/components/display/TabsNaturalFlow.vue.mjs +15 -11
- package/es/components/display/TabsNaturalFlow.vue2.mjs +2 -2
- package/es/components/display/TabsRefineFlow.vue.mjs +55 -42
- package/es/components/display/TabsRefineFlow.vue2.mjs +2 -2
- package/es/components/display/TabsTile.vue.mjs +4 -4
- package/es/components/display/TabsTile.vue2.mjs +204 -146
- package/es/components/display/WatchSize.vue.mjs +50 -30
- package/es/components/display/WatchSize.vue2.mjs +2 -2
- package/es/components/display/use-tabs-query-sync.mjs +21 -17
- package/es/components/form/FormItem.vue.mjs +4 -4
- package/es/components/form/FormItem.vue2.mjs +183 -121
- package/es/components/form/FormItemNestForm.vue.mjs +4 -4
- package/es/components/form/FormItemNestForm.vue2.mjs +38 -34
- package/es/components/form/FormItemNestFormList.vue.mjs +4 -4
- package/es/components/form/FormItemNestFormList.vue2.mjs +135 -106
- package/es/components/form/FormMain.vue.mjs +4 -4
- package/es/components/form/FormMain.vue2.mjs +226 -139
- package/es/components/form/FormRadioGroup.vue.mjs +67 -52
- package/es/components/form/FormRadioGroup.vue2.mjs +2 -2
- package/es/components/form/FormSearch.vue.mjs +4 -4
- package/es/components/form/FormSearch.vue2.mjs +194 -156
- package/es/components/form/FormSelect.vue.mjs +69 -42
- package/es/components/form/FormSelect.vue2.mjs +2 -2
- package/es/components/form/FormSubmitBtn.vue.mjs +30 -25
- package/es/components/form/FormSubmitBtn.vue2.mjs +2 -2
- package/es/components/form/FormSubmitPanel.vue.mjs +4 -4
- package/es/components/form/FormSubmitPanel.vue2.mjs +129 -96
- package/es/components/form/FormTree.vue.mjs +19 -16
- package/es/components/form/FormTree.vue2.mjs +2 -2
- package/es/components/form/FormVerifyCode.vue.mjs +58 -41
- package/es/components/form/FormVerifyCode.vue2.mjs +2 -2
- package/es/components/form/FormVerifyImage.vue.mjs +4 -4
- package/es/components/form/FormVerifyImage.vue2.mjs +62 -40
- package/es/components/form/form-search-utils.mjs +83 -52
- package/es/components/form/nest-form-item-list.mjs +63 -55
- package/es/components/form/nest-form-item.mjs +30 -30
- package/es/components/form/nest-registry.mjs +4 -4
- package/es/components/form/use-form-submit.mjs +18 -15
- package/es/components/form/use-layout-by-container.mjs +23 -15
- package/es/components/form/use-nest-form-list.mjs +19 -16
- package/es/components/form/use-nest-form.mjs +37 -28
- package/es/components/form/use-nest-layout-scale.mjs +11 -10
- package/es/components/form/utils.mjs +233 -145
- package/es/components/list-page/ListPage.vue.mjs +4 -4
- package/es/components/list-page/ListPage.vue2.mjs +313 -207
- package/es/components/list-page/use-sticky.mjs +45 -33
- package/es/components/menu/MenuItemSub.vue.mjs +47 -43
- package/es/components/menu/MenuItemSub.vue2.mjs +2 -2
- package/es/components/menu/MenuTree.vue.mjs +84 -61
- package/es/components/menu/MenuTree.vue2.mjs +2 -2
- package/es/components/misc/AutoRefresh.vue.mjs +4 -4
- package/es/components/misc/AutoRefresh.vue2.mjs +78 -53
- package/es/components/misc/AutoRefreshGroup.vue.mjs +4 -4
- package/es/components/misc/AutoRefreshGroup.vue2.mjs +54 -51
- package/es/components/misc/SelectModule.vue.mjs +54 -45
- package/es/components/misc/SelectModule.vue2.mjs +2 -2
- package/es/components/misc/TriggerAutoImport.vue.mjs +7 -5
- package/es/components/misc/TriggerAutoImport.vue2.mjs +2 -2
- package/es/components/modal/ModalConfirm.vue.mjs +4 -4
- package/es/components/modal/ModalConfirm.vue2.mjs +160 -125
- package/es/components/modal/ModalDetail.vue.mjs +50 -39
- package/es/components/modal/ModalDetail.vue2.mjs +2 -2
- package/es/components/modal/ModalForm.vue.mjs +63 -52
- package/es/components/modal/ModalForm.vue2.mjs +2 -2
- package/es/components/modal/ModalPorter.vue.mjs +51 -36
- package/es/components/modal/ModalPorter.vue2.mjs +2 -2
- package/es/components/modal/ModalShelf.vue.mjs +38 -28
- package/es/components/modal/ModalShelf.vue2.mjs +2 -2
- package/es/components/modal/modal-shelf-core.mjs +52 -36
- package/es/components/modal/modal-shelf-hierarchy.mjs +11 -9
- package/es/components/panel/PanelEditSwitch.vue.mjs +4 -4
- package/es/components/panel/PanelEditSwitch.vue2.mjs +88 -66
- package/es/components/panel/PanelItem.vue.mjs +4 -4
- package/es/components/panel/PanelItem.vue2.mjs +103 -77
- package/es/components/panel/PanelItemNestForm.vue.mjs +4 -4
- package/es/components/panel/PanelItemNestForm.vue2.mjs +61 -52
- package/es/components/panel/PanelItemNestPanel.vue.mjs +22 -20
- package/es/components/panel/PanelItemNestPanel.vue2.mjs +2 -2
- package/es/components/panel/PanelMain.vue.mjs +4 -4
- package/es/components/panel/PanelMain.vue2.mjs +92 -74
- package/es/components/panel/nest-panel-form.mjs +44 -38
- package/es/components/panel/nest-panel-item.mjs +18 -17
- package/es/components/slot-layout/SlotLayoutFlowAside.vue.mjs +4 -4
- package/es/components/slot-layout/SlotLayoutFlowAside.vue2.mjs +55 -42
- package/es/components/slot-layout/SlotLayoutTemplate.vue.mjs +11 -9
- package/es/components/slot-layout/SlotLayoutTemplate.vue2.mjs +2 -2
- package/es/components/table/TableMain.vue.mjs +4 -4
- package/es/components/table/TableMain.vue2.mjs +378 -275
- package/es/components/table/TableSkeleton.vue.mjs +4 -4
- package/es/components/table/TableSkeleton.vue2.mjs +95 -74
- package/es/components/table/TableToolbar.vue.mjs +4 -4
- package/es/components/table/TableToolbar.vue2.mjs +170 -154
- package/es/components/table/ToolbarButtons.vue.mjs +12 -10
- package/es/components/table/ToolbarButtons.vue2.mjs +2 -2
- package/es/components/table/constants.mjs +4 -3
- package/es/components/table/use-fill-height.mjs +12 -10
- package/es/components/table/use-table-skeleton.mjs +19 -15
- package/es/config/list-model.mjs +2 -2
- package/es/config/route.mjs +4 -3
- package/es/helpers/form.mjs +35 -25
- package/es/helpers/list-helper.mjs +59 -44
- package/es/hooks/activated.mjs +49 -33
- package/es/hooks/feel-size.mjs +39 -23
- package/es/hooks/menus-dispatch.mjs +68 -35
- package/es/hooks/timeout.mjs +29 -14
- package/es/hooks/use-breakpoint.mjs +35 -23
- package/es/hooks/use-channel-viewport-height.mjs +30 -20
- package/es/hooks/use-custom-breakpoint.mjs +48 -31
- package/es/hooks/use-observe-size.mjs +37 -20
- package/es/hooks/use-theme-apply.mjs +175 -124
- package/es/hooks/use-viewport-apply.mjs +39 -27
- package/es/index.mjs +239 -239
- package/es/inject/key.mjs +52 -41
- package/es/injectInfo.json.mjs +2 -2
- package/es/router/group-redirect.mjs +22 -16
- package/es/router/guard/index.mjs +26 -21
- package/es/router/guard/login.mjs +4 -2
- package/es/router/guard/permission.mjs +4 -2
- package/es/store/app.mjs +163 -123
- package/es/store/router-permission.mjs +75 -46
- package/es/store/user.mjs +100 -71
- package/es/style.css +769 -1
- package/es/utils/dom.mjs +20 -16
- package/es/utils/export.mjs +34 -18
- package/es/utils/id.mjs +5 -3
- package/es/utils/router.mjs +21 -14
- package/es/utils/theme-scale.mjs +50 -35
- package/es/utils/time.mjs +20 -14
- package/package.json +4 -3
- package/src/bridge/README.md +5 -0
- package/src/bridge/docs/README.md +72 -0
- package/src/components/README.md +84 -0
- package/src/components/app-layout/README.md +46 -0
- package/src/components/app-layout/docs/README-AppAside.md +69 -0
- package/src/components/app-layout/docs/README-AppBody.md +81 -0
- package/src/components/app-layout/docs/README-AppBreadcrumb.md +71 -0
- package/src/components/app-layout/docs/README-AppFooter.md +41 -0
- package/src/components/app-layout/docs/README-AppHeader.md +73 -0
- package/src/components/app-layout/docs/README-AppLayout.md +83 -0
- package/src/components/app-layout/docs/README-AppPage.md +80 -0
- package/src/components/app-layout/docs/README-AppSidebar.md +70 -0
- package/src/components/app-layout/docs/README-AppTheme.md +66 -0
- package/src/components/data-view/README.md +19 -0
- package/src/components/data-view/docs/README-DataListView.md +114 -0
- package/src/components/display/README.md +23 -0
- package/src/components/display/docs/README-ActionBtn.md +84 -0
- package/src/components/display/docs/README-ActionBtnGroup.md +96 -0
- package/src/components/display/docs/README-ActionConfirm.md +77 -0
- package/src/components/display/docs/README-BooleanTag.md +76 -0
- package/src/components/display/docs/README-HeightProvider.md +74 -0
- package/src/components/display/docs/README-TabsMain.md +99 -0
- package/src/components/display/docs/README-WatchSize.md +70 -0
- package/src/components/form/README.md +24 -0
- package/src/components/form/docs/README-FormItemNestForm.md +86 -0
- package/src/components/form/docs/README-FormItemNestFormList.md +93 -0
- package/src/components/form/docs/README-FormMain.md +101 -0
- package/src/components/form/docs/README-FormSearch.md +89 -0
- package/src/components/form/docs/README-FormSubmitBtn.md +72 -0
- package/src/components/form/docs/README-FormSubmitPanel.md +97 -0
- package/src/components/list-page/README.md +16 -0
- package/src/components/list-page/docs/README-ListPage.md +136 -0
- package/src/components/menu/README.md +19 -0
- package/src/components/menu/docs/README-MenuItemSub.md +53 -0
- package/src/components/menu/docs/README-MenuTree.md +76 -0
- package/src/components/misc/README.md +21 -0
- package/src/components/misc/docs/README-AutoRefresh.md +74 -0
- package/src/components/misc/docs/README-AutoRefreshGroup.md +74 -0
- package/src/components/misc/docs/README-SelectModule.md +72 -0
- package/src/components/modal/README.md +21 -0
- package/src/components/modal/docs/README-ModalConfirm.md +105 -0
- package/src/components/modal/docs/README-ModalDetail.md +103 -0
- package/src/components/modal/docs/README-ModalForm.md +97 -0
- package/src/components/modal/docs/README-ModalPorter.md +92 -0
- package/src/components/modal/docs/README-ModalShelf.md +115 -0
- package/src/components/panel/README.md +19 -0
- package/src/components/panel/docs/README-PanelMain.md +149 -0
- package/src/components/slot-layout/README.md +17 -0
- package/src/components/slot-layout/docs/README-SlotLayoutFlowAside.md +83 -0
- package/src/components/slot-layout/docs/README-SlotLayoutTemplate.md +73 -0
- package/src/components/table/README.md +17 -0
- package/src/components/table/docs/README-TableMain.md +140 -0
- package/src/hooks/README.md +5 -0
- package/src/hooks/docs/README.md +49 -0
- package/types/bridge/config-hook.d.ts +68 -0
- package/types/bridge/index.d.ts +411 -0
- package/types/bridge/layout.d.ts +40 -0
- package/types/bridge/plugin.d.ts +18 -0
- package/types/bridge/route.d.ts +20 -1
- package/types/bridge/state.d.ts +14 -0
- package/types/bridge/storage.d.ts +9 -0
- package/types/bridge/theme/index.d.ts +7 -0
- package/types/bridge/theme/persist.d.ts +12 -0
- package/types/bridge/theme/system-dark.d.ts +12 -0
- package/types/bridge/theme/types.d.ts +238 -0
- package/types/components/app-layout/AppAside.vue.d.ts +1 -0
- package/types/components/app-layout/AppCollapseToggle.vue.d.ts +3 -0
- package/types/components/app-layout/AppHeader.vue.d.ts +3 -0
- package/types/components/app-layout/AppLayout.vue.d.ts +12 -0
- package/types/components/app-layout/AppPage.vue.d.ts +17 -0
- package/types/components/app-layout/AppSidebar.vue.d.ts +2 -0
- package/types/components/app-layout/app-page-geometry.d.ts +48 -0
- package/types/components/app-layout/keep-alive.d.ts +17 -0
- package/types/components/app-layout/types.d.ts +125 -0
- package/types/components/app-layout/viewport.d.ts +28 -0
- package/types/components/data-view/DataListViewItem.vue.d.ts +8 -0
- package/types/components/data-view/index.d.ts +4 -0
- package/types/components/data-view/types.d.ts +42 -0
- package/types/components/data-view/utils.d.ts +3 -0
- package/types/components/display/TabsHeader.vue.d.ts +2 -0
- package/types/components/display/TabsMain.vue.d.ts +2 -0
- package/types/components/display/TabsRefineFlow.vue.d.ts +1 -0
- package/types/components/display/TabsTile.vue.d.ts +247 -12
- package/types/components/display/WatchSize.vue.d.ts +9 -0
- package/types/components/display/index.d.ts +37 -1
- package/types/components/display/types.d.ts +163 -0
- package/types/components/display/use-tabs-query-sync.d.ts +29 -0
- package/types/components/form/FormItemNestForm.vue.d.ts +5 -0
- package/types/components/form/FormItemNestFormList.vue.d.ts +17 -0
- package/types/components/form/FormVerifyCode.vue.d.ts +9 -0
- package/types/components/form/FormVerifyImage.vue.d.ts +1 -0
- package/types/components/form/form-search-utils.d.ts +34 -0
- package/types/components/form/nest-form-item-list.d.ts +28 -0
- package/types/components/form/nest-form-item.d.ts +21 -0
- package/types/components/form/nest-registry.d.ts +14 -0
- package/types/components/form/types.d.ts +208 -8
- package/types/components/form/use-form-submit.d.ts +13 -0
- package/types/components/form/use-layout-by-container.d.ts +23 -0
- package/types/components/form/use-nest-form-list.d.ts +13 -0
- package/types/components/form/use-nest-form.d.ts +15 -0
- package/types/components/form/use-nest-layout-scale.d.ts +12 -0
- package/types/components/form/utils.d.ts +56 -1
- package/types/components/list-page/ListPage.vue.d.ts +6 -0
- package/types/components/list-page/types.d.ts +50 -2
- package/types/components/list-page/use-sticky.d.ts +23 -0
- package/types/components/misc/index.d.ts +6 -1
- package/types/components/misc/types.d.ts +7 -0
- package/types/components/modal/ModalConfirm.vue.d.ts +29 -0
- package/types/components/modal/index.d.ts +7 -1
- package/types/components/modal/modal-shelf-core.d.ts +3 -0
- package/types/components/modal/modal-shelf-hierarchy.d.ts +4 -0
- package/types/components/modal/modal-shelf-types.d.ts +34 -0
- package/types/components/modal/types.d.ts +63 -2
- package/types/components/panel/PanelItemNestForm.vue.d.ts +6 -0
- package/types/components/panel/PanelItemNestPanel.vue.d.ts +5 -0
- package/types/components/panel/nest-panel-form.d.ts +21 -0
- package/types/components/panel/nest-panel-item.d.ts +14 -0
- package/types/components/panel/types.d.ts +52 -1
- package/types/components/slot-layout/SlotLayoutTemplate.vue.d.ts +21 -0
- package/types/components/slot-layout/types.d.ts +4 -0
- package/types/components/table/constants.d.ts +8 -0
- package/types/components/table/types.d.ts +140 -9
- package/types/components/table/use-fill-height.d.ts +14 -0
- package/types/components/table/use-table-skeleton.d.ts +16 -0
- package/types/config/list-model.d.ts +29 -0
- package/types/config/route.d.ts +2 -0
- package/types/helpers/form.d.ts +5 -0
- package/types/helpers/list-helper.d.ts +26 -0
- package/types/helpers/types.d.ts +11 -0
- package/types/hooks/activated.d.ts +23 -0
- package/types/hooks/feel-size.d.ts +2 -0
- package/types/hooks/menus-dispatch.d.ts +4 -0
- package/types/hooks/timeout.d.ts +4 -0
- package/types/hooks/use-channel-viewport-height.d.ts +8 -0
- package/types/hooks/use-custom-breakpoint.d.ts +19 -0
- package/types/hooks/use-observe-size.d.ts +29 -0
- package/types/hooks/use-theme-apply.d.ts +23 -0
- package/types/hooks/use-viewport-apply.d.ts +12 -0
- package/types/inject/key.d.ts +163 -0
- package/types/injectInfo.json.d.ts +1 -1
- package/types/router/group-redirect.d.ts +9 -0
- package/types/router/guard/index.d.ts +13 -0
- package/types/router/guard/login.d.ts +1 -0
- package/types/router/guard/permission.d.ts +1 -0
- package/types/router/guard/types.d.ts +3 -0
- package/types/store/app.d.ts +27 -0
- package/types/store/router-permission.d.ts +53 -0
- package/types/store/user.d.ts +24 -0
- package/types/types/dot-path.d.ts +8 -0
- package/types/types/route.d.ts +45 -0
- package/types/types/utility-types.d.ts +7 -0
- package/types/utils/dom.d.ts +22 -0
- package/types/utils/export.d.ts +16 -1
- package/types/utils/id.d.ts +1 -0
- package/types/utils/router.d.ts +2 -0
- package/types/utils/theme-scale.d.ts +31 -0
- package/types/utils/time.d.ts +1 -0
package/types/bridge/index.d.ts
CHANGED
|
@@ -11,224 +11,635 @@ export { createGenerateRouteMetaRawTree, type RouteMetaDefaultConfig, } from './
|
|
|
11
11
|
export { createStorageWithNamespace } from './storage';
|
|
12
12
|
export type { CoreThemeEntry, CoreThemeLifecycleContext, CoreThemeLifecycleHooks, CoreConfigDescription, CoreThemeModule, CoreThemeMode, CoreThemeDensity, CoreThemeMotion, ElSize, CoreThemeComponentDefaults, CoreThemePresetLayout, BridgeThemeLayoutState, BridgeThemeLayoutBaseline, BridgeThemeHook, } from './theme';
|
|
13
13
|
export type { CoreLayoutModule, BridgeLayoutHook, BridgeLayoutInit, LayoutCollapsePersistShape, } from './layout';
|
|
14
|
+
/**
|
|
15
|
+
* 认证桥接无状态纯工厂。
|
|
16
|
+
*
|
|
17
|
+
* core 模块级零状态——每次调用 `createCoreBridge({...})` 在函数作用域内新建一组
|
|
18
|
+
* 闭包变量,传入 init 参数立即初始化,返回可直接使用的实例。core [MUST NOT] 持
|
|
19
|
+
* 已实例化单例(避免 dist/src 双 module instance 分裂,规避机制见 design §2.3,
|
|
20
|
+
* 结构上不持单例,[MUST NOT] 用 Symbol.for / globalThis 兜底)。
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* register 入参类型,全字段 optional + 「有值才更新」增量合并。
|
|
24
|
+
*
|
|
25
|
+
* #4e 增 4 个增量可选业务 api(loginApi/logoutApi/getUserInfoApi/refreshTokenApi),
|
|
26
|
+
* 由 `createUserStore` 薄壳侧 register 注入;getToken/refreshToken/refreshAuth 由
|
|
27
|
+
* `createUserStore` core 工厂 setup 内自 register(裁决 2/3)。
|
|
28
|
+
*/
|
|
14
29
|
export interface CoreBridgeRegisterOptions<UserInfo = unknown, LoginParams = unknown> {
|
|
30
|
+
/** 取 token(v3 终锁 BR-1 ③ 终裁:零参 facade——core 对 UserInfo 不透明 + 拦截器无 info 源,泛型 `<UserInfo>` 纯透传不沾 getToken 签名) */
|
|
15
31
|
getToken?: () => string | undefined;
|
|
32
|
+
/** 跳转登录 */
|
|
16
33
|
goToLogin?: () => void;
|
|
34
|
+
/** 刷新 token */
|
|
17
35
|
refreshToken?: () => Promise<unknown>;
|
|
36
|
+
/** 刷新鉴权(重新拉取用户信息) */
|
|
18
37
|
refreshAuth?: () => Promise<unknown>;
|
|
38
|
+
/** 登录 api(对应 app accountLogin;#2.7 期 axios `{data}` wrapper 业务层 wrap 剥离,core 直读 UserInfo),增量可选 */
|
|
19
39
|
loginApi?: (params: LoginParams) => Promise<Partial<UserInfo>>;
|
|
40
|
+
/** 退出登录 api(对应 app accountLogout),增量可选 */
|
|
20
41
|
logoutApi?: () => Promise<unknown>;
|
|
42
|
+
/** 取用户信息 api(对应 app getLoginAccountInfo;#2.7 期 axios `{data}` wrapper 业务层 wrap 剥离;{user_info} 连壳历史语义在业务层 wrap 决定是否保留 D2),增量可选 */
|
|
21
43
|
getUserInfoApi?: () => Promise<Partial<UserInfo>>;
|
|
44
|
+
/** 刷新 token api(#C 期签名最简化:core 不感知业务 shape,直传 refreshToken string;业务方 wrap 内自打包业务约定的入参 shape,如 `{Authorization: rt}`),增量可选 */
|
|
22
45
|
refreshTokenApi?: (refreshToken: string) => Promise<string>;
|
|
23
46
|
}
|
|
24
47
|
export type { CoreBridgePlugin, CoreBridgePluginBridgeSlice, CoreBridgePluginContext, CoreBridgePluginInstall, CoreBridgePluginLike, } from './plugin';
|
|
48
|
+
/**
|
|
49
|
+
* pinia persist storage 适配器最小接口。
|
|
50
|
+
*
|
|
51
|
+
* 仅约束 `store/app.ts` persist 适配器实际依赖的三方法,是浏览器 `Storage`
|
|
52
|
+
* 的结构子集——`createStorageWithNamespace()` 返回的命名空间 Storage 可直接赋值兼容。
|
|
53
|
+
*/
|
|
25
54
|
export interface StorageLike {
|
|
55
|
+
/** 读取键值,未命中返回 null */
|
|
26
56
|
getItem: (key: string) => string | null;
|
|
57
|
+
/** 写入键值 */
|
|
27
58
|
setItem: (key: string, value: string) => void;
|
|
59
|
+
/** 删除键值 */
|
|
28
60
|
removeItem: (key: string) => void;
|
|
29
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* 应用主题颜色类型。
|
|
64
|
+
*
|
|
65
|
+
* 镜像 app 端 `@/config` `AppThemeColor` 全字段——store/app 的 `theme`
|
|
66
|
+
* computed 透出后由 app-layout 消费点访问 `primaryColor` 等全字段,故 [MUST]
|
|
67
|
+
* 完整镜像,[MUST NOT] 收窄到 store/app 体内直接读的子集(否则消费点 TS2339)。
|
|
68
|
+
*/
|
|
30
69
|
export interface AppThemeColor {
|
|
70
|
+
/** 背景色 */
|
|
31
71
|
bodyColor: string;
|
|
72
|
+
/** 基础色 */
|
|
32
73
|
baseColor: string;
|
|
74
|
+
/** 主色调 */
|
|
33
75
|
primaryColor: string;
|
|
76
|
+
/** 成功色 */
|
|
34
77
|
successColor: string;
|
|
78
|
+
/** 警告色 */
|
|
35
79
|
warningColor: string;
|
|
80
|
+
/** 危险色 */
|
|
36
81
|
dangerColor: string;
|
|
82
|
+
/** 错误色 */
|
|
37
83
|
errorColor: string;
|
|
84
|
+
/** 信息色 */
|
|
38
85
|
infoColor: string;
|
|
86
|
+
/** 圆角(风格可选;core 挂 --dc-core-radius + --el-border-radius-base) */
|
|
39
87
|
radius?: string;
|
|
88
|
+
/** 边框色(风格可选;core 挂 --dc-core-border-color + --el-border-color) */
|
|
40
89
|
borderColor?: string;
|
|
90
|
+
/** 阴影(风格可选;core 挂 --dc-core-shadow + --el-box-shadow) */
|
|
41
91
|
shadow?: string;
|
|
92
|
+
/** 边框宽(风格可选;core 挂 --dc-core-border-width + --el-border-width) */
|
|
42
93
|
borderWidth?: string;
|
|
94
|
+
/** 强调色(风格可选;core 仅挂 --dc-core-accent,EP 无对应) */
|
|
43
95
|
accent?: string;
|
|
96
|
+
/** 辉光(风格可选;core 仅挂 --dc-core-glow,EP 无对应) */
|
|
44
97
|
glow?: string;
|
|
98
|
+
/** 模糊(风格可选;core 仅挂 --dc-core-blur,EP 无对应) */
|
|
45
99
|
blur?: string;
|
|
100
|
+
/** 聚焦环(风格可选;core 仅挂 --dc-core-focus-ring,EP 无对应) */
|
|
46
101
|
focusRing?: string;
|
|
102
|
+
/** 表面色(风格可选;core 仅挂 --dc-core-surface,EP 无对应) */
|
|
47
103
|
surface?: string;
|
|
48
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* 布局模块 `style` 逃生舱排除的「引擎托管键」联合(甲方终锁键集)。
|
|
107
|
+
*
|
|
108
|
+
* 这些 CSS 属性由布局引擎(store/app 几何 calc + 主题色兜底 + fixed 定位 + sidebar/aside
|
|
109
|
+
* 让位)独占计算,消费方 `style` [MUST NOT] 染指——否则破布局。分类:
|
|
110
|
+
* - 尺寸:width / height(几何算)
|
|
111
|
+
* - 定位:position / top / right / bottom / left / inset(fixed 锚点)
|
|
112
|
+
* - 显示 / 盒外:display(破布局流)/ margin 家族(破 fixed 定位)
|
|
113
|
+
* - 盒内:padding 家族(sidebar/aside 用 paddingTop 让位 header,整族锁防破让位)
|
|
114
|
+
* - 颜色:color / background / backgroundColor(走 config.color|background + --dc-core-* 兜底,规则 14)
|
|
115
|
+
*/
|
|
49
116
|
type AppLayoutManagedStyleKey = "width" | "height" | "position" | "top" | "right" | "bottom" | "left" | "inset" | "display" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "color" | "background" | "backgroundColor";
|
|
117
|
+
/**
|
|
118
|
+
* 布局模块(Header/Footer/Sidebar/Aside)`style` 逃生舱类型。
|
|
119
|
+
*
|
|
120
|
+
* = `Omit<CSSProperties, 托管键>`——消费方显式自定义装饰(borderRadius / boxShadow /
|
|
121
|
+
* border / backdropFilter / opacity / transition 等),走规则 14「组件 prop 显式自定义值
|
|
122
|
+
* → 内联 :style 直值」例外条款。托管键经类型 `Omit` 编译期拦截 + store 合并运行时压过(双保险)。
|
|
123
|
+
*/
|
|
50
124
|
export type AppLayoutModuleStyle = Omit<CSSProperties, AppLayoutManagedStyleKey>;
|
|
125
|
+
/**
|
|
126
|
+
* `store/app.ts` 实际消费的 app config 子集结构。
|
|
127
|
+
*
|
|
128
|
+
* 字段名与层级镜像 app 端 `@/config` 原结构([MUST NOT] 重命名);覆盖
|
|
129
|
+
* store/app 现消费字段(含 `theme` 透出后消费点所需全字段),[MUST NOT] 扩面
|
|
130
|
+
* 到全量 app config。core 不能 import app,故在此显式定义等价 interface。
|
|
131
|
+
*/
|
|
51
132
|
export interface AppConfig {
|
|
133
|
+
/** 应用基础信息(store/app 仅取 name) */
|
|
52
134
|
APP_BASE_INFO: {
|
|
135
|
+
/** 应用名称 */
|
|
53
136
|
name: string;
|
|
54
137
|
};
|
|
138
|
+
/** 应用布局-header 配置 */
|
|
55
139
|
APP_LAYOUT_HEADER_CONFIG: {
|
|
140
|
+
/** header 高度(px) */
|
|
56
141
|
height: number;
|
|
142
|
+
/** 字体色;缺省 → 不写 color、CSS 继承 :root 全局 color(= baseColor);[MUST NOT] 写死字面量 */
|
|
57
143
|
color?: string;
|
|
144
|
+
/** 背景(color / image / gradient 等 CSS background);缺省 → bodyColor(经 --dc-core-* var);[MUST NOT] 写死字面量 */
|
|
58
145
|
background?: string;
|
|
146
|
+
/** 装饰逃生舱(borderRadius/boxShadow/... ;排除引擎托管键,见 {@link AppLayoutModuleStyle}) */
|
|
59
147
|
style?: AppLayoutModuleStyle;
|
|
60
148
|
};
|
|
149
|
+
/** 应用布局-footer 配置 */
|
|
61
150
|
APP_LAYOUT_FOOTER_CONFIG: {
|
|
151
|
+
/** footer 高度(px) */
|
|
62
152
|
height: number;
|
|
153
|
+
/** 字体色;缺省 → 继承 :root color(baseColor) */
|
|
63
154
|
color?: string;
|
|
155
|
+
/** 背景(color / image / gradient 等 CSS background);缺省 → bodyColor */
|
|
64
156
|
background?: string;
|
|
157
|
+
/** 装饰逃生舱(见 {@link AppLayoutModuleStyle}) */
|
|
65
158
|
style?: AppLayoutModuleStyle;
|
|
66
159
|
};
|
|
160
|
+
/** 应用布局-sidebar 配置(store/app 取 collapseWidth / width) */
|
|
67
161
|
APP_LAYOUT_SIDEBAR_CONFIG: {
|
|
162
|
+
/** [展开的]宽度(px) */
|
|
68
163
|
width: number;
|
|
164
|
+
/** 折叠起来的宽度(px) */
|
|
69
165
|
collapseWidth: number;
|
|
166
|
+
/** 字体色;缺省 → 继承 :root color(baseColor) */
|
|
70
167
|
color?: string;
|
|
168
|
+
/** 背景(color / image / gradient 等 CSS background);缺省 → bodyColor */
|
|
71
169
|
background?: string;
|
|
170
|
+
/** 装饰逃生舱(见 {@link AppLayoutModuleStyle}) */
|
|
72
171
|
style?: AppLayoutModuleStyle;
|
|
73
172
|
};
|
|
173
|
+
/**
|
|
174
|
+
* 应用布局-aside 右侧补充区配置(P1' 新增 additive,对称 sidebar)。
|
|
175
|
+
* 仅自定义 shell 渲染右侧区时生效;不配则 aside 不存在(经典布局零影响)。
|
|
176
|
+
*/
|
|
74
177
|
APP_LAYOUT_ASIDE_CONFIG: {
|
|
178
|
+
/** aside 宽度(px) */
|
|
75
179
|
width: number;
|
|
180
|
+
/** 字体色;缺省 → 继承 :root color(baseColor) */
|
|
76
181
|
color?: string;
|
|
182
|
+
/** 背景(color / image / gradient 等 CSS background);缺省 → bodyColor */
|
|
77
183
|
background?: string;
|
|
184
|
+
/** 装饰逃生舱(见 {@link AppLayoutModuleStyle}) */
|
|
78
185
|
style?: AppLayoutModuleStyle;
|
|
79
186
|
};
|
|
187
|
+
/** 应用布局-页面主体配置(store/app 仅取 shimPadding) */
|
|
80
188
|
APP_LAYOUT_BODY_CONFIG: {
|
|
189
|
+
/** 页面主体 padding - 默认值(px) */
|
|
81
190
|
shimPadding: number;
|
|
82
191
|
};
|
|
192
|
+
/**
|
|
193
|
+
* 应用布局-模块间距配置(内缝;模块间露 size px 底色条带,漏出 .app-body 的 bodyColor)。
|
|
194
|
+
*
|
|
195
|
+
* 与 viewport 边框(整体外框)正交:gap 是模块**之间**的缝。默认 `{ size: 0 }` = 模块贴合、
|
|
196
|
+
* 现状不变;`size>0` 时 store 几何 calc 在相邻模块间叠加该间距(缺位侧不留悬空缝)。
|
|
197
|
+
* 分离观感需模块 `background` 为 surface 色(≠ bodyColor),由 preset/消费方设。
|
|
198
|
+
* 布局插件经 `bridge.update("APP_LAYOUT_GAP_CONFIG", { size })` 设值。
|
|
199
|
+
*/
|
|
83
200
|
APP_LAYOUT_GAP_CONFIG: {
|
|
201
|
+
/** 模块间距(px);缺省 0 = 贴合 */
|
|
84
202
|
size: number;
|
|
85
203
|
};
|
|
204
|
+
/**
|
|
205
|
+
* 应用布局-视口边框配置(整个 app-shell 相对浏览器视口四边内缩,套"边框"留白观感)。
|
|
206
|
+
*
|
|
207
|
+
* Header/Sidebar 的 fixed 锚点由 `0` 改贴四边 padding 值;AppBody 在原扣 header 高 /
|
|
208
|
+
* sidebar 宽基础上经 calc 再叠加对应 viewport 边距。app 端可整体不传(核内默认四边 0
|
|
209
|
+
* = 不套框,现状不变);布局插件经 `bridge.update("APP_LAYOUT_VIEWPORT_CONFIG", ...)` 设值。
|
|
210
|
+
*/
|
|
86
211
|
APP_LAYOUT_VIEWPORT_CONFIG: {
|
|
212
|
+
/** 视口上内边距(px) */
|
|
87
213
|
paddingTop: number;
|
|
214
|
+
/** 视口右内边距(px) */
|
|
88
215
|
paddingRight: number;
|
|
216
|
+
/** 视口下内边距(px) */
|
|
89
217
|
paddingBottom: number;
|
|
218
|
+
/** 视口左内边距(px) */
|
|
90
219
|
paddingLeft: number;
|
|
91
220
|
};
|
|
221
|
+
/** 应用主题配置(store/app 取 dark / light,各为完整 AppThemeColor) */
|
|
92
222
|
APP_THEME_CONFIG: {
|
|
223
|
+
/** 亮色主题 */
|
|
93
224
|
light: AppThemeColor;
|
|
225
|
+
/** 暗色主题 */
|
|
94
226
|
dark: AppThemeColor;
|
|
95
227
|
};
|
|
228
|
+
/** 应用路由元信息默认配置(store/app 取 show* 四项;createUserStore 经此取 menuShow/needLogin 默认) */
|
|
96
229
|
APP_ROUTER_META_DEFAULT_CONFIG: {
|
|
230
|
+
/** 各路由[未配置情况下]默认是否展示 header */
|
|
97
231
|
showHeader: boolean;
|
|
232
|
+
/** 各路由[未配置情况下]默认是否展示 footer */
|
|
98
233
|
showFooter: boolean;
|
|
234
|
+
/** 各路由[未配置情况下]默认是否展示 sidebar */
|
|
99
235
|
showSidebar: boolean;
|
|
236
|
+
/** 各路由[未配置情况下]默认是否展示右侧 aside(additive 可选;缺省 false,store `?? false` 兜底) */
|
|
100
237
|
showAside?: boolean;
|
|
238
|
+
/** 默认是否展示 breadcrumb */
|
|
101
239
|
showBreadcrumb: boolean;
|
|
240
|
+
/** 各路由[未配置情况下]默认是否展示在菜单 */
|
|
102
241
|
menuShow: boolean;
|
|
242
|
+
/** 各路由[未配置情况下]默认是否需要登录 */
|
|
103
243
|
needLogin: boolean;
|
|
104
244
|
};
|
|
245
|
+
/** 应用缓存配置(#4e additive 第 8 项;createUserStore 经 namespace 实例化 useState) */
|
|
105
246
|
APP_CACHE_CONFIG: {
|
|
247
|
+
/** 缓存命名空间 */
|
|
106
248
|
namespace: string;
|
|
107
249
|
};
|
|
108
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* 应用环境信息(#2.5 期新增,per ADR-6)。
|
|
253
|
+
*
|
|
254
|
+
* 镜像 app 端 `@/config` `APP_ENV_INFO` 字面量推导结构。`mode` 取自
|
|
255
|
+
* `import.meta.env.MODE`,`isProd` / `isDev` 派生自 mode 比较;本类型对外
|
|
256
|
+
* 显式声明便于下游业务项目直接 import 使用。
|
|
257
|
+
*/
|
|
109
258
|
export interface AppEnvInfo {
|
|
259
|
+
/** 环境模式(如 "production" / "development") */
|
|
110
260
|
mode: string;
|
|
261
|
+
/** 是生产环境 */
|
|
111
262
|
isProd: boolean;
|
|
263
|
+
/** 是开发环境 */
|
|
112
264
|
isDev: boolean;
|
|
113
265
|
}
|
|
266
|
+
/**
|
|
267
|
+
* 应用布局-面包屑配置(#2.5 期新增,per ADR-6)。
|
|
268
|
+
*/
|
|
114
269
|
export interface AppLayoutBreadcrumbConfig {
|
|
270
|
+
/** 面包屑高度(px) */
|
|
115
271
|
height: number;
|
|
116
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* 应用布局聚合配置(#2.5 期新增,per ADR-3 候选 b bridge 内部派生)。
|
|
275
|
+
*
|
|
276
|
+
* 由 `createCoreBridge` 内部从 5 子布局配置(HEADER/FOOTER/SIDEBAR/BREADCRUMB/BODY)
|
|
277
|
+
* Object.freeze 聚合派生,挂载到 `bridge.APP_LAYOUT_CONFIG` readonly 属性。
|
|
278
|
+
*/
|
|
117
279
|
export interface AppLayoutConfig {
|
|
280
|
+
/** header 配置 */
|
|
118
281
|
header: AppConfig["APP_LAYOUT_HEADER_CONFIG"];
|
|
282
|
+
/** footer 配置 */
|
|
119
283
|
footer: AppConfig["APP_LAYOUT_FOOTER_CONFIG"];
|
|
284
|
+
/** sidebar 配置 */
|
|
120
285
|
sidebar: AppConfig["APP_LAYOUT_SIDEBAR_CONFIG"];
|
|
286
|
+
/** aside 右侧补充区配置(P1' additive) */
|
|
121
287
|
aside: AppConfig["APP_LAYOUT_ASIDE_CONFIG"];
|
|
288
|
+
/** 面包屑配置 */
|
|
122
289
|
breadcrumb: AppLayoutBreadcrumbConfig;
|
|
290
|
+
/** 页面主体配置 */
|
|
123
291
|
body: AppConfig["APP_LAYOUT_BODY_CONFIG"];
|
|
292
|
+
/** 视口边框配置 */
|
|
124
293
|
viewport: AppConfig["APP_LAYOUT_VIEWPORT_CONFIG"];
|
|
294
|
+
/** 模块间距配置(内缝 gap) */
|
|
125
295
|
gap: AppConfig["APP_LAYOUT_GAP_CONFIG"];
|
|
126
296
|
}
|
|
297
|
+
/**
|
|
298
|
+
* 应用路由配置(#2.5 期新增,per ADR-6)。
|
|
299
|
+
*
|
|
300
|
+
* 镜像 app 端 `@/config/router.ts` `APP_ROUTER_CONFIG` 字面量结构。
|
|
301
|
+
*/
|
|
127
302
|
export interface AppRouterConfig {
|
|
303
|
+
/** 是否使用 hash 路由 */
|
|
128
304
|
isHash: boolean;
|
|
305
|
+
/** 路由根路径(同一域名不同 pathname 对应不同应用) */
|
|
129
306
|
basePath: string;
|
|
307
|
+
/** 相同层级路由缓存最大数量 */
|
|
130
308
|
keepAliveMaxCount: number;
|
|
309
|
+
/** 路由 meta 默认值(复用 AppConfig 字段类型) */
|
|
131
310
|
metaDefault: AppConfig["APP_ROUTER_META_DEFAULT_CONFIG"];
|
|
132
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* 应用路由路径配置——8 path 聚合(#7.3 期新增)。
|
|
314
|
+
*
|
|
315
|
+
* 镜像 app 端 `@/config/router.ts` `APP_ROUTER_PATHS_CONFIG` 聚合结构;供
|
|
316
|
+
* layout 族下沉 core 时通过 `appBridge.APP_ROUTER_PATHS_CONFIG.homePath`
|
|
317
|
+
* 等读取路径常量,避免直 import 业务侧 `@/config` 路径符号。
|
|
318
|
+
*
|
|
319
|
+
* `loginNoCheckPath` / `authNoCheckPath` 标 `readonly string[]` 表只读语义;
|
|
320
|
+
* 业务侧 `string[]` 协变兼容 `readonly string[]`(赋值方向单向)。
|
|
321
|
+
*/
|
|
133
322
|
export interface AppRouterPathsConfig {
|
|
323
|
+
/** 根路径[!!!必设重定向] */
|
|
134
324
|
rootPath: string;
|
|
325
|
+
/** 首页路径 */
|
|
135
326
|
homePath: string;
|
|
327
|
+
/** 登录路径 */
|
|
136
328
|
loginPath: string;
|
|
329
|
+
/** 注册路径 */
|
|
137
330
|
registerPath: string;
|
|
331
|
+
/** 404 路径 */
|
|
138
332
|
noFoundPath: string;
|
|
333
|
+
/** 无权限路径 */
|
|
139
334
|
noPermissionPath: string;
|
|
335
|
+
/** 登录免检路径 */
|
|
140
336
|
loginNoCheckPath: readonly string[];
|
|
337
|
+
/** 权限免检路径 */
|
|
141
338
|
authNoCheckPath: readonly string[];
|
|
142
339
|
}
|
|
340
|
+
/** 应用基础信息 type 别名(#2.5 期 type 别名复用,per ADR-6) */
|
|
143
341
|
export type AppBaseInfo = AppConfig["APP_BASE_INFO"];
|
|
342
|
+
/** 应用布局-header 配置 type 别名 */
|
|
144
343
|
export type AppLayoutHeaderConfig = AppConfig["APP_LAYOUT_HEADER_CONFIG"];
|
|
344
|
+
/** 应用布局-footer 配置 type 别名 */
|
|
145
345
|
export type AppLayoutFooterConfig = AppConfig["APP_LAYOUT_FOOTER_CONFIG"];
|
|
346
|
+
/** 应用布局-sidebar 配置 type 别名 */
|
|
146
347
|
export type AppLayoutSidebarConfig = AppConfig["APP_LAYOUT_SIDEBAR_CONFIG"];
|
|
348
|
+
/** 应用布局-aside 右侧补充区配置 type 别名(P1' additive) */
|
|
147
349
|
export type AppLayoutAsideConfig = AppConfig["APP_LAYOUT_ASIDE_CONFIG"];
|
|
350
|
+
/** 应用布局-页面主体配置 type 别名 */
|
|
148
351
|
export type AppLayoutBodyConfig = AppConfig["APP_LAYOUT_BODY_CONFIG"];
|
|
352
|
+
/** 应用布局-视口边框配置 type 别名 */
|
|
149
353
|
export type AppLayoutViewportConfig = AppConfig["APP_LAYOUT_VIEWPORT_CONFIG"];
|
|
354
|
+
/** 应用布局-模块间距配置 type 别名(内缝 gap) */
|
|
150
355
|
export type AppLayoutGapConfig = AppConfig["APP_LAYOUT_GAP_CONFIG"];
|
|
356
|
+
/** 应用主题配置 type 别名 */
|
|
151
357
|
export type AppThemeConfig = AppConfig["APP_THEME_CONFIG"];
|
|
358
|
+
/** 应用路由元信息默认配置 type 别名 */
|
|
152
359
|
export type AppRouterMetaDefaultConfig = AppConfig["APP_ROUTER_META_DEFAULT_CONFIG"];
|
|
360
|
+
/** 应用缓存配置 type 别名 */
|
|
153
361
|
export type AppCacheConfig = AppConfig["APP_CACHE_CONFIG"];
|
|
362
|
+
/**
|
|
363
|
+
* token / refreshToken 字段访问器(含 get + set)。
|
|
364
|
+
*
|
|
365
|
+
* 第一宪法:core 对业务 `UserInfo` shape 完全不透明——业务自存自取,经本 adapter
|
|
366
|
+
* 注入读写两字段的纯函数,core [MUST NOT] 硬编字面字段名/路径耦合业务字段位置。
|
|
367
|
+
* `set` [MUST] 产新对象([MUST NOT] 原地 mutate,破响应式 + 破不可变)。
|
|
368
|
+
*/
|
|
154
369
|
export interface UserInfoFieldAccessor<UserInfo = unknown> {
|
|
370
|
+
/** 读字段值;[MUST] 返回 string——业务经 getUserInfoInitFn 把该字段初值置 `""`,保证空态为 `""` 而非 undefined(类型恒定,免下游满屏 `token!`) */
|
|
155
371
|
get: (info: Partial<UserInfo>) => string;
|
|
372
|
+
/**
|
|
373
|
+
* 写入字段值,返回**保留 info 其余全部字段**的新对象。
|
|
374
|
+
*
|
|
375
|
+
* [MUST] 含 info 全字段(如 `{ ...info, <业务字段>: value }`)——createUserStore
|
|
376
|
+
* getInfo 顺势更新全部用户信息时以 data 为基,依赖本契约把 token/refreshToken
|
|
377
|
+
* 贴回而不丢失 data 其余字段;[MUST NOT] 只返回单字段对象,[MUST NOT] 原地 mutate info。
|
|
378
|
+
*/
|
|
156
379
|
set: (info: Partial<UserInfo>, value: string) => Partial<UserInfo>;
|
|
157
380
|
}
|
|
381
|
+
/**
|
|
382
|
+
* permission 字段访问器(仅 get)。
|
|
383
|
+
*
|
|
384
|
+
* 权限由服务端下发只读,core 不写——仅 get 无 set;返回权限 key 列表(业务侧保底 `[]`)。
|
|
385
|
+
*/
|
|
158
386
|
export interface UserInfoPermissionAccessor<UserInfo = unknown> {
|
|
387
|
+
/** 从用户信息读取权限列表 */
|
|
159
388
|
get: (info: Partial<UserInfo>) => (string | number)[];
|
|
160
389
|
}
|
|
390
|
+
/**
|
|
391
|
+
* 用户信息字段访问器集(token / refreshToken / permission 三字段注入)。
|
|
392
|
+
*
|
|
393
|
+
* createUserStore 经 `bridge.userInfoAccess.<字段>.get/set` 读写业务 UserInfo,
|
|
394
|
+
* core 零字段名耦合(第一宪法)。业务 shape 完全自由(嵌套 / 组合 / 任意命名),
|
|
395
|
+
* core 只认 adapter 契约不认数据结构。
|
|
396
|
+
*/
|
|
161
397
|
export interface UserInfoAccess<UserInfo = unknown> {
|
|
398
|
+
/** token 字段访问器 */
|
|
162
399
|
token: UserInfoFieldAccessor<UserInfo>;
|
|
400
|
+
/** refreshToken 字段访问器 */
|
|
163
401
|
refreshToken: UserInfoFieldAccessor<UserInfo>;
|
|
402
|
+
/** permission 字段访问器(仅 get) */
|
|
164
403
|
permission: UserInfoPermissionAccessor<UserInfo>;
|
|
165
404
|
}
|
|
405
|
+
/**
|
|
406
|
+
* `createCoreBridge` 入参类型(#2.5 期 schema 扩张到 14 顶层字段,per ADR-3 / ADR-6)。
|
|
407
|
+
*
|
|
408
|
+
* #2.5 期完全显式入参化:原 `appConfig: AppConfig` 嵌套字段拆解为 11 个顶层字段平铺
|
|
409
|
+
* + 新增 `APP_ENV_INFO` / `APP_LAYOUT_BREADCRUMB_CONFIG` / `APP_ROUTER_CONFIG` 3 字段
|
|
410
|
+
* + 注:`APP_LAYOUT_CONFIG` 由 bridge 内部从 5 子布局配置聚合派生(候选 b,不在 initOptions 中)。
|
|
411
|
+
*
|
|
412
|
+
* `routes`(#4e additive)为 app 嵌套路由树(带 children),createUserStore 经此算权限树;
|
|
413
|
+
* `getUserInfoInitFn` 为 createUserStore 用户信息空保底注入面(core 对 UserInfo 不透明,
|
|
414
|
+
* 业务 shape 不下沉,规则 8)。`userInfoAccess` 为 token / refreshToken / permission
|
|
415
|
+
* 三字段的业务注入访问器(第一宪法:core 经纯函数 get/set 读写,零字面字段名耦合,
|
|
416
|
+
* 业务 UserInfo shape 完全自由)。
|
|
417
|
+
*/
|
|
166
418
|
export interface CoreBridgeInitOptions<UserInfo = unknown> {
|
|
419
|
+
/** 应用基础信息(store/app 仅取 name) */
|
|
167
420
|
APP_BASE_INFO: AppBaseInfo;
|
|
421
|
+
/** 应用环境信息(mode / isProd / isDev,env 派生) */
|
|
168
422
|
APP_ENV_INFO: AppEnvInfo;
|
|
423
|
+
/** 应用缓存配置(bridge 内部 storage / useState 派生 namespace) */
|
|
169
424
|
APP_CACHE_CONFIG: AppCacheConfig;
|
|
425
|
+
/** 应用布局-header 配置 */
|
|
170
426
|
APP_LAYOUT_HEADER_CONFIG: AppLayoutHeaderConfig;
|
|
427
|
+
/** 应用布局-footer 配置 */
|
|
171
428
|
APP_LAYOUT_FOOTER_CONFIG: AppLayoutFooterConfig;
|
|
429
|
+
/** 应用布局-sidebar 配置 */
|
|
172
430
|
APP_LAYOUT_SIDEBAR_CONFIG: AppLayoutSidebarConfig;
|
|
431
|
+
/**
|
|
432
|
+
* 应用布局-aside 右侧补充区配置(P1' 新增 additive,可选;app 不传时核内默认 width 0)。
|
|
433
|
+
* 默认 shell 也渲染 AppAside(宽 0 不可见);app/preset 加宽即启用,经典布局零影响。
|
|
434
|
+
*/
|
|
173
435
|
APP_LAYOUT_ASIDE_CONFIG?: Partial<AppLayoutAsideConfig>;
|
|
436
|
+
/** 应用布局-面包屑配置(#2.5 期新增字段) */
|
|
174
437
|
APP_LAYOUT_BREADCRUMB_CONFIG: AppLayoutBreadcrumbConfig;
|
|
438
|
+
/** 应用布局-页面主体配置 */
|
|
175
439
|
APP_LAYOUT_BODY_CONFIG: AppLayoutBodyConfig;
|
|
440
|
+
/**
|
|
441
|
+
* 应用布局-视口边框配置(可选;app 整体不传时核内默认四边 0 = 不套框,现状不变)。
|
|
442
|
+
* 传部分字段时与默认四边 0 浅合并(见 createCoreBridge 内 DEFAULT 合并)。
|
|
443
|
+
*/
|
|
176
444
|
APP_LAYOUT_VIEWPORT_CONFIG?: Partial<AppLayoutViewportConfig>;
|
|
445
|
+
/**
|
|
446
|
+
* 应用布局-模块间距配置(可选;app 不传时核内默认 `{ size: 0 }` = 模块贴合、现状不变)。
|
|
447
|
+
* 布局插件经 preset.layout.gap 或 `bridge.update` 设值。
|
|
448
|
+
*/
|
|
177
449
|
APP_LAYOUT_GAP_CONFIG?: Partial<AppLayoutGapConfig>;
|
|
450
|
+
/** 应用路由元信息默认配置(bridge 内部 generateRouteMetaRawTree 派生) */
|
|
178
451
|
APP_ROUTER_META_DEFAULT_CONFIG: AppRouterMetaDefaultConfig;
|
|
452
|
+
/** 应用路由配置(#2.5 期新增字段) */
|
|
179
453
|
APP_ROUTER_CONFIG: AppRouterConfig;
|
|
454
|
+
/** 应用路由路径配置(#7.3 期新增字段;8 path 聚合供 layout 族通过 bridge 取业务路径) */
|
|
180
455
|
APP_ROUTER_PATHS_CONFIG: AppRouterPathsConfig;
|
|
456
|
+
/** 应用主题配置(light / dark 双主题) */
|
|
181
457
|
APP_THEME_CONFIG: AppThemeConfig;
|
|
458
|
+
/**
|
|
459
|
+
* 明暗模式默认值(**仅无缓存时生效**,可选);缺省 `"light"`。
|
|
460
|
+
*
|
|
461
|
+
* 读持久化命中 themeMode → 缓存优先;无缓存才回落本值。设 `"dark"` =「首次进入默认暗色」、
|
|
462
|
+
* `"system"` =「默认跟随系统」。透传给 theme cache hook 的 `defaultMode`。
|
|
463
|
+
*/
|
|
182
464
|
defaultThemeMode?: CoreThemeMode;
|
|
465
|
+
/**
|
|
466
|
+
* 是否显示内置「风格切换下拉」(AppTheme 的 ElSelect);缺省 `true`。
|
|
467
|
+
*
|
|
468
|
+
* false 时仅隐藏风格下拉,**亮/暗/跟随系统三态切换恒显、不受此控**。风格下拉本就
|
|
469
|
+
* 仅在注册多风格(list.length>1)时出现,此开关用于「多风格已注册但不想让用户切风格」。
|
|
470
|
+
* 经 `bridge.showThemeStyleSwitcher` readonly 暴露,AppTheme 直读 `v-if` 自控。
|
|
471
|
+
*/
|
|
183
472
|
showThemeStyleSwitcher?: boolean;
|
|
473
|
+
/** app 嵌套路由树(必传,#4e additive;createUserStore 权限树依赖 children 嵌套,[MUST NOT] 传扁平化数据) */
|
|
184
474
|
routes: RouteRecordRaw[];
|
|
475
|
+
/** 用户信息空保底工厂(v3 终锁 Δ0b;恒返非空业务字段默认值对象,createUserStore useState 经此取初值,core 不锁业务 shape) */
|
|
185
476
|
getUserInfoInitFn: () => UserInfo;
|
|
477
|
+
/** 用户信息字段访问器集(第一宪法:core 经业务注入 get/set 读写 token/refreshToken/permission,零字段名耦合,业务 shape 自由) */
|
|
186
478
|
userInfoAccess: UserInfoAccess<UserInfo>;
|
|
187
479
|
}
|
|
480
|
+
/**
|
|
481
|
+
* 认证桥接实例类型。
|
|
482
|
+
*
|
|
483
|
+
* 调用侧 4 auth 方法签名与原 app `@/config` facade 完全一致。
|
|
484
|
+
* 工厂 `createCoreBridge(options)` 接收 init 参数,内部立即初始化,
|
|
485
|
+
* 返回即用的实例——消除 create-then-init 两步时序耦合。
|
|
486
|
+
*/
|
|
188
487
|
export interface CoreBridge<UserInfo = unknown, LoginParams = unknown> {
|
|
488
|
+
/** 注册 auth fn + 业务 api(增量合并,多次调用就近增量,后注册覆盖前注册) */
|
|
189
489
|
register: (options: CoreBridgeRegisterOptions<UserInfo, LoginParams>) => void;
|
|
490
|
+
/** 取 token(v3 终锁 BR-1 ③ 终裁零参;现有无参调用 `bridge.getToken()` 继续合法,泛型 `<UserInfo>` 纯透传不沾本签名) */
|
|
190
491
|
getToken: () => string | undefined;
|
|
492
|
+
/** 跳转登录 */
|
|
191
493
|
goToLogin: () => void;
|
|
494
|
+
/** 刷新 token */
|
|
192
495
|
refreshToken: () => Promise<void>;
|
|
496
|
+
/** 刷新鉴权 */
|
|
193
497
|
refreshAuth: () => Promise<void>;
|
|
498
|
+
/** 返回 bridge 内部派生的 storage 实例(per REQ-1 入参内化;保持 StorageLike 可变方法可调用) */
|
|
194
499
|
getStorage: () => StorageLike;
|
|
500
|
+
/** 返回 `init` 注册的 routes 引用(routes 例外保持可变,破循环依赖时序,per REQ-4 + audit §3.4) */
|
|
195
501
|
getRoutes: () => RouteRecordRaw[];
|
|
502
|
+
/** 返回 `init` 注册的 getUserInfoInitFn 引用(v3 终锁 Δ0d,镜像 getRoutes 范式) */
|
|
196
503
|
getUserInfoInitFn: () => () => UserInfo;
|
|
504
|
+
/** bridge 内部派生 useState 实例方法(per REQ-2;ns 已绑定,调用方零 ns 参;cacheKey 形如 `${ns}/useState/${moduleKey}`) */
|
|
197
505
|
useState: ReturnType<typeof createUseState>;
|
|
506
|
+
/** bridge 内部派生 generateRouteMetaRawTree 实例方法(per REQ-3;metaDefault 已绑定 APP_ROUTER_META_DEFAULT_CONFIG,调用方零 metaDefault 参) */
|
|
198
507
|
generateRouteMetaRawTree: ReturnType<typeof createGenerateRouteMetaRawTree>;
|
|
508
|
+
/** 登录 api(createUserStore login 内调;#2.7 期 axios `{data}` wrapper 业务层 wrap 剥离;未注册被调 reject 原生 Error) */
|
|
199
509
|
loginApi: (params: LoginParams) => Promise<Partial<UserInfo>>;
|
|
510
|
+
/** 退出登录 api(createUserStore logout 内调;未注册被调 reject 原生 Error) */
|
|
200
511
|
logoutApi: () => Promise<unknown>;
|
|
512
|
+
/** 取用户信息 api(createUserStore getInfo 内调;#2.7 期 axios `{data}` wrapper 业务层 wrap 剥离;连壳 {user_info} 见 design D2 由业务层决定;未注册被调 reject 原生 Error) */
|
|
201
513
|
getUserInfoApi: () => Promise<Partial<UserInfo>>;
|
|
514
|
+
/** 刷新 token api(createUserStore refreshTokenFn 内调;#C 期签名最简化:core 直传 refreshToken string,业务 wrap 内自打包业务 shape;未注册被调 reject 原生 Error) */
|
|
202
515
|
refreshTokenApi: (refreshToken: string) => Promise<string>;
|
|
516
|
+
/** 应用基础信息(per #2.5 期 REQ-1 直接挂载形态) */
|
|
203
517
|
readonly APP_BASE_INFO: DeepReadonly<AppBaseInfo>;
|
|
518
|
+
/** 应用环境信息(per #2.5 期 REQ-1) */
|
|
204
519
|
readonly APP_ENV_INFO: AppEnvInfo;
|
|
520
|
+
/** 应用缓存配置(per #2.5 期 REQ-1) */
|
|
205
521
|
readonly APP_CACHE_CONFIG: AppCacheConfig;
|
|
522
|
+
/** 应用布局-header 配置(per #2.5 期 REQ-1) */
|
|
206
523
|
readonly APP_LAYOUT_HEADER_CONFIG: DeepReadonly<AppLayoutHeaderConfig>;
|
|
524
|
+
/** 应用布局-footer 配置(per #2.5 期 REQ-1) */
|
|
207
525
|
readonly APP_LAYOUT_FOOTER_CONFIG: DeepReadonly<AppLayoutFooterConfig>;
|
|
526
|
+
/** 应用布局-sidebar 配置(per #2.5 期 REQ-1) */
|
|
208
527
|
readonly APP_LAYOUT_SIDEBAR_CONFIG: DeepReadonly<AppLayoutSidebarConfig>;
|
|
528
|
+
/** 应用布局-aside 右侧补充区配置(P1' additive,响应式只读视图) */
|
|
209
529
|
readonly APP_LAYOUT_ASIDE_CONFIG: DeepReadonly<AppLayoutAsideConfig>;
|
|
530
|
+
/** 应用布局-面包屑配置(per #2.5 期 REQ-1) */
|
|
210
531
|
readonly APP_LAYOUT_BREADCRUMB_CONFIG: DeepReadonly<AppLayoutBreadcrumbConfig>;
|
|
532
|
+
/** 应用布局-页面主体配置(per #2.5 期 REQ-1) */
|
|
211
533
|
readonly APP_LAYOUT_BODY_CONFIG: DeepReadonly<AppLayoutBodyConfig>;
|
|
534
|
+
/** 应用布局-视口边框配置(响应式只读视图,经 bridge.update 跟随) */
|
|
212
535
|
readonly APP_LAYOUT_VIEWPORT_CONFIG: DeepReadonly<AppLayoutViewportConfig>;
|
|
536
|
+
/** 应用布局-模块间距配置(内缝 gap;响应式只读视图,经 bridge.update 跟随) */
|
|
213
537
|
readonly APP_LAYOUT_GAP_CONFIG: DeepReadonly<AppLayoutGapConfig>;
|
|
538
|
+
/** 应用布局聚合配置(per #2.5 期 ADR-3 bridge 内部聚合派生) */
|
|
214
539
|
readonly APP_LAYOUT_CONFIG: DeepReadonly<AppLayoutConfig>;
|
|
540
|
+
/** 应用路由元信息默认配置(per #2.5 期 REQ-1) */
|
|
215
541
|
readonly APP_ROUTER_META_DEFAULT_CONFIG: AppRouterMetaDefaultConfig;
|
|
542
|
+
/** 应用路由配置(per #2.5 期 REQ-1) */
|
|
216
543
|
readonly APP_ROUTER_CONFIG: AppRouterConfig;
|
|
544
|
+
/** 应用路由路径配置(per #7.3 期;8 path 聚合 readonly 挂载) */
|
|
217
545
|
readonly APP_ROUTER_PATHS_CONFIG: AppRouterPathsConfig;
|
|
546
|
+
/** 应用主题配置(per #2.5 期 REQ-1) */
|
|
218
547
|
readonly APP_THEME_CONFIG: DeepReadonly<AppThemeConfig>;
|
|
548
|
+
/**
|
|
549
|
+
* 主题模块(架构反转:core/bridge 主导主题切换)。
|
|
550
|
+
*
|
|
551
|
+
* `theme.{add,remove,setStyle,setDark,list,labelOf}`——风格 map 注册/注销 + 切换 + 展示名。
|
|
552
|
+
* 插件 install 经 `bridge.theme.add(name, preset)` 注册风格(preset = {config,label?});切换真相在
|
|
553
|
+
* bridge,appStore / AppTheme.vue 转发 `setStyle` / `setDark`([MUST NOT] bridge 反向监测 store)。
|
|
554
|
+
*/
|
|
219
555
|
readonly theme: CoreThemeModule;
|
|
556
|
+
/** 当前风格名(响应式只读真相源;[MUST NOT] 解构/快照取值,⚠️ 切换后定格) */
|
|
220
557
|
readonly themeStyle: DeepReadonly<Ref<string>>;
|
|
558
|
+
/** 明暗模式三态真相源(响应式只读;亮/暗/跟随系统)。`theme.setMode` 切换;themeIsDark 由本 mode 派生。 */
|
|
221
559
|
readonly themeMode: DeepReadonly<Ref<CoreThemeMode>>;
|
|
560
|
+
/** 是否暗色(响应式只读 **派生**;= mode==='system'?系统偏暗:mode==='dark'。appStore.isDarkTheme / 挂值 composable 读此) */
|
|
222
561
|
readonly themeIsDark: DeepReadonly<Ref<boolean>>;
|
|
562
|
+
/**
|
|
563
|
+
* 当前 preset 的 layout 运行时维度(响应式只读真相源)。
|
|
564
|
+
*
|
|
565
|
+
* = `{ shell?, extractLevel1ToHeader }`——AppLayout 直读:`shell` 缺省回退内置默认
|
|
566
|
+
* AppShell(经典布局);`extractLevel1ToHeader` 驱动菜单分流。尺寸 / 套框纯数据维度
|
|
567
|
+
* 经 `theme.setStyle` 灌进 bridge 响应式布局 config(基线复位 + 叠加),不在此重复。
|
|
568
|
+
* [MUST NOT] 解构/快照(⚠️ 切换 preset 后定格)。
|
|
569
|
+
*/
|
|
223
570
|
readonly themeLayout: DeepReadonly<Ref<BridgeThemeLayoutState>>;
|
|
571
|
+
/**
|
|
572
|
+
* 当前密度档 / 动效档(响应式只读真相源;明暗无关)。
|
|
573
|
+
* `useCoreThemeApply` watch 此重写节奏 `<style>`;`theme.setStyle` 按 preset 复位、
|
|
574
|
+
* `theme.setDensity`/`setMotion` 直接改。[MUST NOT] 解构/快照。
|
|
575
|
+
*/
|
|
224
576
|
readonly themeDensity: DeepReadonly<Ref<CoreThemeDensity>>;
|
|
225
577
|
readonly themeMotion: DeepReadonly<Ref<CoreThemeMotion>>;
|
|
578
|
+
/**
|
|
579
|
+
* 当前生效的 JS 主题色(输出 B:JS 色值直给,与挂值 composable 的 cssvar 输出 A 对称)。
|
|
580
|
+
*
|
|
581
|
+
* = `themeIsDark ? APP_THEME_CONFIG.dark : APP_THEME_CONFIG.light`——明暗 + 风格的
|
|
582
|
+
* 选择逻辑落在 bridge 这个真相源(store **不再自选**,仅 `appStore.theme` 转发本字段)。
|
|
583
|
+
* 给「需对颜色做运算、吃不了 CSS var」的消费方直读真实色值
|
|
584
|
+
* (MenuTree → ElMenu hover 派生 TinyColor parse / 任意 JS 内联样式)。
|
|
585
|
+
* 纯 CSS 消费方走挂值 composable 写的 `--dc-core-*` cascade(输出 A)。
|
|
586
|
+
* [MUST NOT] 解构/快照(⚠️ 切换风格/明暗后定格)。
|
|
587
|
+
*/
|
|
226
588
|
readonly themeColors: DeepReadonly<Ref<AppThemeColor>>;
|
|
589
|
+
/** 是否显示内置「风格切换下拉」(AppTheme ElSelect);init 静态值,缺省 true。亮暗切换恒显、不受此控。 */
|
|
227
590
|
readonly showThemeStyleSwitcher: boolean;
|
|
591
|
+
/**
|
|
592
|
+
* 布局折叠模块(折叠真相源在 bridge)。
|
|
593
|
+
*
|
|
594
|
+
* `layout.{sidebarCollapsed,asideCollapsed}` 响应式只读折叠态 + `setSidebarCollapse /
|
|
595
|
+
* toggleSidebar / setAsideCollapse / toggleAside` 切换方法。appStore 转发
|
|
596
|
+
* (`sidebarIsCollapse` 读 `sidebarCollapsed`、`changeSidebarCollapseStatus` →
|
|
597
|
+
* `setSidebarCollapse`),AppSidebar / AppAside 经 store 驱动;折叠态持久化随写。
|
|
598
|
+
* [MUST NOT] 解构/快照折叠态(⚠️ 切换后定格)。
|
|
599
|
+
*/
|
|
228
600
|
readonly layout: CoreLayoutModule;
|
|
601
|
+
/** 用户信息字段访问器集(业务注入;createUserStore 经 bridge.userInfoAccess.<字段>.get/set 读写,第一宪法 core 零字段耦合) */
|
|
229
602
|
readonly userInfoAccess: UserInfoAccess<UserInfo>;
|
|
603
|
+
/**
|
|
604
|
+
* 更新本期 7 个响应式配置字段(插件系统一期,REQ-1)。
|
|
605
|
+
*
|
|
606
|
+
* 两参单字段 + **一级浅合并**(`Object.assign` 把 partial 第一层属性覆盖到对应
|
|
607
|
+
* reactive 子配置,未传字段保留)。`theme` 的 `light`/`dark` 作为第一层属性整体
|
|
608
|
+
* 替换(`update("APP_THEME_CONFIG", {light: newLight})` 整体替换 `light`、保留
|
|
609
|
+
* `dark`)。[MUST NOT] 期望深合并——非 lodash merge / structuredClone 语义。
|
|
610
|
+
* update 后对应 `bridge.APP_XXX` readonly 视图自动跟随。
|
|
611
|
+
*/
|
|
230
612
|
update: <K extends UpdatableConfigKey>(key: K, partial: Partial<UpdatableConfigMap[K]>) => void;
|
|
613
|
+
/**
|
|
614
|
+
* 安装 bridge 插件。
|
|
615
|
+
*
|
|
616
|
+
* 插件状态按 bridge 实例隔离;同一插件引用或同名插件重复安装时会跳过。
|
|
617
|
+
* `app.use(bridge)` 只负责 Vue provide,完整插件扩展走本方法。
|
|
618
|
+
*/
|
|
231
619
|
use: <Options = unknown>(plugin: CoreBridgePluginLike<UserInfo, LoginParams, Options>, options?: Options) => CoreBridge<UserInfo, LoginParams>;
|
|
620
|
+
/**
|
|
621
|
+
* Vue 插件 install(插件系统一期,REQ-9)。
|
|
622
|
+
*
|
|
623
|
+
* `app.use(bridge)` 经 `app.provide(CORE_BRIDGE_KEY, bridge)` 全局注入整个 bridge
|
|
624
|
+
* 实例;业务子组件 `inject(CORE_BRIDGE_KEY)` 拿到整 bridge → 读只读响应式配置 +
|
|
625
|
+
* 调 `bridge.update`。**opt-in**:不 `app.use(bridge)` 则 inject 返回 undefined。
|
|
626
|
+
* 区别于组件级 `APP_LAYOUT_BRIDGE_KEY`(layout 域窄切片)——本通道是 app 级全局整实例。
|
|
627
|
+
*/
|
|
232
628
|
install: (app: App) => App;
|
|
233
629
|
}
|
|
630
|
+
/**
|
|
631
|
+
* 认证桥接无状态纯工厂:接收 init 参数,内部立即初始化,返回可直接使用的
|
|
632
|
+
* `CoreBridge` 实例。实例状态(appConfig / storage / routes / fn 引用)仅存在于
|
|
633
|
+
* 本次调用的闭包内,工厂自身零状态。
|
|
634
|
+
*
|
|
635
|
+
* @example
|
|
636
|
+
* const appBridge = createCoreBridge<LoginAccountInfo, AccountLoginParams>({
|
|
637
|
+
* APP_BASE_INFO, APP_ENV_INFO, APP_CACHE_CONFIG,
|
|
638
|
+
* APP_LAYOUT_HEADER_CONFIG, APP_LAYOUT_FOOTER_CONFIG, APP_LAYOUT_SIDEBAR_CONFIG,
|
|
639
|
+
* APP_LAYOUT_BREADCRUMB_CONFIG, APP_LAYOUT_BODY_CONFIG,
|
|
640
|
+
* APP_ROUTER_META_DEFAULT_CONFIG, APP_ROUTER_CONFIG, APP_THEME_CONFIG,
|
|
641
|
+
* routes,
|
|
642
|
+
* getUserInfoInitFn: getUserInfoInit,
|
|
643
|
+
* });
|
|
644
|
+
*/
|
|
234
645
|
export declare function createCoreBridge<UserInfo = unknown, LoginParams = unknown>(options: CoreBridgeInitOptions<UserInfo>): CoreBridge<UserInfo, LoginParams>;
|