UNPKG

4.73 kBSource Map (JSON)View Raw
1{"version":3,"file":"DocPage.types.js","sourceRoot":"../src/","sources":["common/DocPage.types.ts"],"names":[],"mappings":"","sourcesContent":["import { IStyleFunctionOrObject, Omit } from '../Utilities';\nimport { ITheme, IStyle } from '../Styling';\n\nexport interface IExample {\n /** Title of the example */\n title: string;\n\n /** Raw source code of the example */\n code: string;\n\n /** Working example of the example */\n view: JSX.Element;\n\n isScrollable?: boolean;\n\n /** JS String for codepen of the example */\n codepenJS?: string;\n\n /** Custom styles. Partial version of `IExampleCardProps['styles']`. */\n styles?: IStyleFunctionOrObject<{ theme?: ITheme }, { root: IStyle }>;\n}\n\nexport interface IDocPageProps {\n /** Title that goes into the header */\n title: string;\n\n /** Name of the component being documented */\n componentName: string;\n\n /** URL of the checked in component, should be somewhere on github.com */\n componentUrl: string;\n\n /** Knobs that applies to all the examples */\n exampleKnobs?: JSX.Element;\n\n /** Array of examples, displayed in the order defined */\n examples?: IExample[];\n\n /** Properties table(s) as markdown string */\n propertiesTablesSources?: string[];\n\n /** Overview of the component as markdown string */\n overview?: string;\n\n /** Accessibility of the component as markdown string */\n accessibility?: string;\n\n /** DO's blurb as markdown string */\n dos?: string;\n\n /** DON'Ts blurb as markdown string */\n donts?: string;\n\n /** Best practice as markdown string */\n bestPractices?: string;\n\n /** Feedback section includes link to new issue page and displays Github issues */\n isFeedbackVisible?: boolean;\n\n /** Passed through header visibility flag from the demo component page component */\n isHeaderVisible: boolean;\n\n /** If true, the component accepts all native props from elements specified in `nativePropsElement` */\n allowNativeProps?: boolean;\n\n /** Override component name to use in the native props message */\n allowNativePropsForComponentName?: string;\n\n /**\n * Element(s) whose native props this component accepts (default div).\n * Only relevant if `allowNativeProps` is true.\n */\n nativePropsElement?: string | string[];\n\n /**\n * Related link\n * @deprecated No longer shown on ComponentPage\n */\n related?: JSX.Element;\n\n /** Pass through other sections for ComponentPage */\n otherSections?: {\n title: string;\n section: JSX.Element;\n }[];\n\n /**\n * JSON to populate the api reference tables\n */\n jsonDocs?: IPageJson;\n}\n\n/**\n * Used to keep track of where an API reference page will live on the site.\n */\nexport type PageKind = 'References' | 'Components';\n\n/**\n * Text excerpt token that is part of a type definition or extends block and may have a link\n * to another doc page. For API reference tables.\n */\nexport interface ILinkToken {\n text: string;\n /** If this token is a link, name of the doc page it points to */\n linkedPage?: string;\n /** If this token is a link, group/category of the doc page it points to */\n linkedPageGroup?: string;\n}\n\n/**\n * Generic row for API reference tables.\n * It can represent a member (property or method) of an interface or class.\n */\nexport interface ITableRowJson {\n name: string;\n kind?: 'method' | 'property';\n /**\n * The row's type translated to an array of text elements and links to other types.\n * For example, `Readonly<IFoo>` would translate to:\n * `[{ text: 'Readonly<' }, { text: 'IFoo', hyperlinkedPage: '(page name)', pageKind: '(kind)' }, { text: '>' }]`\n */\n typeTokens: ILinkToken[];\n defaultValue?: string;\n description: string;\n deprecated: boolean;\n deprecatedMessage?: string;\n required?: boolean;\n}\n\n/**\n * Enum member row for API reference tables.\n */\nexport type IEnumTableRowJson = Omit<ITableRowJson, 'kind' | 'typeTokens' | 'defaultValue' | 'required'> & {\n value: string;\n};\n\nexport type ApiKind = 'interface' | 'enum' | 'class' | 'typeAlias';\n\n/**\n * Info for a table representing a top-level API item: interface, enum, class, or type alias.\n */\nexport interface ITableJson {\n kind: ApiKind;\n name: string;\n /**\n * Any types the item extends, translated to an array of text elements and links to other types.\n * For classes and interfaces only.\n */\n extendsTokens: ILinkToken[];\n description: string;\n members?: ITableRowJson[] | IEnumTableRowJson[];\n deprecated?: boolean;\n deprecatedMessage?: string;\n}\n\n/**\n * Structure of the page.json files\n */\nexport interface IPageJson {\n tables: ITableJson[];\n name: string;\n group?: string;\n}\n"]}
\No newline at end of file