forked from mystiq/hydrogen-web
reuse ViewNode in Child type
This commit is contained in:
parent
040efa970c
commit
ea4d833a43
1 changed files with 3 additions and 1 deletions
|
@ -17,9 +17,11 @@ limitations under the License.
|
|||
|
||||
// DOM helper functions
|
||||
|
||||
import {ViewNode} from "./types";
|
||||
|
||||
export type ClassNames<T> = { [className: string]: boolean | ((value: T) => boolean) }
|
||||
export type BasicAttributes<T> = { [attribute: string]: ClassNames<T> | boolean | string }
|
||||
export type Child = string | Text | Element
|
||||
export type Child = string | Text | ViewNode;
|
||||
|
||||
export function isChildren(children: object | Child | Child[]): children is Child | Child[] {
|
||||
// children should be an not-object (that's the attributes), or a domnode, or an array
|
||||
|
|
Loading…
Reference in a new issue