mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 06:36:08 +03:00
22 lines
405 B
TypeScript
22 lines
405 B
TypeScript
|
//@filename: file.tsx
|
||
|
//@jsx: preserve
|
||
|
declare module JSX {
|
||
|
interface Element { }
|
||
|
interface ElementClass {
|
||
|
render: any;
|
||
|
}
|
||
|
interface IntrinsicElements { }
|
||
|
}
|
||
|
|
||
|
interface Obj1type {
|
||
|
new(n: string): { x: number };
|
||
|
}
|
||
|
var Obj1: Obj1type;
|
||
|
<Obj1 x={10} />; // Error, no render member
|
||
|
|
||
|
interface Obj2type {
|
||
|
(n: string): { x: number; render: any; };
|
||
|
}
|
||
|
var Obj2: Obj2type;
|
||
|
<Obj2 x={32} render={100} />; // OK
|