fcs
2025-04-10 0163870d662dc5b7d69ceff977490ede594f7d82
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/// <reference types="node" />
import { Context, RunningScriptOptions } from 'vm';
/**
 * Compiles sync JavaScript code into JavaScript with async Functions.
 *
 * @param {String} code JavaScript string to convert
 * @param {Array} names Array of function names to add `await` operators to
 * @return {String} Converted JavaScript string with async/await injected
 * @api public
 */
declare function degenerator(code: string, _names: degenerator.DegeneratorNames): string;
declare namespace degenerator {
    type DegeneratorName = string | RegExp;
    type DegeneratorNames = DegeneratorName[];
    interface CompileOptions extends RunningScriptOptions {
        sandbox?: Context;
    }
    function compile<R = any, A extends any[] = []>(code: string, returnName: string, names: DegeneratorNames, options?: CompileOptions): (...args: A) => Promise<R>;
}
export = degenerator;