/** * Determine if the given argument is a Generator object. * (A generator is the one created when calling a generator function) * * @example * ```ts * function *gen() {} * * isGenerator(gen()); // -> true * isGenerator({ next() {}, throw() {} return() {} [Symbol.iterator]() {} }); // -> true * isGenerator(() => {}); // -> false * ``` * * @param x - Argument to test * @return - Whether the argument a Generator like function or not */ export declare function isGenerator(x: any): x is Generator; /** * Determine if the given argument is a Generator Function * * @example * ```ts * function* gen() {} * * isGeneratorFunction(gen); // -> true * isGeneratorFunction(() => {}); // -> false * ``` * * @param x - Argument to test * @return - Whether the argument a Generator or not */ export default function isGeneratorFunction(x: any): x is GeneratorFunction;