What does "residency" mean?

Residency: A political agency at a native court in British India, held by an officer styled the Residentl: also, a Dutch commercial colony or province in the East Indies.

Sources