1 |
|
2 | import { RequireItResult } from './RsgRequireItResult';
|
3 | import { MarkdownExample, Example } from './RsgExample';
|
4 | import { LoaderComponent, ExpandMode, Component } from './RsgComponent';
|
5 | export interface BaseSection {
|
6 | name?: string;
|
7 | slug?: string;
|
8 | ignore?: string | string[];
|
9 | description?: string;
|
10 | exampleMode?: ExpandMode;
|
11 | usageMode?: ExpandMode;
|
12 | href?: string;
|
13 | sectionDepth?: number;
|
14 | external?: boolean;
|
15 | expand?: boolean;
|
16 | }
|
17 | export interface ProcessedSection extends BaseSection {
|
18 | visibleName?: string;
|
19 | filepath?: string;
|
20 | externalLink?: boolean;
|
21 | href?: string;
|
22 | }
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | export interface Section extends ProcessedSection {
|
28 | content?: Example[] | string;
|
29 | components?: Component[];
|
30 | sections?: Section[];
|
31 | }
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | export interface TOCItem extends ProcessedSection {
|
39 | heading?: boolean;
|
40 | shouldOpenInNewTab?: boolean;
|
41 | selected?: boolean;
|
42 | initialOpen?: boolean;
|
43 | forcedOpen?: boolean;
|
44 | content?: React.ReactNode;
|
45 | components?: TOCItem[];
|
46 | sections?: TOCItem[];
|
47 | }
|
48 |
|
49 |
|
50 |
|
51 |
|
52 | export interface ConfigSection extends BaseSection {
|
53 | components?: string | string[] | (() => string[]);
|
54 | sections?: ConfigSection[];
|
55 | content?: string;
|
56 | }
|
57 | /**
|
58 | * Type returned when sections are transformed to their webpack
|
59 | * loadable equivalents
|
60 | */
|
61 | export interface LoaderSection extends BaseSection {
|
62 | slug?: string;
|
63 | content?: RequireItResult | MarkdownExample;
|
64 | components: LoaderComponent[];
|
65 | sections: LoaderSection[];
|
66 | }
|
67 |
|
\ | No newline at end of file |