Skip to content

Instantly share code, notes, and snippets.

@Goldziher
Created August 1, 2021 06:39
Show Gist options
  • Save Goldziher/afe89d427fff79a146f778b761bcb8cc to your computer and use it in GitHub Desktop.
Save Goldziher/afe89d427fff79a146f778b761bcb8cc to your computer and use it in GitHub Desktop.
EntityInterface helper type
export type EntityInterface<Entity, Base> = {
[K in keyof Omit<Entity, keyof Base>]: K extends Base
? Omit<Entity, keyof Base>
: Entity[K];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment