@xyd-js/core 0.1.0-xyd.4 → 0.1.0-xyd.54

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.
@@ -1,376 +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
- // styling configurations for the documentation
5
- styling?: Styling
9
+ /** Theme configuration for the application */
10
+ theme?: Theme
6
11
 
7
- structure?: Structure
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
- // ------ START setting for styling START ------
19
- export interface Styling {
20
- // Name of your company or project. Used for the global title.
21
- name: string;
36
+ /** Engine configuration */
37
+ engine?: Engine
38
+ }
22
39
 
23
- // Path to logo image or object with path to “light” and “dark” mode logo images, and where the logo links to. SVG format is recommended.
24
- // It does not pixelate and the file size is generally smaller.
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
- // Path to the favicon image. For example: /path/to/favicon.svg
28
- favicon?: string;
29
-
30
- // Hex color codes for your global theme
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
65
+ /**
66
+ * Coder configuration for the theme, including options like syntax highlighting.
67
+ */
68
+ coder?: Coder
38
69
 
39
- // Set a decorative background.
40
- background?: Background
70
+ /**
71
+ * Banner configuration for the theme.
72
+ */
73
+ banner?: Banner
41
74
 
42
- // Set a custom background image to be displayed behind every page.
43
- backgroundImage?: string
75
+ /** Path to the favicon image. For example: /path/to/favicon.svg */
76
+ favicon?: string;
44
77
 
45
- // Custom fonts. Apply globally or set different fonts for headings and the body text.
46
- font?: FontDetailsType | { headings?: FontDetailsType, body?: FontDetailsType }
78
+ /** The defult level of the table of contents. */
79
+ maxTocDepth?: number
47
80
 
48
- // Customize the dark mode toggle.
49
- modeToggle?: ModeToggle
81
+ /** Head configuration */
82
+ head?: HeadConfig[]
50
83
 
51
- // Customize the styling of components within the sidebar.
52
- sidebar?: StyleSidebar
84
+ /** The iconify library */
85
+ icons?: Icons
53
86
 
54
- // Styling configurations for the topbar.
55
- topbar?: Topbar
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
+ }
56
114
 
57
- // The location of the search bar entry.
58
- search?: SearchType
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>]
59
123
 
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
- // Path to the logo in light mode. For example: `/path/to/logo.svg`
130
+ /** Path to the logo in light mode. For example: `/path/to/logo.svg` */
66
131
  light?: string;
67
132
 
68
- // Path to the logo in dark mode. For example: `/path/to/logo.svg`
133
+ /** Path to the logo in dark mode. For example: `/path/to/logo.svg` */
69
134
  dark?: string;
70
135
 
71
- // Where clicking on the logo links you to
136
+ /** Where clicking on the logo links you to */
72
137
  href?: string;
73
138
  }
74
139
 
75
- export interface Colors {
76
- // The primary color. Used most often for highlighted content, section headers, accents, in light mode
77
- primary: string
78
-
79
- // The primary color for dark mode. Used most often for highlighted content, section headers, accents, in dark mode
80
- light?: string
81
-
82
- // The primary color for important buttons
83
- dark?: string
84
-
85
- // The color of the background in both light and dark mode
86
- background?: {
87
- light: string
88
-
89
- dark: string
90
- }
91
- }
92
-
93
- export interface Background {
94
- // The style of the decorative background.
95
- style?: "gradient" | "grid" | "windows"
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
- export interface FontDetailsType {
100
- // The font family name. Custom fonts and all Google Fonts are supported. e.g. “Open Sans”, “Playfair Display”
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
- }
169
+ /** The iconify library version */
170
+ version?: string
113
171
 
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"
172
+ /** The default iconify icon name */
173
+ default?: boolean
117
174
 
118
- // Set to true to hide the dark/light mode toggle. You can combine isHidden with default to force your docs to only use light or dark mode.
119
- isHidden?: boolean
175
+ /** Merge icons from the library into the default iconify library */
176
+ noprefix?: boolean
120
177
  }
121
178
 
