//@filename: file.tsx
//@jsx: preserve
declare module JSX {
interface Element { }
interface IntrinsicElements {
test1: Attribs1;
}
}
interface Attribs1 {
x: string;
y?: number;
z?: string;
}
// OK
var obj1 = { x: 'foo' };
// Error, x is not string
var obj2 = { x: 32 };
// Error, x is missing
var obj3 = { y: 32 };
// OK
var obj4 = { x: 32, y: 32 };
// Error
var obj5 = { x: 32, y: 32 };
// Ok
var obj6 = { x: 'ok', y: 32, extra: 100 };
// OK (spread override)
var obj7 = { x: 'foo' };