mirror of
https://github.com/discourse/discourse.git
synced 2026-08-05 20:29:55 +08:00
Converts the composer text-manipulation, toolbar, and rich editor extension modules, along with the rich editor component, its extensions, and its text-manipulation library, from JavaScript/Glimmer to TypeScript. The prior `// @ts-check` JSDoc typedefs are replaced with real type declarations: a component `Signature` plus named contracts such as `RichEditorExtension`, `PluginParams`, `TextManipulation`, `PlaceholderHandler`, and `AutocompleteHandler`. The conversion is types-only. Runtime behavior is unchanged: existing guards, optional chaining, fallbacks, and control-flow branches are preserved, and no value imports were demoted to `import type`. Where the old code silenced an unresolved import with `// @ts-ignore`, the untyped `pretty-text/upload-short-url` module is now typed through an ambient declaration in `app/lib/types/`. Since `pretty-text` is a separate package not wired into the type graph, that declaration is an interim stopgap carrying a `TODO(devxp-typescript-pending)`; wiring the module for a proper source conversion is left as follow-up, and I'm happy to settle the approach in review. Verified with `pnpm lint:types` (0 errors) and the ProseMirror editor and `d-editor` integration suites (224 tests) green against a fresh build. --------- Co-authored-by: Renato Atilio <renatoat@gmail.com> |
||
|---|---|---|
| .. | ||
| asset-processor | ||
| deprecation-silencer | ||
| discourse | ||
| discourse-i18n | ||
| discourse-markdown-it | ||
| discourse-types | ||
| pretty-text | ||
| .npmrc | ||
| polyfills.js | ||