File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -3,21 +3,17 @@ import { State, ChildDom } from "vanjs-core";
3
3
import { FunctionChild } from "./type" ;
4
4
5
5
type OriginalElement = HTMLElement ;
6
+ type JSXProp < T , K extends keyof T > = T [ K ] | ( ( ) => T [ K ] ) | State < T [ K ] > ;
6
7
7
8
export declare namespace JSX {
8
- type JSXProp < T , K extends keyof T > = K extends "children"
9
- ? ChildDom
10
- : K extends "style"
11
- ? CSS . Properties
12
- : K extends "ref"
13
- ? State < T >
14
- : T [ K ] | ( ( ) => T [ K ] ) | State < T [ K ] > ;
15
9
type HTMLAttributes < T > = {
16
- [ K in keyof T ] ?: JSXProp < T , K > ;
17
- } ;
10
+ [ K in keyof Omit < T , "children" | "style" > ] ?: JSXProp < T , K > ;
11
+ } & Partial < { children : ChildDom ; style : CSS . Properties ; ref : State < T > } > ;
12
+
18
13
type SVGAttributes < T > = {
19
- [ K in keyof T ] ?: JSXProp < T , K > ;
20
- } ;
14
+ [ K in keyof Omit < T , "children" | "style" > ] ?: JSXProp < T , K > ;
15
+ } & Partial < { children : ChildDom ; style : CSS . Properties ; ref : State < T > } > ;
16
+
21
17
export type ElementType = string | FunctionChild < any > ;
22
18
export interface Element extends OriginalElement { }
23
19
export interface ElementAttributesProperty {
You can’t perform that action at this time.
0 commit comments