wui-components-v2 1.0.7 → 1.0.8

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.
Files changed (2) hide show
  1. package/index.d.ts +46 -13
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import type { App } from 'vue'
2
+ import type { ConfigProviderThemeVars } from 'wot-design-uni'
2
3
 
3
- // SystemSettings 组件声明类型
4
- interface ComponentWithInstall {
4
+ // SystemSettings 组件类型
5
+ interface ComponentWithInstall extends Record<string, any> {
5
6
  name: string
6
7
  install?: (app: App) => void
7
8
  }
8
9
 
9
- // 声明 SystemSettings 组件的类型
10
+ // 声明 SystemSettings 组件
10
11
  declare const SystemSettings: ComponentWithInstall
11
12
 
12
13
  // 组件列表类型
@@ -18,27 +19,59 @@ declare const coms: ComponentWithInstall[]
18
19
  */
19
20
  declare function install(app: App): void
20
21
 
21
- // 核心功能函数类型声明
22
- interface CoreFunctions {
23
- useLocale: typeof useLocale
24
- useManualTheme: typeof useManualTheme
22
+ // 主题相关类型
23
+ interface ThemeColorOption {
24
+ name: string
25
+ value: string
26
+ primary: string
27
+ }
28
+
29
+ interface LocaleOption {
30
+ name: string
31
+ value: string
25
32
  }
26
33
 
34
+ type ThemeMode = 'light' | 'dark'
35
+
27
36
  interface UseLocaleReturn {
28
- // 根据实际返回值类型进行调整
29
- locale: any
30
- setLocale: (locale: string) => void
37
+ locale: Readonly<LocaleOption>
38
+ changeSystemLocale: () => void
31
39
  }
32
40
 
33
41
  interface UseManualThemeReturn {
34
- // 根据实际返回值类型进行调整
35
- theme: any
36
- setTheme: (theme: string) => void
42
+ theme: Readonly<ThemeMode>
43
+ primary: import('vue').ComputedRef<string>
44
+ isDark: import('vue').ComputedRef<boolean>
45
+ followSystem: import('vue').ComputedRef<boolean>
46
+ hasUserSet: import('vue').ComputedRef<boolean>
47
+ currentThemeColor: import('vue').ComputedRef<ThemeColorOption>
48
+ currentLocale: import('vue').ComputedRef<LocaleOption>
49
+ themeVars: import('vue').ComputedRef<ConfigProviderThemeVars>
50
+ showThemeColorSheet: import('vue').Ref<boolean>
51
+ showLanguageSheet: import('vue').Ref<boolean>
52
+ themeColorOptions: ThemeColorOption[]
53
+ LocaleOptions: LocaleOption[]
54
+ initTheme: () => void
55
+ toggleTheme: (mode?: ThemeMode) => void
56
+ setFollowSystem: (follow: boolean) => void
57
+ openThemeColorPicker: () => void
58
+ closeThemeColorPicker: () => void
59
+ selectThemeColor: (option: ThemeColorOption) => void
60
+ openLanguagePicker: () => void
61
+ closeLanguagePicker: () => void
62
+ selectLanguage: (option: LocaleOption) => void
37
63
  }
38
64
 
65
+ // 组合式API函数
39
66
  declare function useLocale(): UseLocaleReturn
40
67
  declare function useManualTheme(): UseManualThemeReturn
41
68
 
69
+ // 核心功能函数集合类型
70
+ interface CoreFunctions {
71
+ useLocale: typeof useLocale
72
+ useManualTheme: typeof useManualTheme
73
+ }
74
+
42
75
  // 导出核心功能函数集合
43
76
  export declare const coreFunctions: CoreFunctions
44
77
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",