diff --git a/types/babel__generator/index.d.ts b/types/babel__generator/index.d.ts index f98a49ef2d..d9b178a92e 100644 --- a/types/babel__generator/index.d.ts +++ b/types/babel__generator/index.d.ts @@ -4,6 +4,7 @@ // Johnny Estilles // Melvin Groenhoff // Cameron Yan +// Lyanbin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.9 @@ -96,15 +97,86 @@ export interface GeneratorOptions { */ jsescOption?: { /** - * The type of quote to use in the output. If omitted, autodetects based on `ast.tokens`. + * The default value for the quotes option is 'single'. This means that any occurrences of ' in the input + * string are escaped as \', so that the output can be used in a string literal wrapped in single quotes. */ - quotes?: 'single' | 'double'; + quotes?: 'single' | 'double' | 'backtick'; /** - * When enabled, the output is a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through the quotes setting. - * Defaults to `true`. + * The default value for the numbers option is 'decimal'. This means that any numeric values are represented + * using decimal integer literals. Other valid options are binary, octal, and hexadecimal, which result in + * binary integer literals, octal integer literals, and hexadecimal integer literals, respectively. + */ + numbers?: 'binary' | 'octal' | 'decimal' | 'hexadecimal'; + + /** + * The wrap option takes a boolean value (true or false), and defaults to false (disabled). When enabled, the + * output is a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through + * the quotes setting. */ wrap?: boolean; + + /** + * The es6 option takes a boolean value (true or false), and defaults to false (disabled). When enabled, any + * astral Unicode symbols in the input are escaped using ECMAScript 6 Unicode code point escape sequences + * instead of using separate escape sequences for each surrogate half. If backwards compatibility with ES5 + * environments is a concern, don’t enable this setting. If the json setting is enabled, the value for the es6 + * setting is ignored (as if it was false). + */ + es6?: boolean; + + /** + * The escapeEverything option takes a boolean value (true or false), and defaults to false (disabled). When + * enabled, all the symbols in the output are escaped — even printable ASCII symbols. + */ + escapeEverything?: boolean; + + /** + * The minimal option takes a boolean value (true or false), and defaults to false (disabled). When enabled, + * only a limited set of symbols in the output are escaped: \0, \b, \t, \n, \f, \r, \\, \u2028, \u2029. + */ + minimal?: boolean; + + /** + * The isScriptContext option takes a boolean value (true or false), and defaults to false (disabled). When + * enabled, occurrences of or