Skip to content

Commit ef8f7fe

Browse files
committed
refactor(superdoc): convert core/types/index.js to TypeScript (SD-2869)
Replaces 769 lines of JSDoc @typedef declarations with native TS interfaces, type aliases, and re-exports. Each public name is preserved verbatim (Config, Modules, FindReplace*, PasswordPrompt*, Surface*, ContextMenu*, Document, User, etc.) so consumers that import from 'superdoc/types' or via the auto-derived assertion list see the same shape. Why TS instead of JSDoc: The drift class SD-2863 catches lives in implementations that consume the JSDoc typedefs. The typedef file itself was unchecked: a typedef that referenced an undefined name silently shipped as `any`. Native TypeScript declarations are checked by the compiler at every import site, so the typedef-side cannot drift from the implementation it describes. Surface preservation: - All 50+ exported names retained. - Optional vs required field flags retained. - Generic typedefs (SurfaceOutcome, SurfaceHandle) keep `<T = unknown>`. - Nested @Property declarations inlined as nested object types rather than promoted to new named interfaces, to keep the public surface byte-equivalent. - JSDoc `Object` becomes TS `object` (lowercase) which matches the resolved type consumers already saw. - Re-exported types (Editor, StoryLocator, BookmarkAddress, etc.) emerge from the same `@superdoc/super-editor` module under the same names. Verified: pnpm --filter superdoc run check:jsdoc passes (3 gated files clean), the consumer-typecheck matrix passes 27/27, and the postbuild declaration audit reports no FAIL findings.
1 parent 957c6aa commit ef8f7fe

2 files changed

Lines changed: 1372 additions & 778 deletions

File tree

0 commit comments

Comments
 (0)