Skip to content

Instantly share code, notes, and snippets.

@przemyslawjanpietrzak
Created December 11, 2018 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save przemyslawjanpietrzak/d2e81b76127b8955821e1bdb604b5dd1 to your computer and use it in GitHub Desktop.
Save przemyslawjanpietrzak/d2e81b76127b8955821e1bdb604b5dd1 to your computer and use it in GitHub Desktop.
type ReadonlyObject<A> = { readonly [K in keyof A]: A[K] };
type DeepReadonlyObject<A> = { readonly [K in keyof A]: DeepReadonly<A[K]> }
type X = DeepReadonlyObject<{ key: string, key1: number }>; // { readonly key: any; readonly key1: any; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment