-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add
index.d.ts
and declare it in package.json
- Loading branch information
1 parent
10406f9
commit 1660056
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
type CPSFn< | ||
Callbacks extends Array<(...args: unknown[]) => void> | ||
> = (...args: Callbacks) => void | ||
|
||
type ChainFns< | ||
FromCallbacks extends Array<(...args: unknown[]) => void>, | ||
ToCallbacks extends Array<(...args: unknown[]) => void>, | ||
> = { | ||
[T in keyof FromCallbacks]?: (...args: Parameters<FromCallbacks[T]>) => CPSFn<ToCallbacks> | undefined | ||
} | ||
|
||
type CPS< | ||
Callbacks extends Array<(...args: unknown[]) => void> | ||
> = CPSFn<Callbacks> & { | ||
chain< | ||
ToCallbacks extends Array<(...args: unknown[]) => void> | ||
>(...fns: ChainFns<Callbacks, ToCallbacks>): CPS<ToCallbacks> | ||
} | ||
|
||
declare function CPS< | ||
Callbacks extends Array<(...args: unknown[]) => void> | ||
>(fn: CPSFn<Callbacks>): CPS<Callbacks> | ||
|
||
export { CPS, CPSFn } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters