Remove internal ViewDesc API from type declarations #178

Merged
ocavue merged 1 commit from ocavue/hide-pmViewDesc into master 2025-02-14 13:06:00 +01:00
ocavue commented 2025-02-14 08:54:20 +01:00 (Migrated from github.com)

In prosemirror-view/dist/index.d.ts, I noticed some internal APIs:

declare global {
    interface Node {
        pmViewDesc?: ViewDesc;
    }
}

declare class ViewDesc {
  // ...
}

declare class NodeViewDesc extends ViewDesc {
  // ...
}

While most of these APIs are fine, pmViewDesc is causing issues in my automated documentation generation from .d.ts files. To resolve this, I propose adding /// @internal comment to pmViewDesc. This will prevent them from appearing in the generated documentation.

In [prosemirror-view/dist/index.d.ts](https://unpkg.com/prosemirror-view@1.38.0/dist/index.d.ts), I noticed some internal APIs: ```ts declare global { interface Node { pmViewDesc?: ViewDesc; } } declare class ViewDesc { // ... } declare class NodeViewDesc extends ViewDesc { // ... } ``` While most of these APIs are fine, `pmViewDesc` is causing issues in my automated documentation generation from `.d.ts` files. To resolve this, I propose adding `/// @internal` comment to `pmViewDesc`. This will prevent them from appearing in the generated documentation.
marijnh commented 2025-02-14 13:04:43 +01:00 (Migrated from github.com)

Oh wow, I hadn't realized TS copied those into our .d.ts files. Thanks for spotting that.

Oh wow, I hadn't realized TS copied those into our .d.ts files. Thanks for spotting that.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prosemirror/prosemirror-view!178
No description provided.