Skip to content

refactor(superdoc): widen ExportParams.fieldsHighlightColor to string | null (SD-2828)#3107

Merged
caio-pizzol merged 1 commit into
mainfrom
caio/SD-2828-fields-highlight
May 4, 2026
Merged

refactor(superdoc): widen ExportParams.fieldsHighlightColor to string | null (SD-2828)#3107
caio-pizzol merged 1 commit into
mainfrom
caio/SD-2828-fields-highlight

Conversation

@caio-pizzol

Copy link
Copy Markdown
Contributor

The runtime defaults `fieldsHighlightColor` to `null` when the consumer omits it, forwards that `null` straight through to `Editor.exportDocx` (which already types it as `string | null`), and on through the converter. The previous public typedef narrowed to `string`, so consumers passing the runtime-equivalent `null` failed strict-mode typechecks on a value the runtime accepts.

Three follow-on changes:

  • `ExportParams.fieldsHighlightColor` widens to `string | null | undefined` (typedef + JSDoc on `exportEditorsToDOCX`).
  • New consumer fixture covers the three valid shapes (string, null, omitted) and pins the exact field type via `Equal<A,B>` so a future re-narrowing surfaces as a CI failure.
  • 2 matrix scenarios (bundler + node16) exercise the fixture.

Why now: penultimate item on the SD-2828 closeout list, after provider widening (#3101) and SearchMatch publicization (#3105). No runtime change.

Verified: consumer matrix 41/41, check:jsdoc clean, build:es declaration audit clean, SuperDoc.test.js 79/79.

… | null (SD-2828)

The runtime defaults this field to `null` when the consumer omits it,
forwards that `null` through to `Editor.exportDocx` (which already
types it as `string | null`), and on through the converter. The
previous public typedef narrowed to `string`, so consumers passing
the runtime-equivalent `null` failed strict-mode typechecks.

Adds a consumer fixture covering the three valid shapes (string, null,
omitted) plus a strict `Equal<A,B>` assertion so a future re-narrowing
surfaces as a CI failure.
@caio-pizzol
caio-pizzol requested a review from a team as a code owner May 4, 2026 09:13
@linear

linear Bot commented May 4, 2026

Copy link
Copy Markdown

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@caio-pizzol
caio-pizzol merged commit c04d4bf into main May 4, 2026
74 checks passed
@caio-pizzol
caio-pizzol deleted the caio/SD-2828-fields-highlight branch May 4, 2026 09:52
@superdoc-bot

superdoc-bot Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in @superdoc-dev/mcp v0.3.0-next.37

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in vscode-ext v2.3.0-next.81

@superdoc-bot

superdoc-bot Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in @superdoc-dev/react v1.2.0-next.79

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in superdoc-cli v0.8.0-next.55

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in superdoc v1.30.0-next.38

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in superdoc-sdk v1.8.0-next.40

@superdoc-bot

superdoc-bot Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in superdoc-cli v0.9.0

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in superdoc v1.32.0

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in @superdoc-dev/mcp v0.4.0

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in @superdoc-dev/react v1.3.0

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in vscode-ext v2.4.0

@superdoc-bot

superdoc-bot Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in superdoc-sdk v1.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants