Skip to content

Commit 7cd7062

Browse files
author
James Hill
committed
Expose IVNode interface for external useage
1 parent ffe44f0 commit 7cd7062

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hypnode",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { IAttrs } from './attributes';
22
import { useState, setElement, setIndex } from './useState';
3-
import { virtualDom } from './virtualDom';
3+
import { IVNode, virtualDom } from './virtualDom';
44

55
/* -----------------------------------
66
*
@@ -215,4 +215,4 @@ function render(root: HTMLElement, output: HTMLElement) {
215215
*
216216
* -------------------------------- */
217217

218-
export { h, useState, render, Hypnode, Tag };
218+
export { Hypnode, Tag, IVNode, h, useState, render };

src/virtualDom.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
import { IAttrs } from './attributes';
22
import { Tag } from './index';
33

4+
/* -----------------------------------
5+
*
6+
* IVNode
7+
*
8+
* -------------------------------- */
9+
10+
interface IVNode {
11+
nodeName: Tag;
12+
attrs: IAttrs;
13+
children: any[];
14+
}
15+
416
/* -----------------------------------
517
*
618
* Virtual
@@ -21,4 +33,4 @@ function virtualDom(tag: Tag, attrs: IAttrs, children: any[]): any {
2133
*
2234
* -------------------------------- */
2335

24-
export { virtualDom };
36+
export { IVNode, virtualDom };

0 commit comments

Comments
 (0)