Skip to content

Instantly share code, notes, and snippets.

@tswistak
Created January 16, 2019 10:27
Show Gist options
  • Save tswistak/58eec6fddd00de2c24a8256a69536cc3 to your computer and use it in GitHub Desktop.
Save tswistak/58eec6fddd00de2c24a8256a69536cc3 to your computer and use it in GitHub Desktop.
Avoiding any in TypeScript, listing 4
type Partial<T> = {
[P in keyof T]?: T[P];
};
type Required<T> = {
[P in keyof T]-?: T[P];
};
type Readonly<T> = {
readonly [P in keyof T]: T[P];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment