chore(refactor): format files with Prettier

pull/1095/head
Simon Friis Vindum 1 year ago
parent d0db5c5c6b
commit 20d1ce2cc5

@ -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<X, Y, Output> = (<T>() => T extends X
? 1
: 2) extends <T>() => T extends Y ? 1 : 2
export type IfEquals<X, Y, Output> = (<T>() => T extends X ? 1 : 2) extends <
T
>() => T extends Y ? 1 : 2
? Output
: never
: never;
export type WritableKeys<T> = {
[P in keyof T]-?: IfEquals<
{ [Q in P]: T[P] },
{ -readonly [Q in P]: T[P] },
P
>
}[keyof T]
>;
}[keyof T];
export type ElementProperties<T> = {
[Property in WritableKeys<T> as T[Property] extends string | number | null | undefined ? Property : never]?: T[Property]
}
[Property in WritableKeys<T> as T[Property] extends
| string
| number
| null
| undefined
? Property
: never]?: T[Property];
};
export type VNodeProps<T> = ElementProperties<T> & Props
export type VNodeProps<T> = ElementProperties<T> & Props;
export type HtmlElements = {
[Property in keyof HTMLElementTagNameMap]: VNodeData<VNodeProps<HTMLElementTagNameMap[Property]>>
}
[Property in keyof HTMLElementTagNameMap]: VNodeData<
VNodeProps<HTMLElementTagNameMap[Property]>
>;
};
export interface IntrinsicElements extends HtmlElements {
[elemName: string]: VNodeData;

@ -1,12 +1,13 @@
import { VNode, VNodeData } from "../vnode";
import { Module } from "./module";
export type ElementStyle = Partial<CSSStyleDeclaration>
export type ElementStyle = Partial<CSSStyleDeclaration>;
export type VNodeStyle = ElementStyle & Record<string, string> & {
delayed?: ElementStyle & Record<string, string>;
remove?: ElementStyle & Record<string, string>;
};
export type VNodeStyle = ElementStyle &
Record<string, string> & {
delayed?: ElementStyle & Record<string, string>;
remove?: ElementStyle & Record<string, string>;
};
// Binding `requestAnimationFrame` like this fixes a bug in IE/Edge. See #360 and #409.
const raf =

Loading…
Cancel
Save