mirror of
https://github.com/swc-project/swc.git
synced 2024-12-20 12:12:16 +03:00
20 lines
346 B
TypeScript
20 lines
346 B
TypeScript
|
//@filename: file.tsx
|
||
|
//@jsx: preserve
|
||
|
declare module JSX {
|
||
|
interface Element { }
|
||
|
interface IntrinsicElements {
|
||
|
test1: Attribs1;
|
||
|
}
|
||
|
}
|
||
|
interface Attribs1 {
|
||
|
c1?: (x: string) => void;
|
||
|
}
|
||
|
|
||
|
// OK
|
||
|
<test1 c1={(x) => x.length} />; // OK
|
||
|
<test1 data-c1={(x) => x.leng} />; // OK
|
||
|
|
||
|
|
||
|
// Errors
|
||
|
<test1 c1={(x) => x.leng} />; // Error, no leng on 'string'
|