From 5d309ff52cd399a6b71968a6b9a70c8ac0b98981 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Sat, 5 Mar 2022 19:02:27 +0200 Subject: Added node_modules for the updating to work properly. --- node_modules/throat/index.d.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 node_modules/throat/index.d.ts (limited to 'node_modules/throat/index.d.ts') diff --git a/node_modules/throat/index.d.ts b/node_modules/throat/index.d.ts new file mode 100644 index 0000000..038ca51 --- /dev/null +++ b/node_modules/throat/index.d.ts @@ -0,0 +1,32 @@ +/** + * Throttle the given function to only run `size` times in parallel. + * Extra calls will be queued until one of the earlier calls completes. + */ +declare function throat( + size: number, + fn: (...args: TArgs) => Promise +): (...args: TArgs) => Promise; + +/** + * Throttle the given function to only run `size` times in parallel. + * Extra calls will be queued until one of the earlier calls completes. + */ +declare function throat( + fn: (...args: TArgs) => Promise, + size: number +): (...args: TArgs) => Promise; + +/** + * Create a throttle that only allows `size` calls in parallel. + * Extra calls will be queued until one of the earlier calls completes. + * + * To create an exclusive lock, just use a `size` of `1`. + */ +declare function throat( + size: number +): ( + fn: (...args: TArgs) => Promise, + ...args: TArgs +) => Promise; +export default throat; + -- cgit v1.2.3