import type { ArrowCallableWithCALL, Callable, ProtoCallable } from '../../index.js'; import type { WithCALL } from '../CALL.js'; import type { _ArrowCallable, IArrowCallable } from './_/ArrowCallableType.js'; import type { ArrowCallableOptions } from './ArrowCallableOptions.js'; import { UNSET } from '../../../_/symbols/unset.js'; export type ArrowCallable | UNSET = UNSET> = Options extends UNSET ? IArrowCallable : Options extends ArrowCallableOptions ? _ArrowCallable : Options extends WithCALL ? ArrowCallableWithCALL : Options extends Callable<{ this: void; }> ? _ArrowCallable<{ call: Options; }> : never; export type __unused_ArrowCallable = ProtoCallable; /** * Create a function with no own properties * * - ✅ Works with `clone` * - ❌ Does not allow `this` (hence "ArrowCallable") * - ❌ Does not work with `Proxy` (if needed, @see {@link ProtoCallable}) * * @example * * ```ts * const a = CustomArrowCallable({call: (n: number) => 2 * n, { a: 1 }}) * * expect(a.a).toBe(1) * expect(a(2)).toBe(4) * ``` * * @param options - @see `ArrowCallableOptions` */ export declare function CustomArrowCallable(options: Options): ArrowCallable; /** * Create a function with no own properties * * - ✅ Works with `clone` * - ❌ Does not allow `this` (hence "ArrowCallable") * - ❌ Does not work with `Proxy` (if needed, @see {@link ProtoCallable}) * * @example * * ```ts * const a = ArrowCallable({ a: 1, [CALL]: (n: number) => 2 * n }) * * expect(a.a).toBe(1) * expect(a(2)).toBe(4) * ``` * * @param shape - An object to shallow-copy properties and `__proto__` from; * also, `shape[CALL]` property will be used as the call function */ export declare function ArrowCallable(shape: O): ArrowCallable; //# sourceMappingURL=ArrowCallable.d.ts.map