Skip to content

Type Alias: CountryCitizenship

ts
type CountryCitizenship = (typeof Country)[number]["citizenship"];

Type representing any valid citizenship/nationality demonym.

This creates a union type of all citizenship strings plus undefined, providing type safety when working with nationality data.

Example

typescript
const citizenship: CountryCitizenship = "Canadian"; // ✓ Valid
const citizenship2: CountryCitizenship = undefined; // ✓ Also valid
const invalid: CountryCitizenship = "Invalid"; // ✗ TypeScript error