First commit
Create basic render engine that only allows to add elements
This commit is contained in:
parent
0d3eb3d40f
commit
f411544fe9
14 changed files with 414 additions and 0 deletions
18
src/lib/YarJs.interfaces.ts
Normal file
18
src/lib/YarJs.interfaces.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
export type YarHTMLTagName = keyof React.JSX.IntrinsicElements | string;
|
||||
|
||||
export type YarProps = {
|
||||
children: YarElement[];
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
export interface YarElement {
|
||||
type: YarHTMLTagName;
|
||||
props: YarProps;
|
||||
}
|
||||
|
||||
export interface YarFiber extends YarElement {
|
||||
parent: null | YarFiber;
|
||||
dom: null | HTMLElement | Text;
|
||||
child: null | YarFiber;
|
||||
sibling: null | YarFiber;
|
||||
}
|
||||
Reference in a new issue