wui-components-v2 1.0.7 → 1.0.9

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