@lexibase/rdx-types 1.0.0-beta.1 → 1.0.0-beta.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/config.d.ts +29 -2
- package/dist/index.d.ts +14 -1
- package/dist/plugins.d.ts +42 -0
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ComponentType } from 'react'
|
|
2
|
+
import type { RdxPlugin } from './plugins'
|
|
2
3
|
|
|
4
|
+
/** @deprecated Legacy development website config. New projects use RdxConfig. */
|
|
3
5
|
export type RDXConfig = {
|
|
4
6
|
/**
|
|
5
7
|
* The title of the documentation site.
|
|
@@ -103,10 +105,21 @@ export type RDXConfig = {
|
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
107
|
|
|
106
|
-
/**
|
|
107
|
-
export type
|
|
108
|
+
/** Public configuration shared by the CLI, runtime, and plugins. */
|
|
109
|
+
export type RdxHomepage = {
|
|
110
|
+
enabled?: boolean
|
|
111
|
+
title?: string
|
|
112
|
+
description?: string
|
|
113
|
+
buttons?: { label: string; href: string }[]
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export type RdxConfig = {
|
|
108
117
|
title: string
|
|
109
118
|
description?: string
|
|
119
|
+
lang?: string
|
|
120
|
+
docsDir?: string
|
|
121
|
+
homepage?: RdxHomepage
|
|
122
|
+
plugins?: RdxPlugin[]
|
|
110
123
|
theme?: {
|
|
111
124
|
defaultTheme?: 'system' | 'dark' | 'light'
|
|
112
125
|
}
|
|
@@ -120,3 +133,17 @@ export type RdxRuntimeConfig = {
|
|
|
120
133
|
}
|
|
121
134
|
}
|
|
122
135
|
}
|
|
136
|
+
|
|
137
|
+
/** Compatibility alias for projects created by the first beta. */
|
|
138
|
+
export type RdxRuntimeConfig = RdxConfig
|
|
139
|
+
|
|
140
|
+
export type ResolvedRdxConfig = Omit<
|
|
141
|
+
RdxConfig,
|
|
142
|
+
'description' | 'lang' | 'docsDir' | 'theme' | 'plugins'
|
|
143
|
+
> & {
|
|
144
|
+
description: string
|
|
145
|
+
lang: string
|
|
146
|
+
docsDir: string
|
|
147
|
+
theme: { defaultTheme: 'system' | 'dark' | 'light' }
|
|
148
|
+
plugins: RdxPlugin[]
|
|
149
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
export { VersionsRaw, MDXLoader, DocLink, DocCategory } from './loaders'
|
|
2
|
-
export {
|
|
2
|
+
export {
|
|
3
|
+
RDXConfig,
|
|
4
|
+
RdxConfig,
|
|
5
|
+
RdxHomepage,
|
|
6
|
+
RdxRuntimeConfig,
|
|
7
|
+
ResolvedRdxConfig,
|
|
8
|
+
} from './config'
|
|
9
|
+
export {
|
|
10
|
+
RdxContentSource,
|
|
11
|
+
RdxPlugin,
|
|
12
|
+
RdxPluginCommand,
|
|
13
|
+
RdxPluginContext,
|
|
14
|
+
RdxProject,
|
|
15
|
+
} from './plugins'
|
|
3
16
|
export {
|
|
4
17
|
RdxDocCategory,
|
|
5
18
|
RdxDocFrontmatter,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ResolvedRdxConfig } from './config'
|
|
2
|
+
|
|
3
|
+
/** A separate documentation tree exposed below /docs/<routePrefix>. */
|
|
4
|
+
export type RdxContentSource = {
|
|
5
|
+
id: string
|
|
6
|
+
label: string
|
|
7
|
+
docsDir: string
|
|
8
|
+
routePrefix: string
|
|
9
|
+
badge?: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type RdxPluginContext = {
|
|
13
|
+
rootDir: string
|
|
14
|
+
command: string
|
|
15
|
+
config: ResolvedRdxConfig
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type RdxPluginCommand = {
|
|
19
|
+
name: string
|
|
20
|
+
description: string
|
|
21
|
+
run: (context: RdxPluginContext & { args: string[] }) => void | Promise<void>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Hooks run only for explicitly configured plugins, in declaration order. */
|
|
25
|
+
export type RdxPlugin = {
|
|
26
|
+
name: string
|
|
27
|
+
apiVersion: 1
|
|
28
|
+
setup?: (
|
|
29
|
+
context: RdxPluginContext
|
|
30
|
+
) =>
|
|
31
|
+
| { sources?: RdxContentSource[] }
|
|
32
|
+
| void
|
|
33
|
+
| Promise<{ sources?: RdxContentSource[] } | void>
|
|
34
|
+
commands?: RdxPluginCommand[]
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type RdxProject = {
|
|
38
|
+
rootDir: string
|
|
39
|
+
config: ResolvedRdxConfig
|
|
40
|
+
sources: RdxContentSource[]
|
|
41
|
+
commands: RdxPluginCommand[]
|
|
42
|
+
}
|