1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

Doc: explain how to get TypeScript typings (#9883)

Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
This commit is contained in:
Max Patiiuk 2024-02-09 06:16:18 -06:00 committed by GitHub
parent 13f907e7f1
commit f74570b403
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,6 +41,35 @@ Browser:
For usage with RequireJS, UMD versions are located in `lib/turndown.umd.js` (for Node.js) and `lib/turndown.browser.umd.js` for browser usage. These files are generated when the npm package is published. To generate them manually, clone this repo and run `npm run build`.
<details>
<summary>Getting TypeScript typings</summary>
Install typings:
```sh
npm install @types/turndown
```
Create a `declarations.d.ts` file:
```ts
declare module '@joplin/turndown' {
export { default } from 'turndown';
}
```
Add the path to the `declarations.d.ts` file in the `"files"` array
in your `tsconfig.json`:
```json
{
// ...
"files": ["declarations.d.ts"]
// ...
}
```
</details>
## Usage
```js