import {Application, JSX, DefaultTheme, DefaultThemeRenderContext, Options, ReflectionKind} from 'typedoc' export class MiroThemeContext extends DefaultThemeRenderContext { constructor(theme: DefaultTheme, options: Options) { super(theme, options) // Remove footer this.footer = () => null // Replace navigation with custom index this.navigation = (context) => { type Item = { title: string url?: string icon?: ReflectionKind cssClasses?: string children?: Array } const items: Item[] = [ { title: 'Miro', url: 'classes/index.Miro.html', }, { title: 'MiroApi', url: 'classes/index.MiroApi.html', children: [ { title: 'Board', url: 'classes/index.Board.html', children: [ {title: 'StickyNoteItem'}, {title: 'TextItem'}, {title: 'CardItem'}, {title: 'AppCardItem'}, {title: 'DocumentItem'}, {title: 'EmbedItem'}, {title: 'ShapeItem'}, {title: 'ImageItem'}, {title: 'FrameItem'}, {title: 'Item'}, {title: 'Connector'}, {title: 'Tag'}, ], }, {title: 'Team'}, {title: 'Organization'}, ], }, { title: 'MiroOptions', url: 'interfaces/index.MiroOptions.html', icon: ReflectionKind.Interface, }, { title: 'Storage', url: 'interfaces/index._internal_.Storage.html', icon: ReflectionKind.Interface, }, ] const Navigation = ({items}: {items: Item[]}) => { return ( ) } return ( <>

{this.secondaryNavigation(context)} ) } } } export class MiroTheme extends DefaultTheme { private _contextCache?: MiroThemeContext override getRenderContext(): MiroThemeContext { this._contextCache ||= new MiroThemeContext(this, this.application.options) return this._contextCache } } export function load(app: Application) { // Add custom css app.renderer.hooks.on( 'head.end', (): JSX.Element => ( ), ) // register custom theme app.renderer.defineTheme('miro', MiroTheme) }