Skip to content

Export LanguageName type #385

@metonym

Description

@metonym

It would be nice for TypeScript to have a type alias for all names of default languages included in the library.

This type can then be used for langtag. A widened string literal union should be used to afford autocomplete, but also allow an arbitrary string.

import type { LanguageName } from "./languages";

type LangTag = LanguageName | (string & {});

This utility type should also be used by #383

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions