Skip to content

Commit 1bc4202

Browse files
Add tsconfig to documentation
1 parent 4ed236f commit 1bc4202

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/src/content/docs/guides/adding-settings.mdx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,25 @@ module.exports = require('flarum-webpack-config')({
1414
});
1515
```
1616

17+
For typings, add the extension to your `tsconfig.json`:
18+
19+
```json
20+
{
21+
"compilerOptions": {
22+
"paths": {
23+
"@ordinaryjellyfish-sentra": ["../vendor/ordinaryjellyfish/sentra/js/dist-typings/admin/index.d.ts"]
24+
}
25+
}
26+
}
27+
```
28+
1729
Then you'll need to extend the settings page:
1830

1931
```ts
2032
// src/admin/index.ts
2133
import app from 'flarum/admin/app';
2234
import { extend } from 'flarum/common/extend';
23-
// Your IDE may throw an error with this import, this can be safely ignored
35+
// If your IDE throws an error with this import, make sure you added the Sentra typings to your tsconfig
2436
import { SettingsPage } from '@ordinaryjellyfish-sentra';
2537

2638
app.initializers.add('your/extension', () => {

0 commit comments

Comments
 (0)