import * as React from "react" ; import { Props } from "@blueprintjs/core" ; import { DocumentationContextTypes , IDocumentationContext } from "../../common/context" ; export interface IApiLinkProps extends Props { children ? : never ; name : string ; } /**
 * Renders a link to open a symbol in the API Browser.
 */ export class ApiLink extends React . PureComponent < IApiLinkProps > { public static contextTypes = DocumentationContextTypes ; public context : IDocumentationContext ; public render ( ) { const { className , name } = this . props ; return ( < a className = { className } href = { `#api/${ name }` } onClick = { this . handleClick } > { name } < /a>); } private handleClick = ( evt ) => { evt . preventDefault ( ) ; this . context . showApiDocs ( this . props . name ) ; } ; }