valaxy 0.17.0-beta.3 → 0.17.0-beta.4

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/shims.d.ts ADDED
@@ -0,0 +1,62 @@
1
+ import 'vue-router'
2
+
3
+ import './client/typed-router'
4
+
5
+ import type { Post } from './types'
6
+ import type { Header } from './node/markdown'
7
+
8
+ declare module 'valaxy-addon-*'
9
+ declare module '@docsearch/js' {
10
+ function docsearch<T = any>(props: T): void
11
+ export default docsearch
12
+ }
13
+
14
+ declare interface Window {
15
+ // algolia
16
+ instantsearch: any
17
+ algoliasearch: any
18
+ }
19
+
20
+ // markdowns can be treat as Vue components
21
+ declare module '*.md' {
22
+ import type { DefineComponent } from 'vue'
23
+
24
+ const component: DefineComponent<object, object, any>
25
+ export default component
26
+ }
27
+
28
+ declare module '*.vue' {
29
+ import type { DefineComponent } from 'vue'
30
+
31
+ const component: DefineComponent<object, object, any>
32
+ export default component
33
+ }
34
+
35
+ // vite hmr data
36
+ declare module '/@valaxyjs/config' {
37
+ const config: string
38
+ export default config
39
+ }
40
+
41
+ declare module '/@valaxyjs/context' {
42
+ const ctx: string
43
+ export default ctx
44
+ }
45
+ declare module '/@valaxyjs/addons' {
46
+ import type { DefineComponent } from 'vue'
47
+
48
+ const components: { props: any, component: DefineComponent<object, object, any> }[]
49
+ export default components
50
+ }
51
+
52
+ declare module '/@valaxyjs/locales' {
53
+ const messages: object
54
+ export default messages
55
+ }
56
+
57
+ declare module 'vue-router' {
58
+ interface RouteMeta {
59
+ headers: Header[]
60
+ frontmatter: Post
61
+ }
62
+ }
@@ -0,0 +1,5 @@
1
+ # valaxy/types
2
+
3
+ > Types for Valaxy.
4
+
5
+ Include client and node types (that need to be shared by client).
package/types/config.ts CHANGED
@@ -337,6 +337,13 @@ export interface RuntimeConfig {
337
337
  addons: Record<string, ValaxyAddon>
338
338
  }
339
339
 
340
+ export interface Pkg {
341
+ name: string
342
+ version: string
343
+ homepage?: string
344
+ [key: string]: any
345
+ }
346
+
340
347
  export interface ValaxyConfig<ThemeConfig = DefaultTheme.Config> {
341
348
  siteConfig: SiteConfig
342
349
  /**
@@ -349,12 +356,7 @@ export interface ValaxyConfig<ThemeConfig = DefaultTheme.Config> {
349
356
  * @description 主题配置
350
357
  */
351
358
  themeConfig: ThemeConfig & {
352
- pkg: {
353
- name: string
354
- version: string
355
- homepage?: string
356
- [key: string]: any
357
- }
359
+ pkg: Pkg
358
360
  }
359
361
  /**
360
362
  * generated by runtime
package/types/index.ts CHANGED
@@ -5,6 +5,7 @@ export * from './data'
5
5
  export * from './posts'
6
6
 
7
7
  // used in node, but without node deps
8
+ // and need be shared with client types
8
9
  export * from './node'
9
10
 
10
11
  // default theme