mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
reuse ViewNode in Child type
This commit is contained in:
parent
040efa970c
commit
ea4d833a43
@ -17,9 +17,11 @@ limitations under the License.
|
|||||||
|
|
||||||
// DOM helper functions
|
// DOM helper functions
|
||||||
|
|
||||||
|
import {ViewNode} from "./types";
|
||||||
|
|
||||||
export type ClassNames<T> = { [className: string]: boolean | ((value: T) => boolean) }
|
export type ClassNames<T> = { [className: string]: boolean | ((value: T) => boolean) }
|
||||||
export type BasicAttributes<T> = { [attribute: string]: ClassNames<T> | boolean | string }
|
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[] {
|
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
|
// children should be an not-object (that's the attributes), or a domnode, or an array
|
||||||
|
Loading…
Reference in New Issue
Block a user