1namespace ts { 2 // The following are deprecations for the public API. Deprecated exports are removed from the compiler itself 3 // and compatible implementations are added here, along with an appropriate deprecation warning using 4 // the `@deprecated` JSDoc tag as well as the `Debug.deprecate` API. 5 // 6 // Deprecations fall into one of three categories: 7 // 8 // * "soft" - Soft deprecations are indicated with the `@deprecated` JSDoc Tag. 9 // * "warn" - Warning deprecations are indicated with the `@deprecated` JSDoc Tag and a diagnostic message (assuming a compatible host) 10 // * "error" - Error deprecations are indicated with the `@deprecated` JSDoc tag and will throw a `TypeError` when invoked. 11 12 // DEPRECATION: Node factory top-level exports 13 // DEPRECATION PLAN: 14 // - soft: 4.0 15 // - warn: 4.1 16 // - error: TBD 17 // #region Node factory top-level exports 18 19 // NOTE: These exports are deprecated in favor of using a `NodeFactory` instance and exist here purely for backwards compatibility reasons. 20 const factoryDeprecation: DeprecationOptions = { since: "4.0", warnAfter: "4.1", message: "Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead." }; 21 22 /** @deprecated Use `factory.createNodeArray` or the factory supplied by your transformation context instead. */ 23 export const createNodeArray = Debug.deprecate(factory.createNodeArray, factoryDeprecation); 24 25 /** @deprecated Use `factory.createNumericLiteral` or the factory supplied by your transformation context instead. */ 26 export const createNumericLiteral = Debug.deprecate(factory.createNumericLiteral, factoryDeprecation); 27 28 /** @deprecated Use `factory.createBigIntLiteral` or the factory supplied by your transformation context instead. */ 29 export const createBigIntLiteral = Debug.deprecate(factory.createBigIntLiteral, factoryDeprecation); 30 31 /** @deprecated Use `factory.createStringLiteral` or the factory supplied by your transformation context instead. */ 32 export const createStringLiteral = Debug.deprecate(factory.createStringLiteral, factoryDeprecation); 33 34 /** @deprecated Use `factory.createStringLiteralFromNode` or the factory supplied by your transformation context instead. */ 35 export const createStringLiteralFromNode = Debug.deprecate(factory.createStringLiteralFromNode, factoryDeprecation); 36 37 /** @deprecated Use `factory.createRegularExpressionLiteral` or the factory supplied by your transformation context instead. */ 38 export const createRegularExpressionLiteral = Debug.deprecate(factory.createRegularExpressionLiteral, factoryDeprecation); 39 40 /** @deprecated Use `factory.createLoopVariable` or the factory supplied by your transformation context instead. */ 41 export const createLoopVariable = Debug.deprecate(factory.createLoopVariable, factoryDeprecation); 42 43 /** @deprecated Use `factory.createUniqueName` or the factory supplied by your transformation context instead. */ 44 export const createUniqueName = Debug.deprecate(factory.createUniqueName, factoryDeprecation); 45 46 /** @deprecated Use `factory.createPrivateIdentifier` or the factory supplied by your transformation context instead. */ 47 export const createPrivateIdentifier = Debug.deprecate(factory.createPrivateIdentifier, factoryDeprecation); 48 49 /** @deprecated Use `factory.createSuper` or the factory supplied by your transformation context instead. */ 50 export const createSuper = Debug.deprecate(factory.createSuper, factoryDeprecation); 51 52 /** @deprecated Use `factory.createThis` or the factory supplied by your transformation context instead. */ 53 export const createThis = Debug.deprecate(factory.createThis, factoryDeprecation); 54 55 /** @deprecated Use `factory.createNull` or the factory supplied by your transformation context instead. */ 56 export const createNull = Debug.deprecate(factory.createNull, factoryDeprecation); 57 58 /** @deprecated Use `factory.createTrue` or the factory supplied by your transformation context instead. */ 59 export const createTrue = Debug.deprecate(factory.createTrue, factoryDeprecation); 60 61 /** @deprecated Use `factory.createFalse` or the factory supplied by your transformation context instead. */ 62 export const createFalse = Debug.deprecate(factory.createFalse, factoryDeprecation); 63 64 /** @deprecated Use `factory.createModifier` or the factory supplied by your transformation context instead. */ 65 export const createModifier = Debug.deprecate(factory.createModifier, factoryDeprecation); 66 67 /** @deprecated Use `factory.createModifiersFromModifierFlags` or the factory supplied by your transformation context instead. */ 68 export const createModifiersFromModifierFlags = Debug.deprecate(factory.createModifiersFromModifierFlags, factoryDeprecation); 69 70 /** @deprecated Use `factory.createQualifiedName` or the factory supplied by your transformation context instead. */ 71 export const createQualifiedName = Debug.deprecate(factory.createQualifiedName, factoryDeprecation); 72 73 /** @deprecated Use `factory.updateQualifiedName` or the factory supplied by your transformation context instead. */ 74 export const updateQualifiedName = Debug.deprecate(factory.updateQualifiedName, factoryDeprecation); 75 76 /** @deprecated Use `factory.createComputedPropertyName` or the factory supplied by your transformation context instead. */ 77 export const createComputedPropertyName = Debug.deprecate(factory.createComputedPropertyName, factoryDeprecation); 78 79 /** @deprecated Use `factory.updateComputedPropertyName` or the factory supplied by your transformation context instead. */ 80 export const updateComputedPropertyName = Debug.deprecate(factory.updateComputedPropertyName, factoryDeprecation); 81 82 /** @deprecated Use `factory.createTypeParameterDeclaration` or the factory supplied by your transformation context instead. */ 83 export const createTypeParameterDeclaration = Debug.deprecate(factory.createTypeParameterDeclaration, factoryDeprecation); 84 85 /** @deprecated Use `factory.updateTypeParameterDeclaration` or the factory supplied by your transformation context instead. */ 86 export const updateTypeParameterDeclaration = Debug.deprecate(factory.updateTypeParameterDeclaration, factoryDeprecation); 87 88 /** @deprecated Use `factory.createParameterDeclaration` or the factory supplied by your transformation context instead. */ 89 export const createParameter = Debug.deprecate(factory.createParameterDeclaration, factoryDeprecation); 90 91 /** @deprecated Use `factory.updateParameterDeclaration` or the factory supplied by your transformation context instead. */ 92 export const updateParameter = Debug.deprecate(factory.updateParameterDeclaration, factoryDeprecation); 93 94 /** @deprecated Use `factory.createDecorator` or the factory supplied by your transformation context instead. */ 95 export const createDecorator = Debug.deprecate(factory.createDecorator, factoryDeprecation); 96 97 /** @deprecated Use `factory.updateDecorator` or the factory supplied by your transformation context instead. */ 98 export const updateDecorator = Debug.deprecate(factory.updateDecorator, factoryDeprecation); 99 100 /** @deprecated Use `factory.createPropertyDeclaration` or the factory supplied by your transformation context instead. */ 101 export const createProperty = Debug.deprecate(factory.createPropertyDeclaration, factoryDeprecation); 102 103 /** @deprecated Use `factory.updatePropertyDeclaration` or the factory supplied by your transformation context instead. */ 104 export const updateProperty = Debug.deprecate(factory.updatePropertyDeclaration, factoryDeprecation); 105 106 /** @deprecated Use `factory.createMethodDeclaration` or the factory supplied by your transformation context instead. */ 107 export const createMethod = Debug.deprecate(factory.createMethodDeclaration, factoryDeprecation); 108 109 /** @deprecated Use `factory.updateMethodDeclaration` or the factory supplied by your transformation context instead. */ 110 export const updateMethod = Debug.deprecate(factory.updateMethodDeclaration, factoryDeprecation); 111 112 /** @deprecated Use `factory.createConstructorDeclaration` or the factory supplied by your transformation context instead. */ 113 export const createConstructor = Debug.deprecate(factory.createConstructorDeclaration, factoryDeprecation); 114 115 /** @deprecated Use `factory.updateConstructorDeclaration` or the factory supplied by your transformation context instead. */ 116 export const updateConstructor = Debug.deprecate(factory.updateConstructorDeclaration, factoryDeprecation); 117 118 /** @deprecated Use `factory.createGetAccessorDeclaration` or the factory supplied by your transformation context instead. */ 119 export const createGetAccessor = Debug.deprecate(factory.createGetAccessorDeclaration, factoryDeprecation); 120 121 /** @deprecated Use `factory.updateGetAccessorDeclaration` or the factory supplied by your transformation context instead. */ 122 export const updateGetAccessor = Debug.deprecate(factory.updateGetAccessorDeclaration, factoryDeprecation); 123 124 /** @deprecated Use `factory.createSetAccessorDeclaration` or the factory supplied by your transformation context instead. */ 125 export const createSetAccessor = Debug.deprecate(factory.createSetAccessorDeclaration, factoryDeprecation); 126 127 /** @deprecated Use `factory.updateSetAccessorDeclaration` or the factory supplied by your transformation context instead. */ 128 export const updateSetAccessor = Debug.deprecate(factory.updateSetAccessorDeclaration, factoryDeprecation); 129 130 /** @deprecated Use `factory.createCallSignature` or the factory supplied by your transformation context instead. */ 131 export const createCallSignature = Debug.deprecate(factory.createCallSignature, factoryDeprecation); 132 133 /** @deprecated Use `factory.updateCallSignature` or the factory supplied by your transformation context instead. */ 134 export const updateCallSignature = Debug.deprecate(factory.updateCallSignature, factoryDeprecation); 135 136 /** @deprecated Use `factory.createConstructSignature` or the factory supplied by your transformation context instead. */ 137 export const createConstructSignature = Debug.deprecate(factory.createConstructSignature, factoryDeprecation); 138 139 /** @deprecated Use `factory.updateConstructSignature` or the factory supplied by your transformation context instead. */ 140 export const updateConstructSignature = Debug.deprecate(factory.updateConstructSignature, factoryDeprecation); 141 142 /** @deprecated Use `factory.updateIndexSignature` or the factory supplied by your transformation context instead. */ 143 export const updateIndexSignature = Debug.deprecate(factory.updateIndexSignature, factoryDeprecation); 144 145 /** @deprecated Use `factory.createKeywordTypeNode` or the factory supplied by your transformation context instead. */ 146 export const createKeywordTypeNode = Debug.deprecate(factory.createKeywordTypeNode, factoryDeprecation); 147 148 /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */ 149 export const createTypePredicateNodeWithModifier = Debug.deprecate(factory.createTypePredicateNode, factoryDeprecation); 150 151 /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */ 152 export const updateTypePredicateNodeWithModifier = Debug.deprecate(factory.updateTypePredicateNode, factoryDeprecation); 153 154 /** @deprecated Use `factory.createTypeReferenceNode` or the factory supplied by your transformation context instead. */ 155 export const createTypeReferenceNode = Debug.deprecate(factory.createTypeReferenceNode, factoryDeprecation); 156 157 /** @deprecated Use `factory.updateTypeReferenceNode` or the factory supplied by your transformation context instead. */ 158 export const updateTypeReferenceNode = Debug.deprecate(factory.updateTypeReferenceNode, factoryDeprecation); 159 160 /** @deprecated Use `factory.createFunctionTypeNode` or the factory supplied by your transformation context instead. */ 161 export const createFunctionTypeNode = Debug.deprecate(factory.createFunctionTypeNode, factoryDeprecation); 162 163 /** @deprecated Use `factory.updateFunctionTypeNode` or the factory supplied by your transformation context instead. */ 164 export const updateFunctionTypeNode = Debug.deprecate(factory.updateFunctionTypeNode, factoryDeprecation); 165 166 /** @deprecated Use `factory.createConstructorTypeNode` or the factory supplied by your transformation context instead. */ 167 export const createConstructorTypeNode = Debug.deprecate(( 168 typeParameters: readonly TypeParameterDeclaration[] | undefined, 169 parameters: readonly ParameterDeclaration[], 170 type: TypeNode 171 ) => { 172 return factory.createConstructorTypeNode(/*modifiers*/ undefined, typeParameters, parameters, type); 173 }, factoryDeprecation); 174 175 /** @deprecated Use `factory.updateConstructorTypeNode` or the factory supplied by your transformation context instead. */ 176 export const updateConstructorTypeNode = Debug.deprecate(( 177 node: ConstructorTypeNode, 178 typeParameters: NodeArray<TypeParameterDeclaration> | undefined, 179 parameters: NodeArray<ParameterDeclaration>, 180 type: TypeNode 181 ) => { 182 return factory.updateConstructorTypeNode(node, node.modifiers, typeParameters, parameters, type); 183 }, factoryDeprecation); 184 185 /** @deprecated Use `factory.createTypeQueryNode` or the factory supplied by your transformation context instead. */ 186 export const createTypeQueryNode = Debug.deprecate(factory.createTypeQueryNode, factoryDeprecation); 187 188 /** @deprecated Use `factory.updateTypeQueryNode` or the factory supplied by your transformation context instead. */ 189 export const updateTypeQueryNode = Debug.deprecate(factory.updateTypeQueryNode, factoryDeprecation); 190 191 /** @deprecated Use `factory.createTypeLiteralNode` or the factory supplied by your transformation context instead. */ 192 export const createTypeLiteralNode = Debug.deprecate(factory.createTypeLiteralNode, factoryDeprecation); 193 194 /** @deprecated Use `factory.updateTypeLiteralNode` or the factory supplied by your transformation context instead. */ 195 export const updateTypeLiteralNode = Debug.deprecate(factory.updateTypeLiteralNode, factoryDeprecation); 196 197 /** @deprecated Use `factory.createArrayTypeNode` or the factory supplied by your transformation context instead. */ 198 export const createArrayTypeNode = Debug.deprecate(factory.createArrayTypeNode, factoryDeprecation); 199 200 /** @deprecated Use `factory.updateArrayTypeNode` or the factory supplied by your transformation context instead. */ 201 export const updateArrayTypeNode = Debug.deprecate(factory.updateArrayTypeNode, factoryDeprecation); 202 203 /** @deprecated Use `factory.createTupleTypeNode` or the factory supplied by your transformation context instead. */ 204 export const createTupleTypeNode = Debug.deprecate(factory.createTupleTypeNode, factoryDeprecation); 205 206 /** @deprecated Use `factory.updateTupleTypeNode` or the factory supplied by your transformation context instead. */ 207 export const updateTupleTypeNode = Debug.deprecate(factory.updateTupleTypeNode, factoryDeprecation); 208 209 /** @deprecated Use `factory.createOptionalTypeNode` or the factory supplied by your transformation context instead. */ 210 export const createOptionalTypeNode = Debug.deprecate(factory.createOptionalTypeNode, factoryDeprecation); 211 212 /** @deprecated Use `factory.updateOptionalTypeNode` or the factory supplied by your transformation context instead. */ 213 export const updateOptionalTypeNode = Debug.deprecate(factory.updateOptionalTypeNode, factoryDeprecation); 214 215 /** @deprecated Use `factory.createRestTypeNode` or the factory supplied by your transformation context instead. */ 216 export const createRestTypeNode = Debug.deprecate(factory.createRestTypeNode, factoryDeprecation); 217 218 /** @deprecated Use `factory.updateRestTypeNode` or the factory supplied by your transformation context instead. */ 219 export const updateRestTypeNode = Debug.deprecate(factory.updateRestTypeNode, factoryDeprecation); 220 221 /** @deprecated Use `factory.createUnionTypeNode` or the factory supplied by your transformation context instead. */ 222 export const createUnionTypeNode = Debug.deprecate(factory.createUnionTypeNode, factoryDeprecation); 223 224 /** @deprecated Use `factory.updateUnionTypeNode` or the factory supplied by your transformation context instead. */ 225 export const updateUnionTypeNode = Debug.deprecate(factory.updateUnionTypeNode, factoryDeprecation); 226 227 /** @deprecated Use `factory.createIntersectionTypeNode` or the factory supplied by your transformation context instead. */ 228 export const createIntersectionTypeNode = Debug.deprecate(factory.createIntersectionTypeNode, factoryDeprecation); 229 230 /** @deprecated Use `factory.updateIntersectionTypeNode` or the factory supplied by your transformation context instead. */ 231 export const updateIntersectionTypeNode = Debug.deprecate(factory.updateIntersectionTypeNode, factoryDeprecation); 232 233 /** @deprecated Use `factory.createConditionalTypeNode` or the factory supplied by your transformation context instead. */ 234 export const createConditionalTypeNode = Debug.deprecate(factory.createConditionalTypeNode, factoryDeprecation); 235 236 /** @deprecated Use `factory.updateConditionalTypeNode` or the factory supplied by your transformation context instead. */ 237 export const updateConditionalTypeNode = Debug.deprecate(factory.updateConditionalTypeNode, factoryDeprecation); 238 239 /** @deprecated Use `factory.createInferTypeNode` or the factory supplied by your transformation context instead. */ 240 export const createInferTypeNode = Debug.deprecate(factory.createInferTypeNode, factoryDeprecation); 241 242 /** @deprecated Use `factory.updateInferTypeNode` or the factory supplied by your transformation context instead. */ 243 export const updateInferTypeNode = Debug.deprecate(factory.updateInferTypeNode, factoryDeprecation); 244 245 /** @deprecated Use `factory.createImportTypeNode` or the factory supplied by your transformation context instead. */ 246 export const createImportTypeNode = Debug.deprecate(factory.createImportTypeNode, factoryDeprecation); 247 248 /** @deprecated Use `factory.updateImportTypeNode` or the factory supplied by your transformation context instead. */ 249 export const updateImportTypeNode = Debug.deprecate(factory.updateImportTypeNode, factoryDeprecation); 250 251 /** @deprecated Use `factory.createParenthesizedType` or the factory supplied by your transformation context instead. */ 252 export const createParenthesizedType = Debug.deprecate(factory.createParenthesizedType, factoryDeprecation); 253 254 /** @deprecated Use `factory.updateParenthesizedType` or the factory supplied by your transformation context instead. */ 255 export const updateParenthesizedType = Debug.deprecate(factory.updateParenthesizedType, factoryDeprecation); 256 257 /** @deprecated Use `factory.createThisTypeNode` or the factory supplied by your transformation context instead. */ 258 export const createThisTypeNode = Debug.deprecate(factory.createThisTypeNode, factoryDeprecation); 259 260 /** @deprecated Use `factory.updateTypeOperatorNode` or the factory supplied by your transformation context instead. */ 261 export const updateTypeOperatorNode = Debug.deprecate(factory.updateTypeOperatorNode, factoryDeprecation); 262 263 /** @deprecated Use `factory.createIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */ 264 export const createIndexedAccessTypeNode = Debug.deprecate(factory.createIndexedAccessTypeNode, factoryDeprecation); 265 266 /** @deprecated Use `factory.updateIndexedAccessTypeNode` or the factory supplied by your transformation context instead. */ 267 export const updateIndexedAccessTypeNode = Debug.deprecate(factory.updateIndexedAccessTypeNode, factoryDeprecation); 268 269 /** @deprecated Use `factory.createMappedTypeNode` or the factory supplied by your transformation context instead. */ 270 export const createMappedTypeNode = Debug.deprecate(factory.createMappedTypeNode, factoryDeprecation); 271 272 /** @deprecated Use `factory.updateMappedTypeNode` or the factory supplied by your transformation context instead. */ 273 export const updateMappedTypeNode = Debug.deprecate(factory.updateMappedTypeNode, factoryDeprecation); 274 275 /** @deprecated Use `factory.createLiteralTypeNode` or the factory supplied by your transformation context instead. */ 276 export const createLiteralTypeNode = Debug.deprecate(factory.createLiteralTypeNode, factoryDeprecation); 277 278 /** @deprecated Use `factory.updateLiteralTypeNode` or the factory supplied by your transformation context instead. */ 279 export const updateLiteralTypeNode = Debug.deprecate(factory.updateLiteralTypeNode, factoryDeprecation); 280 281 /** @deprecated Use `factory.createObjectBindingPattern` or the factory supplied by your transformation context instead. */ 282 export const createObjectBindingPattern = Debug.deprecate(factory.createObjectBindingPattern, factoryDeprecation); 283 284 /** @deprecated Use `factory.updateObjectBindingPattern` or the factory supplied by your transformation context instead. */ 285 export const updateObjectBindingPattern = Debug.deprecate(factory.updateObjectBindingPattern, factoryDeprecation); 286 287 /** @deprecated Use `factory.createArrayBindingPattern` or the factory supplied by your transformation context instead. */ 288 export const createArrayBindingPattern = Debug.deprecate(factory.createArrayBindingPattern, factoryDeprecation); 289 290 /** @deprecated Use `factory.updateArrayBindingPattern` or the factory supplied by your transformation context instead. */ 291 export const updateArrayBindingPattern = Debug.deprecate(factory.updateArrayBindingPattern, factoryDeprecation); 292 293 /** @deprecated Use `factory.createBindingElement` or the factory supplied by your transformation context instead. */ 294 export const createBindingElement = Debug.deprecate(factory.createBindingElement, factoryDeprecation); 295 296 /** @deprecated Use `factory.updateBindingElement` or the factory supplied by your transformation context instead. */ 297 export const updateBindingElement = Debug.deprecate(factory.updateBindingElement, factoryDeprecation); 298 299 /** @deprecated Use `factory.createArrayLiteralExpression` or the factory supplied by your transformation context instead. */ 300 export const createArrayLiteral = Debug.deprecate(factory.createArrayLiteralExpression, factoryDeprecation); 301 302 /** @deprecated Use `factory.updateArrayLiteralExpression` or the factory supplied by your transformation context instead. */ 303 export const updateArrayLiteral = Debug.deprecate(factory.updateArrayLiteralExpression, factoryDeprecation); 304 305 /** @deprecated Use `factory.createObjectLiteralExpression` or the factory supplied by your transformation context instead. */ 306 export const createObjectLiteral = Debug.deprecate(factory.createObjectLiteralExpression, factoryDeprecation); 307 308 /** @deprecated Use `factory.updateObjectLiteralExpression` or the factory supplied by your transformation context instead. */ 309 export const updateObjectLiteral = Debug.deprecate(factory.updateObjectLiteralExpression, factoryDeprecation); 310 311 /** @deprecated Use `factory.createPropertyAccessExpression` or the factory supplied by your transformation context instead. */ 312 export const createPropertyAccess = Debug.deprecate(factory.createPropertyAccessExpression, factoryDeprecation); 313 314 /** @deprecated Use `factory.updatePropertyAccessExpression` or the factory supplied by your transformation context instead. */ 315 export const updatePropertyAccess = Debug.deprecate(factory.updatePropertyAccessExpression, factoryDeprecation); 316 317 /** @deprecated Use `factory.createPropertyAccessChain` or the factory supplied by your transformation context instead. */ 318 export const createPropertyAccessChain = Debug.deprecate(factory.createPropertyAccessChain, factoryDeprecation); 319 320 /** @deprecated Use `factory.updatePropertyAccessChain` or the factory supplied by your transformation context instead. */ 321 export const updatePropertyAccessChain = Debug.deprecate(factory.updatePropertyAccessChain, factoryDeprecation); 322 323 /** @deprecated Use `factory.createElementAccessExpression` or the factory supplied by your transformation context instead. */ 324 export const createElementAccess = Debug.deprecate(factory.createElementAccessExpression, factoryDeprecation); 325 326 /** @deprecated Use `factory.updateElementAccessExpression` or the factory supplied by your transformation context instead. */ 327 export const updateElementAccess = Debug.deprecate(factory.updateElementAccessExpression, factoryDeprecation); 328 329 /** @deprecated Use `factory.createElementAccessChain` or the factory supplied by your transformation context instead. */ 330 export const createElementAccessChain = Debug.deprecate(factory.createElementAccessChain, factoryDeprecation); 331 332 /** @deprecated Use `factory.updateElementAccessChain` or the factory supplied by your transformation context instead. */ 333 export const updateElementAccessChain = Debug.deprecate(factory.updateElementAccessChain, factoryDeprecation); 334 335 /** @deprecated Use `factory.createCallExpression` or the factory supplied by your transformation context instead. */ 336 export const createCall = Debug.deprecate(factory.createCallExpression, factoryDeprecation); 337 338 /** @deprecated Use `factory.updateCallExpression` or the factory supplied by your transformation context instead. */ 339 export const updateCall = Debug.deprecate(factory.updateCallExpression, factoryDeprecation); 340 341 /** @deprecated Use `factory.createCallChain` or the factory supplied by your transformation context instead. */ 342 export const createCallChain = Debug.deprecate(factory.createCallChain, factoryDeprecation); 343 344 /** @deprecated Use `factory.updateCallChain` or the factory supplied by your transformation context instead. */ 345 export const updateCallChain = Debug.deprecate(factory.updateCallChain, factoryDeprecation); 346 347 /** @deprecated Use `factory.createNewExpression` or the factory supplied by your transformation context instead. */ 348 export const createNew = Debug.deprecate(factory.createNewExpression, factoryDeprecation); 349 350 /** @deprecated Use `factory.updateNewExpression` or the factory supplied by your transformation context instead. */ 351 export const updateNew = Debug.deprecate(factory.updateNewExpression, factoryDeprecation); 352 353 /** @deprecated Use `factory.createTypeAssertion` or the factory supplied by your transformation context instead. */ 354 export const createTypeAssertion = Debug.deprecate(factory.createTypeAssertion, factoryDeprecation); 355 356 /** @deprecated Use `factory.updateTypeAssertion` or the factory supplied by your transformation context instead. */ 357 export const updateTypeAssertion = Debug.deprecate(factory.updateTypeAssertion, factoryDeprecation); 358 359 /** @deprecated Use `factory.createParenthesizedExpression` or the factory supplied by your transformation context instead. */ 360 export const createParen = Debug.deprecate(factory.createParenthesizedExpression, factoryDeprecation); 361 362 /** @deprecated Use `factory.updateParenthesizedExpression` or the factory supplied by your transformation context instead. */ 363 export const updateParen = Debug.deprecate(factory.updateParenthesizedExpression, factoryDeprecation); 364 365 /** @deprecated Use `factory.createFunctionExpression` or the factory supplied by your transformation context instead. */ 366 export const createFunctionExpression = Debug.deprecate(factory.createFunctionExpression, factoryDeprecation); 367 368 /** @deprecated Use `factory.updateFunctionExpression` or the factory supplied by your transformation context instead. */ 369 export const updateFunctionExpression = Debug.deprecate(factory.updateFunctionExpression, factoryDeprecation); 370 371 /** @deprecated Use `factory.createDeleteExpression` or the factory supplied by your transformation context instead. */ 372 export const createDelete = Debug.deprecate(factory.createDeleteExpression, factoryDeprecation); 373 374 /** @deprecated Use `factory.updateDeleteExpression` or the factory supplied by your transformation context instead. */ 375 export const updateDelete = Debug.deprecate(factory.updateDeleteExpression, factoryDeprecation); 376 377 /** @deprecated Use `factory.createTypeOfExpression` or the factory supplied by your transformation context instead. */ 378 export const createTypeOf = Debug.deprecate(factory.createTypeOfExpression, factoryDeprecation); 379 380 /** @deprecated Use `factory.updateTypeOfExpression` or the factory supplied by your transformation context instead. */ 381 export const updateTypeOf = Debug.deprecate(factory.updateTypeOfExpression, factoryDeprecation); 382 383 /** @deprecated Use `factory.createVoidExpression` or the factory supplied by your transformation context instead. */ 384 export const createVoid = Debug.deprecate(factory.createVoidExpression, factoryDeprecation); 385 386 /** @deprecated Use `factory.updateVoidExpression` or the factory supplied by your transformation context instead. */ 387 export const updateVoid = Debug.deprecate(factory.updateVoidExpression, factoryDeprecation); 388 389 /** @deprecated Use `factory.createAwaitExpression` or the factory supplied by your transformation context instead. */ 390 export const createAwait = Debug.deprecate(factory.createAwaitExpression, factoryDeprecation); 391 392 /** @deprecated Use `factory.updateAwaitExpression` or the factory supplied by your transformation context instead. */ 393 export const updateAwait = Debug.deprecate(factory.updateAwaitExpression, factoryDeprecation); 394 395 /** @deprecated Use `factory.createPrefixExpression` or the factory supplied by your transformation context instead. */ 396 export const createPrefix = Debug.deprecate(factory.createPrefixUnaryExpression, factoryDeprecation); 397 398 /** @deprecated Use `factory.updatePrefixExpression` or the factory supplied by your transformation context instead. */ 399 export const updatePrefix = Debug.deprecate(factory.updatePrefixUnaryExpression, factoryDeprecation); 400 401 /** @deprecated Use `factory.createPostfixUnaryExpression` or the factory supplied by your transformation context instead. */ 402 export const createPostfix = Debug.deprecate(factory.createPostfixUnaryExpression, factoryDeprecation); 403 404 /** @deprecated Use `factory.updatePostfixUnaryExpression` or the factory supplied by your transformation context instead. */ 405 export const updatePostfix = Debug.deprecate(factory.updatePostfixUnaryExpression, factoryDeprecation); 406 407 /** @deprecated Use `factory.createBinaryExpression` or the factory supplied by your transformation context instead. */ 408 export const createBinary = Debug.deprecate(factory.createBinaryExpression, factoryDeprecation); 409 410 /** @deprecated Use `factory.updateConditionalExpression` or the factory supplied by your transformation context instead. */ 411 export const updateConditional = Debug.deprecate(factory.updateConditionalExpression, factoryDeprecation); 412 413 /** @deprecated Use `factory.createTemplateExpression` or the factory supplied by your transformation context instead. */ 414 export const createTemplateExpression = Debug.deprecate(factory.createTemplateExpression, factoryDeprecation); 415 416 /** @deprecated Use `factory.updateTemplateExpression` or the factory supplied by your transformation context instead. */ 417 export const updateTemplateExpression = Debug.deprecate(factory.updateTemplateExpression, factoryDeprecation); 418 419 /** @deprecated Use `factory.createTemplateHead` or the factory supplied by your transformation context instead. */ 420 export const createTemplateHead = Debug.deprecate(factory.createTemplateHead, factoryDeprecation); 421 422 /** @deprecated Use `factory.createTemplateMiddle` or the factory supplied by your transformation context instead. */ 423 export const createTemplateMiddle = Debug.deprecate(factory.createTemplateMiddle, factoryDeprecation); 424 425 /** @deprecated Use `factory.createTemplateTail` or the factory supplied by your transformation context instead. */ 426 export const createTemplateTail = Debug.deprecate(factory.createTemplateTail, factoryDeprecation); 427 428 /** @deprecated Use `factory.createNoSubstitutionTemplateLiteral` or the factory supplied by your transformation context instead. */ 429 export const createNoSubstitutionTemplateLiteral = Debug.deprecate(factory.createNoSubstitutionTemplateLiteral, factoryDeprecation); 430 431 /** @deprecated Use `factory.updateYieldExpression` or the factory supplied by your transformation context instead. */ 432 export const updateYield = Debug.deprecate(factory.updateYieldExpression, factoryDeprecation); 433 434 /** @deprecated Use `factory.createSpreadExpression` or the factory supplied by your transformation context instead. */ 435 export const createSpread = Debug.deprecate(factory.createSpreadElement, factoryDeprecation); 436 437 /** @deprecated Use `factory.updateSpreadExpression` or the factory supplied by your transformation context instead. */ 438 export const updateSpread = Debug.deprecate(factory.updateSpreadElement, factoryDeprecation); 439 440 /** @deprecated Use `factory.createOmittedExpression` or the factory supplied by your transformation context instead. */ 441 export const createOmittedExpression = Debug.deprecate(factory.createOmittedExpression, factoryDeprecation); 442 443 /** @deprecated Use `factory.createAsExpression` or the factory supplied by your transformation context instead. */ 444 export const createAsExpression = Debug.deprecate(factory.createAsExpression, factoryDeprecation); 445 446 /** @deprecated Use `factory.updateAsExpression` or the factory supplied by your transformation context instead. */ 447 export const updateAsExpression = Debug.deprecate(factory.updateAsExpression, factoryDeprecation); 448 449 /** @deprecated Use `factory.createNonNullExpression` or the factory supplied by your transformation context instead. */ 450 export const createNonNullExpression = Debug.deprecate(factory.createNonNullExpression, factoryDeprecation); 451 452 /** @deprecated Use `factory.updateNonNullExpression` or the factory supplied by your transformation context instead. */ 453 export const updateNonNullExpression = Debug.deprecate(factory.updateNonNullExpression, factoryDeprecation); 454 455 /** @deprecated Use `factory.createNonNullChain` or the factory supplied by your transformation context instead. */ 456 export const createNonNullChain = Debug.deprecate(factory.createNonNullChain, factoryDeprecation); 457 458 /** @deprecated Use `factory.updateNonNullChain` or the factory supplied by your transformation context instead. */ 459 export const updateNonNullChain = Debug.deprecate(factory.updateNonNullChain, factoryDeprecation); 460 461 /** @deprecated Use `factory.createMetaProperty` or the factory supplied by your transformation context instead. */ 462 export const createMetaProperty = Debug.deprecate(factory.createMetaProperty, factoryDeprecation); 463 464 /** @deprecated Use `factory.updateMetaProperty` or the factory supplied by your transformation context instead. */ 465 export const updateMetaProperty = Debug.deprecate(factory.updateMetaProperty, factoryDeprecation); 466 467 /** @deprecated Use `factory.createTemplateSpan` or the factory supplied by your transformation context instead. */ 468 export const createTemplateSpan = Debug.deprecate(factory.createTemplateSpan, factoryDeprecation); 469 470 /** @deprecated Use `factory.updateTemplateSpan` or the factory supplied by your transformation context instead. */ 471 export const updateTemplateSpan = Debug.deprecate(factory.updateTemplateSpan, factoryDeprecation); 472 473 /** @deprecated Use `factory.createSemicolonClassElement` or the factory supplied by your transformation context instead. */ 474 export const createSemicolonClassElement = Debug.deprecate(factory.createSemicolonClassElement, factoryDeprecation); 475 476 /** @deprecated Use `factory.createBlock` or the factory supplied by your transformation context instead. */ 477 export const createBlock = Debug.deprecate(factory.createBlock, factoryDeprecation); 478 479 /** @deprecated Use `factory.updateBlock` or the factory supplied by your transformation context instead. */ 480 export const updateBlock = Debug.deprecate(factory.updateBlock, factoryDeprecation); 481 482 /** @deprecated Use `factory.createVariableStatement` or the factory supplied by your transformation context instead. */ 483 export const createVariableStatement = Debug.deprecate(factory.createVariableStatement, factoryDeprecation); 484 485 /** @deprecated Use `factory.updateVariableStatement` or the factory supplied by your transformation context instead. */ 486 export const updateVariableStatement = Debug.deprecate(factory.updateVariableStatement, factoryDeprecation); 487 488 /** @deprecated Use `factory.createEmptyStatement` or the factory supplied by your transformation context instead. */ 489 export const createEmptyStatement = Debug.deprecate(factory.createEmptyStatement, factoryDeprecation); 490 491 /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */ 492 export const createExpressionStatement = Debug.deprecate(factory.createExpressionStatement, factoryDeprecation); 493 494 /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */ 495 export const updateExpressionStatement = Debug.deprecate(factory.updateExpressionStatement, factoryDeprecation); 496 497 /** @deprecated Use `factory.createExpressionStatement` or the factory supplied by your transformation context instead. */ 498 export const createStatement = Debug.deprecate(factory.createExpressionStatement, factoryDeprecation); 499 500 /** @deprecated Use `factory.updateExpressionStatement` or the factory supplied by your transformation context instead. */ 501 export const updateStatement = Debug.deprecate(factory.updateExpressionStatement, factoryDeprecation); 502 503 /** @deprecated Use `factory.createIfStatement` or the factory supplied by your transformation context instead. */ 504 export const createIf = Debug.deprecate(factory.createIfStatement, factoryDeprecation); 505 506 /** @deprecated Use `factory.updateIfStatement` or the factory supplied by your transformation context instead. */ 507 export const updateIf = Debug.deprecate(factory.updateIfStatement, factoryDeprecation); 508 509 /** @deprecated Use `factory.createDoStatement` or the factory supplied by your transformation context instead. */ 510 export const createDo = Debug.deprecate(factory.createDoStatement, factoryDeprecation); 511 512 /** @deprecated Use `factory.updateDoStatement` or the factory supplied by your transformation context instead. */ 513 export const updateDo = Debug.deprecate(factory.updateDoStatement, factoryDeprecation); 514 515 /** @deprecated Use `factory.createWhileStatement` or the factory supplied by your transformation context instead. */ 516 export const createWhile = Debug.deprecate(factory.createWhileStatement, factoryDeprecation); 517 518 /** @deprecated Use `factory.updateWhileStatement` or the factory supplied by your transformation context instead. */ 519 export const updateWhile = Debug.deprecate(factory.updateWhileStatement, factoryDeprecation); 520 521 /** @deprecated Use `factory.createForStatement` or the factory supplied by your transformation context instead. */ 522 export const createFor = Debug.deprecate(factory.createForStatement, factoryDeprecation); 523 524 /** @deprecated Use `factory.updateForStatement` or the factory supplied by your transformation context instead. */ 525 export const updateFor = Debug.deprecate(factory.updateForStatement, factoryDeprecation); 526 527 /** @deprecated Use `factory.createForInStatement` or the factory supplied by your transformation context instead. */ 528 export const createForIn = Debug.deprecate(factory.createForInStatement, factoryDeprecation); 529 530 /** @deprecated Use `factory.updateForInStatement` or the factory supplied by your transformation context instead. */ 531 export const updateForIn = Debug.deprecate(factory.updateForInStatement, factoryDeprecation); 532 533 /** @deprecated Use `factory.createForOfStatement` or the factory supplied by your transformation context instead. */ 534 export const createForOf = Debug.deprecate(factory.createForOfStatement, factoryDeprecation); 535 536 /** @deprecated Use `factory.updateForOfStatement` or the factory supplied by your transformation context instead. */ 537 export const updateForOf = Debug.deprecate(factory.updateForOfStatement, factoryDeprecation); 538 539 /** @deprecated Use `factory.createContinueStatement` or the factory supplied by your transformation context instead. */ 540 export const createContinue = Debug.deprecate(factory.createContinueStatement, factoryDeprecation); 541 542 /** @deprecated Use `factory.updateContinueStatement` or the factory supplied by your transformation context instead. */ 543 export const updateContinue = Debug.deprecate(factory.updateContinueStatement, factoryDeprecation); 544 545 /** @deprecated Use `factory.createBreakStatement` or the factory supplied by your transformation context instead. */ 546 export const createBreak = Debug.deprecate(factory.createBreakStatement, factoryDeprecation); 547 548 /** @deprecated Use `factory.updateBreakStatement` or the factory supplied by your transformation context instead. */ 549 export const updateBreak = Debug.deprecate(factory.updateBreakStatement, factoryDeprecation); 550 551 /** @deprecated Use `factory.createReturnStatement` or the factory supplied by your transformation context instead. */ 552 export const createReturn = Debug.deprecate(factory.createReturnStatement, factoryDeprecation); 553 554 /** @deprecated Use `factory.updateReturnStatement` or the factory supplied by your transformation context instead. */ 555 export const updateReturn = Debug.deprecate(factory.updateReturnStatement, factoryDeprecation); 556 557 /** @deprecated Use `factory.createWithStatement` or the factory supplied by your transformation context instead. */ 558 export const createWith = Debug.deprecate(factory.createWithStatement, factoryDeprecation); 559 560 /** @deprecated Use `factory.updateWithStatement` or the factory supplied by your transformation context instead. */ 561 export const updateWith = Debug.deprecate(factory.updateWithStatement, factoryDeprecation); 562 563 /** @deprecated Use `factory.createSwitchStatement` or the factory supplied by your transformation context instead. */ 564 export const createSwitch = Debug.deprecate(factory.createSwitchStatement, factoryDeprecation); 565 566 /** @deprecated Use `factory.updateSwitchStatement` or the factory supplied by your transformation context instead. */ 567 export const updateSwitch = Debug.deprecate(factory.updateSwitchStatement, factoryDeprecation); 568 569 /** @deprecated Use `factory.createLabelStatement` or the factory supplied by your transformation context instead. */ 570 export const createLabel = Debug.deprecate(factory.createLabeledStatement, factoryDeprecation); 571 572 /** @deprecated Use `factory.updateLabelStatement` or the factory supplied by your transformation context instead. */ 573 export const updateLabel = Debug.deprecate(factory.updateLabeledStatement, factoryDeprecation); 574 575 /** @deprecated Use `factory.createThrowStatement` or the factory supplied by your transformation context instead. */ 576 export const createThrow = Debug.deprecate(factory.createThrowStatement, factoryDeprecation); 577 578 /** @deprecated Use `factory.updateThrowStatement` or the factory supplied by your transformation context instead. */ 579 export const updateThrow = Debug.deprecate(factory.updateThrowStatement, factoryDeprecation); 580 581 /** @deprecated Use `factory.createTryStatement` or the factory supplied by your transformation context instead. */ 582 export const createTry = Debug.deprecate(factory.createTryStatement, factoryDeprecation); 583 584 /** @deprecated Use `factory.updateTryStatement` or the factory supplied by your transformation context instead. */ 585 export const updateTry = Debug.deprecate(factory.updateTryStatement, factoryDeprecation); 586 587 /** @deprecated Use `factory.createDebuggerStatement` or the factory supplied by your transformation context instead. */ 588 export const createDebuggerStatement = Debug.deprecate(factory.createDebuggerStatement, factoryDeprecation); 589 590 /** @deprecated Use `factory.createVariableDeclarationList` or the factory supplied by your transformation context instead. */ 591 export const createVariableDeclarationList = Debug.deprecate(factory.createVariableDeclarationList, factoryDeprecation); 592 593 /** @deprecated Use `factory.updateVariableDeclarationList` or the factory supplied by your transformation context instead. */ 594 export const updateVariableDeclarationList = Debug.deprecate(factory.updateVariableDeclarationList, factoryDeprecation); 595 596 /** @deprecated Use `factory.createFunctionDeclaration` or the factory supplied by your transformation context instead. */ 597 export const createFunctionDeclaration = Debug.deprecate(factory.createFunctionDeclaration, factoryDeprecation); 598 599 /** @deprecated Use `factory.updateFunctionDeclaration` or the factory supplied by your transformation context instead. */ 600 export const updateFunctionDeclaration = Debug.deprecate(factory.updateFunctionDeclaration, factoryDeprecation); 601 602 /** @deprecated Use `factory.createClassDeclaration` or the factory supplied by your transformation context instead. */ 603 export const createClassDeclaration = Debug.deprecate(factory.createClassDeclaration, factoryDeprecation); 604 605 /** @deprecated Use `factory.updateClassDeclaration` or the factory supplied by your transformation context instead. */ 606 export const updateClassDeclaration = Debug.deprecate(factory.updateClassDeclaration, factoryDeprecation); 607 608 /** @deprecated Use `factory.createInterfaceDeclaration` or the factory supplied by your transformation context instead. */ 609 export const createInterfaceDeclaration = Debug.deprecate(factory.createInterfaceDeclaration, factoryDeprecation); 610 611 /** @deprecated Use `factory.updateInterfaceDeclaration` or the factory supplied by your transformation context instead. */ 612 export const updateInterfaceDeclaration = Debug.deprecate(factory.updateInterfaceDeclaration, factoryDeprecation); 613 614 /** @deprecated Use `factory.createTypeAliasDeclaration` or the factory supplied by your transformation context instead. */ 615 export const createTypeAliasDeclaration = Debug.deprecate(factory.createTypeAliasDeclaration, factoryDeprecation); 616 617 /** @deprecated Use `factory.updateTypeAliasDeclaration` or the factory supplied by your transformation context instead. */ 618 export const updateTypeAliasDeclaration = Debug.deprecate(factory.updateTypeAliasDeclaration, factoryDeprecation); 619 620 /** @deprecated Use `factory.createEnumDeclaration` or the factory supplied by your transformation context instead. */ 621 export const createEnumDeclaration = Debug.deprecate(factory.createEnumDeclaration, factoryDeprecation); 622 623 /** @deprecated Use `factory.updateEnumDeclaration` or the factory supplied by your transformation context instead. */ 624 export const updateEnumDeclaration = Debug.deprecate(factory.updateEnumDeclaration, factoryDeprecation); 625 626 /** @deprecated Use `factory.createModuleDeclaration` or the factory supplied by your transformation context instead. */ 627 export const createModuleDeclaration = Debug.deprecate(factory.createModuleDeclaration, factoryDeprecation); 628 629 /** @deprecated Use `factory.updateModuleDeclaration` or the factory supplied by your transformation context instead. */ 630 export const updateModuleDeclaration = Debug.deprecate(factory.updateModuleDeclaration, factoryDeprecation); 631 632 /** @deprecated Use `factory.createModuleBlock` or the factory supplied by your transformation context instead. */ 633 export const createModuleBlock = Debug.deprecate(factory.createModuleBlock, factoryDeprecation); 634 635 /** @deprecated Use `factory.updateModuleBlock` or the factory supplied by your transformation context instead. */ 636 export const updateModuleBlock = Debug.deprecate(factory.updateModuleBlock, factoryDeprecation); 637 638 /** @deprecated Use `factory.createCaseBlock` or the factory supplied by your transformation context instead. */ 639 export const createCaseBlock = Debug.deprecate(factory.createCaseBlock, factoryDeprecation); 640 641 /** @deprecated Use `factory.updateCaseBlock` or the factory supplied by your transformation context instead. */ 642 export const updateCaseBlock = Debug.deprecate(factory.updateCaseBlock, factoryDeprecation); 643 644 /** @deprecated Use `factory.createNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */ 645 export const createNamespaceExportDeclaration = Debug.deprecate(factory.createNamespaceExportDeclaration, factoryDeprecation); 646 647 /** @deprecated Use `factory.updateNamespaceExportDeclaration` or the factory supplied by your transformation context instead. */ 648 export const updateNamespaceExportDeclaration = Debug.deprecate(factory.updateNamespaceExportDeclaration, factoryDeprecation); 649 650 /** @deprecated Use `factory.createImportEqualsDeclaration` or the factory supplied by your transformation context instead. */ 651 export const createImportEqualsDeclaration = Debug.deprecate(factory.createImportEqualsDeclaration, factoryDeprecation); 652 653 /** @deprecated Use `factory.updateImportEqualsDeclaration` or the factory supplied by your transformation context instead. */ 654 export const updateImportEqualsDeclaration = Debug.deprecate(factory.updateImportEqualsDeclaration, factoryDeprecation); 655 656 /** @deprecated Use `factory.createImportDeclaration` or the factory supplied by your transformation context instead. */ 657 export const createImportDeclaration = Debug.deprecate(factory.createImportDeclaration, factoryDeprecation); 658 659 /** @deprecated Use `factory.updateImportDeclaration` or the factory supplied by your transformation context instead. */ 660 export const updateImportDeclaration = Debug.deprecate(factory.updateImportDeclaration, factoryDeprecation); 661 662 /** @deprecated Use `factory.createNamespaceImport` or the factory supplied by your transformation context instead. */ 663 export const createNamespaceImport = Debug.deprecate(factory.createNamespaceImport, factoryDeprecation); 664 665 /** @deprecated Use `factory.updateNamespaceImport` or the factory supplied by your transformation context instead. */ 666 export const updateNamespaceImport = Debug.deprecate(factory.updateNamespaceImport, factoryDeprecation); 667 668 /** @deprecated Use `factory.createNamedImports` or the factory supplied by your transformation context instead. */ 669 export const createNamedImports = Debug.deprecate(factory.createNamedImports, factoryDeprecation); 670 671 /** @deprecated Use `factory.updateNamedImports` or the factory supplied by your transformation context instead. */ 672 export const updateNamedImports = Debug.deprecate(factory.updateNamedImports, factoryDeprecation); 673 674 /** @deprecated Use `factory.createImportSpecifier` or the factory supplied by your transformation context instead. */ 675 export const createImportSpecifier = Debug.deprecate(factory.createImportSpecifier, factoryDeprecation); 676 677 /** @deprecated Use `factory.updateImportSpecifier` or the factory supplied by your transformation context instead. */ 678 export const updateImportSpecifier = Debug.deprecate(factory.updateImportSpecifier, factoryDeprecation); 679 680 /** @deprecated Use `factory.createExportAssignment` or the factory supplied by your transformation context instead. */ 681 export const createExportAssignment = Debug.deprecate(factory.createExportAssignment, factoryDeprecation); 682 683 /** @deprecated Use `factory.updateExportAssignment` or the factory supplied by your transformation context instead. */ 684 export const updateExportAssignment = Debug.deprecate(factory.updateExportAssignment, factoryDeprecation); 685 686 /** @deprecated Use `factory.createNamedExports` or the factory supplied by your transformation context instead. */ 687 export const createNamedExports = Debug.deprecate(factory.createNamedExports, factoryDeprecation); 688 689 /** @deprecated Use `factory.updateNamedExports` or the factory supplied by your transformation context instead. */ 690 export const updateNamedExports = Debug.deprecate(factory.updateNamedExports, factoryDeprecation); 691 692 /** @deprecated Use `factory.createExportSpecifier` or the factory supplied by your transformation context instead. */ 693 export const createExportSpecifier = Debug.deprecate(factory.createExportSpecifier, factoryDeprecation); 694 695 /** @deprecated Use `factory.updateExportSpecifier` or the factory supplied by your transformation context instead. */ 696 export const updateExportSpecifier = Debug.deprecate(factory.updateExportSpecifier, factoryDeprecation); 697 698 /** @deprecated Use `factory.createExternalModuleReference` or the factory supplied by your transformation context instead. */ 699 export const createExternalModuleReference = Debug.deprecate(factory.createExternalModuleReference, factoryDeprecation); 700 701 /** @deprecated Use `factory.updateExternalModuleReference` or the factory supplied by your transformation context instead. */ 702 export const updateExternalModuleReference = Debug.deprecate(factory.updateExternalModuleReference, factoryDeprecation); 703 704 /** @deprecated Use `factory.createJSDocTypeExpression` or the factory supplied by your transformation context instead. */ 705 export const createJSDocTypeExpression = Debug.deprecate(factory.createJSDocTypeExpression, factoryDeprecation); 706 707 /** @deprecated Use `factory.createJSDocTypeTag` or the factory supplied by your transformation context instead. */ 708 export const createJSDocTypeTag = Debug.deprecate(factory.createJSDocTypeTag, factoryDeprecation); 709 710 /** @deprecated Use `factory.createJSDocReturnTag` or the factory supplied by your transformation context instead. */ 711 export const createJSDocReturnTag = Debug.deprecate(factory.createJSDocReturnTag, factoryDeprecation); 712 713 /** @deprecated Use `factory.createJSDocThisTag` or the factory supplied by your transformation context instead. */ 714 export const createJSDocThisTag = Debug.deprecate(factory.createJSDocThisTag, factoryDeprecation); 715 716 /** @deprecated Use `factory.createJSDocComment` or the factory supplied by your transformation context instead. */ 717 export const createJSDocComment = Debug.deprecate(factory.createJSDocComment, factoryDeprecation); 718 719 /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */ 720 export const createJSDocParameterTag = Debug.deprecate(factory.createJSDocParameterTag, factoryDeprecation); 721 722 /** @deprecated Use `factory.createJSDocClassTag` or the factory supplied by your transformation context instead. */ 723 export const createJSDocClassTag = Debug.deprecate(factory.createJSDocClassTag, factoryDeprecation); 724 725 /** @deprecated Use `factory.createJSDocAugmentsTag` or the factory supplied by your transformation context instead. */ 726 export const createJSDocAugmentsTag = Debug.deprecate(factory.createJSDocAugmentsTag, factoryDeprecation); 727 728 /** @deprecated Use `factory.createJSDocEnumTag` or the factory supplied by your transformation context instead. */ 729 export const createJSDocEnumTag = Debug.deprecate(factory.createJSDocEnumTag, factoryDeprecation); 730 731 /** @deprecated Use `factory.createJSDocTemplateTag` or the factory supplied by your transformation context instead. */ 732 export const createJSDocTemplateTag = Debug.deprecate(factory.createJSDocTemplateTag, factoryDeprecation); 733 734 /** @deprecated Use `factory.createJSDocTypedefTag` or the factory supplied by your transformation context instead. */ 735 export const createJSDocTypedefTag = Debug.deprecate(factory.createJSDocTypedefTag, factoryDeprecation); 736 737 /** @deprecated Use `factory.createJSDocCallbackTag` or the factory supplied by your transformation context instead. */ 738 export const createJSDocCallbackTag = Debug.deprecate(factory.createJSDocCallbackTag, factoryDeprecation); 739 740 /** @deprecated Use `factory.createJSDocSignature` or the factory supplied by your transformation context instead. */ 741 export const createJSDocSignature = Debug.deprecate(factory.createJSDocSignature, factoryDeprecation); 742 743 /** @deprecated Use `factory.createJSDocPropertyTag` or the factory supplied by your transformation context instead. */ 744 export const createJSDocPropertyTag = Debug.deprecate(factory.createJSDocPropertyTag, factoryDeprecation); 745 746 /** @deprecated Use `factory.createJSDocTypeLiteral` or the factory supplied by your transformation context instead. */ 747 export const createJSDocTypeLiteral = Debug.deprecate(factory.createJSDocTypeLiteral, factoryDeprecation); 748 749 /** @deprecated Use `factory.createJSDocImplementsTag` or the factory supplied by your transformation context instead. */ 750 export const createJSDocImplementsTag = Debug.deprecate(factory.createJSDocImplementsTag, factoryDeprecation); 751 752 /** @deprecated Use `factory.createJSDocAuthorTag` or the factory supplied by your transformation context instead. */ 753 export const createJSDocAuthorTag = Debug.deprecate(factory.createJSDocAuthorTag, factoryDeprecation); 754 755 /** @deprecated Use `factory.createJSDocPublicTag` or the factory supplied by your transformation context instead. */ 756 export const createJSDocPublicTag = Debug.deprecate(factory.createJSDocPublicTag, factoryDeprecation); 757 758 /** @deprecated Use `factory.createJSDocPrivateTag` or the factory supplied by your transformation context instead. */ 759 export const createJSDocPrivateTag = Debug.deprecate(factory.createJSDocPrivateTag, factoryDeprecation); 760 761 /** @deprecated Use `factory.createJSDocProtectedTag` or the factory supplied by your transformation context instead. */ 762 export const createJSDocProtectedTag = Debug.deprecate(factory.createJSDocProtectedTag, factoryDeprecation); 763 764 /** @deprecated Use `factory.createJSDocReadonlyTag` or the factory supplied by your transformation context instead. */ 765 export const createJSDocReadonlyTag = Debug.deprecate(factory.createJSDocReadonlyTag, factoryDeprecation); 766 767 /** @deprecated Use `factory.createJSDocUnknownTag` or the factory supplied by your transformation context instead. */ 768 export const createJSDocTag = Debug.deprecate(factory.createJSDocUnknownTag, factoryDeprecation); 769 770 /** @deprecated Use `factory.createJsxElement` or the factory supplied by your transformation context instead. */ 771 export const createJsxElement = Debug.deprecate(factory.createJsxElement, factoryDeprecation); 772 773 /** @deprecated Use `factory.updateJsxElement` or the factory supplied by your transformation context instead. */ 774 export const updateJsxElement = Debug.deprecate(factory.updateJsxElement, factoryDeprecation); 775 776 /** @deprecated Use `factory.createJsxSelfClosingElement` or the factory supplied by your transformation context instead. */ 777 export const createJsxSelfClosingElement = Debug.deprecate(factory.createJsxSelfClosingElement, factoryDeprecation); 778 779 /** @deprecated Use `factory.updateJsxSelfClosingElement` or the factory supplied by your transformation context instead. */ 780 export const updateJsxSelfClosingElement = Debug.deprecate(factory.updateJsxSelfClosingElement, factoryDeprecation); 781 782 /** @deprecated Use `factory.createJsxOpeningElement` or the factory supplied by your transformation context instead. */ 783 export const createJsxOpeningElement = Debug.deprecate(factory.createJsxOpeningElement, factoryDeprecation); 784 785 /** @deprecated Use `factory.updateJsxOpeningElement` or the factory supplied by your transformation context instead. */ 786 export const updateJsxOpeningElement = Debug.deprecate(factory.updateJsxOpeningElement, factoryDeprecation); 787 788 /** @deprecated Use `factory.createJsxClosingElement` or the factory supplied by your transformation context instead. */ 789 export const createJsxClosingElement = Debug.deprecate(factory.createJsxClosingElement, factoryDeprecation); 790 791 /** @deprecated Use `factory.updateJsxClosingElement` or the factory supplied by your transformation context instead. */ 792 export const updateJsxClosingElement = Debug.deprecate(factory.updateJsxClosingElement, factoryDeprecation); 793 794 /** @deprecated Use `factory.createJsxFragment` or the factory supplied by your transformation context instead. */ 795 export const createJsxFragment = Debug.deprecate(factory.createJsxFragment, factoryDeprecation); 796 797 /** @deprecated Use `factory.createJsxText` or the factory supplied by your transformation context instead. */ 798 export const createJsxText = Debug.deprecate(factory.createJsxText, factoryDeprecation); 799 800 /** @deprecated Use `factory.updateJsxText` or the factory supplied by your transformation context instead. */ 801 export const updateJsxText = Debug.deprecate(factory.updateJsxText, factoryDeprecation); 802 803 /** @deprecated Use `factory.createJsxOpeningFragment` or the factory supplied by your transformation context instead. */ 804 export const createJsxOpeningFragment = Debug.deprecate(factory.createJsxOpeningFragment, factoryDeprecation); 805 806 /** @deprecated Use `factory.createJsxJsxClosingFragment` or the factory supplied by your transformation context instead. */ 807 export const createJsxJsxClosingFragment = Debug.deprecate(factory.createJsxJsxClosingFragment, factoryDeprecation); 808 809 /** @deprecated Use `factory.updateJsxFragment` or the factory supplied by your transformation context instead. */ 810 export const updateJsxFragment = Debug.deprecate(factory.updateJsxFragment, factoryDeprecation); 811 812 /** @deprecated Use `factory.createJsxAttribute` or the factory supplied by your transformation context instead. */ 813 export const createJsxAttribute = Debug.deprecate(factory.createJsxAttribute, factoryDeprecation); 814 815 /** @deprecated Use `factory.updateJsxAttribute` or the factory supplied by your transformation context instead. */ 816 export const updateJsxAttribute = Debug.deprecate(factory.updateJsxAttribute, factoryDeprecation); 817 818 /** @deprecated Use `factory.createJsxAttributes` or the factory supplied by your transformation context instead. */ 819 export const createJsxAttributes = Debug.deprecate(factory.createJsxAttributes, factoryDeprecation); 820 821 /** @deprecated Use `factory.updateJsxAttributes` or the factory supplied by your transformation context instead. */ 822 export const updateJsxAttributes = Debug.deprecate(factory.updateJsxAttributes, factoryDeprecation); 823 824 /** @deprecated Use `factory.createJsxSpreadAttribute` or the factory supplied by your transformation context instead. */ 825 export const createJsxSpreadAttribute = Debug.deprecate(factory.createJsxSpreadAttribute, factoryDeprecation); 826 827 /** @deprecated Use `factory.updateJsxSpreadAttribute` or the factory supplied by your transformation context instead. */ 828 export const updateJsxSpreadAttribute = Debug.deprecate(factory.updateJsxSpreadAttribute, factoryDeprecation); 829 830 /** @deprecated Use `factory.createJsxExpression` or the factory supplied by your transformation context instead. */ 831 export const createJsxExpression = Debug.deprecate(factory.createJsxExpression, factoryDeprecation); 832 833 /** @deprecated Use `factory.updateJsxExpression` or the factory supplied by your transformation context instead. */ 834 export const updateJsxExpression = Debug.deprecate(factory.updateJsxExpression, factoryDeprecation); 835 836 /** @deprecated Use `factory.createCaseClause` or the factory supplied by your transformation context instead. */ 837 export const createCaseClause = Debug.deprecate(factory.createCaseClause, factoryDeprecation); 838 839 /** @deprecated Use `factory.updateCaseClause` or the factory supplied by your transformation context instead. */ 840 export const updateCaseClause = Debug.deprecate(factory.updateCaseClause, factoryDeprecation); 841 842 /** @deprecated Use `factory.createDefaultClause` or the factory supplied by your transformation context instead. */ 843 export const createDefaultClause = Debug.deprecate(factory.createDefaultClause, factoryDeprecation); 844 845 /** @deprecated Use `factory.updateDefaultClause` or the factory supplied by your transformation context instead. */ 846 export const updateDefaultClause = Debug.deprecate(factory.updateDefaultClause, factoryDeprecation); 847 848 /** @deprecated Use `factory.createHeritageClause` or the factory supplied by your transformation context instead. */ 849 export const createHeritageClause = Debug.deprecate(factory.createHeritageClause, factoryDeprecation); 850 851 /** @deprecated Use `factory.updateHeritageClause` or the factory supplied by your transformation context instead. */ 852 export const updateHeritageClause = Debug.deprecate(factory.updateHeritageClause, factoryDeprecation); 853 854 /** @deprecated Use `factory.createCatchClause` or the factory supplied by your transformation context instead. */ 855 export const createCatchClause = Debug.deprecate(factory.createCatchClause, factoryDeprecation); 856 857 /** @deprecated Use `factory.updateCatchClause` or the factory supplied by your transformation context instead. */ 858 export const updateCatchClause = Debug.deprecate(factory.updateCatchClause, factoryDeprecation); 859 860 /** @deprecated Use `factory.createPropertyAssignment` or the factory supplied by your transformation context instead. */ 861 export const createPropertyAssignment = Debug.deprecate(factory.createPropertyAssignment, factoryDeprecation); 862 863 /** @deprecated Use `factory.updatePropertyAssignment` or the factory supplied by your transformation context instead. */ 864 export const updatePropertyAssignment = Debug.deprecate(factory.updatePropertyAssignment, factoryDeprecation); 865 866 /** @deprecated Use `factory.createShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */ 867 export const createShorthandPropertyAssignment = Debug.deprecate(factory.createShorthandPropertyAssignment, factoryDeprecation); 868 869 /** @deprecated Use `factory.updateShorthandPropertyAssignment` or the factory supplied by your transformation context instead. */ 870 export const updateShorthandPropertyAssignment = Debug.deprecate(factory.updateShorthandPropertyAssignment, factoryDeprecation); 871 872 /** @deprecated Use `factory.createSpreadAssignment` or the factory supplied by your transformation context instead. */ 873 export const createSpreadAssignment = Debug.deprecate(factory.createSpreadAssignment, factoryDeprecation); 874 875 /** @deprecated Use `factory.updateSpreadAssignment` or the factory supplied by your transformation context instead. */ 876 export const updateSpreadAssignment = Debug.deprecate(factory.updateSpreadAssignment, factoryDeprecation); 877 878 /** @deprecated Use `factory.createEnumMember` or the factory supplied by your transformation context instead. */ 879 export const createEnumMember = Debug.deprecate(factory.createEnumMember, factoryDeprecation); 880 881 /** @deprecated Use `factory.updateEnumMember` or the factory supplied by your transformation context instead. */ 882 export const updateEnumMember = Debug.deprecate(factory.updateEnumMember, factoryDeprecation); 883 884 /** @deprecated Use `factory.updateSourceFile` or the factory supplied by your transformation context instead. */ 885 export const updateSourceFileNode = Debug.deprecate(factory.updateSourceFile, factoryDeprecation); 886 887 /** @deprecated Use `factory.createNotEmittedStatement` or the factory supplied by your transformation context instead. */ 888 export const createNotEmittedStatement = Debug.deprecate(factory.createNotEmittedStatement, factoryDeprecation); 889 890 /** @deprecated Use `factory.createPartiallyEmittedExpression` or the factory supplied by your transformation context instead. */ 891 export const createPartiallyEmittedExpression = Debug.deprecate(factory.createPartiallyEmittedExpression, factoryDeprecation); 892 893 /** @deprecated Use `factory.updatePartiallyEmittedExpression` or the factory supplied by your transformation context instead. */ 894 export const updatePartiallyEmittedExpression = Debug.deprecate(factory.updatePartiallyEmittedExpression, factoryDeprecation); 895 896 /** @deprecated Use `factory.createCommaListExpression` or the factory supplied by your transformation context instead. */ 897 export const createCommaList = Debug.deprecate(factory.createCommaListExpression, factoryDeprecation); 898 899 /** @deprecated Use `factory.updateCommaListExpression` or the factory supplied by your transformation context instead. */ 900 export const updateCommaList = Debug.deprecate(factory.updateCommaListExpression, factoryDeprecation); 901 902 /** @deprecated Use `factory.createBundle` or the factory supplied by your transformation context instead. */ 903 export const createBundle = Debug.deprecate(factory.createBundle, factoryDeprecation); 904 905 /** @deprecated Use `factory.updateBundle` or the factory supplied by your transformation context instead. */ 906 export const updateBundle = Debug.deprecate(factory.updateBundle, factoryDeprecation); 907 908 /** @deprecated Use `factory.createImmediatelyInvokedFunctionExpression` or the factory supplied by your transformation context instead. */ 909 export const createImmediatelyInvokedFunctionExpression = Debug.deprecate(factory.createImmediatelyInvokedFunctionExpression, factoryDeprecation); 910 911 /** @deprecated Use `factory.createImmediatelyInvokedArrowFunction` or the factory supplied by your transformation context instead. */ 912 export const createImmediatelyInvokedArrowFunction = Debug.deprecate(factory.createImmediatelyInvokedArrowFunction, factoryDeprecation); 913 914 /** @deprecated Use `factory.createVoidZero` or the factory supplied by your transformation context instead. */ 915 export const createVoidZero = Debug.deprecate(factory.createVoidZero, factoryDeprecation); 916 917 /** @deprecated Use `factory.createExportDefault` or the factory supplied by your transformation context instead. */ 918 export const createExportDefault = Debug.deprecate(factory.createExportDefault, factoryDeprecation); 919 920 /** @deprecated Use `factory.createExternalModuleExport` or the factory supplied by your transformation context instead. */ 921 export const createExternalModuleExport = Debug.deprecate(factory.createExternalModuleExport, factoryDeprecation); 922 923 /** @deprecated Use `factory.createNamespaceExport` or the factory supplied by your transformation context instead. */ 924 export const createNamespaceExport = Debug.deprecate(factory.createNamespaceExport, factoryDeprecation); 925 926 /** @deprecated Use `factory.updateNamespaceExport` or the factory supplied by your transformation context instead. */ 927 export const updateNamespaceExport = Debug.deprecate(factory.updateNamespaceExport, factoryDeprecation); 928 929 /** @deprecated Use `factory.createToken` or the factory supplied by your transformation context instead. */ 930 export const createToken = Debug.deprecate(function createToken<TKind extends SyntaxKind>(kind: TKind): Token<TKind> { 931 return factory.createToken(kind); 932 }, factoryDeprecation); 933 934 /** @deprecated Use `factory.createIdentifier` or the factory supplied by your transformation context instead. */ 935 export const createIdentifier = Debug.deprecate(function createIdentifier(text: string) { 936 return factory.createIdentifier(text, /*typeArguments*/ undefined, /*originalKeywordKind*/ undefined); 937 }, factoryDeprecation); 938 939 /** @deprecated Use `factory.createTempVariable` or the factory supplied by your transformation context instead. */ 940 export const createTempVariable = Debug.deprecate(function createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined): Identifier { 941 return factory.createTempVariable(recordTempVariable, /*reserveInNestedScopes*/ undefined); 942 }, factoryDeprecation); 943 944 /** @deprecated Use `factory.getGeneratedNameForNode` or the factory supplied by your transformation context instead. */ 945 export const getGeneratedNameForNode = Debug.deprecate(function getGeneratedNameForNode(node: Node | undefined): Identifier { 946 return factory.getGeneratedNameForNode(node, /*flags*/ undefined); 947 }, factoryDeprecation); 948 949 /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic)` or the factory supplied by your transformation context instead. */ 950 export const createOptimisticUniqueName = Debug.deprecate(function createOptimisticUniqueName(text: string): Identifier { 951 return factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic); 952 }, factoryDeprecation); 953 954 /** @deprecated Use `factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.FileLevel)` or the factory supplied by your transformation context instead. */ 955 export const createFileLevelUniqueName = Debug.deprecate(function createFileLevelUniqueName(text: string): Identifier { 956 return factory.createUniqueName(text, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.FileLevel); 957 }, factoryDeprecation); 958 959 /** @deprecated Use `factory.createIndexSignature` or the factory supplied by your transformation context instead. */ 960 export const createIndexSignature = Debug.deprecate(function createIndexSignature(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode): IndexSignatureDeclaration { 961 return factory.createIndexSignature(decorators, modifiers, parameters, type); 962 }, factoryDeprecation); 963 964 /** @deprecated Use `factory.createTypePredicateNode` or the factory supplied by your transformation context instead. */ 965 export const createTypePredicateNode = Debug.deprecate(function createTypePredicateNode(parameterName: Identifier | ThisTypeNode | string, type: TypeNode): TypePredicateNode { 966 return factory.createTypePredicateNode(/*assertsModifier*/ undefined, parameterName, type); 967 }, factoryDeprecation); 968 969 /** @deprecated Use `factory.updateTypePredicateNode` or the factory supplied by your transformation context instead. */ 970 export const updateTypePredicateNode = Debug.deprecate(function updateTypePredicateNode(node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode): TypePredicateNode { 971 return factory.updateTypePredicateNode(node, /*assertsModifier*/ undefined, parameterName, type); 972 }, factoryDeprecation); 973 974 /** @deprecated Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead. */ 975 export const createLiteral = Debug.deprecate(function createLiteral(value: string | number | PseudoBigInt | boolean | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): PrimaryExpression { 976 if (typeof value === "number") { 977 return factory.createNumericLiteral(value); 978 } 979 // eslint-disable-next-line no-in-operator 980 if (typeof value === "object" && "base10Value" in value) { // PseudoBigInt 981 return factory.createBigIntLiteral(value); 982 } 983 if (typeof value === "boolean") { 984 return value ? factory.createTrue() : factory.createFalse(); 985 } 986 if (typeof value === "string") { 987 return factory.createStringLiteral(value, /*isSingleQuote*/ undefined); 988 } 989 return factory.createStringLiteralFromNode(value); 990 } as { 991 (value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral; 992 (value: number | PseudoBigInt): NumericLiteral; 993 (value: boolean): BooleanLiteral; 994 (value: string | number | PseudoBigInt | boolean): PrimaryExpression; 995 }, { since: "4.0", warnAfter: "4.1", message: "Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead." }); 996 997 /** @deprecated Use `factory.createMethodSignature` or the factory supplied by your transformation context instead. */ 998 export const createMethodSignature = Debug.deprecate(function createMethodSignature( 999 typeParameters: readonly TypeParameterDeclaration[] | undefined, 1000 parameters: readonly ParameterDeclaration[], 1001 type: TypeNode | undefined, 1002 name: string | PropertyName, 1003 questionToken: QuestionToken | undefined 1004 ) { 1005 return factory.createMethodSignature(/*modifiers*/ undefined, name, questionToken, typeParameters, parameters, type); 1006 }, factoryDeprecation); 1007 1008 /** @deprecated Use `factory.updateMethodSignature` or the factory supplied by your transformation context instead. */ 1009 export const updateMethodSignature = Debug.deprecate(function updateMethodSignature( 1010 node: MethodSignature, 1011 typeParameters: NodeArray<TypeParameterDeclaration> | undefined, 1012 parameters: NodeArray<ParameterDeclaration>, 1013 type: TypeNode | undefined, 1014 name: PropertyName, 1015 questionToken: QuestionToken | undefined 1016 ) { 1017 return factory.updateMethodSignature(node, node.modifiers, name, questionToken, typeParameters, parameters, type); 1018 }, factoryDeprecation); 1019 1020 /** @deprecated Use `factory.createTypeOperatorNode` or the factory supplied by your transformation context instead. */ 1021 export const createTypeOperatorNode = Debug.deprecate(function createTypeOperatorNode(operatorOrType: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword | TypeNode, type?: TypeNode) { 1022 let operator: TypeOperatorNode["operator"]; 1023 if (type) { 1024 operator = operatorOrType as TypeOperatorNode["operator"]; 1025 } 1026 else { 1027 type = operatorOrType as TypeNode; 1028 operator = SyntaxKind.KeyOfKeyword; 1029 } 1030 return factory.createTypeOperatorNode(operator, type); 1031 } as { 1032 (type: TypeNode): TypeOperatorNode; 1033 (operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword | SyntaxKind.ReadonlyKeyword, type: TypeNode): TypeOperatorNode; 1034 }, factoryDeprecation); 1035 1036 /** @deprecated Use `factory.createTaggedTemplate` or the factory supplied by your transformation context instead. */ 1037 export const createTaggedTemplate = Debug.deprecate(function createTaggedTemplate(tag: Expression, typeArgumentsOrTemplate: readonly TypeNode[] | TemplateLiteral | undefined, template?: TemplateLiteral) { 1038 let typeArguments: readonly TypeNode[] | undefined; 1039 if (template) { 1040 typeArguments = typeArgumentsOrTemplate as readonly TypeNode[] | undefined; 1041 } 1042 else { 1043 template = typeArgumentsOrTemplate as TemplateLiteral; 1044 } 1045 return factory.createTaggedTemplateExpression(tag, typeArguments, template); 1046 } as { 1047 (tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; 1048 (tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression; 1049 }, factoryDeprecation); 1050 1051 /** @deprecated Use `factory.updateTaggedTemplate` or the factory supplied by your transformation context instead. */ 1052 export const updateTaggedTemplate = Debug.deprecate(function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, typeArgumentsOrTemplate: readonly TypeNode[] | TemplateLiteral | undefined, template?: TemplateLiteral) { 1053 let typeArguments: readonly TypeNode[] | undefined; 1054 if (template) { 1055 typeArguments = typeArgumentsOrTemplate as readonly TypeNode[] | undefined; 1056 } 1057 else { 1058 template = typeArgumentsOrTemplate as TemplateLiteral; 1059 } 1060 return factory.updateTaggedTemplateExpression(node, tag, typeArguments, template); 1061 } as { 1062 (node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; 1063 (node: TaggedTemplateExpression, tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral): TaggedTemplateExpression; 1064 }, factoryDeprecation); 1065 1066 /** @deprecated Use `factory.updateBinary` or the factory supplied by your transformation context instead. */ 1067 export const updateBinary = Debug.deprecate(function updateBinary(node: BinaryExpression, left: Expression, right: Expression, operator: BinaryOperator | BinaryOperatorToken = node.operatorToken) { 1068 if (typeof operator === "number") { 1069 operator = operator === node.operatorToken.kind ? node.operatorToken : factory.createToken(operator); 1070 } 1071 return factory.updateBinaryExpression(node, left, operator, right); 1072 }, factoryDeprecation); 1073 1074 /** @deprecated Use `factory.createConditional` or the factory supplied by your transformation context instead. */ 1075 export const createConditional = Debug.deprecate(function createConditional(condition: Expression, questionTokenOrWhenTrue: QuestionToken | Expression, whenTrueOrWhenFalse: Expression, colonToken?: ColonToken, whenFalse?: Expression) { 1076 return arguments.length === 5 ? factory.createConditionalExpression(condition, questionTokenOrWhenTrue as QuestionToken, whenTrueOrWhenFalse, colonToken, whenFalse!) : 1077 arguments.length === 3 ? factory.createConditionalExpression(condition, factory.createToken(SyntaxKind.QuestionToken), questionTokenOrWhenTrue as Expression, factory.createToken(SyntaxKind.ColonToken), whenTrueOrWhenFalse) : 1078 Debug.fail("Argument count mismatch"); 1079 } as { 1080 (condition: Expression, whenTrue: Expression, whenFalse: Expression): ConditionalExpression; 1081 (condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression): ConditionalExpression; 1082 }, factoryDeprecation); 1083 1084 /** @deprecated Use `factory.createYield` or the factory supplied by your transformation context instead. */ 1085 export const createYield = Debug.deprecate(function createYield(asteriskTokenOrExpression?: AsteriskToken | Expression | undefined, expression?: Expression) { 1086 let asteriskToken: AsteriskToken | undefined; 1087 if (expression) { 1088 asteriskToken = asteriskTokenOrExpression as AsteriskToken; 1089 } 1090 else { 1091 expression = asteriskTokenOrExpression as Expression; 1092 } 1093 return factory.createYieldExpression(asteriskToken, expression); 1094 } as { 1095 (expression?: Expression): YieldExpression; 1096 (asteriskToken: AsteriskToken | undefined, expression: Expression): YieldExpression; 1097 }, factoryDeprecation); 1098 1099 /** @deprecated Use `factory.createClassExpression` or the factory supplied by your transformation context instead. */ 1100 export const createClassExpression = Debug.deprecate(function createClassExpression( 1101 modifiers: readonly Modifier[] | undefined, 1102 name: string | Identifier | undefined, 1103 typeParameters: readonly TypeParameterDeclaration[] | undefined, 1104 heritageClauses: readonly HeritageClause[] | undefined, 1105 members: readonly ClassElement[] 1106 ) { 1107 return factory.createClassExpression(/*decorators*/ undefined, modifiers, name, typeParameters, heritageClauses, members); 1108 }, factoryDeprecation); 1109 1110 /** @deprecated Use `factory.updateClassExpression` or the factory supplied by your transformation context instead. */ 1111 export const updateClassExpression = Debug.deprecate(function updateClassExpression( 1112 node: ClassExpression, 1113 modifiers: readonly Modifier[] | undefined, 1114 name: Identifier | undefined, 1115 typeParameters: readonly TypeParameterDeclaration[] | undefined, 1116 heritageClauses: readonly HeritageClause[] | undefined, 1117 members: readonly ClassElement[] 1118 ) { 1119 return factory.updateClassExpression(node, /*decorators*/ undefined, modifiers, name, typeParameters, heritageClauses, members); 1120 }, factoryDeprecation); 1121 1122 /** @deprecated Use `factory.createPropertySignature` or the factory supplied by your transformation context instead. */ 1123 export const createPropertySignature = Debug.deprecate(function createPropertySignature( 1124 modifiers: readonly Modifier[] | undefined, 1125 name: PropertyName | string, 1126 questionToken: QuestionToken | undefined, 1127 type: TypeNode | undefined, 1128 initializer?: Expression 1129 ): PropertySignature { 1130 const node = factory.createPropertySignature(modifiers, name, questionToken, type); 1131 node.initializer = initializer; 1132 return node; 1133 }, factoryDeprecation); 1134 1135 /** @deprecated Use `factory.updatePropertySignature` or the factory supplied by your transformation context instead. */ 1136 export const updatePropertySignature = Debug.deprecate(function updatePropertySignature( 1137 node: PropertySignature, 1138 modifiers: readonly Modifier[] | undefined, 1139 name: PropertyName, 1140 questionToken: QuestionToken | undefined, 1141 type: TypeNode | undefined, 1142 initializer: Expression | undefined 1143 ) { 1144 let updated = factory.updatePropertySignature(node, modifiers, name, questionToken, type); 1145 if (node.initializer !== initializer) { 1146 if (updated === node) { 1147 updated = factory.cloneNode(node); 1148 } 1149 updated.initializer = initializer; 1150 } 1151 return updated; 1152 }, factoryDeprecation); 1153 1154 /** @deprecated Use `factory.createExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */ 1155 export const createExpressionWithTypeArguments = Debug.deprecate(function createExpressionWithTypeArguments(typeArguments: readonly TypeNode[] | undefined, expression: Expression) { 1156 return factory.createExpressionWithTypeArguments(expression, typeArguments); 1157 }, factoryDeprecation); 1158 1159 /** @deprecated Use `factory.updateExpressionWithTypeArguments` or the factory supplied by your transformation context instead. */ 1160 export const updateExpressionWithTypeArguments = Debug.deprecate(function updateExpressionWithTypeArguments(node: ExpressionWithTypeArguments, typeArguments: readonly TypeNode[] | undefined, expression: Expression) { 1161 return factory.updateExpressionWithTypeArguments(node, expression, typeArguments); 1162 }, factoryDeprecation); 1163 1164 /** @deprecated Use `factory.createArrowFunction` or the factory supplied by your transformation context instead. */ 1165 export const createArrowFunction = Debug.deprecate(function createArrowFunction(modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanTokenOrBody: ConciseBody | EqualsGreaterThanToken | undefined, body?: ConciseBody) { 1166 return arguments.length === 6 ? factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody as EqualsGreaterThanToken | undefined, body!) : 1167 arguments.length === 5 ? factory.createArrowFunction(modifiers, typeParameters, parameters, type, /*equalsGreaterThanToken*/ undefined, equalsGreaterThanTokenOrBody as ConciseBody) : 1168 Debug.fail("Argument count mismatch"); 1169 } as { 1170 (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken | undefined, body: ConciseBody): ArrowFunction; 1171 (modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction; 1172 }, factoryDeprecation); 1173 1174 /** @deprecated Use `factory.updateArrowFunction` or the factory supplied by your transformation context instead. */ 1175 export const updateArrowFunction = Debug.deprecate(function updateArrowFunction(node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanTokenOrBody: EqualsGreaterThanToken | ConciseBody, body?: ConciseBody) { 1176 return arguments.length === 7 ? factory.updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanTokenOrBody as EqualsGreaterThanToken, body!) : 1177 arguments.length === 6 ? factory.updateArrowFunction(node, modifiers, typeParameters, parameters, type, node.equalsGreaterThanToken, equalsGreaterThanTokenOrBody as ConciseBody) : 1178 Debug.fail("Argument count mismatch"); 1179 } as { 1180 (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody): ArrowFunction; 1181 (node: ArrowFunction, modifiers: readonly Modifier[] | undefined, typeParameters: readonly TypeParameterDeclaration[] | undefined, parameters: readonly ParameterDeclaration[], type: TypeNode | undefined, body: ConciseBody): ArrowFunction; 1182 }, factoryDeprecation); 1183 1184 /** @deprecated Use `factory.createVariableDeclaration` or the factory supplied by your transformation context instead. */ 1185 export const createVariableDeclaration = Debug.deprecate(function createVariableDeclaration(name: string | BindingName, exclamationTokenOrType?: ExclamationToken | TypeNode, typeOrInitializer?: TypeNode | Expression, initializer?: Expression) { 1186 return arguments.length === 4 ? factory.createVariableDeclaration(name, exclamationTokenOrType as ExclamationToken | undefined, typeOrInitializer as TypeNode | undefined, initializer) : 1187 arguments.length >= 1 && arguments.length <= 3 ? factory.createVariableDeclaration(name, /*exclamationToken*/ undefined, exclamationTokenOrType as TypeNode | undefined, typeOrInitializer as Expression | undefined) : 1188 Debug.fail("Argument count mismatch"); 1189 } as { 1190 (name: string | BindingName, type?: TypeNode, initializer?: Expression): VariableDeclaration; 1191 (name: string | BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; 1192 }, factoryDeprecation); 1193 1194 /** @deprecated Use `factory.updateVariableDeclaration` or the factory supplied by your transformation context instead. */ 1195 export const updateVariableDeclaration = Debug.deprecate(function updateVariableDeclaration(node: VariableDeclaration, name: BindingName, exclamationTokenOrType: ExclamationToken | TypeNode | undefined, typeOrInitializer: TypeNode | Expression | undefined, initializer?: Expression | undefined) { 1196 return arguments.length === 5 ? factory.updateVariableDeclaration(node, name, exclamationTokenOrType as ExclamationToken | undefined, typeOrInitializer as TypeNode | undefined, initializer) : 1197 arguments.length === 4 ? factory.updateVariableDeclaration(node, name, node.exclamationToken, exclamationTokenOrType as TypeNode | undefined, typeOrInitializer as Expression | undefined) : 1198 Debug.fail("Argument count mismatch"); 1199 } as { 1200 (node: VariableDeclaration, name: BindingName, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; 1201 (node: VariableDeclaration, name: BindingName, exclamationToken: ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): VariableDeclaration; 1202 }, factoryDeprecation); 1203 1204 /** @deprecated Use `factory.createImportClause` or the factory supplied by your transformation context instead. */ 1205 export const createImportClause = Debug.deprecate(function createImportClause(name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly = false): ImportClause { 1206 return factory.createImportClause(isTypeOnly, name, namedBindings); 1207 }, factoryDeprecation); 1208 1209 /** @deprecated Use `factory.updateImportClause` or the factory supplied by your transformation context instead. */ 1210 export const updateImportClause = Debug.deprecate(function updateImportClause(node: ImportClause, name: Identifier | undefined, namedBindings: NamedImportBindings | undefined, isTypeOnly: boolean) { 1211 return factory.updateImportClause(node, isTypeOnly, name, namedBindings); 1212 }, factoryDeprecation); 1213 1214 /** @deprecated Use `factory.createExportDeclaration` or the factory supplied by your transformation context instead. */ 1215 export const createExportDeclaration = Debug.deprecate(function createExportDeclaration(decorators: readonly Decorator[] | undefined, modifiers: readonly Modifier[] | undefined, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, isTypeOnly = false) { 1216 return factory.createExportDeclaration(decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier); 1217 }, factoryDeprecation); 1218 1219 /** @deprecated Use `factory.updateExportDeclaration` or the factory supplied by your transformation context instead. */ 1220 export const updateExportDeclaration = Debug.deprecate(function updateExportDeclaration( 1221 node: ExportDeclaration, 1222 decorators: readonly Decorator[] | undefined, 1223 modifiers: readonly Modifier[] | undefined, 1224 exportClause: NamedExportBindings | undefined, 1225 moduleSpecifier: Expression | undefined, 1226 isTypeOnly: boolean) { 1227 return factory.updateExportDeclaration(node, decorators, modifiers, isTypeOnly, exportClause, moduleSpecifier); 1228 }, factoryDeprecation); 1229 1230 /** @deprecated Use `factory.createJSDocParameterTag` or the factory supplied by your transformation context instead. */ 1231 export const createJSDocParamTag = Debug.deprecate(function createJSDocParamTag(name: EntityName, isBracketed: boolean, typeExpression?: JSDocTypeExpression, comment?: string): JSDocParameterTag { 1232 return factory.createJSDocParameterTag(/*tagName*/ undefined, name, isBracketed, typeExpression, /*isNameFirst*/ false, comment); 1233 }, factoryDeprecation); 1234 1235 /** @deprecated Use `factory.createComma` or the factory supplied by your transformation context instead. */ 1236 export const createComma = Debug.deprecate(function createComma(left: Expression, right: Expression): Expression { 1237 return factory.createComma(left, right); 1238 }, factoryDeprecation); 1239 1240 /** @deprecated Use `factory.createLessThan` or the factory supplied by your transformation context instead. */ 1241 export const createLessThan = Debug.deprecate(function createLessThan(left: Expression, right: Expression): Expression { 1242 return factory.createLessThan(left, right); 1243 }, factoryDeprecation); 1244 1245 /** @deprecated Use `factory.createAssignment` or the factory supplied by your transformation context instead. */ 1246 export const createAssignment = Debug.deprecate(function createAssignment(left: Expression, right: Expression): BinaryExpression { 1247 return factory.createAssignment(left, right); 1248 }, factoryDeprecation); 1249 1250 /** @deprecated Use `factory.createStrictEquality` or the factory supplied by your transformation context instead. */ 1251 export const createStrictEquality = Debug.deprecate(function createStrictEquality(left: Expression, right: Expression): BinaryExpression { 1252 return factory.createStrictEquality(left, right); 1253 }, factoryDeprecation); 1254 1255 /** @deprecated Use `factory.createStrictInequality` or the factory supplied by your transformation context instead. */ 1256 export const createStrictInequality = Debug.deprecate(function createStrictInequality(left: Expression, right: Expression): BinaryExpression { 1257 return factory.createStrictInequality(left, right); 1258 }, factoryDeprecation); 1259 1260 /** @deprecated Use `factory.createAdd` or the factory supplied by your transformation context instead. */ 1261 export const createAdd = Debug.deprecate(function createAdd(left: Expression, right: Expression): BinaryExpression { 1262 return factory.createAdd(left, right); 1263 }, factoryDeprecation); 1264 1265 /** @deprecated Use `factory.createSubtract` or the factory supplied by your transformation context instead. */ 1266 export const createSubtract = Debug.deprecate(function createSubtract(left: Expression, right: Expression): BinaryExpression { 1267 return factory.createSubtract(left, right); 1268 }, factoryDeprecation); 1269 1270 /** @deprecated Use `factory.createLogicalAnd` or the factory supplied by your transformation context instead. */ 1271 export const createLogicalAnd = Debug.deprecate(function createLogicalAnd(left: Expression, right: Expression): BinaryExpression { 1272 return factory.createLogicalAnd(left, right); 1273 }, factoryDeprecation); 1274 1275 /** @deprecated Use `factory.createLogicalOr` or the factory supplied by your transformation context instead. */ 1276 export const createLogicalOr = Debug.deprecate(function createLogicalOr(left: Expression, right: Expression): BinaryExpression { 1277 return factory.createLogicalOr(left, right); 1278 }, factoryDeprecation); 1279 1280 /** @deprecated Use `factory.createPostfixIncrement` or the factory supplied by your transformation context instead. */ 1281 export const createPostfixIncrement = Debug.deprecate(function createPostfixIncrement(operand: Expression): PostfixUnaryExpression { 1282 return factory.createPostfixIncrement(operand); 1283 }, factoryDeprecation); 1284 1285 /** @deprecated Use `factory.createLogicalNot` or the factory supplied by your transformation context instead. */ 1286 export const createLogicalNot = Debug.deprecate(function createLogicalNot(operand: Expression): PrefixUnaryExpression { 1287 return factory.createLogicalNot(operand); 1288 }, factoryDeprecation); 1289 1290 /** @deprecated Use an appropriate `factory` method instead. */ 1291 export const createNode = Debug.deprecate(function createNode(kind: SyntaxKind, pos = 0, end = 0): Node { 1292 return setTextRangePosEnd( 1293 kind === SyntaxKind.SourceFile ? parseBaseNodeFactory.createBaseSourceFileNode(kind) : 1294 kind === SyntaxKind.Identifier ? parseBaseNodeFactory.createBaseIdentifierNode(kind) : 1295 kind === SyntaxKind.PrivateIdentifier ? parseBaseNodeFactory.createBasePrivateIdentifierNode(kind) : 1296 !isNodeKind(kind) ? parseBaseNodeFactory.createBaseTokenNode(kind) : 1297 parseBaseNodeFactory.createBaseNode(kind), 1298 pos, 1299 end 1300 ); 1301 }, { since: "4.0", warnAfter: "4.1", message: "Use an appropriate `factory` method instead." }); 1302 1303 /** 1304 * Creates a shallow, memberwise clone of a node ~for mutation~ with its `pos`, `end`, and `parent` set. 1305 * 1306 * NOTE: It is unsafe to change any properties of a `Node` that relate to its AST children, as those changes won't be 1307 * captured with respect to transformations. 1308 * 1309 * @deprecated Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`. 1310 */ 1311 export const getMutableClone = Debug.deprecate(function getMutableClone<T extends Node>(node: T): T { 1312 const clone = factory.cloneNode(node); 1313 setTextRange(clone, node); 1314 setParent(clone, node.parent); 1315 return clone; 1316 }, { since: "4.0", warnAfter: "4.1", message: "Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`." }); 1317 1318 // #endregion Node Factory top-level exports 1319 1320 // DEPRECATION: Renamed node tests 1321 // DEPRECATION PLAN: 1322 // - soft: 4.0 1323 // - warn: 4.1 1324 // - error: TBD 1325 // #region Renamed node Tests 1326 1327 /** @deprecated Use `isTypeAssertionExpression` instead. */ 1328 export const isTypeAssertion = Debug.deprecate(function isTypeAssertion(node: Node): node is TypeAssertion { 1329 return node.kind === SyntaxKind.TypeAssertionExpression; 1330 }, { 1331 since: "4.0", 1332 warnAfter: "4.1", 1333 message: "Use `isTypeAssertionExpression` instead." 1334 }); 1335 1336 // #endregion Renamed node Tests 1337 1338 // DEPRECATION: Renamed `Map` and `ReadonlyMap` interfaces 1339 // DEPRECATION PLAN: 1340 // - soft: 4.0 1341 // - remove: TBD (will remove for at least one release before replacing with `ESMap`/`ReadonlyESMap`) 1342 // - replace: TBD (will eventually replace with `ESMap`/`ReadonlyESMap`) 1343 // #region Renamed `Map` and `ReadonlyMap` interfaces 1344 1345 /** 1346 * @deprecated Use `ts.ReadonlyESMap<K, V>` instead. 1347 */ 1348 export interface ReadonlyMap<T> extends ReadonlyESMap<string, T> { 1349 } 1350 1351 /** 1352 * @deprecated Use `ts.ESMap<K, V>` instead. 1353 */ 1354 export interface Map<T> extends ESMap<string, T> { } 1355 1356 // #endregion 1357}