aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/call-bind-apply-helpers/index.d.ts
diff options
context:
space:
mode:
authorpack <pack@packgekko.xyz>2026-08-09 10:54:08 +0000
committerpack <pack@packgekko.xyz>2026-08-09 10:54:08 +0000
commitd3adc16a08d95d6e331de55d7d3bf05a66a874a8 (patch)
treea2dabd199501e67c547c2ce79e1374ca3aa55443 /node_modules/call-bind-apply-helpers/index.d.ts
parent55a4f1fc869e41aca748c63d3018f0448b1606e0 (diff)
downloadcrud-d3adc16a08d95d6e331de55d7d3bf05a66a874a8.tar.gz
stop tracking node_modules/
Diffstat (limited to '')
-rw-r--r--node_modules/call-bind-apply-helpers/index.d.ts64
1 files changed, 0 insertions, 64 deletions
diff --git a/node_modules/call-bind-apply-helpers/index.d.ts b/node_modules/call-bind-apply-helpers/index.d.ts
deleted file mode 100644
index 541516b..0000000
--- a/node_modules/call-bind-apply-helpers/index.d.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-type RemoveFromTuple<
- Tuple extends readonly unknown[],
- RemoveCount extends number,
- Index extends 1[] = []
-> = Index["length"] extends RemoveCount
- ? Tuple
- : Tuple extends [infer First, ...infer Rest]
- ? RemoveFromTuple<Rest, RemoveCount, [...Index, 1]>
- : Tuple;
-
-type ConcatTuples<
- Prefix extends readonly unknown[],
- Suffix extends readonly unknown[]
-> = [...Prefix, ...Suffix];
-
-type ExtractFunctionParams<T> = T extends (this: infer TThis, ...args: infer P extends readonly unknown[]) => infer R
- ? { thisArg: TThis; params: P; returnType: R }
- : never;
-
-type BindFunction<
- T extends (this: any, ...args: any[]) => any,
- TThis,
- TBoundArgs extends readonly unknown[],
- ReceiverBound extends boolean
-> = ExtractFunctionParams<T> extends {
- thisArg: infer OrigThis;
- params: infer P extends readonly unknown[];
- returnType: infer R;
-}
- ? ReceiverBound extends true
- ? (...args: RemoveFromTuple<P, Extract<TBoundArgs["length"], number>>) => R extends [OrigThis, ...infer Rest]
- ? [TThis, ...Rest] // Replace `this` with `thisArg`
- : R
- : <U, RemainingArgs extends RemoveFromTuple<P, Extract<TBoundArgs["length"], number>>>(
- thisArg: U,
- ...args: RemainingArgs
- ) => R extends [OrigThis, ...infer Rest]
- ? [U, ...ConcatTuples<TBoundArgs, Rest>] // Preserve bound args in return type
- : R
- : never;
-
-declare function callBind<
- const T extends (this: any, ...args: any[]) => any,
- Extracted extends ExtractFunctionParams<T>,
- const TBoundArgs extends Partial<Extracted["params"]> & readonly unknown[],
- const TThis extends Extracted["thisArg"]
->(
- args: [fn: T, thisArg: TThis, ...boundArgs: TBoundArgs]
-): BindFunction<T, TThis, TBoundArgs, true>;
-
-declare function callBind<
- const T extends (this: any, ...args: any[]) => any,
- Extracted extends ExtractFunctionParams<T>,
- const TBoundArgs extends Partial<Extracted["params"]> & readonly unknown[]
->(
- args: [fn: T, ...boundArgs: TBoundArgs]
-): BindFunction<T, Extracted["thisArg"], TBoundArgs, false>;
-
-declare function callBind<const TArgs extends readonly unknown[]>(
- args: [fn: Exclude<TArgs[0], Function>, ...rest: TArgs]
-): never;
-
-// export as namespace callBind;
-export = callBind;