* Fix JSX contextual types to not eagerly become apparent * Apply changes from code review, unify common code * Fix jsx children contextual typing * Light code review feedback * Use fillMissingTypeArguments * Accept nonliteral jsx child type * Add test for the fillMissingTypeArguments case
18 lines
659 B
TypeScript
18 lines
659 B
TypeScript
// @strict: true
|
|
// @jsx: preserve
|
|
namespace JSX {
|
|
export interface Element {}
|
|
export interface IntrinsicClassAttributes<TClass, TOther=never> {
|
|
ref?: TClass;
|
|
item?: TOther;
|
|
}
|
|
export interface ElementClass extends Element {}
|
|
export interface ElementAttributesProperty { props: {}; }
|
|
export interface ElementChildrenAttribute { children: {}; }
|
|
export interface IntrinsicAttributes {}
|
|
export interface IntrinsicElements { [key: string]: Element }
|
|
}
|
|
class ElemClass<T extends {x: number}> implements JSX.ElementClass {
|
|
constructor(public props: T) {}
|
|
}
|
|
const elem = <ElemClass x={12} y={24} /> |