I've seen two definitions of connectedness of categorical flavour which I present below:
(Maps into two point set): A topological space $X$ is connected iff the only continous functions $f:X \to \{ 0,1 \}$ are the constant functions *
(Intermediate value property of maps into $\mathbb{R}$): A topological space is connected iff every continous function $f:X \to \mathbb{R}$ has the intermediate value property *
These are quite nice because they show that to understand connectedness, an internal property of the space, it suffices to study the behaviour of maps from that space into some other fixed space. In short, it shows that a certain internal property of the space is stored in maps from the space.
In undergraduate topology, another concept that's introduced around the same time connectedness is and also starts with a "c" is compactness. Now, I know there are many types of compactness, which luckily turn out to be the same metric spaces. The many equivalent versions can be found on wiki.
However, I've never heard of a categorical formulation of compactness and couldn't find much on it by googling. I found this MO question discusses a possible umformulation. But, the final conclusion was that the one provided by the asker wouldn't suffice.
I want to ask, does there exist a simple categorical description of open cover compactness? If notno, why is it difficult to give a simple description of compactness in terms of maps of a given space to some other fixed one like we do with connectedness?
Remark:
I am aware that if such a characterization existed, it would involve properties of map which involves $X$ as domain, rather than codomain. This intuition I have comes of the fact we only have that image of compact set is compact and not that preimage of compact set is compact. That is, whether preimage of compact set is compact or non compact has no say on if the function is continous or not.