index.d.ts 549 B

123456789101112131415161718192021222324
  1. declare const isGeneratorFn: {
  2. /**
  3. Check if something is a generator function.
  4. @example
  5. ```
  6. import isGeneratorFn = require('is-generator-fn');
  7. isGeneratorFn(function * () {});
  8. //=> true
  9. isGeneratorFn(function () {});
  10. //=> false
  11. ```
  12. */
  13. (value: unknown): value is GeneratorFunction;
  14. // TODO: Remove this for the next major release, refactor the whole definition to:
  15. // declare function isGeneratorFn(value: unknown): value is GeneratorFunction;
  16. // export = isGeneratorFn;
  17. default: typeof isGeneratorFn;
  18. };
  19. export = isGeneratorFn;