/** length of const array or tuple */ export type Length = T["length"]; /** build a tuple with length L, and type T */ export type Tuple = R extends { length: L } ? R : Tuple; /** adds two constant positive whole number types */ export type Add = Length<[...Tuple, ...Tuple]>; /** subtracts one constant positive whole number type from another */ export type Subtract = Tuple extends [...infer U, ...Tuple] ? Length : never; /** type of the last element of a readonly array or tuple */ export type Last = A[Subtract, 1>]; /** type of the first element of a readonly array or tuple */ export type First = A[Length]; /** * Extract the prop types of a vue 2 component. This is an alternative to `ExtractPropTypes`, which has unreliable behavior in vue 2. * @example * type MyComponentPropsType = GetComponentPropTypes; */ export type GetComponentPropTypes< T extends import("vue/types/v3-component-public-instance").ComponentPublicInstanceConstructor > = InstanceType["$props"];