valaxy 0.1.0 → 0.2.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.
Files changed (86) hide show
  1. package/bin/valaxy.js +1 -1
  2. package/dist/chunk-4LP5LOFC.js +86 -0
  3. package/dist/chunk-BDKTP6RW.js +1 -0
  4. package/dist/chunk-UVMBC7I3.mjs +1 -0
  5. package/dist/chunk-VLZSM7W4.mjs +86 -0
  6. package/dist/config-24b4f209.d.ts +188 -0
  7. package/dist/index.d.ts +316 -151
  8. package/dist/index.js +1 -1
  9. package/dist/index.mjs +1 -1
  10. package/dist/{cli.d.ts → node/cli.d.ts} +0 -0
  11. package/dist/node/cli.js +45 -0
  12. package/dist/node/cli.mjs +45 -0
  13. package/dist/node/index.d.ts +46 -0
  14. package/dist/node/index.js +1 -0
  15. package/dist/node/index.mjs +1 -0
  16. package/package.json +22 -18
  17. package/src/client/components/PostCard.vue +1 -1
  18. package/src/client/components/PostList.vue +5 -5
  19. package/src/client/components/ValaxyCopyright.vue +1 -1
  20. package/src/client/components/ValaxyFooter.vue +1 -1
  21. package/src/client/components/ValaxyOverlay.vue +4 -4
  22. package/src/client/components/ValaxyPagination.vue +16 -14
  23. package/src/client/components/ValaxyRightSidebar.vue +4 -4
  24. package/src/client/components/ValaxySidebar.vue +4 -8
  25. package/src/client/components/ValaxyToc.vue +11 -9
  26. package/src/client/composables/comments/index.ts +1 -0
  27. package/src/client/composables/comments/twikoo.ts +37 -0
  28. package/src/client/composables/comments/waline.ts +8 -5
  29. package/src/client/composables/common.ts +3 -4
  30. package/src/client/composables/search/algolia.ts +2 -1
  31. package/src/client/composables/sidebar.ts +2 -2
  32. package/src/client/composables/tag.ts +9 -2
  33. package/src/client/composables/widgets/backToTop.ts +10 -4
  34. package/src/client/main.ts +1 -8
  35. package/src/client/modules/valaxy.ts +36 -15
  36. package/src/client/shims.d.ts +5 -5
  37. package/src/client/styles/common/button.scss +3 -5
  38. package/src/client/styles/common/code.scss +157 -0
  39. package/src/client/styles/common/hamburger.scss +2 -2
  40. package/src/client/styles/common/markdown.scss +6 -5
  41. package/src/client/styles/common/sidebar.scss +3 -3
  42. package/src/client/styles/common/transition.scss +2 -2
  43. package/src/client/styles/css-vars.scss +39 -0
  44. package/src/client/styles/global/helper.scss +2 -2
  45. package/src/client/styles/global/index.scss +1 -1
  46. package/src/client/styles/global/nprogress.scss +1 -1
  47. package/src/client/styles/global/reset.scss +2 -1
  48. package/src/client/styles/index.scss +12 -1
  49. package/src/client/styles/mixins/config.scss +1 -1
  50. package/src/client/styles/mixins/index.scss +1 -0
  51. package/src/client/styles/palette.scss +6 -8
  52. package/src/client/styles/vars.scss +1 -13
  53. package/src/client/styles/widgets/banner.scss +2 -2
  54. package/src/client/utils/index.ts +0 -2
  55. package/src/node/build.ts +20 -1
  56. package/src/node/cli.ts +32 -19
  57. package/src/node/markdown/highlight.ts +50 -0
  58. package/src/node/markdown/highlightLines.ts +96 -0
  59. package/src/node/markdown/index.ts +22 -11
  60. package/src/node/markdown/markdown-it-katex.ts +20 -10
  61. package/src/node/markdown/parseHeader.ts +4 -2
  62. package/src/node/options.ts +3 -1
  63. package/src/node/plugins/index.ts +53 -24
  64. package/src/node/plugins/markdown.ts +1 -1
  65. package/src/node/plugins/preset.ts +46 -10
  66. package/src/node/plugins/unocss.ts +12 -7
  67. package/src/node/rss.ts +121 -0
  68. package/src/node/server.ts +1 -1
  69. package/src/node/shims.d.ts +15 -0
  70. package/src/node/utils/cli.ts +0 -1
  71. package/src/node/vite.ts +7 -15
  72. package/src/types/config.ts +27 -2
  73. package/tsup.config.ts +1 -0
  74. package/dist/build-CLF7GOPQ.mjs +0 -1
  75. package/dist/build-F47TGGER.js +0 -1
  76. package/dist/chunk-5S6S3FLN.mjs +0 -83
  77. package/dist/chunk-JORQSKHF.mjs +0 -1
  78. package/dist/chunk-TOMJSB6R.js +0 -83
  79. package/dist/chunk-VJNIZVTJ.js +0 -1
  80. package/dist/cli.js +0 -6
  81. package/dist/cli.mjs +0 -6
  82. package/src/client/pages/about/index.md +0 -5
  83. package/src/client/pages/posts/index.md +0 -5
  84. package/src/client/styles/css-vars/dark.scss +0 -17
  85. package/src/client/styles/css-vars/index.scss +0 -18
  86. package/src/client/styles/css-vars/light.scss +0 -9
