/* eslint-disable @typescript-eslint/no-explicit-any */ import type { AnyArray, AnyParams } from "./array"; export type Func = (...args: Params) => Result; export type Creater = Func<[], T>; export type AnyFunc = Func; export type Terminator = Func<[], never>; export type TypeGuard = ( obj: Union ) => obj is SubSet; export type TypeAssertionFunc = ( obj: Union ) => asserts obj is Subset; export type Mapper = Func<[source: In], Out>; export type Predicate = Mapper; export type Method = ( this: This, ...args: Params ) => Result; export type AnyMethod = Method; export type Getter = Method; export type Setter = Method; export type MethodKeys = { [K in keyof This]: This[K] extends AnyFunc ? K : never; }[keyof This]; export type PropertyKeys = { [K in keyof T]: T[K] extends AnyFunc ? never : K; }[keyof T]; export type PropertyPart = Pick>; export type MethodPart = Pick>; export type ConstructorOf = new ( ...args: Params ) => T; export type AnyConstructor = ConstructorOf; export type InstanceSource = | ConstructorOf | { [Symbol.hasInstance](value: unknown): value is T }; export type AnyInstanceSource = InstanceSource;