Skip to content

Instantly share code, notes, and snippets.

@kujo205
Last active February 11, 2024 00:30
Show Gist options
  • Select an option

  • Save kujo205/06e1b5d35b362f3094d6b9fb58e3aad6 to your computer and use it in GitHub Desktop.

Select an option

Save kujo205/06e1b5d35b362f3094d6b9fb58e3aad6 to your computer and use it in GitHub Desktop.

Revisions

  1. kujo205 revised this gist Feb 11, 2024. 2 changed files with 5 additions and 5 deletions.
    5 changes: 5 additions & 0 deletions ExtractClassMethodReturnTypes.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    type ExtractClassMethodReturnTypes<T> = {
    [K in keyof T]: T[K] extends (...args: any[]) => infer R ? Awaited<R> : never;
    };

    type AuthControllerMethods = ExtractClassMethodReturnTypes<AuthController>;
    5 changes: 0 additions & 5 deletions ts
    Original file line number Diff line number Diff line change
    @@ -1,5 +0,0 @@
    type ExtractMethodReturnTypes<T> = {
    [K in keyof T]: T[K] extends (...args: any[]) => infer R ? Awaited<R> : never;
    };

    type AuthControllerMethods = ExtractMethodReturnTypes<AuthController>;
  2. kujo205 renamed this gist Feb 11, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. kujo205 created this gist Feb 11, 2024.
    5 changes: 5 additions & 0 deletions typescript
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    type ExtractMethodReturnTypes<T> = {
    [K in keyof T]: T[K] extends (...args: any[]) => infer R ? Awaited<R> : never;
    };

    type AuthControllerMethods = ExtractMethodReturnTypes<AuthController>;