@@ -0,0 +1,188 @@
1
+ import { PartialDeep } from 'type-fest';
2
+ import { VitePluginConfig } from 'unocss/vite';
3
+ import MarkdownIt from 'markdown-it';
4
+ import Anchor from 'markdown-it-anchor';
5
+ import { KatexOptions } from 'katex';
6
+ import Markdown from 'vite-plugin-md';
7
+
8
+ interface MarkdownOptions extends MarkdownIt.Options {
9
+ config?: (md: MarkdownIt) => void;
10
+ anchor?: {
11
+ permalink?: Anchor.AnchorOptions['permalink'];
12
+ };
13
+ toc?: any;
14
+ katex?: KatexOptions;
15
+ }
16
+
17
+ declare type ViteMdOptions = Parameters<typeof Markdown>[0];
18
+
19
+ declare type ValaxyThemeConfig = Record<string, any>;
20
+ interface SocialLink {
21
+ /**
22
+ * The title of your link
23
+ */
24
+ name: string;
25
+ link: string;
26
+ /**
27
+ * 图标名称
28
+ * https://icones.js.org/
29
+ */
30
+ icon: string;
31
+ color: string;
32
+ }
33
+ interface ValaxyConfig<T = ValaxyThemeConfig> {
34
+ /**
35
+ * Default language
36
+ * @description 默认语言
37
+ * @default 'en'
38
+ */
39
+ lang: string;
40
+ /**
41
+ * You site url in web, required for ssg & rss
42
+ * @description 站点的 URL,SSG & RSS 需要(譬如生成版权处文章永久链接)
43
+ */
44
+ url: string;
45
+ /**
46
+ * Site title
47
+ * @description 站点标题
48
+ */
49
+ title: string;
50
+ /**
51
+ * 副标题
52
+ */
53
+ subtitle: string;
54
+ /**
55
+ * 站点描述
56
+ */
57
+ description: string;
58
+ /**
59
+ * The owner of this blog
60
+ * @description 博客作者
61
+ */
62
+ author: {
63
+ /**
64
+ * Your name
65
+ * @description 你的名字
66
+ */
67
+ name: string;
68
+ email: string;
69
+ link: string;
70
+ avatar: string;
71
+ /**
72
+ * The status of you
73
+ * @description 状态
74
+ */
75
+ status: {
76
+ emoji: string;
77
+ /**
78
+ * show when hover emoji
79
+ * @description 当鼠标悬浮在图标上时显示
80
+ */
81
+ message: string;
82
+ };
83
+ };
84
+ feed: {
85
+ /**
86
+ * name: feed -> feed.xml / feed.atom / feed.json
87
+ * @default '' -> feed.xml / atom.xml / feed.json
88
+ */
89
+ name: string;
90
+ favicon: string;
91
+ };
92
+ /**
93
+ * 社交链接
94
+ */
95
+ social: SocialLink[];
96
+ /**
97
+ * search
98
+ */
99
+ search: {
100
+ algolia: {
101
+ enable: boolean;
102
+ appId: string;
103
+ apiKey: string;
104
+ indexName: string;
105
+ chunkSize: number;
106
+ };
107
+ };
108
+ /**
109
+ * comment: waline/...
110
+ */
111
+ comment: {
112
+ waline: {
113
+ enable: boolean;
114
+ serverURL: string;
115
+ };
116
+ twikoo: {
117
+ enable: boolean;
118
+ envId: string;
119
+ };
120
+ };
121
+ /**
122
+ * The name of theme
123
+ * @description 主题名称
124
+ */
125
+ theme: string;
126
+ /**
127
+ * The config of theme
128
+ * @description 主题配置
129
+ */
130
+ themeConfig: T;
131
+ /**
132
+ * Unocss Config
133
+ */
134
+ unocss: VitePluginConfig;
135
+ /**
136
+ * The license of your posts
137
+ * @description 文章所使用的协议,默认使用 Creative Commons
138
+ * @default https://creativecommons.org/licenses/
139
+ */
140
+ license: {
141
+ /**
142
+ * Whether to show at the bottom of the article
143
+ * @description 是否显示在文章底部
144
+ * @default true
145
+ */
146
+ enabled: boolean;
147
+ /**
148
+ * Creative License Language, same with your config.lang
149
+ * when lang === 'zh-CN', use 'zh'
150
+ * @description 默认与站点语言相同
151
+ * @default 'en'
152
+ */
153
+ language: string;
154
+ /**
155
+ * Type of license
156
+ * @description 证书类型
157
+ * @default 'by-nc-sa'
158
+ */
159
+ type: 'zero' | 'by-sa' | 'by-nd' | 'by-nc' | 'by-nc-sa' | 'by-nc-nd';
160
+ };
161
+ /**
162
+ * donate for author
163
+ * @description 打赏/赞助
164
+ */
165
+ sponsor: {
166
+ enable: boolean;
167
+ title: string;
168
+ methods: {
169
+ name: string;
170
+ url: string;
171
+ color: string;
172
+ icon: string;
173
+ }[];
174
+ };
175
+ /**
176
+ * for markdown
177
+ */
178
+ markdown: ViteMdOptions;
179
+ markdownIt: MarkdownOptions;
180
+ }
181
+ /**
182
+ * Valaxy User Config
183
+ * @description Valaxy 用户配置
184
+ */
185
+ declare type UserConfig<T = ValaxyThemeConfig> = PartialDeep<ValaxyConfig<T>>;
186
+ declare const defaultValaxyConfig: ValaxyConfig;
187
+
188
+ export { SocialLink as S, UserConfig as U, ValaxyConfig as V, ValaxyThemeConfig as a, defaultValaxyConfig as d };
package/dist/index.d.ts CHANGED
@@ -1,203 +1,368 @@
1
- import * as vite from 'vite';
2
- import { InlineConfig } from 'vite';
3
- import { VitePluginConfig } from 'unocss/vite';
4
- import MarkdownIt from 'markdown-it';
5
- import Anchor from 'markdown-it-anchor';
6
- import { KatexOptions } from 'katex';
7
- import Markdown from 'vite-plugin-md';
8
-
9
- interface MarkdownOptions extends MarkdownIt.Options {
10
- config?: (md: MarkdownIt) => void;
11
- anchor?: {
12
- permalink?: Anchor.AnchorOptions['permalink'];
13
- };
14
- toc?: any;
15
- katex?: KatexOptions;
16
- }
1
+ import * as vue from 'vue';
2
+ import { InjectionKey, ComputedRef, StyleValue, Ref } from 'vue';
3
+ import { V as ValaxyConfig, a as ValaxyThemeConfig } from './config-24b4f209.js';
4
+ export { S as SocialLink, U as UserConfig, V as ValaxyConfig, a as ValaxyThemeConfig, d as defaultValaxyConfig } from './config-24b4f209.js';
5
+ import 'type-fest';
6
+ import 'unocss/vite';
7
+ import 'markdown-it';
8
+ import 'markdown-it-anchor';
9
+ import 'katex';
10
+ import 'vite-plugin-md';
17
11
 
