import { Properties } from "csstype"; /** * @see https://stackoverflow.com/questions/51465182/how-to-remove-index-signature-using-mapped-types/66252656#66252656 */ type RemoveIndex = { [P in keyof T as string extends P ? never : number extends P ? never : P extends "symbol" ? never : P extends "object" ? never : P]: T[P]; }; export type DOMElements = keyof RemoveIndex; type BaseDomDisplayProps = "block" | "inline" | "inlineBlock" | "flex" | "inlineFlex" | "grid" | "none"; export type DOMClass = any; export interface _BaseDomProps { element?: DOMElements | ComplexComponent; block?: boolean; inline?: boolean; inlineBlock?: boolean; flex?: boolean; inlineFlex?: boolean; grid?: boolean; none?: boolean; class?: DOMClass; className?: DOMClass; skeleton?(resource: any): any; children?: any; style?: Properties & { [k: string]: any; }; ref?: any; } export type ElementProps = Omit, keyof _BaseDomProps>; export type BaseDomProps = Partial; export type BaseClass = string | number; export type OptionalPick = { [P in K]?: T[P]; }; export type BaseElement = Omit & T; type Renderable = JSX.Element | string | number | boolean; interface ClassComponentProto { render(props: any, state: any): Renderable; } interface ClassComponent { new (props: any, state: any): any; readonly prototype: ClassComponentProto; } type FunctionalCompnent = (props: any) => Renderable; export type ComplexComponent = FunctionalCompnent | ClassComponent; export type KitColors = "kit-background" | "kit-shade-1" | "kit-shade-2" | "kit-shade-3" | "kit-shade-4" | "kit-shade-5" | "kit-shade-6" | "kit-shade-7" | "kit-shade-8" | "kit-foreground" | "kit-error-lightest" | "kit-error-light" | "kit-error" | "kit-error-dark" | "kit-selection" | "kit-success-lightest" | "kit-success-light" | "kit-success" | "kit-success-dark" | "kit-warning-lightest" | "kit-warning-light" | "kit-warning" | "kit-warning-dark" | "kit-violet-lightest" | "kit-violet-light" | "kit-violet" | "kit-violet-dark" | "kit-cyan-lightest" | "kit-cyan-light" | "kit-cyan" | "kit-cyan-dark" | "kit-highlight-purple" | "kit-highlight-magenta" | "kit-highlight-pink" | "kit-highlight-yellow"; export {};