refactor: remove shorthands on h
This commit is contained in:
parent
ca91797c7f
commit
0cd8183fbf
@ -5,7 +5,6 @@ import {
|
||||
VNode,
|
||||
createElementVNode,
|
||||
createComponentVNode,
|
||||
createTextVNode,
|
||||
createFragment,
|
||||
createPortal,
|
||||
VNodeData,
|
||||
@ -36,14 +35,6 @@ export type ElementType =
|
||||
| typeof Fragment
|
||||
| typeof Portal
|
||||
|
||||
interface VNodeFactories {
|
||||
c: typeof createComponentVNode
|
||||
e: typeof createElementVNode
|
||||
t: typeof createTextVNode
|
||||
f: typeof createFragment
|
||||
p: typeof createPortal
|
||||
}
|
||||
|
||||
// This is used to differentiate the data object from
|
||||
// vnodes and arrays
|
||||
type Differ = { _isVNode?: never; [Symbol.iterator]?: never }
|
||||
@ -53,7 +44,7 @@ type OptionsComponent<P> =
|
||||
| (ComponentOptions<P> & { render: Function })
|
||||
|
||||
// TODO improve return type with props information
|
||||
interface createElement extends VNodeFactories {
|
||||
interface createElement {
|
||||
// element
|
||||
(tag: string, children?: RawChildrenType): VNode
|
||||
(
|
||||
@ -175,9 +166,3 @@ export const h = ((tag: ElementType, data?: any, children?: any): VNode => {
|
||||
)
|
||||
}
|
||||
}) as createElement
|
||||
|
||||
h.c = createComponentVNode
|
||||
h.e = createElementVNode
|
||||
h.t = createTextVNode
|
||||
h.f = createFragment
|
||||
h.p = createPortal
|
||||
|
@ -1,7 +1,14 @@
|
||||
// Core API
|
||||
export { h, Fragment, Portal } from './h'
|
||||
export { Component } from './component'
|
||||
export { cloneVNode, createPortal, createFragment } from './vdom'
|
||||
export {
|
||||
cloneVNode,
|
||||
createElementVNode,
|
||||
createComponentVNode,
|
||||
createTextVNode,
|
||||
createFragment,
|
||||
createPortal
|
||||
} from './vdom'
|
||||
export {
|
||||
createRenderer,
|
||||
NodeOps,
|
||||
|
Loading…
Reference in New Issue
Block a user