@@ -3176,14 +3176,27 @@ declare namespace ts {
3176
3176
createStringLiteralFromNode(sourceNode: PropertyNameLiteral, isSingleQuote?: boolean): StringLiteral;
3177
3177
createRegularExpressionLiteral(text: string): RegularExpressionLiteral;
3178
3178
createIdentifier(text: string): Identifier;
3179
- /** Create a unique temporary variable. */
3180
- createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined): Identifier;
3181
- /** Create a unique temporary variable for use in a loop. */
3182
- createLoopVariable(): Identifier;
3179
+ /**
3180
+ * Create a unique temporary variable.
3181
+ * @param recordTempVariable An optional callback used to record the temporary variable name. This
3182
+ * should usually be a reference to `hoistVariableDeclaration` from a `TransformationContext`, but
3183
+ * can be `undefined` if you plan to record the temporary variable manually.
3184
+ * @param reservedInNestedScopes When `true`, reserves the temporary variable name in all nested scopes
3185
+ * during emit so that the variable can be referenced in a nested function body. This is an alternative to
3186
+ * setting `EmitFlags.ReuseTempVariableScope` on the nested function itself.
3187
+ */
3188
+ createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined, reservedInNestedScopes?: boolean): Identifier;
3189
+ /**
3190
+ * Create a unique temporary variable for use in a loop.
3191
+ * @param reservedInNestedScopes When `true`, reserves the temporary variable name in all nested scopes
3192
+ * during emit so that the variable can be referenced in a nested function body. This is an alternative to
3193
+ * setting `EmitFlags.ReuseTempVariableScope` on the nested function itself.
3194
+ */
3195
+ createLoopVariable(reservedInNestedScopes?: boolean): Identifier;
3183
3196
/** Create a unique name based on the supplied text. */
3184
3197
createUniqueName(text: string, flags?: GeneratedIdentifierFlags): Identifier;
3185
3198
/** Create a unique name generated for a node. */
3186
- getGeneratedNameForNode(node: Node | undefined): Identifier;
3199
+ getGeneratedNameForNode(node: Node | undefined, flags?: GeneratedIdentifierFlags ): Identifier;
3187
3200
createPrivateIdentifier(text: string): PrivateIdentifier;
3188
3201
createToken(token: SyntaxKind.SuperKeyword): SuperExpression;
3189
3202
createToken(token: SyntaxKind.ThisKeyword): ThisExpression;
@@ -10256,7 +10269,7 @@ declare namespace ts {
10256
10269
/** @deprecated Use `factory.createRegularExpressionLiteral` or the factory supplied by your transformation context instead. */
10257
10270
const createRegularExpressionLiteral: (text: string) => RegularExpressionLiteral;
10258
10271
/** @deprecated Use `factory.createLoopVariable` or the factory supplied by your transformation context instead. */
10259
- const createLoopVariable: () => Identifier;
10272
+ const createLoopVariable: (reservedInNestedScopes?: boolean | undefined ) => Identifier;
10260
10273
/** @deprecated Use `factory.createUniqueName` or the factory supplied by your transformation context instead. */
10261
10274
const createUniqueName: (text: string, flags?: GeneratedIdentifierFlags | undefined) => Identifier;
10262
10275
/** @deprecated Use `factory.createPrivateIdentifier` or the factory supplied by your transformation context instead. */
0 commit comments