@lytjs/plugin-theme 6.9.2 → 6.9.3
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/index.d.cts +44 -0
- package/dist/index.d.ts +44 -0
- package/package.json +4 -4
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as _lytjs_core from '@lytjs/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @lytjs/plugin-theme - 类型定义
|
|
5
|
+
*/
|
|
6
|
+
interface Theme {
|
|
7
|
+
/** 主题名称 */
|
|
8
|
+
name: string;
|
|
9
|
+
/** 主题变量 */
|
|
10
|
+
variables: Record<string, string>;
|
|
11
|
+
/** 是否为深色主题 */
|
|
12
|
+
isDark?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface ThemeOptions {
|
|
15
|
+
/** 默认主题 */
|
|
16
|
+
defaultTheme?: string;
|
|
17
|
+
/** 主题列表 */
|
|
18
|
+
themes?: Theme[];
|
|
19
|
+
/** 是否启用系统主题检测 */
|
|
20
|
+
enableSystemTheme?: boolean;
|
|
21
|
+
/** 本地存储 key */
|
|
22
|
+
storageKey?: string;
|
|
23
|
+
/** CSS 变量前缀 */
|
|
24
|
+
variablePrefix?: string;
|
|
25
|
+
}
|
|
26
|
+
interface ThemeInstance {
|
|
27
|
+
/** 当前主题 */
|
|
28
|
+
currentTheme: string;
|
|
29
|
+
/** 可用主题列表 */
|
|
30
|
+
availableThemes: string[];
|
|
31
|
+
/** 设置主题 */
|
|
32
|
+
setTheme: (name: string) => void;
|
|
33
|
+
/** 切换到下一个主题 */
|
|
34
|
+
toggleTheme: () => void;
|
|
35
|
+
/** 注册新主题 */
|
|
36
|
+
registerTheme: (theme: Theme) => void;
|
|
37
|
+
/** 获取主题变量 */
|
|
38
|
+
getThemeVariables: (name?: string) => Record<string, string>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare function createThemeManager(options?: ThemeOptions): ThemeInstance;
|
|
42
|
+
declare const pluginTheme: _lytjs_core.PluginDefinition<unknown>;
|
|
43
|
+
|
|
44
|
+
export { type Theme, type ThemeInstance, type ThemeOptions, createThemeManager, pluginTheme as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as _lytjs_core from '@lytjs/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @lytjs/plugin-theme - 类型定义
|
|
5
|
+
*/
|
|
6
|
+
interface Theme {
|
|
7
|
+
/** 主题名称 */
|
|
8
|
+
name: string;
|
|
9
|
+
/** 主题变量 */
|
|
10
|
+
variables: Record<string, string>;
|
|
11
|
+
/** 是否为深色主题 */
|
|
12
|
+
isDark?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface ThemeOptions {
|
|
15
|
+
/** 默认主题 */
|
|
16
|
+
defaultTheme?: string;
|
|
17
|
+
/** 主题列表 */
|
|
18
|
+
themes?: Theme[];
|
|
19
|
+
/** 是否启用系统主题检测 */
|
|
20
|
+
enableSystemTheme?: boolean;
|
|
21
|
+
/** 本地存储 key */
|
|
22
|
+
storageKey?: string;
|
|
23
|
+
/** CSS 变量前缀 */
|
|
24
|
+
variablePrefix?: string;
|
|
25
|
+
}
|
|
26
|
+
interface ThemeInstance {
|
|
27
|
+
/** 当前主题 */
|
|
28
|
+
currentTheme: string;
|
|
29
|
+
/** 可用主题列表 */
|
|
30
|
+
availableThemes: string[];
|
|
31
|
+
/** 设置主题 */
|
|
32
|
+
setTheme: (name: string) => void;
|
|
33
|
+
/** 切换到下一个主题 */
|
|
34
|
+
toggleTheme: () => void;
|
|
35
|
+
/** 注册新主题 */
|
|
36
|
+
registerTheme: (theme: Theme) => void;
|
|
37
|
+
/** 获取主题变量 */
|
|
38
|
+
getThemeVariables: (name?: string) => Record<string, string>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare function createThemeManager(options?: ThemeOptions): ThemeInstance;
|
|
42
|
+
declare const pluginTheme: _lytjs_core.PluginDefinition<unknown>;
|
|
43
|
+
|
|
44
|
+
export { type Theme, type ThemeInstance, type ThemeOptions, createThemeManager, pluginTheme as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lytjs/plugin-theme",
|
|
3
|
-
"version": "6.9.
|
|
3
|
+
"version": "6.9.3",
|
|
4
4
|
"description": "LytJS official theme plugin for CSS variable management, dark/light mode, and custom theme support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"clean": "rm -rf dist"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@lytjs/core": "
|
|
33
|
-
"@lytjs/reactivity": "
|
|
34
|
-
"@lytjs/common-is": "
|
|
32
|
+
"@lytjs/core": "^6.9.3",
|
|
33
|
+
"@lytjs/reactivity": "^6.9.3",
|
|
34
|
+
"@lytjs/common-is": "^6.9.3"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"tsup": "^8.0.0",
|