Factory type

Factory describes a generic factory function signature. The type is generic over a few parameters:

type Factory<Type, Initial> = (initialValue: Initial extends true ? Type : Type) => Type