diff --git a/TYPES.md b/TYPES.md index 8504722..35a4e7a 100644 --- a/TYPES.md +++ b/TYPES.md @@ -39,7 +39,7 @@ const ClassFactory = (Ctor: T): InstanceType => new Ctor Returns a union of the **public** method types on a class. ```ts export type ClassMethodTypes = { - [K in keyof T]: T[K] extends (...args: unknown[]) => void ? T[K] : never; + [K in keyof T]: T[K] extends (...args: never) => void ? T[K] : never; }[keyof T]; /* Usage */ @@ -55,7 +55,7 @@ type MethodTypes = ClassMethodTypes; // (() => void | (param: string) => numb Returns a string union of **public** method names on a class. ```ts export type ClassMethodNames = { - [K in keyof T]: T[K] extends (...args: unknown[]) => void ? K : never; + [K in keyof T]: T[K] extends (...args: never) => void ? K : never; }[keyof T]; /* Usage */