/// // component utility types /** A function component that accepts props `P` */ type Component

= (props: P) => JSX.Element /** A component whose props include `children` */ type ParentComponent

= Component< P & { children?: JSX.Element } > /** A component with no `children` prop */ type VoidComponent

= Component

/** A function or class component that accepts props `P` */ type ComponentType

= | Component

| (new ( props: P, ) => JSX.ElementClass) /** * A flow-control component (like Show, For). `C` is the children type * — defaults to `JSX.Element`, but can be a render callback. */ type FlowComponent

= Component< P & { children?: C } > /** Callback children — single or array mixed with elements */ type Children = C | (C | JSX.Element)[] // prop extraction /** Extracts the props type from a component function or tag name */ type ComponentProps = T extends (props: infer P) => any ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : Record