Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.d.ts 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. export interface Limit {
  2. /**
  3. @param fn - Promise-returning/async function.
  4. @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions.
  5. @returns The promise returned by calling `fn(...arguments)`.
  6. */
  7. <Arguments extends unknown[], ReturnType>(
  8. fn: (...arguments: Arguments) => PromiseLike<ReturnType> | ReturnType,
  9. ...arguments: Arguments
  10. ): Promise<ReturnType>;
  11. /**
  12. The number of promises that are currently running.
  13. */
  14. readonly activeCount: number;
  15. /**
  16. The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
  17. */
  18. readonly pendingCount: number;
  19. /**
  20. Discard pending promises that are waiting to run.
  21. This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
  22. Note: This does not cancel promises that are already running.
  23. */
  24. clearQueue(): void;
  25. }
  26. /**
  27. Run multiple promise-returning & async functions with limited concurrency.
  28. @param concurrency - Concurrency limit. Minimum: `1`.
  29. @returns A `limit` function.
  30. */
  31. export default function pLimit(concurrency: number): Limit;