Something went wrong. Try again.
Automerge backed Markdown editor for the Atmosphere
Something went wrong. Try again.
842 B · 25 lines
TypeScript
at main
1234567891011121314151617181920212223242526import { ItemView } from '../../plugin/views/item-view'import type { ReactItemView } from '../../plugin/views/item-view'import type { WorkspaceLeaf } from '../../plugin/workspace'import type { DocumentInfoPlugin } from './document-info-plugin'import { TocPanel } from './toc-panel'import { createElement } from 'react'
export const TOC_VIEW_TYPE = 'table-of-contents'
export class TocView extends ItemView implements ReactItemView { private plugin: DocumentInfoPlugin
constructor(leaf: WorkspaceLeaf, plugin: DocumentInfoPlugin) { super(leaf) this.plugin = plugin }
getViewType(): string { return TOC_VIEW_TYPE } getDisplayText(): string { return 'Outline' } getIcon(): string { return 'list' }
getReactComponent(): import('react').ReactNode { return createElement(TocPanel, { plugin: this.plugin }) }}