diff --git a/src/jsx.ts b/src/jsx.ts index 14a70e2..4d4278f 100644 --- a/src/jsx.ts +++ b/src/jsx.ts @@ -106,29 +106,37 @@ export namespace jsx { /* IfEquals/WritableKeys: https://stackoverflow.com/questions/52443276/how-to-exclude-getter-only-properties-from-type-in-typescript/52473108#52473108 */ - export type IfEquals = (() => T extends X - ? 1 - : 2) extends () => T extends Y ? 1 : 2 + export type IfEquals = (() => T extends X ? 1 : 2) extends < + T + >() => T extends Y ? 1 : 2 ? Output - : never + : never; export type WritableKeys = { [P in keyof T]-?: IfEquals< { [Q in P]: T[P] }, { -readonly [Q in P]: T[P] }, P - > - }[keyof T] + >; + }[keyof T]; export type ElementProperties = { - [Property in WritableKeys as T[Property] extends string | number | null | undefined ? Property : never]?: T[Property] - } + [Property in WritableKeys as T[Property] extends + | string + | number + | null + | undefined + ? Property + : never]?: T[Property]; + }; - export type VNodeProps = ElementProperties & Props + export type VNodeProps = ElementProperties & Props; export type HtmlElements = { - [Property in keyof HTMLElementTagNameMap]: VNodeData> - } + [Property in keyof HTMLElementTagNameMap]: VNodeData< + VNodeProps + >; + }; export interface IntrinsicElements extends HtmlElements { [elemName: string]: VNodeData; diff --git a/src/modules/style.ts b/src/modules/style.ts index 863deb9..4ffdb41 100755 --- a/src/modules/style.ts +++ b/src/modules/style.ts @@ -1,12 +1,13 @@ import { VNode, VNodeData } from "../vnode"; import { Module } from "./module"; -export type ElementStyle = Partial +export type ElementStyle = Partial; -export type VNodeStyle = ElementStyle & Record & { - delayed?: ElementStyle & Record; - remove?: ElementStyle & Record; -}; +export type VNodeStyle = ElementStyle & + Record & { + delayed?: ElementStyle & Record; + remove?: ElementStyle & Record; + }; // Binding `requestAnimationFrame` like this fixes a bug in IE/Edge. See #360 and #409. const raf =