Skip to content

Commit 03a7b48

Browse files
authored
fix(types): gate public surface without skipLibCheck (#3114)
* fix(types): gate public surface without skipLibCheck SD-2892: add packed-tarball consumer typecheck scenarios that compile the full public fixture set with skipLibCheck=false under bundler, node16, and nodenext. Fix the declaration issues exposed by that gate: publish the public mdast/ws type dependencies, emit NodeNext-safe relative declaration specifiers, keep Vue SFC declarations resolvable, and tighten JSDoc-generated declarations. Vue is published as ^3.5.0 because catalog: cannot survive npm packaging and exact patch installs duplicate Vue global macro declarations in consumers. @types/ws stays a dependency because @hocuspocus/provider peer declarations require it under skipLibCheck=false; @types/mdast is directly referenced by public markdown helper declarations. * fix(track-changes): keep optional and unused params off public d.ts (SD-2892) JSDoc tightening in 56dac0d inadvertently required options.id on markInsertion/markDeletion (the runtime treats it as optional) and required options.tr/options.map on addMarkStep (which never destructures them). Mark id optional with bracket syntax and drop the unused tr/map declarations so the emitted public d.ts matches the runtime contract.
1 parent c1ad3f6 commit 03a7b48

21 files changed

Lines changed: 112 additions & 32 deletions

File tree

packages/super-editor/src/editors/v1/components/toolbar/super-toolbar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ import { markerTextToBulletStyle } from '@helpers/list-numbering-helpers.js';
134134
* @typedef {Object} CommandItem
135135
* @property {ToolbarItem} item - The toolbar item
136136
* @property {*} [argument] - The argument to pass to the command
137+
* @property {*} [option] - The selected nested option for option-style commands
137138
*/
138139

139140
/**

packages/super-editor/src/editors/v1/core/commands/backspaceAcrossRuns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { findPreviousTextDeleteRange } from './findPreviousTextDeleteRange.js';
1212
* Placed after the specialized handlers (backspaceSkipEmptyRun,
1313
* backspaceNextToRun) in the keymap chain so it only fires when they bail.
1414
*
15-
* @returns {import('@core/commands/types').Command}
15+
* @returns {import('./types/index.js').Command}
1616
*/
1717
export const backspaceAcrossRuns =
1818
() =>

packages/super-editor/src/editors/v1/core/commands/backspaceEmptyRunParagraph.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { TextSelection } from 'prosemirror-state';
33
/**
44
* Removes a paragraph that only contains an empty run when backspacing inside it.
55
* Prevents deleting the only paragraph in the document.
6-
* @returns {import('@core/commands/types').Command}
6+
* @returns {import('./types/index.js').Command}
77
*/
88
export const backspaceEmptyRunParagraph =
99
() =>

packages/super-editor/src/editors/v1/core/commands/backspaceNextToRun.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { findPreviousTextDeleteRange } from './findPreviousTextDeleteRange.js';
44
/**
55
* Backspaces a single character when the cursor sits adjacent to a run boundary.
66
* Deletes the last character of the previous run (or the previous sibling run) without removing the whole run node.
7-
* @returns {import('@core/commands/types').Command}
7+
* @returns {import('./types/index.js').Command}
88
*/
99
export const backspaceNextToRun =
1010
() =>

packages/super-editor/src/editors/v1/core/commands/backspaceSkipEmptyRun.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Selection } from 'prosemirror-state';
33
/**
44
* Backspaces over an empty run to the left of the cursor, deleting the previous character instead.
55
* Only triggers when inside a run positioned directly before an empty sibling run.
6-
* @returns {import('@core/commands/types').Command}
6+
* @returns {import('./types/index.js').Command}
77
*/
88
export const backspaceSkipEmptyRun =
99
() =>

packages/super-editor/src/editors/v1/core/commands/deleteNextToRun.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Selection } from 'prosemirror-state';
33
/**
44
* Deletes a single character in the run immediately after the cursor.
55
* Keeps the run node intact and skips empty runs.
6-
* @returns {import('@core/commands/types').Command}
6+
* @returns {import('./types/index.js').Command}
77
*/
88
export const deleteNextToRun =
99
() =>

packages/super-editor/src/editors/v1/core/commands/deleteSkipEmptyRun.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Selection } from 'prosemirror-state';
33
/**
44
* Deletes while skipping over an empty run to the right of the cursor.
55
* When the cursor is at the end of a run and followed by an empty run, removes the next character beyond it.
6-
* @returns {import('@core/commands/types').Command}
6+
* @returns {import('./types/index.js').Command}
77
*/
88
export const deleteSkipEmptyRun =
99
() =>

packages/super-editor/src/editors/v1/core/commands/skipTab.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { TextSelection } from 'prosemirror-state';
33
/**
44
* Moves the cursor across a tab node when inside a run.
55
* @param {1|-1} dir Direction to move: forward (1) or backward (-1).
6-
* @returns {import('@core/commands/types').Command}
6+
* @returns {import('./types/index.js').Command}
77
*/
88
export function skipTab(dir) {
99
return ({ state, dispatch }) => {

packages/super-editor/src/editors/v1/extensions/run/commands/split-run.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function clearHeadingStyleId(attrs) {
3232

3333
/**
3434
* Splits a run node at the current selection into two paragraphs.
35-
* @returns {import('@core/commands/types').Command}
35+
* @returns {import('../../../core/commands/types/index.js').Command}
3636
*/
3737
export const splitRunToParagraph = () => (props) => {
3838
const { state, view, tr, editor } = props;
@@ -274,7 +274,7 @@ function applyStyleMarks(state, tr, editor, paragraphAttrs, tableInfo) {
274274

275275
/**
276276
* Splits the current run node into two sibling runs at the cursor position.
277-
* @returns {import('@core/commands/types').Command}
277+
* @returns {import('../../../core/commands/types/index.js').Command}
278278
*/
279279
export const splitRunAtCursor = () => (props) => {
280280
let { state, dispatch, tr } = props;

packages/super-editor/src/editors/v1/extensions/structured-content/document-section/helpers.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { DOMSerializer } from 'prosemirror-model';
22

3+
/**
4+
* @typedef {import('../../../core/Editor.js').Editor} Editor
5+
* @typedef {import('prosemirror-model').Node} ProseMirrorNode
6+
*/
7+
38
/**
49
* Get all sections in the editor document.
510
* This function traverses the document and collects all nodes of the specified section type.
@@ -51,7 +56,7 @@ export const exportSectionsToHTML = (editor) => {
5156

5257
/**
5358
* Get HTML representation of a ProseMirror node.
54-
* @param {Node} node - The ProseMirror node to convert.
59+
* @param {ProseMirrorNode} node - The ProseMirror node to convert.
5560
* @param {Editor} editor - The editor instance used for serialization.
5661
* @returns {String} The HTML representation of the node's content.
5762
*/

0 commit comments

Comments
 (0)