Skip to content
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.

Commit

Permalink
changed the usage from our own types to the types of the plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
DerMolly committed Oct 30, 2020
1 parent 1690a7b commit a7af734
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { RefObject, useState } from 'react'
import { Dropdown } from 'react-bootstrap'
import { useSelector } from 'react-redux'
import useResizeObserver from 'use-resize-observer'
import { TocAst } from '../../../external-types/markdown-it-toc-done-right/interface'
import { TocAst } from 'markdown-it-toc-done-right'
import { ApplicationState } from '../../../redux'
import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon'
import { ShowIf } from '../../common/show-if/show-if'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Fragment, ReactElement, useMemo } from 'react'
import { Trans, useTranslation } from 'react-i18next'
import { TocAst } from '../../../external-types/markdown-it-toc-done-right/interface'
import { TocAst } from 'markdown-it-toc-done-right'
import { ShowIf } from '../../common/show-if/show-if'
import './table-of-contents.scss'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useCallback, useMemo, useRef, useState } from 'react'
import { Alert } from 'react-bootstrap'
import { Trans } from 'react-i18next'
import { TocAst } from '../../external-types/markdown-it-toc-done-right/interface'
import { TocAst } from 'markdown-it-toc-done-right'
import { InternalLink } from '../common/links/internal-link'
import { ShowIf } from '../common/show-if/show-if'
import { RawYAMLMetadata, YAMLMetaData } from '../editor/yaml-metadata/yaml-metadata'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import equal from 'fast-deep-equal'
import { RefObject, useEffect, useRef } from 'react'
import { TocAst } from '../../../external-types/markdown-it-toc-done-right/interface'
import { TocAst } from 'markdown-it-toc-done-right'

export const usePostTocAstOnChange = (tocAst: RefObject<TocAst|undefined>, onTocChange?: (ast: TocAst) => void): void => {
const lastTocAst = useRef<TocAst>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import MarkdownIt from 'markdown-it'
import { TocAst } from '../../../external-types/markdown-it-toc-done-right/interface'
import { TocAst } from 'markdown-it-toc-done-right'
import { RawYAMLMetadata } from '../../editor/yaml-metadata/yaml-metadata'
import { alertContainer } from '../markdown-it-plugins/alert-container'
import { documentToc } from '../markdown-it-plugins/document-toc'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import MarkdownIt from 'markdown-it'
import toc from 'markdown-it-toc-done-right'
import { TocAst } from '../../../external-types/markdown-it-toc-done-right/interface'
import toc, { TocAst } from 'markdown-it-toc-done-right'
import { slugify } from '../../editor/table-of-contents/table-of-contents'

export type DocumentTocPluginOptions = (ast: TocAst) => void

export const documentToc:MarkdownIt.PluginWithOptions<DocumentTocPluginOptions> = (markdownIt, onToc) => {
export const documentToc: MarkdownIt.PluginWithOptions<DocumentTocPluginOptions> = (markdownIt, onToc) => {
if (!onToc) {
return
}
Expand Down
6 changes: 0 additions & 6 deletions src/external-types/markdown-it-toc-done-right/index.d.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/external-types/markdown-it-toc-done-right/interface.ts

This file was deleted.

0 comments on commit a7af734

Please sign in to comment.