Skip to content

Instantly share code, notes, and snippets.

@sota1235
Created May 5, 2020 03:44
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 sota1235/cd369d0e399152376e7aed5190954742 to your computer and use it in GitHub Desktop.
Save sota1235/cd369d0e399152376e7aed5190954742 to your computer and use it in GitHub Desktop.
// will be used for type definition of select method for RDB
type ObjectKeys<T extends { [key: string]: any }> = keyof T;
function test<TRecord>(
columns: ObjectKeys<TRecord>[],
) {
console.log(columns);
}
test<{
id: number,
hoge: string,
moge: number,
}>(['id', 'hoge']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment