earljs
Version:
Ergonomic, modern and type-safe assertion library
13 lines (12 loc) • 664 B
TypeScript
import { Exact } from 'ts-essentials';
export interface Newable<T> {
new (...args: any[]): T;
}
export declare type BigIntLike = {
asIntN: Function;
asUintN: Function;
(value?: any): any;
};
export declare type NewableOrPrimitive<T = any> = Newable<T> | SymbolConstructor | BigIntLike;
export declare type Class2Primitive<T> = T extends String ? string : T extends Number ? number : T extends Boolean ? boolean : T extends BigIntLike ? bigint : T extends Symbol ? symbol : T extends Function ? () => any : T extends Exact<Object, T> ? any : T extends Array<any> ? any[] : T;
export declare type NonEmptyOnly<T> = keyof T extends never ? never : T;