shelving
Version:
Toolkit for using data in JavaScript.
18 lines (17 loc) • 1.12 kB
TypeScript
import type { AnyConstructor } from "./class.js";
/** Unknown function. */
export type UnknownFunction = (...args: unknown[]) => unknown;
/** Any function (purposefully as wide as possible for use with `extends X` or `is X` statements). */
export type AnyFunction = (...args: any) => any;
/** Any calling function or constructor, usually referring to something that can call in the current scope that can appear in a stack trace. */
export type AnyCaller = AnyFunction | AnyConstructor;
/** Is a value a function? */
export declare function isFunction(value: unknown): value is AnyFunction;
/** Assert that a value is a function. */
export declare function assertFunction(value: unknown): asserts value is AnyFunction;
/** Readonly unknown array that is being used as a set of arguments to a function. */
export type Arguments = readonly unknown[];
/** Function that just passes through the first argument. */
export declare function PASSTHROUGH<T>(value: T): T;
/** Function that does nothing with its arguments and always returns void. */
export declare function BLACKHOLE(...unused: Arguments): void | undefined;