// @jsx: react // @filename: renderer.d.ts export namespace dom { namespace JSX { interface IntrinsicElements { [e: string]: {}; } interface Element { __domBrand: void; props: { children?: Element[]; }; } interface ElementClass extends Element { render(): Element; } interface ElementAttributesProperty { props: any; } interface ElementChildrenAttribute { children: any; } } } export function dom(): dom.JSX.Element; // @filename: renderer2.d.ts export namespace predom { namespace JSX { interface IntrinsicElements { [e: string]: {}; } interface Element { __predomBrand: void; props: { children?: Element[]; }; } interface ElementClass extends Element { render(): Element; } interface ElementAttributesProperty { props: any; } interface ElementChildrenAttribute { children: any; } } } export function predom(): predom.JSX.Element; // @filename: component.tsx /** @jsx predom */ import { predom } from "./renderer2" export const MySFC = (props: {x: number, y: number, children?: predom.JSX.Element[]}) =>
{props.x} + {props.y} = {props.x + props.y}{...this.props.children}
; export class MyClass implements predom.JSX.Element { __predomBrand!: void; constructor(public props: {x: number, y: number, children?: predom.JSX.Element[]}) {} render() { return{this.props.x} + {this.props.y} = {this.props.x + this.props.y} {...this.props.children}
; } } export const tree ={props.x} + {props.y} = {props.x + props.y}{props.children}
; class DOMClass implements dom.JSX.Element { __domBrand!: void; constructor(public props: {x: number, y: number, children?: dom.JSX.Element[]}) {} render() { return{this.props.x} + {this.props.y} = {this.props.x + this.props.y}{...this.props.children}
; } } // Should work, everything is a DOM element const _tree =