summaryrefslogtreecommitdiff
path: root/u/fn/callable.ts
diff options
context:
space:
mode:
Diffstat (limited to 'u/fn/callable.ts')
-rw-r--r--u/fn/callable.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/u/fn/callable.ts b/u/fn/callable.ts
new file mode 100644
index 0000000..2749947
--- /dev/null
+++ b/u/fn/callable.ts
@@ -0,0 +1,15 @@
+// deno-lint-ignore no-explicit-any
+export interface Callable<T = any, ArgT = any> {
+ (...args: Array<ArgT>): T;
+}
+
+export interface Supplier<T> extends Callable<T, undefined> {
+ (): T;
+}
+
+export interface SideEffect<T> extends Callable<void, T> {
+}
+
+export interface Mapper<T, U> extends Callable<U, T> {
+ (t: T): U;
+}