mirror of
https://github.com/flarum/framework.git
synced 2025-02-27 16:50:56 +08:00
Add fix for broken type hinting on class components (#2962)
This commit is contained in:
parent
ea9c109b65
commit
065a3a9799
13
framework/core/js/@types/global/index.d.ts
vendored
13
framework/core/js/@types/global/index.d.ts
vendored
@ -30,6 +30,19 @@ declare global {
|
|||||||
interface JQuery {
|
interface JQuery {
|
||||||
tooltip: TooltipJQueryFunction;
|
tooltip: TooltipJQueryFunction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For more info, see: https://www.typescriptlang.org/docs/handbook/jsx.html#attribute-type-checking
|
||||||
|
*
|
||||||
|
* In a nutshell, we need to add `ElementAttributesProperty` to tell Typescript
|
||||||
|
* what property on component classes to look at for attribute typings. For our
|
||||||
|
* Component class, this would be `attrs` (e.g. `this.attrs...`)
|
||||||
|
*/
|
||||||
|
namespace JSX {
|
||||||
|
interface ElementAttributesProperty {
|
||||||
|
attrs: Record<string, unknown>;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user