docs(README): Note TypeScript and DLL-build support

This commit is contained in:
Tony Narlock 2024-03-17 12:29:26 -05:00
parent 5f5dabd4c4
commit dcae401b46

View File

@ -25,6 +25,8 @@ ckeditor5-math is a TeX-based mathematical plugin for CKEditor 5. You can use it
## Features
- Written in TypeScript (as of v41.2.1)
- DLL build support (as of v36.0.3)
- TeX syntax
- Inline and display equations
- Preview view
@ -267,43 +269,6 @@ CKEditor5.editorInline.InlineEditorEditor
My solution for this is use rendering element outside of CKEditor DOM and place it to right place by using absolute position. Alternative solution could be using iframe, but then typesetting engine's scripts and styles have to copy to child document.
## TypeScript users
ckeditor5-math does not have typings yet. TypeScript builds of CKEditor will see
this:
```sh
src/ckeditor.ts:63:18 - error TS7016: Could not find a declaration file for module '@isaul32/ckeditor5-math/src/math'.
'/path/to/your/project/node_modules/@isaul32/ckeditor5-math/src/math.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/isaul32__ckeditor5-math` if it exists or add a new declaration (.d.ts) file containing
`declare module '@isaul32/ckeditor5-math/src/math';`
```
### Workaround for typings
1. Create a `d.ts` declaration file, e.g. `typings/ckeditor5-math.d.ts`
```typescript
declare module '@isaul32/ckeditor5-math';
declare module '@isaul32/ckeditor5-math/src/math';
declare module '@isaul32/ckeditor5-math/src/autoformatmath';
```
2. In your [`tsconfig.json`](https://www.typescriptlang.org/tsconfig)'s
root-level [`include`](https://www.typescriptlang.org/tsconfig#include)
option, make sure your declaration file is covered, e.g.
```json
{
"extends": "ckeditor5/tsconfig.json",
"include": [
"src",
"typings",
"../../typings"
]
}
```
## Development
Contributions, improvements and bug fixes are welcome. To aid in this, try out