1 | import { IStyleFunctionOrObject, Omit } from '../Utilities';
|
2 | import { ITheme, IStyle } from '../Styling';
|
3 | export interface IExample {
|
4 | /** Title of the example */
|
5 | title: string;
|
6 | /** Raw source code of the example */
|
7 | code: string;
|
8 | /** Working example of the example */
|
9 | view: JSX.Element;
|
10 | isScrollable?: boolean;
|
11 | /** JS String for codepen of the example */
|
12 | codepenJS?: string;
|
13 | /** Custom styles. Partial version of `IExampleCardProps['styles']`. */
|
14 | styles?: IStyleFunctionOrObject<{
|
15 | theme?: ITheme;
|
16 | }, {
|
17 | root: IStyle;
|
18 | }>;
|
19 | }
|
20 | export interface IDocPageProps {
|
21 | /** Title that goes into the header */
|
22 | title: string;
|
23 | /** Name of the component being documented */
|
24 | componentName: string;
|
25 | /** URL of the checked in component, should be somewhere on github.com */
|
26 | componentUrl: string;
|
27 | /** Knobs that applies to all the examples */
|
28 | exampleKnobs?: JSX.Element;
|
29 | /** Array of examples, displayed in the order defined */
|
30 | examples?: IExample[];
|
31 | /** Properties table(s) as markdown string */
|
32 | propertiesTablesSources?: string[];
|
33 | /** Overview of the component as markdown string */
|
34 | overview?: string;
|
35 | /** Accessibility of the component as markdown string */
|
36 | accessibility?: string;
|
37 | /** DO's blurb as markdown string */
|
38 | dos?: string;
|
39 | /** DON'Ts blurb as markdown string */
|
40 | donts?: string;
|
41 | /** Best practice as markdown string */
|
42 | bestPractices?: string;
|
43 | /** Feedback section includes link to new issue page and displays Github issues */
|
44 | isFeedbackVisible?: boolean;
|
45 | /** Passed through header visibility flag from the demo component page component */
|
46 | isHeaderVisible: boolean;
|
47 | /** If true, the component accepts all native props from elements specified in `nativePropsElement` */
|
48 | allowNativeProps?: boolean;
|
49 | /** Override component name to use in the native props message */
|
50 | allowNativePropsForComponentName?: string;
|
51 | /**
|
52 | * Element(s) whose native props this component accepts (default div).
|
53 | * Only relevant if `allowNativeProps` is true.
|
54 | */
|
55 | nativePropsElement?: string | string[];
|
56 | /**
|
57 | * Related link
|
58 | * @deprecated No longer shown on ComponentPage
|
59 | */
|
60 | related?: JSX.Element;
|
61 | /** Pass through other sections for ComponentPage */
|
62 | otherSections?: {
|
63 | title: string;
|
64 | section: JSX.Element;
|
65 | }[];
|
66 | /**
|
67 | * JSON to populate the api reference tables
|
68 | */
|
69 | jsonDocs?: IPageJson;
|
70 | }
|
71 | /**
|
72 | * Used to keep track of where an API reference page will live on the site.
|
73 | */
|
74 | export declare type PageKind = 'References' | 'Components';
|
75 | /**
|
76 | * Text excerpt token that is part of a type definition or extends block and may have a link
|
77 | * to another doc page. For API reference tables.
|
78 | */
|
79 | export interface ILinkToken {
|
80 | text: string;
|
81 | /** If this token is a link, name of the doc page it points to */
|
82 | linkedPage?: string;
|
83 | /** If this token is a link, group/category of the doc page it points to */
|
84 | linkedPageGroup?: string;
|
85 | }
|
86 | /**
|
87 | * Generic row for API reference tables.
|
88 | * It can represent a member (property or method) of an interface or class.
|
89 | */
|
90 | export interface ITableRowJson {
|
91 | name: string;
|
92 | kind?: 'method' | 'property';
|
93 | /**
|
94 | * The row's type translated to an array of text elements and links to other types.
|
95 | * For example, `Readonly<IFoo>` would translate to:
|
96 | * `[{ text: 'Readonly<' }, { text: 'IFoo', hyperlinkedPage: '(page name)', pageKind: '(kind)' }, { text: '>' }]`
|
97 | */
|
98 | typeTokens: ILinkToken[];
|
99 | defaultValue?: string;
|
100 | description: string;
|
101 | deprecated: boolean;
|
102 | deprecatedMessage?: string;
|
103 | required?: boolean;
|
104 | }
|
105 | /**
|
106 | * Enum member row for API reference tables.
|
107 | */
|
108 | export declare type IEnumTableRowJson = Omit<ITableRowJson, 'kind' | 'typeTokens' | 'defaultValue' | 'required'> & {
|
109 | value: string;
|
110 | };
|
111 | export declare type ApiKind = 'interface' | 'enum' | 'class' | 'typeAlias';
|
112 | /**
|
113 | * Info for a table representing a top-level API item: interface, enum, class, or type alias.
|
114 | */
|
115 | export interface ITableJson {
|
116 | kind: ApiKind;
|
117 | name: string;
|
118 | /**
|
119 | * Any types the item extends, translated to an array of text elements and links to other types.
|
120 | * For classes and interfaces only.
|
121 | */
|
122 | extendsTokens: ILinkToken[];
|
123 | description: string;
|
124 | members?: ITableRowJson[] | IEnumTableRowJson[];
|
125 | deprecated?: boolean;
|
126 | deprecatedMessage?: string;
|
127 | }
|
128 | /**
|
129 | * Structure of the page.json files
|
130 | */
|
131 | export interface IPageJson {
|
132 | tables: ITableJson[];
|
133 | name: string;
|
134 | group?: string;
|
135 | }
|