2022-08-29 13:49:01 +03:00
|
|
|
//@jsx: preserve
|
2021-01-15 13:30:44 +03:00
|
|
|
//@module: amd
|
|
|
|
|
|
|
|
//@filename: react.d.ts
|
|
|
|
declare module JSX {
|
|
|
|
interface Element { }
|
|
|
|
interface IntrinsicElements {
|
|
|
|
div: any;
|
|
|
|
}
|
|
|
|
interface ElementAttributesProperty { prop: any }
|
|
|
|
}
|
|
|
|
|
|
|
|
//@filename: file.tsx
|
|
|
|
|
|
|
|
interface IProps {
|
|
|
|
primaryText: string,
|
|
|
|
[propName: string]: string | number
|
|
|
|
}
|
|
|
|
|
|
|
|
function VerticalNavMenuItem(prop: IProps) {
|
|
|
|
return <div>props.primaryText</div>
|
|
|
|
}
|
|
|
|
|
|
|
|
function VerticalNav() {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<VerticalNavMenuItem primaryText={2} /> // error
|
|
|
|
<VerticalNavMenuItem justRandomProp={2} primaryText={"hello"} /> // ok
|
|
|
|
<VerticalNavMenuItem justRandomProp1={true} primaryText={"hello"} /> // error
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|