Typedoc has a lot of errors about .d.ts files

I'm trying to document a series of api documents in a project I'm working on, but when using the command typedoc ./src/ts/api --out ./docs, I get a lot of errors that have nothing to do with ./src/ts/api, including the following (the whole stack trace is thousands of lines):

Error: node_modules/@types/react/index.d.ts:2970:19 - error TS2320: Interface 'ElementClass' cannot simultaneously extend types 'Component<any, {}, any>' and 'Component<any, {}, any>'.
  Named property 'refs' of types 'Component<any, {}, any>' and 'Component<any, {}, any>' are not identical.

2970         interface ElementClass extends React.Component<any> {
                       ~~~~~~~~~~~~

Error: node_modules/@types/react/index.d.ts:2978:14 - error TS2300: Duplicate identifier 'LibraryManagedAttributes'.

2978         type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
                  ~~~~~~~~~~~~~~~~~~~~~~~~

  node_modules/@types/react-dom/node_modules/@types/react/index.d.ts:3057:14
    3057         type LibraryManagedAttributes<C, P> = C extends React.MemoExoticComponent<infer T> | React.LazyExoticComponent<infer T>
                      ~~~~~~~~~~~~~~~~~~~~~~~~
    'LibraryManagedAttributes' was also declared here.

There's also another part:

Error: node_modules/react-simplemde-editor/typings/SimpleMdeReact.d.ts:9:152 - error TS1109: Expression expected.

9     [TKey in string & DOMEvent & keyof GlobalEventHandlersEventMap as `${TKey}`]?: (instance: Editor, event: GlobalEventHandlersEventMap[TKey]) => void;
How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum