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