@ngspot/ngx-errors
Version:
<p align="center"> <img width="20%" height="20%" src="https://github.com/DmitryEfimenko/ngspot/blob/main/packages/ngx-errors/package/assets/logo.png?raw=true"> </p>
18 lines (17 loc) • 534 B
TypeScript
/**
* Extract arguments of function
*/
export type ArgumentsType<F> = F extends (...args: infer A) => any ? A : never;
/**
* Provides all object method names as strings
*/
export type MethodNames<T> = {
[P in keyof T]: T[P] extends (...a: any) => unknown ? P : never;
}[keyof T];
/**
* Provides the type of an object method
*/
export type TypeOfClassMethod<T, K extends keyof T> = {
[P in keyof T]: T[P] extends (...a: any) => unknown ? T[K] : never;
}[keyof T];
export type LiteralUnionOrString<T> = T | (string & {});