Skip to main content

PopUnion TypeAlias

Gets the first item of a union type.

This API is reserved for internal system use and should not be imported directly. It may change at any time without notice.

For more information about our API support guarantees, see here.

Signature

export type PopUnion<Union, AsOverloadedFunction = UnionToIntersection<Union extends unknown ? (f: Union) => void : never>> = AsOverloadedFunction extends (a: infer First) => void ? First : never;

Type Parameters

ParameterDefaultDescription
UnionThe union to convert.
AsOverloadedFunctionUnionToIntersection<Union extends unknown ? (f: Union) => void : never>Implementation detail: do not specify.