18
- declare type ViteMdOptions = Parameters<typeof Markdown>[0];
19
-
20
- declare type ValaxyThemeConfig = Record<string, any>;
21
- interface SocialLink {
12
+ interface Post {
22
13
  /**
23
- * The title of your link
14
+ * Path of post
15
+ * route.path
16
+ * @description 路径
24
17
  */
25
- name: string;
26
- link: string;
18
+ path?: string;
27
19
  /**
28
- * 图标名称
29
- * https://icones.js.org/
20
+ * Title
21
+ * @description 文章标题
30
22
  */
31
- icon: string;
32
- color: string;
33
- }
34
- interface ValaxyConfig<T = ValaxyThemeConfig> {
23
+ title?: string;
24
+ date?: string | number | Date;
35
25
  /**
36
- * Default language
37
- * @description 默认语言
38
- * @default 'en'
26
+ * Updated Time
39
27
  */
40
- lang: string;
28
+ updated?: string | number | Date;
29
+ lang?: string;
41
30
  /**
42
- * You site url in web, required for ssg, do not add / in end
43
- * @description 站点的 URL,SSG 需要(譬如生成版权处文章永久链接),不要在末尾添加 /
31
+ * TODO
32
+ * Read Time
33
+ * @description 阅读时长
44
34
  */
45
- url: string;
35
+ duration?: string;
46
36
  /**
47
- * Site title
48
- * @description 站点标题
37
+ * post card type, can be bilibili/yuque/...
49
38
  */
50
- title: string;
39
+ type?: string;
51
40
  /**
52
- * 副标题
41
+ * override url, and jump directly
53
42
  */
54
- subtitle: string;
43
+ url?: string;
55
44
  /**
56
- * 站点描述
45
+ * @description 摘要
57
46
  */
58
- description: string;
47
+ excerpt?: string;
59
48
  /**
60
- * The owner of this blog
61
- * @description 博客作者
49
+ * Display sponsor info
50
+ * @description 是否开启赞助
62
51
  */
63
- author: {
64
- /**
65
- * Your name
66
- * @description 你的名字
67
- */
68
- name: string;
69
- avatar: string;
70
- /**
71
- * The status of you
72
- * @description 状态
73
- */
74
- status: {
75
- emoji: string;
76
- /**
77
- * show when hover emoji
78
- * @description 当鼠标悬浮在图标上时显示
79
- */
80
- message: string;
81
- };
82
- };
52
+ sponsor?: boolean;
83
53
  /**
84
- * 社交链接
54
+ * Copyright
55
+ * @description 是否显示文章底部版权信息
85
56
  */
86
- social: SocialLink[];
57
+ copyright?: boolean;
87
58
  /**
88
- * search
59
+ * Category
60
+ * @description 分类,若为数组,则按顺序代表多层文件夹
89
61
  */
90
- search: {
91
- algolia: {
92
- enable: boolean;
93
- appId: string;
94
- apiKey: string;
95
- indexName: string;
96
- chunkSize: number;
97
- };
98
- };
62
+ categories?: string | string[];
99
63
  /**
100
- * comment: waline/...
64
+ * Tags
65
+ * @description 标签,可以有多个
101
66
  */
102
- comment: {
103
- waline: {
104
- enable: boolean;
105
- serverURL: string;
106
- };
107
- };
67
+ tags?: string[];
108
68
  /**
109
- * The name of theme
110
- * @description 主题名称
69
+ * display prev next
70
+ * @description 是否显示前一篇、后一篇导航
111
71
  */
112
- theme: string;
72
+ nav?: boolean;
113
73
  /**
114
- * The config of theme
115
- * @description 主题配置
74
+ * icon before title
116
75
  */
117
- themeConfig: T;
76
+ icon?: string;
118
77
  /**
119
- * Unocss Config
78
+ * title color
120
79
  */
121
- unocss: VitePluginConfig;
80
+ color?: string;
122
81
  /**
123
- * The license of your posts
124
- * @description 文章所使用的协议,默认使用 Creative Commons
125
- * @default https://creativecommons.org/licenses/
82
+ * display comment
126
83
  */
127
- license: {
128
- /**
129
- * Whether to show at the bottom of the article
130
- * @description 是否显示在文章底部
131
- * @default true
132
- */
133
- enabled: boolean;
84
+ comment?: boolean;
85
+ /**
86
+ * post is end
87
+ * @description 是否完结,将在末尾添加衬线字体 Q.E.D.
88
+ */
89
+ end?: boolean;
90
+ /**
91
+ * use aplayer
92
+ */
93
+ aplayer?: boolean;
94
+ /**
95
+ * use katex
96
+ */
97
+ katex?: boolean;
98
+ /**
99
+ * use codepen
100
+ */
101
+ codepen?: boolean;
102
+ /**
103
+ * 置顶
104
+ */
105
+ top?: number;
106
+ /**
107
+ * display toc
108
+ * @description 是否显示目录
109
+ */
110
+ toc?: boolean;
111
+ }
112
+
113
+ /**
114
+ * Theme Config
115
+ */
116
+ interface ThemeConfig {
117
+ colors: {
134
118
  /**
135
- * Creative License Language, same with your config.lang
136
- * when lang === 'zh-CN', use 'zh'
137
- * @description 默认与站点语言相同
138
- * @default 'en'
119
+ * primary color
120
+ * @default '#0078E7'
139
121
  */
140
- language: string;
122
+ primary: string;
123
+ };
124
+ /**
125
+ * 首页标语
126
+ */
127
+ banner: {
128
+ enable: boolean;
141
129
  /**
142
- * Type of license
143
- * @description 证书类型
144
- * @default 'by-nc-sa'
130
+ * 标题
145
131
  */
146
- type: 'zero' | 'by-sa' | 'by-nd' | 'by-nc' | 'by-nc-sa' | 'by-nc-nd';
132
+ title: string;
133
+ };
134
+ bg_image: {
135
+ enable: boolean;
136
+ url: string;
137
+ dark?: string;
138
+ opacity: number;
147
139
  };
148
140
  /**
149
- * donate for author
150
- * @description 打赏/赞助
141
+ * say something
142
+ * https://say.elpsy.cn
151
143
  */
152
- sponsor: {
144
+ say: {
153
145
  enable: boolean;
154
- title: string;
155
- methods: {
146
+ api: string;
147
+ hitokoto: {
148
+ enable: boolean;
149
+ api: string;
150
+ };
151
+ };
152
+ pages: {
153
+ name: string;
154
+ url: string;
155
+ icon: string;
156
+ color: string;
157
+ }[];
158
+ /**
159
+ * footer
160
+ */
161
+ footer: {
162
+ /**
163
+ * 建站于
164
+ */
165
+ since: number;
166
+ /**
167
+ * Icon between year and copyright info.
168
+ */
169
+ icon: {
170
+ /**
171
+ * icon name, i-xxx
172
+ */
156
173
  name: string;
157
- url: string;
174
+ animated: boolean;
158
175
  color: string;
159
- icon: string;
160
- }[];
176
+ url: string;
177
+ title: string;
178
+ };
179
+ /**
180
+ * Powered by valaxy & valaxy-theme-${name}, default is yun
181
+ */
182
+ powered: boolean;
183
+ /**
184
+ * Chinese Users | 中国用户
185
+ * 备案 ICP
186
+ * 国内用户需要在网站页脚展示备案 ICP 号
187
+ * https://beian.miit.gov.cn/
188
+ */
189
+ beian: {
190
+ enable: boolean;
191
+ /**
192
+ * 苏ICP备xxxxxxxx号
193
+ */
194
+ icp: string;
195
+ };
161
196
  };
162
197
  /**
163
- * for markdown
198
+ * post card types
164
199
  */
165
- markdown: ViteMdOptions;
166
- markdownIt: MarkdownOptions;
200
+ types: Record<string, {
201
+ color: string;
202
+ icon: string;
203
+ }>;
167
204
  }
168
205
 
169
- interface ResolvedValaxyOptions {
170
- /**
171
- * Client root path
172
- * @default 'valaxy/src/client'
173
- */
174
- clientRoot: string;
175
- /**
176
- * User root path
177
- * @default process.cwd()
178
- */
179
- userRoot: string;
180
- /**
181
- * Theme root path
182
- */
183
- themeRoot: string;
184
- /**
185
- * Theme name
186
- */
187
- theme: string;
206
+ declare const valaxyConfigSymbol: InjectionKey<ComputedRef<ValaxyConfig<ThemeConfig>>>;
207
+ declare const valaxyConfigRef: vue.ShallowRef<ValaxyConfig<ValaxyThemeConfig>>;
208
+ declare function initConfig(): ComputedRef<ValaxyConfig<ValaxyThemeConfig>>;
209
+ declare function useConfig(): ComputedRef<ValaxyConfig<ThemeConfig>>;
210
+ /**
211
+ * getThemeConfig
212
+ * @returns
213
+ */
214
+ declare function useThemeConfig(): ComputedRef<ThemeConfig>;
215
+
216
+ interface ParentCategory {
217
+ total: number;
218
+ children: Categories;
219
+ }
220
+ interface PostCategory {
221
+ total: number;
222
+ posts: Post[];
223
+ }
224
+ declare type Category = ParentCategory | PostCategory;
225
+ declare type Categories = Map<string, Category>;
226
+ /**
227
+ * get categories from posts
228
+ * @returns
229
+ */
230
+ declare function useCategory(): ParentCategory;
231
+
232
+ /**
233
+ * get post list
234
+ * todo: use vue provide/inject to global
235
+ * @param params
236
+ * @returns
237
+ */
238
+ declare function usePostList(params?: {
239
+ type?: string;
240
+ }): vue.ComputedRef<Post[]>;
241
+ /**
242
+ * get prev and next post
243
+ * @param path
244
+ * @returns
245
+ */
246
+ declare function usePrevNext(path?: string): vue.ComputedRef<Post | null>[];
247
+ /**
248
+ * get type card property
249
+ * todo: test reactive
250
+ */
251
+ declare function usePostProperty(type?: string): {
252
+ color: string;
253
+ icon: string;
254
+ styles: {};
255
+ } | {
256
+ color: string;
257
+ icon: string;
258
+ styles: vue.ComputedRef<StyleValue>;
259
+ };
260
+
261
+ declare type Tags = Map<string, {
262
+ count: number;
263
+ }>;
264
+ /**
265
+ * get utils about tags
266
+ */
267
+ declare function useTags(options?: {
188
268
  /**
189
- * Valaxy Config
269
+ * Primary Color
190
270
  */
191
- config: ValaxyConfig;
271
+ primary: string;
272
+ }): {
273
+ tags: Tags;
274
+ getTagStyle: (count: number) => {
275
+ '--yun-tag-color': string;
276
+ fontSize: string;
277
+ };
278
+ };
279
+ /**
280
+ * get tag map
281
+ * @returns
282
+ */
283
+ declare function useTag(): Tags;
284
+
285
+ declare function useFrontmatter(): vue.ComputedRef<Post>;
286
+ /**
287
+ * get full url
288
+ */
289
+ declare function useFullUrl(): vue.ComputedRef<string>;
290
+
291
+ /**
292
+ * use katex css cdn
293
+ */
294
+ declare function useKatex(): void;
295
+
296
+ /**
297
+ * trigger show invisible element
298
+ * @param target
299
+ * @returns
300
+ */
301
+ declare function useInvisibleElement(target: Ref<HTMLElement>): {
302
+ show: () => void;
303
+ };
304
+
305
+ declare const isDark: vue.WritableComputedRef<boolean>;
306
+ declare const toggleDark: (value?: boolean | undefined) => boolean;
307
+
308
+ declare function useLayout(layout: string): vue.ComputedRef<boolean>;
309
+
310
+ /**
311
+ * use MetingJS and Aplayer
312
+ * https://github.com/MoePlayer/APlayer
313
+ * https://github.com/metowolf/MetingJS
314
+ */
315
+ declare function useAplayer(): void;
316
+
317
+ /**
318
+ * You can use href="#" to back to top
319
+ * @description 你可以使用它来编写自己的 backToTop
320
+ */
321
+ declare function useBackToTop(options?: {
192
322
  /**
193
- * config file path
323
+ * show backToTop button, when height > offset
194
324
  */
195
- configFile: string;
196
- }
197
- interface ValaxyServerOptions {
198
- onConfigReload?: (newConfig: ValaxyConfig, config: ValaxyConfig) => void;
199
- }
325
+ offset: number;
326
+ }): {
327
+ percentage: vue.Ref<number>;
328
+ show: vue.Ref<boolean>;
329
+ };
330
+
331
+ declare function useCodePen(): void;
332
+
333
+ declare function useActiveSidebarLinks(): void;
334
+
335
+ declare function useTwikoo(options?: {}): void;
336
+
337
+ declare function useWaline(options?: {}): void;
338
+
339
+ /**
340
+ * 生成介于 min 与 max 之间的随机数
341
+ * @returns
342
+ */
343
+ declare function random(min: number, max: number): number;
344
+ /**
345
+ * wrap node
346
+ * @param className
347
+ */
348
+ declare function wrap(el: HTMLElement, className: string): void;
349
+ /**
350
+ * 包裹表格,添加 class 以控制 table 样式
351
+ */
352
+ declare const wrapTable: (container?: HTMLElement | Document) => void;
200
353
 
201
- declare function createServer(options: ResolvedValaxyOptions, viteConfig?: InlineConfig, serverOptions?: ValaxyServerOptions): Promise<vite.ViteDevServer>;
354
+ /**
355
+ * use dayjs format date
356
+ * @param date
357
+ * @param template
358
+ * @returns
359
+ */
360
+ declare function formatDate(date: string | number | Date, template?: string): string;
361
+ /**
362
+ * sort posts by date
363
+ * @param posts
364
+ * @param desc
365
+ */
366
+ declare function sortByDate(posts: Post[], desc?: boolean): Post[];
202
367
 
203
- export { createServer };
368
+ export { Categories, Category, ParentCategory, Post, PostCategory, Tags, formatDate, initConfig, isDark, random, sortByDate, toggleDark, useActiveSidebarLinks, useAplayer, useBackToTop, useCategory, useCodePen, useConfig, useFrontmatter, useFullUrl, useInvisibleElement, useKatex, useLayout, usePostList, usePostProperty, usePrevNext, useTag, useTags, useThemeConfig, useTwikoo, useWaline, valaxyConfigRef, valaxyConfigSymbol, wrap, wrapTable };