createVNode,
VNodeArrayChildren,
Fragment,
+ Text,
+ Comment,
isVNode
} from './vnode'
import { Teleport, TeleportProps } from './components/Teleport'
children?: RawChildren | RawSlots
): VNode
+// text/comment
+export function h(
+ type: typeof Text | typeof Comment,
+ children?: string | number | boolean
+): VNode
+export function h(
+ type: typeof Text | typeof Comment,
+ props?: null,
+ children?: string | number | boolean
+): VNode
// fragment
export function h(type: typeof Fragment, children?: VNodeArrayChildren): VNode
export function h(
// Kanitkorn Sujautra <https://github.com/lukyth>
// Sebastian Silbermann <https://github.com/eps1lon>
+import { VNode } from '@vue/runtime-core'
import * as CSS from 'csstype'
export interface CSSProperties extends CSS.Properties<string | number> {
declare global {
namespace JSX {
- interface Element {}
+ interface Element extends VNode {}
interface ElementClass {
$props: {}
}
import {
+ h,
+ Text,
FunctionalComponent,
expectError,
expectType,
} from './index'
// simple function signature
-const Foo = (props: { foo: number }) => props.foo
+const Foo = (props: { foo: number }) => h(Text, null, props.foo)
// TSX
expectType<JSX.Element>(<Foo foo={1} />)
Fragment,
Teleport,
expectError,
- expectType
+ expectType,
+ VNode
} from './index'
+expectType<VNode>(<div />)
expectType<JSX.Element>(<div />)
expectType<JSX.Element>(<div id="foo" />)
expectType<JSX.Element>(<input value="foo" />)