Skip to content

Instantly share code, notes, and snippets.

@Voltra
Created July 10, 2022 19:46
Show Gist options
  • Save Voltra/d129743c6769545f72b5202a28a69045 to your computer and use it in GitHub Desktop.
Save Voltra/d129743c6769545f72b5202a28a69045 to your computer and use it in GitHub Desktop.
types.ts
export type MethodsOf<Obj> = {
[Key in keyof Obj]: Obj[Key] extends (...args: unknown[]) => unknown ? Key : never;
}[keyof Obj];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment