import { UNSET } from '../_/index.js'; import type { ArrayPrefix } from '../array/ArrayPrefix.js'; import type { AlsoAccept } from '../type/index.js'; import type { Callable } from './callable/index.js'; import type { CallableParameters_ } from './Parameters/index.js'; import type { CallableReturn_ } from './Return/index.js'; /** @internal */ export declare class _BindableFunction, BoundArguments extends readonly unknown[]> { readonly function: Func; /** * Currently bound `this` * * - Not read-only - can reassign `this` * * - Notable use case: create self-referencing `BindableFunction` */ boundThis: BoundThis; readonly boundArguments: BoundArguments; get name(): string; toString(): string; constructor(func: Func, boundThis?: BoundThis, ...boundArguments: BoundArguments); bind>(thisArg: BindThis): BoundFunction; bind, BindArguments extends ArrayPrefix>>(thisArg: BindThis, ...args: BindArguments): BoundFunction; unbind(): UnboundFunction; clone(): _BindableFunction; } export declare const BindableFunction: BindableFunctionConstructor; export type BindableFunction = _BindableFunction & BoundFunctionCall; export interface BindableFunctionConstructor { /** Unbound */ new (func: Func): BindableFunction; /** Bound `this` */ new (func: Func, boundThis: BoundThis): BindableFunction; /** Bound `this` and arguments list prefix */ new (func: Func, boundThis: BoundThis, boundArguments: BoundArguments): BindableFunction; } export type BoundFunctionCall = BoundArguments extends [] ? Func : (...args: BoundFunctionParameters) => CallableReturn_; export type _BoundFunctionParametersRec = BoundArguments extends [] ? AllArguments : BoundArguments extends [unknown, ...infer Bs] ? AllArguments extends [unknown, ...infer As] ? _BoundFunctionParametersRec : never : never; export type BoundFunctionParameters = _BoundFunctionParametersRec, BoundArguments>; export type UnboundFunction = BindableFunction; export type BoundFunction = BindableFunction; //# sourceMappingURL=BindableFunction.d.ts.map