MarkdownPreviewView has invalid constructor in the docs

According to the docs

MarkdownPreviewView class has constructor

constructor(containerEl: HTMLElement);

which is inherited from grandparent MarkdownRenderChild.(constructor)

However, calling

new MarkdownPreviewView(containerEl);

will fail in runtime.

The reason for the failure is that the typing doesn’t match the actual non-exported constructor, which based on my reverse-engineering suppose to have a signature

constructor(view: MarkdownView);

Similarly, while class MarkdownRenderer is abstract and cannot be instantiated directly, it has the same problem as above with the misleading constructor, which would be another runtime error for child classes

class MyMarkdownRenderer extends MarkdownRenderer {
  constructor(containerEl: HTMLElement) {
    super(containerEl);
  }
}

The actual constructor seems to be

constructor(app: App, containerEl: HTMLElement, shouldHandleNodeInsert?: boolean);

This appears to be an error in the docs generator and how it handles inherited methods.
In your first link you can see that it says “Inherited from MarkdownRenderChild”

The constructor for both MarkdownPreviewView and MarkdownRenderer is private, but they both extend from MarkdownRenderChild which has a public constructor.
The docs generator, not having access to the private constructors thinks it’s the same across all three.

Not sure how to best fix that yet.

I would suggest you to modify your d.ts generator setup and documentation generator to add

class SomeClass {
  private constructor() {}
  // ...
}

To all such classes, like the ones mentioned above and many others like TFile.

In such way, you’ll explicitly make impossible to create instances of your class via API.