People had ways of thinking about mental illness long before there was such a thing as the dsm… when the map is untrustworthy you just go direct to the territory
But it wasn't well defined and very flexible and subjective. That's why so many merely difficult, temporarily deranged or even inconvenient people got locked away in asylums for their whole lives.