Commit 9045a26
authored
fix(superdoc): close public typedef gaps surfaced by SuperDoc.js probe (SD-2872) (#3046)
* fix(superdoc): close public typedef gaps surfaced by SuperDoc.js probe (SD-2872)
Probing `// @ts-check` against `packages/superdoc/src/core/SuperDoc.js`
(per the SD-2863 ratchet) surfaced 16 properties that the
implementation reads but the public JSDoc typedefs do not declare.
Each missing field is a customer-typeable property the runtime
supports today but TypeScript reports as unknown for consumers.
Adds:
Config.useLayoutEngine
Config.onFontsResolved
Config.socket
Modules.whiteboard
SuperDocLayoutEngineOptions.virtualization (+ enabled, window, overscan)
SuperDocLayoutEngineOptions.showBookmarks
User.color
Document.role
Verified locally: enabling `// @ts-check` on SuperDoc.js drops the
TS2339 errors against named typedefs from 17 to 1 (the remaining one
is a `Editor | PresentationEditor` narrowing issue, not a typedef
gap, and is in scope for SD-2867 phase 2).
This PR ships the typedef-side fix only. Enrolling SuperDoc.js under
the SD-2863 gate is tracked in SD-2867; ~137 unrelated errors
(implicit-any, loose `Object` typedefs, strict-null) need dedicated
cleanup before the gate enrollment.
* fix(superdoc): correct three typedef shapes from PR3046 review (SD-2872)
Codex review pass found three additions in the previous commit that
did not match runtime behavior:
- Document.role advertised a per-document override that does not
exist. SuperDoc only writes `doc.role = config.role` internally;
external collaboration overwrites it. Customers who set it on a
per-document basis would see their value silently replaced. Removed
the typedef.
- Modules.whiteboard rejected the `false` disable sentinel that
use-whiteboard.js explicitly checks (`config === false`). Widened
the type to `false | { enabled?: boolean }` so the runtime-supported
shape compiles.
- Config.onFontsResolved typed the payload as `{ editor }`. The
editor actually emits `{ documentFonts, unsupportedFonts }`
(FontsResolvedPayload). Aligned with the public type already
exported from `@superdoc/super-editor`.1 parent e6b36ca commit 9045a26
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
536 | 537 | | |
537 | 538 | | |
538 | 539 | | |
| 540 | + | |
539 | 541 | | |
540 | 542 | | |
541 | 543 | | |
| |||
628 | 630 | | |
629 | 631 | | |
630 | 632 | | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
631 | 638 | | |
632 | 639 | | |
633 | 640 | | |
| |||
725 | 732 | | |
726 | 733 | | |
727 | 734 | | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
728 | 738 | | |
729 | 739 | | |
730 | 740 | | |
| |||
0 commit comments