122
- export interface StyleSidebar {
123
- // The styling of the sidebar item.
124
- items: "container" | "card" | "border" | "undecorated"
179
+ export interface Icons {
180
+ /** The iconify library */
181
+ library?: string | string[] | IconLibrary | IconLibrary[]
125
182
  }
126
183
 
127
- export interface Topbar {
128
- // Styling configurations for the topbar.
129
- style: "default" | "gradient"
130
- }
131
-
132
- export type ThemeType = "gusto" | "poetry" | "plato" | "picasso"
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
- export type Rounded = "default" | "sharp"
139
- // ------ END setting for styling END ------
190
+ // ------ END settings for theme END ------
140
191
 
141
192
 
142
- // ------ START setting for structure START ------
143
- export interface Structure {
144
- // Definition of sidebar - an array of groups with all the pages within that group
145
- sidebar: (SidebarMulti | Sidebar) []
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
- // Array of headers
201
+ /** Array of headers */
148
202
  header?: Header[]
149
203
 
150
- // The call to action button in the topbar
151
- topbarCtaButton?: CallToAction
204
+ /** Array of segments */
205
+ segments?: Segment[]
152
206
 
153
- // Array of version names. Only use this if you want to show different versions of docs with a dropdown in the navigation bar.
154
- versions?: string[]
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
- // Anchors, includes the icon, name, and url.
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
- export interface SidebarMulti {
170
- // routing match
171
- match: string
217
+ /**
218
+ * Sidebar navigation type
219
+ */
220
+ export type SidebarNavigation = (SidebarRoute | Sidebar | string)[]
172
221
 
173
- // sidebar items
174
- items: Sidebar[]
222
+ /**
223
+ * Sidebar multi-group configuration
224
+ */
225
+ export interface SidebarRoute {
226
+ /** Route for this sidebar group */
227
+ route: string
228
+
229
+ /** Sidebar pages within this group */
230
+ pages: Sidebar[]
175
231
  }
176
232
 
233
+ /**
234
+ * Sidebar configuration
235
+ */
177
236
  export interface Sidebar {
178
- // The name of the group.
237
+ /** The name of the group */
179
238
  group?: string
180
239
 
181
- // The relative paths to the markdown files that will serve as pages.
182
- // Note: groups are recursive, so to add a sub-folder add another group object in the page array.
183
- pages?: (string | Sidebar)[]
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
- // The Fontawesome icon for the group. Note: this only applies to sub-folders.
246
+ /**
247
+ * The icon of the group.
248
+ */
186
249
  icon?: string
187
250
 
188
- // The type of Fontawesome icon. Must be one of: brands, duotone, light, sharp-solid, solid, thin
189
- iconType?: string
251
+ /**
252
+ * The sort order of the group.
253
+ */
254
+ sort?: number
190
255
  }
191
256
 
192
- export interface SubHeader {
193
- match: string
194
- name: string
195
- items: Header[]
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
- // The url once you click on the button. Example: https://mintlify.com/contact
203
- url?: string
291
+ /**
292
+ * Segment configuration
293
+ */
294
+ export interface Segment {
295
+ /** Route for this segment */
296
+ route: string
204
297
 
205
- sub?: SubHeader
298
+ /** Title of this segment */
299
+ title: string
300
+
301
+ /** Items within this segment */
302
+ pages: SegmentPage[]
206
303
  }
207
304
 
208
- export interface CallToAction {
209
- // Link shows a button. GitHub shows the repo information at the url provided including the number of GitHub stars.
210
- type?: "link" | "github"
305
+ export interface SegmentPage {
306
+ page: string
211
307
 
212
- // If type is a link: What the button links to. If type is a github: Link to the repository to load GitHub information from.
213
- url?: string
308
+ title: string
309
+ }
214
310
 
215
- // Text inside the button. Only required if type is a link.
216
- name?: string
311
+ /**
312
+ * Header configuration
313
+ */
314
+ export type Header = {
315
+ /** The name of the button */
316
+ title?: string
217
317
 
218
- // The style of the button.
219
- style?: "pill" | "roundedRectangle"
318
+ /** The url once you click on the button */
319
+ page?: string
220
320
 
221
- // Whether to display the arrow
222
- arrow?: boolean
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
- // The Font Awesome or JSX icon used to feature the anchor.
227
- icon?: string | React.JSX.Element
329
+ /** The iconify icon name */
330
+ icon?: string
228
331
 
229
- // The name of the anchor label.
332
+ /** The name of the anchor label */
230
333
  name?: string
231
334
 
232
- // The start of the URL that marks what pages go in the anchor. Generally, this is the name of the folder you put your pages in.
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
- bottom: Anchor[]
346
+ /** Bottom anchors */
347
+ bottom?: Anchor[]
238
348
  }
239
349
 
240
- export interface FooterSocials {
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
- // Enables a button to allow users to suggest edits via pull requests
253
- suggestEdit?: boolean
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
- // Enables a button to allow users to raise an issue about the documentation
256
- raiseIssue?: boolean
257
- }
363
+ /**
364
+ * GraphQL configuration
365
+ */
366
+ graphql?: APIFile
258
367
 
259
- export interface Search {
260
- // Set the prompt for the search bar. Default is Search...
261
- prompt?: string
368
+ /**
369
+ * Sources configuration
370
+ */
371
+ sources?: APIFile
262
372
  }
263
373
 
264
- // ------ END setting for structure END ------
265
-
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
266
378
 
267
- // ------ START setting for API START ------
268
- export type APIFile = string | string[] | { [id: string]: string }
379
+ /**
380
+ * API file map type
381
+ */
382
+ export type APIFileMap = {
383
+ [name: string]: string | APIFileAdvanced
384
+ }
269
385
 
270
- export interface API {
386
+ /**
387
+ * API file advanced type
388
+ */
389
+ export type APIFileAdvanced = {
390
+ /** API information configuration */
271
391
  info?: APIInfo
272
392
 
273
- // A string/array/map of strings of URL(s) or relative path(s) pointing to your OpenAPI file.
274
- openapi?: APIFile
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
- // TODO: better in the future?
280
- match?: {
281
- graphql?: string
282
- openapi?: string
283
- }
393
+ /** Route configuration */
394
+ route: string
284
395
  }
285
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
+ */
286
404
  export interface APIInfo {
287
- // The base url for all API endpoints. If baseUrl is an array, it will enable for multiple base url options that the user can toggle.
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
+ */
288
409
  baseUrl?: string
289
410
 
290
- // auth info
411
+ /** Authentication information */
291
412
  auth?: APIAuth
292
413
 
293
- // The name of the authentication parameter used in the API playground.
294
- // If method is basic, the format should be [usernameName]:[passwordName]
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
+ */
295
418
  name?: string
296
419
 
297
- /*
298
- The default value thats designed to be a prefix for the authentication input field.
299
-
300
- E.g. If an inputPrefix of AuthKey would inherit the default input result of the authentication field as AuthKey.
301
- */
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
+ */
302
424
  inputPrefix?: string
303
425
 
304
- // Configurations for the API playground
426
+ /** Configurations for the API playground */
305
427
  playground?: APIPlayground
306
428
 
429
+ /** Request configuration */
307
430
  request?: APIInfoRequest
308
-
309
- paramFields?: ApiParamFields
310
431
  }
311
432
 
433
+ /**
434
+ * API authentication configuration
435
+ */
312
436
  export interface APIAuth {
313
- // The authentication strategy used for all API endpoints.
437
+ /** The authentication strategy used for all API endpoints */
314
438
  method: "bearer" | "basic" | "key"
315
439
  }
316
440
 
441
+ /**
442
+ * API playground configuration
443
+ */
317
444
  export interface APIPlayground {
445
+ /** Playground display mode */
318
446
  mode?: "show" | "simple" | "hide"
319
447
  }
320
448
 
449
+ /**
450
+ * API request configuration
451
+ */
321
452
  export interface APIInfoRequest {
322
- // Configurations for the auto-generated API request examples
453
+ /** Configurations for the auto-generated API request examples */
323
454
  example?: {
324
- /*
325
- An array of strings that determine the order of the languages of the auto-generated request examples.
326
- You can either define custom languages utilizing x-codeSamples or use our default languages which include bash, python, javascript, php, go, java
327
- */
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
+ */
328
460
  languages?: string[]
329
461
  }
330
462
  }
331
463
 
332
- export interface ApiParamFields {
333
- /*
334
- The default expanded state of expandable options in the API playground.
464
+ // ------ END settings for API END ------
335
465
 
336
- "all" - every expandable component is expanded
337
466
 
338
- "topLevel" - every top-level expandable component is expanded
339
-
340
- "topLevelOneOfs" - every top-level oneOf type is expanded
341
-
342
- "none" - every expandable component is closed (default behavior)
343
- */
344
- expanded: "all" | "topLevel" | "topLevelOneOfs" | "none"
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
345
485
  }
346
486
 
347
- // ------ END setting for API END ------
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
+ }
348
498
 
499
+ // #endregion IntegrationAnalytics
349
500
 
350
- // ------ START setting for integrations START ------
351
- export interface Integrations {
352
- // Configurations to add third-party analytics integrations. See full list of supported analytics here.
353
- analytics?: Analytics
354
- }
501
+ /**
502
+ * Search configuration
503
+ */
504
+ export interface IntegrationSearch {
505
+ /** Algolia search configuration */
506
+ algolia?: {
507
+ /** Algolia application ID */
508
+ appId: string
355
509
 
356
- export interface Analytics {
357
- livesession: {
358
- trackId: string
510
+ /** Algolia API key */
511
+ apiKey: string
359
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
360
524
  }
361
525
 
362
- // ------ END setting for integrations END ------
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
+ }
363
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
+ }
364
570
 
365
- // ------ START setting for redirecs START ------
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
+ */
366
624
  export interface Redirects {
625
+ /** Source path to redirect from */
367
626
  source: string
368
627
 
628
+ /** Destination path to redirect to */
369
629
  destination: string
370
630
  }
371
631
 
632
+ /**
633
+ * SEO configuration
634
+ */
372
635
  export interface SEO {
373
- indexHiddenPages: boolean
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
374
693
  }
375
694
 
376
- // ------ END setting for redirects END ------
695
+ // ------ END settings for config END ------