@pubinfo/core 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AppSetting-Dzj6YBgW.js → AppSetting-CmT5_15W.js} +15 -15
- package/dist/{HCheckList.vue_vue_type_script_setup_true_lang-OWv01eXk.js → HCheckList.vue_vue_type_script_setup_true_lang-CHzkJth7.js} +1 -1
- package/dist/{HToggle-BnESuuPG.js → HToggle-DpDYLh8y.js} +1 -1
- package/dist/HeaderThinMenu-D6jF8yl1.js +4 -0
- package/dist/{PreferencesContent-DBKQJ8Ob.js → PreferencesContent-AXqWatOF.js} +4 -4
- package/dist/{SettingBreadcrumb-DmP1nJLZ.js → SettingBreadcrumb-CBWdS_nO.js} +3 -3
- package/dist/{SettingCopyright-C8_F7BB2.js → SettingCopyright-D5Jhdu1J.js} +2 -2
- package/dist/{SettingEnableTransition-BeJMq6ny.js → SettingEnableTransition-DQJozSZH.js} +2 -2
- package/dist/{SettingHome-yGmbxzJm.js → SettingHome-DAwn9Ypx.js} +2 -2
- package/dist/{SettingMenu-yWnqZqmz.js → SettingMenu-DEQRAtWl.js} +3 -3
- package/dist/{SettingMode-B8fgUhvi.js → SettingMode-bh3I8UBZ.js} +1 -1
- package/dist/{SettingNavSearch--yQEXqEL.js → SettingNavSearch-iYc-eRzY.js} +2 -2
- package/dist/{SettingOther-CSs1_D9L.js → SettingOther-C2TS6okv.js} +2 -2
- package/dist/{SettingPage-Pm7KblGG.js → SettingPage-B2_SNyn5.js} +2 -2
- package/dist/{SettingTabbar-DM5hdlQf.js → SettingTabbar-BETdKJxz.js} +3 -3
- package/dist/{SettingThemes-DqygGgDK.js → SettingThemes-ComNCP3P.js} +12 -11
- package/dist/{SettingToolbar-BP-yWiKo.js → SettingToolbar-D0DTBbbb.js} +2 -2
- package/dist/{SettingTopbar-Dd_SXy2e.js → SettingTopbar-BcO5Hcxm.js} +3 -3
- package/dist/{SettingWidthMode-DOtJg5uB.js → SettingWidthMode-wzTMq96A.js} +1 -1
- package/dist/built-in/pinia-plugin/plugins/persist.d.ts +2 -2
- package/dist/built-in/pinia-plugin/plugins/persistedstate/index.d.ts +3 -0
- package/dist/built-in/pinia-plugin/plugins/persistedstate/persistedstate.d.ts +15 -0
- package/dist/built-in/pinia-plugin/plugins/persistedstate/types.d.ts +150 -0
- package/dist/built-in/pinia-plugin/plugins/persistedstate/utils.d.ts +17 -0
- package/dist/core/ctx.d.ts +1 -0
- package/dist/core/interface.d.ts +26 -1
- package/dist/core/utils/index.d.ts +2 -0
- package/dist/features/composables/index.d.ts +1 -0
- package/dist/features/composables/partyLogin.d.ts +7 -1
- package/dist/{index-npW0xuOi.js → index-6W8u4oWQ.js} +1 -1
- package/dist/{index-igxVB1m3.js → index-B9i7R1pn.js} +2 -2
- package/dist/{index-C88VclMA.js → index-BXLF9xfN.js} +16300 -15834
- package/dist/{index-CnbD4YWA.js → index-C5X0cH7a.js} +3 -3
- package/dist/{index--xVOZLmn.js → index-CMSPnrUx.js} +1 -1
- package/dist/index-DSKHePRb.js +4 -0
- package/dist/{index-D8kKHmiD.js → index-FATjHAwl.js} +1 -1
- package/dist/{index-BSTB6EhQ.js → index-_VKoUSGo.js} +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -12
- package/dist/{pick-l2RrF3SE.js → pick-BvMRfqim.js} +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/package.json +9 -8
- package/src/built-in/pinia-plugin/index.ts +2 -2
- package/src/built-in/pinia-plugin/plugins/persist.ts +15 -4
- package/src/built-in/pinia-plugin/plugins/persistedstate/README.md +551 -0
- package/src/built-in/pinia-plugin/plugins/persistedstate/index.ts +3 -0
- package/src/built-in/pinia-plugin/plugins/persistedstate/persistedstate.ts +575 -0
- package/src/built-in/pinia-plugin/plugins/persistedstate/types.ts +162 -0
- package/src/built-in/pinia-plugin/plugins/persistedstate/utils.ts +46 -0
- package/src/core/ctx.ts +24 -1
- package/src/core/interface.ts +31 -1
- package/src/core/resolver/icon.ts +1 -1
- package/src/core/utils/index.ts +2 -0
- package/src/features/composables/index.ts +1 -0
- package/src/features/composables/partyLogin.ts +180 -38
- package/src/features/context/index.ts +1 -1
- package/src/index.ts +7 -5
- package/src/utils/index.ts +0 -1
- package/src/utils/proxy.ts +1 -1
- package/types/index.d.ts +1 -0
- package/types/pinia.d.ts +94 -0
- package/dist/HeaderThinMenu-Co2S6vIB.js +0 -4
- package/dist/index-GSKGoyv_.js +0 -4
- /package/dist/{utils → core/utils}/global.d.ts +0 -0
- /package/dist/core/{utils.d.ts → utils/utils.d.ts} +0 -0
- /package/src/{utils → core/utils}/global.ts +0 -0
- /package/src/core/{utils.ts → utils/utils.ts} +0 -0
package/types/pinia.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { StateTree } from 'pinia';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 持久化选项类型
|
|
5
|
+
*/
|
|
6
|
+
export type PersistenceOptions<State extends StateTree = StateTree> = Partial<{
|
|
7
|
+
/** 自定义存储键名 */
|
|
8
|
+
key: string
|
|
9
|
+
/** 存储实例 */
|
|
10
|
+
storage: {
|
|
11
|
+
getItem: (key: string) => string | null
|
|
12
|
+
setItem: (key: string, value: string) => void
|
|
13
|
+
}
|
|
14
|
+
/** 序列化器 */
|
|
15
|
+
serializer: {
|
|
16
|
+
serialize: (data: StateTree) => string
|
|
17
|
+
deserialize: (data: string) => StateTree
|
|
18
|
+
}
|
|
19
|
+
/** 是否开启调试模式 */
|
|
20
|
+
debug: boolean
|
|
21
|
+
/** 恢复数据前的钩子 */
|
|
22
|
+
beforeHydrate: (context: any) => void
|
|
23
|
+
/** 恢复数据后的钩子 */
|
|
24
|
+
afterHydrate: (context: any) => void
|
|
25
|
+
/** 要持久化的状态字段(白名单) */
|
|
26
|
+
pick: string[]
|
|
27
|
+
/** 不需要持久化的状态字段(黑名单) */
|
|
28
|
+
omit: string[]
|
|
29
|
+
/** 存储区域类型 */
|
|
30
|
+
storageArea: 'local' | 'session'
|
|
31
|
+
}>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 扩展 Pinia 的 Store 类型定义
|
|
35
|
+
*/
|
|
36
|
+
declare module 'pinia' {
|
|
37
|
+
/**
|
|
38
|
+
* 扩展 Store 实例,添加持久化相关方法
|
|
39
|
+
*/
|
|
40
|
+
export interface Store<Id extends string = string, S extends StateTree = StateTree, G = Record<string, unknown>, A = Record<string, unknown>> {
|
|
41
|
+
/**
|
|
42
|
+
* 手动持久化当前状态到存储
|
|
43
|
+
*/
|
|
44
|
+
$persist?: () => void
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 手动从存储恢复状态
|
|
48
|
+
* @param options - 恢复选项
|
|
49
|
+
*/
|
|
50
|
+
$hydrate?: (options?: { runHooks?: boolean }) => void
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 扩展 DefineStoreOptionsInPlugin,添加 persist 选项支持
|
|
55
|
+
* 适用于 Options API 风格和插件系统
|
|
56
|
+
*/
|
|
57
|
+
export interface DefineStoreOptionsInPlugin<Id extends string, S extends StateTree, G, A> {
|
|
58
|
+
/**
|
|
59
|
+
* 持久化配置
|
|
60
|
+
* - `true`: 启用默认持久化
|
|
61
|
+
* - `object`: 单个持久化配置
|
|
62
|
+
* - `array`: 多个持久化配置(可以将不同字段保存到不同存储)
|
|
63
|
+
*/
|
|
64
|
+
persist?: boolean | PersistenceOptions<S> | PersistenceOptions<S>[]
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 扩展 DefineSetupStoreOptions,添加 persist 选项支持
|
|
69
|
+
* 适用于 Setup 函数风格(defineStore 的第三个参数)
|
|
70
|
+
*/
|
|
71
|
+
export interface DefineSetupStoreOptions<Id extends string, S extends StateTree, G, A> {
|
|
72
|
+
/**
|
|
73
|
+
* 持久化配置
|
|
74
|
+
* - `true`: 启用默认持久化
|
|
75
|
+
* - `object`: 单个持久化配置
|
|
76
|
+
* - `array`: 多个持久化配置(可以将不同字段保存到不同存储)
|
|
77
|
+
*/
|
|
78
|
+
persist?: boolean | PersistenceOptions<S> | PersistenceOptions<S>[]
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 扩展 DefineStoreOptions,添加 persist 选项支持
|
|
83
|
+
* 适用于 Options API 风格(defineStore 的第二个参数)
|
|
84
|
+
*/
|
|
85
|
+
export interface DefineStoreOptions<Id extends string, S extends StateTree, G, A> {
|
|
86
|
+
/**
|
|
87
|
+
* 持久化配置
|
|
88
|
+
* - `true`: 启用默认持久化
|
|
89
|
+
* - `object`: 单个持久化配置
|
|
90
|
+
* - `array`: 多个持久化配置(可以将不同字段保存到不同存储)
|
|
91
|
+
*/
|
|
92
|
+
persist?: boolean | PersistenceOptions<S> | PersistenceOptions<S>[]
|
|
93
|
+
}
|
|
94
|
+
}
|
package/dist/index-GSKGoyv_.js
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|