@xyd-js/core 0.1.0-xyd.12 → 0.1.0-xyd.15
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/CHANGELOG.md +18 -0
- package/dist/index.d.ts +952 -111
- package/dist/index.js +0 -17
- package/dist/index.js.map +1 -1
- package/index.ts +3 -2
- package/package.json +11 -2
- package/src/types/metadata.ts +123 -0
- package/src/types/seo.ts +475 -0
- package/src/types/settings.ts +545 -231
- package/tsconfig.json +1 -0
- package/tsconfig.tsup.json +6 -0
- package/tsup.config.ts +2 -1
- package/dist/index.d.mts +0 -187
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +0 -1
- package/src/types/content.ts +0 -9
package/src/types/settings.ts
CHANGED
|
@@ -1,379 +1,693 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
|
|
3
|
+
import type { Theme as SyntaxHighlight } from "@code-hike/lighter";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Main settings interface for the application
|
|
7
|
+
*/
|
|
3
8
|
export interface Settings {
|
|
4
|
-
|
|
5
|
-
|
|
9
|
+
/** Theme configuration for the application */
|
|
10
|
+
theme?: Theme
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
/** Navigation configuration */
|
|
13
|
+
navigation?: Navigation
|
|
8
14
|
|
|
15
|
+
/** API configuration */
|
|
9
16
|
api?: API
|
|
10
17
|
|
|
18
|
+
/** Integrations configuration */
|
|
11
19
|
integrations?: Integrations
|
|
12
20
|
|
|
21
|
+
/** Plugins configuration */
|
|
22
|
+
plugins?: Plugins
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
* @unsafe
|
|
27
|
+
*
|
|
28
|
+
* Redirects configuration
|
|
29
|
+
*/
|
|
13
30
|
redirects?: Redirects[]
|
|
14
31
|
|
|
32
|
+
/**
|
|
33
|
+
* @unsafe
|
|
34
|
+
* SEO configuration
|
|
35
|
+
*/
|
|
15
36
|
seo?: SEO
|
|
16
|
-
}
|
|
17
37
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
name: string;
|
|
38
|
+
/** Engine configuration */
|
|
39
|
+
engine?: Engine
|
|
40
|
+
}
|
|
22
41
|
|
|
23
|
-
|
|
24
|
-
|
|
42
|
+
// ------ START settings for theme START ------
|
|
43
|
+
// #region Theme
|
|
44
|
+
/**
|
|
45
|
+
* Theme configuration that changes the look and feel of the project
|
|
46
|
+
*/
|
|
47
|
+
export interface Theme {
|
|
48
|
+
/**
|
|
49
|
+
* A preset theme configuration that changes the look and feel of the project.
|
|
50
|
+
* A theme is a set of default styling configurations.
|
|
51
|
+
*
|
|
52
|
+
* Example built-in themes: `cosmo`, `gusto`, `poetry`, `picasso`
|
|
53
|
+
*/
|
|
54
|
+
readonly name: ThemePresetName | (string & {})
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The default color scheme to use.
|
|
58
|
+
*/
|
|
59
|
+
defaultColorScheme?: "light" | "dark" | "os"
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Path to logo image or object with path to "light" and "dark" mode logo images, and where the logo links to.
|
|
63
|
+
* SVG format is recommended as it does not pixelate and the file size is generally smaller.
|
|
64
|
+
*/
|
|
25
65
|
logo?: string | Logo | React.JSX.Element
|
|
26
66
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
colors?: Colors
|
|
32
|
-
|
|
33
|
-
// A preset theme configuration that changes the look and feel of the project. A theme is a set of default styling configurations. Examples: gusto, poetry, plato, picasso
|
|
34
|
-
theme?: ThemeType
|
|
35
|
-
|
|
36
|
-
// The global layout style of the documentation.
|
|
37
|
-
layout?: LayoutType
|
|
67
|
+
/**
|
|
68
|
+
* Coder configuration for the theme, including options like syntax highlighting.
|
|
69
|
+
*/
|
|
70
|
+
coder?: Coder
|
|
38
71
|
|
|
39
|
-
|
|
40
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Banner configuration for the theme.
|
|
74
|
+
*/
|
|
75
|
+
banner?: Banner
|
|
41
76
|
|
|
42
|
-
|
|
43
|
-
|
|
77
|
+
/** Path to the favicon image. For example: /path/to/favicon.svg */
|
|
78
|
+
favicon?: string;
|
|
44
79
|
|
|
45
|
-
|
|
46
|
-
|
|
80
|
+
/** The defult level of the table of contents. */
|
|
81
|
+
maxTocDepth?: number
|
|
47
82
|
|
|
48
|
-
|
|
49
|
-
|
|
83
|
+
/** Head configuration */
|
|
84
|
+
head?: HeadConfig[]
|
|
50
85
|
|
|
51
|
-
|
|
52
|
-
|
|
86
|
+
/** The iconify library */
|
|
87
|
+
icons?: Icons
|
|
53
88
|
|
|
54
|
-
|
|
55
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Custom scripts to be added to the head of the every page.
|
|
91
|
+
* Paths are relative to the root of the project or absolute.
|
|
92
|
+
*/
|
|
93
|
+
scripts?: Script[]
|
|
94
|
+
}
|
|
95
|
+
// #endregion Theme
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Coder configuration for the theme, including options like syntax highlighting.
|
|
99
|
+
*/
|
|
100
|
+
export interface Coder {
|
|
101
|
+
/**
|
|
102
|
+
* If `true` then code blocks will have line numbers.
|
|
103
|
+
*/
|
|
104
|
+
lines?: boolean
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* If `true` then code blocks will have a scrollbar.
|
|
108
|
+
*/
|
|
109
|
+
scroll?: boolean
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Syntax highlighting configuration.
|
|
113
|
+
*/
|
|
114
|
+
syntaxHighlight?: SyntaxHighlight
|
|
115
|
+
}
|
|
56
116
|
|
|
57
|
-
|
|
58
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Configuration type for head elements that can be added to the HTML head.
|
|
119
|
+
* Format: [tagName, attributes]
|
|
120
|
+
*
|
|
121
|
+
* @example: ['script', { src: 'https://example.com/script.js', defer: true }]
|
|
122
|
+
*/
|
|
123
|
+
export type HeadConfig =
|
|
124
|
+
| [string, Record<string, string | boolean>]
|
|
59
125
|
|
|
60
|
-
|
|
61
|
-
rounded?: Rounded
|
|
62
|
-
}
|
|
126
|
+
export type Script = string
|
|
63
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Logo configuration interface
|
|
130
|
+
*/
|
|
64
131
|
export interface Logo {
|
|
65
|
-
|
|
132
|
+
/** Path to the logo in light mode. For example: `/path/to/logo.svg` */
|
|
66
133
|
light?: string;
|
|
67
134
|
|
|
68
|
-
|
|
135
|
+
/** Path to the logo in dark mode. For example: `/path/to/logo.svg` */
|
|
69
136
|
dark?: string;
|
|
70
137
|
|
|
71
|
-
|
|
138
|
+
/** Where clicking on the logo links you to */
|
|
72
139
|
href?: string;
|
|
73
140
|
}
|
|
74
141
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
142
|
+
/**
|
|
143
|
+
* Banner configuration interface
|
|
144
|
+
*/
|
|
145
|
+
export interface Banner {
|
|
146
|
+
/**
|
|
147
|
+
* Banner content.
|
|
148
|
+
*/
|
|
149
|
+
content: string | React.JSX.Element
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Banner label.
|
|
153
|
+
*/
|
|
154
|
+
label?: string
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Banner kind.
|
|
158
|
+
*/
|
|
159
|
+
kind?: "secondary"
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Banner icon.
|
|
163
|
+
*/
|
|
164
|
+
icon?: string
|
|
96
165
|
}
|
|
97
166
|
|
|
167
|
+
export interface IconLibrary {
|
|
168
|
+
/** The iconify library name */
|
|
169
|
+
name: string
|
|
98
170
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
family: string
|
|
102
|
-
|
|
103
|
-
// The font weight. Precise values such as 560 are also supported for variable fonts. Check under the Styles section for your Google Font for the available weights.
|
|
104
|
-
weight?: number
|
|
105
|
-
|
|
106
|
-
// The URL to the font file. Can be used to specify a font that is not from Google Fonts.
|
|
107
|
-
url?: string
|
|
108
|
-
|
|
109
|
-
// The font format. Required if using a custom font source (url).
|
|
110
|
-
format?: "woff" | "woff2"
|
|
111
|
-
|
|
112
|
-
}
|
|
171
|
+
/** The iconify library version */
|
|
172
|
+
version?: string
|
|
113
173
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
default?: "light" | "dark"
|
|
174
|
+
/** The default iconify icon name */
|
|
175
|
+
default?: boolean
|
|
117
176
|
|
|
118
|
-
|
|
119
|
-
|
|
177
|
+
/** Merge icons from the library into the default iconify library */
|
|
178
|
+
noprefix?: boolean
|
|
120
179
|
}
|
|
121
180
|
|
|
122
|
-
export interface
|
|
123
|
-
|
|
124
|
-
|
|
181
|
+
export interface Icons {
|
|
182
|
+
/** The iconify library */
|
|
183
|
+
library?: string | string[] | IconLibrary | IconLibrary[]
|
|
125
184
|
}
|
|
126
185
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
style: "default" | "gradient"
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export type ThemeType = "gusto" | "poetry" | "plato" | "picasso"
|
|
133
|
-
|
|
134
|
-
export type LayoutType = "app" | "default"
|
|
186
|
+
/** Available theme preset names */
|
|
187
|
+
export type ThemePresetName = "poetry" | "cosmo" | "opener" | "picasso"
|
|
135
188
|
|
|
189
|
+
/** Search bar location options */
|
|
136
190
|
export type SearchType = "side" | "top"
|
|
137
191
|
|
|
138
|
-
|
|
139
|
-
// ------ END setting for styling END ------
|
|
192
|
+
// ------ END settings for theme END ------
|
|
140
193
|
|
|
141
194
|
|
|
142
|
-
// ------ START
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
195
|
+
// ------ START settings for navigation START ------
|
|
196
|
+
/**
|
|
197
|
+
* Navigation configuration interface
|
|
198
|
+
*/
|
|
199
|
+
export interface Navigation {
|
|
200
|
+
/** Definition of sidebar - an array of groups with all the pages within that group */
|
|
201
|
+
sidebar: (SidebarRoute | Sidebar | string)[]
|
|
146
202
|
|
|
147
|
-
|
|
203
|
+
/** Array of headers */
|
|
148
204
|
header?: Header[]
|
|
149
205
|
|
|
150
|
-
|
|
151
|
-
|
|
206
|
+
/** Array of segments */
|
|
207
|
+
segments?: Segment[]
|
|
152
208
|
|
|
153
|
-
|
|
154
|
-
|
|
209
|
+
/**
|
|
210
|
+
* Array of version names. Only use this if you want to show different versions of docs
|
|
211
|
+
* with a dropdown in the navigation bar.
|
|
212
|
+
*/
|
|
213
|
+
// versions?: string[]
|
|
155
214
|
|
|
156
|
-
|
|
215
|
+
/** Anchors, includes the icon, name, and url */
|
|
157
216
|
anchors?: AnchorRoot
|
|
158
|
-
|
|
159
|
-
// An object of social media accounts where the key:property pair represents the social media platform and the account url.
|
|
160
|
-
footerSocials?: FooterSocials
|
|
161
|
-
|
|
162
|
-
// Configurations to enable feedback buttons
|
|
163
|
-
feedback?: Feedback
|
|
164
|
-
|
|
165
|
-
// Configurations to change the search prompt
|
|
166
|
-
search?: Search
|
|
167
217
|
}
|
|
168
218
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
219
|
+
/**
|
|
220
|
+
* Sidebar multi-group configuration
|
|
221
|
+
*/
|
|
222
|
+
export interface SidebarRoute {
|
|
223
|
+
/** Route for this sidebar group */
|
|
224
|
+
route: string
|
|
172
225
|
|
|
173
|
-
|
|
174
|
-
|
|
226
|
+
/** Sidebar pages within this group */
|
|
227
|
+
pages: Sidebar[]
|
|
175
228
|
}
|
|
176
229
|
|
|
230
|
+
/**
|
|
231
|
+
* Sidebar configuration
|
|
232
|
+
*/
|
|
177
233
|
export interface Sidebar {
|
|
178
|
-
|
|
234
|
+
/** The name of the group */
|
|
179
235
|
group?: string
|
|
180
236
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
237
|
+
/**
|
|
238
|
+
* The relative paths to the markdown files that will serve as pages.
|
|
239
|
+
* Note: groups are recursive, so to add a sub-folder add another group object in the page array.
|
|
240
|
+
*/
|
|
241
|
+
pages?: PageURL[]
|
|
184
242
|
|
|
185
|
-
|
|
243
|
+
/**
|
|
244
|
+
* The icon of the group.
|
|
245
|
+
*/
|
|
186
246
|
icon?: string
|
|
187
247
|
|
|
188
|
-
|
|
189
|
-
|
|
248
|
+
/**
|
|
249
|
+
* The sort order of the group.
|
|
250
|
+
*/
|
|
251
|
+
sort?: number
|
|
190
252
|
}
|
|
191
253
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
254
|
+
/**
|
|
255
|
+
* Page URL type
|
|
256
|
+
*/
|
|
257
|
+
export type PageURL = string | VirtualPage | Sidebar
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @internal
|
|
261
|
+
*
|
|
262
|
+
* Virtual page type
|
|
263
|
+
*
|
|
264
|
+
* Virtual pages are composition of pages, needed for templating e.g in uniform
|
|
265
|
+
*
|
|
266
|
+
* Example:
|
|
267
|
+
*
|
|
268
|
+
* {
|
|
269
|
+
* pages: [0
|
|
270
|
+
* ".xyd/.cache/.content/docs/rest/todo:docs/rest/todo",
|
|
271
|
+
* ]
|
|
272
|
+
* }
|
|
273
|
+
*
|
|
274
|
+
* above will be rendered as docs/rest/todo.md using composition from xyd's `.content`
|
|
275
|
+
*/
|
|
276
|
+
export type VirtualPage = string | {
|
|
277
|
+
/** The virtual page to use for the page */
|
|
278
|
+
virtual: string
|
|
279
|
+
|
|
280
|
+
/** The page to use for the page */
|
|
281
|
+
page: string
|
|
282
|
+
|
|
283
|
+
/** The template to use for the page */
|
|
284
|
+
templates?: string | string[]
|
|
196
285
|
}
|
|
197
286
|
|
|
198
|
-
export interface Header {
|
|
199
|
-
// The name of the button.
|
|
200
|
-
name?: string
|
|
201
287
|
|
|
202
|
-
|
|
203
|
-
|
|
288
|
+
/**
|
|
289
|
+
* Segment configuration
|
|
290
|
+
*/
|
|
291
|
+
export interface Segment {
|
|
292
|
+
/** Route for this segment */
|
|
293
|
+
route: string
|
|
294
|
+
|
|
295
|
+
/** Title of this segment */
|
|
296
|
+
title: string
|
|
204
297
|
|
|
205
|
-
|
|
298
|
+
/** Items within this segment */
|
|
299
|
+
pages: SegmentPage[]
|
|
206
300
|
}
|
|
207
301
|
|
|
208
|
-
export interface
|
|
209
|
-
|
|
210
|
-
type?: "link" | "github"
|
|
302
|
+
export interface SegmentPage {
|
|
303
|
+
page: string
|
|
211
304
|
|
|
212
|
-
|
|
213
|
-
|
|
305
|
+
title: string
|
|
306
|
+
}
|
|
214
307
|
|
|
215
|
-
|
|
216
|
-
|
|
308
|
+
/**
|
|
309
|
+
* Header configuration
|
|
310
|
+
*/
|
|
311
|
+
export type Header = {
|
|
312
|
+
/** The name of the button */
|
|
313
|
+
title?: string
|
|
217
314
|
|
|
218
|
-
|
|
219
|
-
|
|
315
|
+
/** The url once you click on the button */
|
|
316
|
+
page?: string
|
|
220
317
|
|
|
221
|
-
|
|
222
|
-
|
|
318
|
+
/** Float the header to the right */
|
|
319
|
+
float?: "right"
|
|
223
320
|
}
|
|
224
321
|
|
|
322
|
+
/**
|
|
323
|
+
* Anchor configuration
|
|
324
|
+
*/
|
|
225
325
|
export interface Anchor {
|
|
226
|
-
|
|
227
|
-
icon?: string
|
|
326
|
+
/** The iconify icon name */
|
|
327
|
+
icon?: string
|
|
228
328
|
|
|
229
|
-
|
|
329
|
+
/** The name of the anchor label */
|
|
230
330
|
name?: string
|
|
231
331
|
|
|
232
|
-
|
|
332
|
+
/**
|
|
333
|
+
* The start of the URL that marks what pages go in the anchor.
|
|
334
|
+
* Generally, this is the name of the folder you put your pages in.
|
|
335
|
+
*/
|
|
233
336
|
url?: string
|
|
234
337
|
}
|
|
235
338
|
|
|
339
|
+
/**
|
|
340
|
+
* Anchor root configuration
|
|
341
|
+
*/
|
|
236
342
|
export interface AnchorRoot {
|
|
237
|
-
|
|
343
|
+
/** Bottom anchors */
|
|
344
|
+
bottom?: Anchor[]
|
|
238
345
|
}
|
|
239
346
|
|
|
240
|
-
|
|
241
|
-
// One of the following values website, facebook, x, youtube, discord, slack, github, linkedin, instagram, hacker-news
|
|
242
|
-
[key: string]: string
|
|
243
|
-
|
|
244
|
-
// The URL to the social platform.
|
|
245
|
-
property: string
|
|
246
|
-
}
|
|
347
|
+
// ------ END settings for structure END ------
|
|
247
348
|
|
|
248
|
-
export interface Feedback {
|
|
249
|
-
// Enables a rating system for users to indicate whether the page has been helpful
|
|
250
|
-
thumbsRating?: boolean
|
|
251
349
|
|
|
252
|
-
|
|
253
|
-
|
|
350
|
+
// ------ START settings for API START ------
|
|
351
|
+
/**
|
|
352
|
+
* API configuration interface
|
|
353
|
+
*/
|
|
354
|
+
export interface API {
|
|
355
|
+
/**
|
|
356
|
+
* OpenAPI configuration
|
|
357
|
+
*/
|
|
358
|
+
openapi?: APIFile
|
|
254
359
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
360
|
+
/**
|
|
361
|
+
* GraphQL configuration
|
|
362
|
+
*/
|
|
363
|
+
graphql?: APIFile
|
|
258
364
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
365
|
+
/**
|
|
366
|
+
* Sources configuration
|
|
367
|
+
*/
|
|
368
|
+
sources?: APIFile
|
|
262
369
|
}
|
|
263
370
|
|
|
264
|
-
|
|
371
|
+
/**
|
|
372
|
+
* API file configuration. Can be a path, an array of paths, a map of paths, or an advanced configuration
|
|
373
|
+
*/
|
|
374
|
+
export type APIFile = string | string[] | APIFileMap | APIFileAdvanced
|
|
265
375
|
|
|
376
|
+
/**
|
|
377
|
+
* API file map type
|
|
378
|
+
*/
|
|
379
|
+
export type APIFileMap = {
|
|
380
|
+
[name: string]: string | APIFileAdvanced
|
|
381
|
+
}
|
|
266
382
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
export
|
|
383
|
+
/**
|
|
384
|
+
* API file advanced type
|
|
385
|
+
*/
|
|
386
|
+
export type APIFileAdvanced = {
|
|
387
|
+
/** API information configuration */
|
|
271
388
|
info?: APIInfo
|
|
272
389
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
// A string or an array of strings of URL(s) or relative path(s) pointing to your GraphQL file.
|
|
277
|
-
graphql?: APIFile
|
|
278
|
-
|
|
279
|
-
// A string or an array of strings of URL(s) or relative path(s) pointing to your source code folder.
|
|
280
|
-
sources?: APIFile
|
|
281
|
-
|
|
282
|
-
// TODO: better in the future? -> move outside of API ?
|
|
283
|
-
match?: {
|
|
284
|
-
graphql?: string
|
|
285
|
-
openapi?: string
|
|
286
|
-
}
|
|
390
|
+
/** Route configuration */
|
|
391
|
+
route: string
|
|
287
392
|
}
|
|
288
393
|
|
|
394
|
+
/**
|
|
395
|
+
* API file type - can be a string, array of strings, or a map of strings
|
|
396
|
+
*/
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* API information configuration
|
|
400
|
+
*/
|
|
289
401
|
export interface APIInfo {
|
|
290
|
-
|
|
402
|
+
/**
|
|
403
|
+
* The base url for all API endpoints. If baseUrl is an array, it will enable
|
|
404
|
+
* for multiple base url options that the user can toggle.
|
|
405
|
+
*/
|
|
291
406
|
baseUrl?: string
|
|
292
407
|
|
|
293
|
-
|
|
408
|
+
/** Authentication information */
|
|
294
409
|
auth?: APIAuth
|
|
295
410
|
|
|
296
|
-
|
|
297
|
-
|
|
411
|
+
/**
|
|
412
|
+
* The name of the authentication parameter used in the API playground.
|
|
413
|
+
* If method is basic, the format should be [usernameName]:[passwordName]
|
|
414
|
+
*/
|
|
298
415
|
name?: string
|
|
299
416
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
*/
|
|
417
|
+
/**
|
|
418
|
+
* The default value that's designed to be a prefisx for the authentication input field.
|
|
419
|
+
* E.g. If an inputPrefix of AuthKey would inherit the default input result of the authentication field as AuthKey.
|
|
420
|
+
*/
|
|
305
421
|
inputPrefix?: string
|
|
306
422
|
|
|
307
|
-
|
|
423
|
+
/** Configurations for the API playground */
|
|
308
424
|
playground?: APIPlayground
|
|
309
425
|
|
|
426
|
+
/** Request configuration */
|
|
310
427
|
request?: APIInfoRequest
|
|
311
|
-
|
|
312
|
-
paramFields?: ApiParamFields
|
|
313
428
|
}
|
|
314
429
|
|
|
430
|
+
/**
|
|
431
|
+
* API authentication configuration
|
|
432
|
+
*/
|
|
315
433
|
export interface APIAuth {
|
|
316
|
-
|
|
434
|
+
/** The authentication strategy used for all API endpoints */
|
|
317
435
|
method: "bearer" | "basic" | "key"
|
|
318
436
|
}
|
|
319
437
|
|
|
438
|
+
/**
|
|
439
|
+
* API playground configuration
|
|
440
|
+
*/
|
|
320
441
|
export interface APIPlayground {
|
|
442
|
+
/** Playground display mode */
|
|
321
443
|
mode?: "show" | "simple" | "hide"
|
|
322
444
|
}
|
|
323
445
|
|
|
446
|
+
/**
|
|
447
|
+
* API request configuration
|
|
448
|
+
*/
|
|
324
449
|
export interface APIInfoRequest {
|
|
325
|
-
|
|
450
|
+
/** Configurations for the auto-generated API request examples */
|
|
326
451
|
example?: {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
452
|
+
/**
|
|
453
|
+
* An array of strings that determine the order of the languages of the auto-generated request examples.
|
|
454
|
+
* You can either define custom languages utilizing x-codeSamples or use our default languages which include
|
|
455
|
+
* bash, python, javascript, php, go, java
|
|
456
|
+
*/
|
|
331
457
|
languages?: string[]
|
|
332
458
|
}
|
|
333
459
|
}
|
|
334
460
|
|
|
335
|
-
|
|
336
|
-
/*
|
|
337
|
-
The default expanded state of expandable options in the API playground.
|
|
338
|
-
|
|
339
|
-
"all" - every expandable component is expanded
|
|
340
|
-
|
|
341
|
-
"topLevel" - every top-level expandable component is expanded
|
|
461
|
+
// ------ END settings for API END ------
|
|
342
462
|
|
|
343
|
-
"topLevelOneOfs" - every top-level oneOf type is expanded
|
|
344
463
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
464
|
+
// ------ START settings for integrations START ------
|
|
465
|
+
/**
|
|
466
|
+
* Integrations configuration
|
|
467
|
+
*/
|
|
468
|
+
export interface Integrations {
|
|
469
|
+
/**
|
|
470
|
+
* Configurations to add third-party analytics integrations.
|
|
471
|
+
* See full list of supported analytics here.
|
|
472
|
+
*/
|
|
473
|
+
analytics?: IntegrationAnalytics
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Configurations to add third-party search integrations.
|
|
477
|
+
* See full list of supported search here.
|
|
478
|
+
*/
|
|
479
|
+
search?: IntegrationSearch
|
|
480
|
+
|
|
481
|
+
apps?: IntegrationApps
|
|
348
482
|
}
|
|
349
483
|
|
|
350
|
-
//
|
|
484
|
+
// #region IntegrationAnalytics
|
|
485
|
+
/**
|
|
486
|
+
* Analytics configuration
|
|
487
|
+
*/
|
|
488
|
+
export interface IntegrationAnalytics {
|
|
489
|
+
/** Livesession analytics configuration */
|
|
490
|
+
livesession?: {
|
|
491
|
+
/** Livesession's TrackID */
|
|
492
|
+
trackId: string
|
|
493
|
+
}
|
|
494
|
+
}
|
|
351
495
|
|
|
496
|
+
// #endregion IntegrationAnalytics
|
|
352
497
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
498
|
+
/**
|
|
499
|
+
* Search configuration
|
|
500
|
+
*/
|
|
501
|
+
export interface IntegrationSearch {
|
|
502
|
+
/** Algolia search configuration */
|
|
503
|
+
algolia?: {
|
|
504
|
+
/** Algolia application ID */
|
|
505
|
+
appId: string
|
|
358
506
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
trackId: string
|
|
507
|
+
/** Algolia API key */
|
|
508
|
+
apiKey: string
|
|
362
509
|
}
|
|
510
|
+
|
|
511
|
+
orama?: {
|
|
512
|
+
/** Orama endpoint */
|
|
513
|
+
endpoint: string
|
|
514
|
+
|
|
515
|
+
/** Orama API key */
|
|
516
|
+
apiKey: string
|
|
517
|
+
|
|
518
|
+
/** Orama suggestions */
|
|
519
|
+
suggestions?: string[]
|
|
520
|
+
} | boolean
|
|
363
521
|
}
|
|
364
522
|
|
|
365
|
-
|
|
523
|
+
export interface IntegrationApps {
|
|
524
|
+
/**
|
|
525
|
+
* Github star app configuration.
|
|
526
|
+
* List of all [options](https://github.com/buttons/react-github-btn).
|
|
527
|
+
*/
|
|
528
|
+
githubStar?: IntegrationAppGithubStar
|
|
529
|
+
}
|
|
366
530
|
|
|
531
|
+
export interface IntegrationAppGithubStar {
|
|
532
|
+
/**
|
|
533
|
+
* The title of the Github button
|
|
534
|
+
*/
|
|
535
|
+
title: string
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* The label of the Github Button
|
|
539
|
+
*/
|
|
540
|
+
label?: string
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* The href of the Github project
|
|
544
|
+
*/
|
|
545
|
+
href: string
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* The data-show-count of the Github project
|
|
549
|
+
*/
|
|
550
|
+
dataShowCount?: boolean
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* The data-icon of the Github button
|
|
554
|
+
*/
|
|
555
|
+
dataIcon?: string
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* The data-size of the Github button
|
|
559
|
+
*/
|
|
560
|
+
dataSize?: string
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* The aria-label of the Github button
|
|
564
|
+
*/
|
|
565
|
+
ariaLabel?: string
|
|
566
|
+
}
|
|
367
567
|
|
|
368
|
-
// ------
|
|
568
|
+
// ------ END settings for integrations END ------
|
|
569
|
+
|
|
570
|
+
// ------ START settings for plugins START ------
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Plugin configuration
|
|
574
|
+
*
|
|
575
|
+
* @example
|
|
576
|
+
* 1)
|
|
577
|
+
* {
|
|
578
|
+
* plugins: [
|
|
579
|
+
* "livesession",
|
|
580
|
+
* ]
|
|
581
|
+
* }
|
|
582
|
+
*
|
|
583
|
+
* or 2)
|
|
584
|
+
* {
|
|
585
|
+
* plugins: [
|
|
586
|
+
* [
|
|
587
|
+
* "livesession",
|
|
588
|
+
* "accountID.websiteID",
|
|
589
|
+
* {
|
|
590
|
+
* keystrokes: true
|
|
591
|
+
* }
|
|
592
|
+
* ]
|
|
593
|
+
* ]
|
|
594
|
+
* }
|
|
595
|
+
*
|
|
596
|
+
* @example [audience:dev]
|
|
597
|
+
* You can also use the type to define the plugin config in your code:
|
|
598
|
+
*
|
|
599
|
+
* const livesessionPlugin: PluginConfig<"livesession", [string, { keystrokes: boolean }]> = [
|
|
600
|
+
* "livesession",
|
|
601
|
+
* "accountID.websiteID",
|
|
602
|
+
* {
|
|
603
|
+
* keystrokes: true
|
|
604
|
+
* }
|
|
605
|
+
* ]
|
|
606
|
+
*/
|
|
607
|
+
export type Plugins = (string | PluginConfig)[]
|
|
608
|
+
|
|
609
|
+
export type PluginConfig<
|
|
610
|
+
PluginName extends string = string,
|
|
611
|
+
PluginArgs extends unknown[] = unknown[]
|
|
612
|
+
> = [PluginName, ...PluginArgs]
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
// ------ END settings for plugins END ------
|
|
616
|
+
|
|
617
|
+
// ------ START settings for redirecs START ------
|
|
618
|
+
/**
|
|
619
|
+
* Redirects configuration
|
|
620
|
+
*/
|
|
369
621
|
export interface Redirects {
|
|
622
|
+
/** Source path to redirect from */
|
|
370
623
|
source: string
|
|
371
624
|
|
|
625
|
+
/** Destination path to redirect to */
|
|
372
626
|
destination: string
|
|
373
627
|
}
|
|
374
628
|
|
|
629
|
+
/**
|
|
630
|
+
* SEO configuration
|
|
631
|
+
*/
|
|
375
632
|
export interface SEO {
|
|
376
|
-
|
|
633
|
+
/**
|
|
634
|
+
* Domain name
|
|
635
|
+
*/
|
|
636
|
+
domain?: string
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Meta tags
|
|
640
|
+
*/
|
|
641
|
+
metatags?: { [tag: string]: string } // TODO: in the future type-safe
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
// ------ END settings for redirects END ------
|
|
645
|
+
|
|
646
|
+
// ------ START settings for engine START ------
|
|
647
|
+
/**
|
|
648
|
+
* Config configuration
|
|
649
|
+
*/
|
|
650
|
+
export interface Engine {
|
|
651
|
+
/**
|
|
652
|
+
* Path aliases for imports. Avoid long relative paths by creating shortcuts.
|
|
653
|
+
*
|
|
654
|
+
* @example
|
|
655
|
+
* ```json
|
|
656
|
+
* {
|
|
657
|
+
* "paths": {
|
|
658
|
+
* "@my-package/*": ["../my-package/src/*"],
|
|
659
|
+
* "@livesession-go/*": ["https://github.com/livesession/livesession-go/*"]
|
|
660
|
+
* }
|
|
661
|
+
* }
|
|
662
|
+
* ```
|
|
663
|
+
*
|
|
664
|
+
* Usage:
|
|
665
|
+
* ```typescript
|
|
666
|
+
* // Instead of
|
|
667
|
+
* @importCode("../../../my-package/src/components/Badge.tsx")
|
|
668
|
+
*
|
|
669
|
+
* // Use
|
|
670
|
+
* @importCode("@my-package/src/components/Badge.tsx")
|
|
671
|
+
* ```
|
|
672
|
+
*/
|
|
673
|
+
paths?: EnginePaths
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* @unsafe
|
|
677
|
+
*
|
|
678
|
+
* Uniform configuration
|
|
679
|
+
*
|
|
680
|
+
*/
|
|
681
|
+
uniform?: EngineUniform
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
export type EnginePaths = { [key: string]: string[] }
|
|
685
|
+
|
|
686
|
+
export type EngineUniform = {
|
|
687
|
+
/**
|
|
688
|
+
* If `true` then virtual pages will not created and generated content will be stored on disk
|
|
689
|
+
*/
|
|
690
|
+
store?: boolean
|
|
377
691
|
}
|
|
378
692
|
|
|
379
|
-
// ------ END
|
|
693
|
+
// ------ END settings for config END ------
|