compatfactory
Version:
A library that unifies the TypeScript Compiler API factory functions across all versions of TypeScript and makes them conform with the Node Factory API
1 lines • 413 kB
Source Map (JSON)
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type * as TS from \"typescript\";\nimport type * as TS4 from \"typescript-4-9-4\";\nimport type {Mutable, RequiredExcept} from \"helpertypes\";\n\ntype PartialNodeFactory = RequiredExcept<\n\tTS.NodeFactory,\n\t| \"createClassStaticBlockDeclaration\"\n\t| \"updateClassStaticBlockDeclaration\"\n\t| \"createSatisfiesExpression\"\n\t| \"updateSatisfiesExpression\"\n\t| \"createUniquePrivateName\"\n\t| \"getGeneratedPrivateNameForNode\"\n>;\ntype NodeWithInternalFlags = TS.Node & {\n\tmodifierFlagsCache?: number;\n\ttransformFlags?: number;\n\toriginal?: TS.Node;\n\temitNode?: TS.Node;\n};\n\nexport function ensureNodeFactory(factoryLike: TS.NodeFactory | typeof TS): TS.NodeFactory {\n\tif (\"factory\" in factoryLike && factoryLike.factory != null) {\n\t\treturn normalizeNodeFactory(factoryLike.factory);\n\t} else if (!(\"updateSourceFileNode\" in factoryLike)) {\n\t\treturn normalizeNodeFactory(factoryLike as PartialNodeFactory);\n\t}\n\n\treturn createNodeFactory(factoryLike as typeof TS);\n}\n\nfunction splitDecoratorsAndModifiers(modifierLikes: readonly TS.ModifierLike[] | undefined): [readonly TS.Decorator[] | undefined, readonly TS.Modifier[] | undefined] {\n\tconst decorators = (modifierLikes?.filter(modifier => \"expression\" in modifier) ?? []) as readonly TS.Decorator[];\n\tconst modifiers = (modifierLikes?.filter(modifier => !(\"expression\" in modifier)) ?? []) as readonly TS.Modifier[];\n\treturn [decorators == null || decorators.length < 1 ? undefined : decorators, modifiers == null || modifiers.length < 1 ? undefined : modifiers];\n}\n\nfunction normalizeNodeFactory(factory: PartialNodeFactory): TS.NodeFactory {\n\t// By casting the factory to TypeScript 4.9.4, we're assuming to be on the last possible version where the decorators argument can still be separate from modifiers in the type definitions\n\tconst ts4CastFactory = factory as unknown as import(\"typescript-4-9-4\").NodeFactory;\n\n\tif (Boolean((factory as {__compatUpgraded?: boolean}).__compatUpgraded)) {\n\t\treturn factory;\n\t}\n\n\t// When this is true, this represents a TypeScript version where the the first argument to many of the factory functions is a list of decorators, which\n\t// has since been merged with modifiers\n\tlet badDecoratorsAsFirstArgument = false;\n\n\ttry {\n\t\t// This will throw on older TypeScript versions that always expect receiving decorators as the first argument\n\t\tbadDecoratorsAsFirstArgument = ts4CastFactory.createImportEqualsDeclaration([], false, \"\", ts4CastFactory.createIdentifier(\"\")).decorators != null;\n\t} catch {\n\t\tbadDecoratorsAsFirstArgument = ts4CastFactory.createImportEqualsDeclaration([], [], false, \"\", ts4CastFactory.createIdentifier(\"\")).decorators != null;\n\t}\n\n\tconst badCreateImportEqualsDeclaration = badDecoratorsAsFirstArgument && factory.createImportEqualsDeclaration.length === 4;\n\tconst badCreateImportSpecifier = badDecoratorsAsFirstArgument && factory.createImportSpecifier.length === 2;\n\tconst badCreateExportSpecifier = badDecoratorsAsFirstArgument && factory.createExportSpecifier.length === 2;\n\n\tconst badCreateMappedTypeNodeA = badDecoratorsAsFirstArgument && factory.createMappedTypeNode.length === 4;\n\tconst badCreateMappedTypeNodeB = badDecoratorsAsFirstArgument && factory.createMappedTypeNode.length === 5;\n\tconst badCreateTypeParameterDeclaration = badDecoratorsAsFirstArgument && factory.createTypeParameterDeclaration.length === 3;\n\n\t// Versions of createImportTypeNode that does not support Import Attributes\n\tconst badCreateImportTypeNode = factory.createImportAttribute == null;\n\n\t// Versions 4.8 and 4.9 of TypeScript for which createImportDeclaration does not support Import Attributes\n\tconst badCreateImportDeclaration = !badDecoratorsAsFirstArgument && factory.createImportAttribute == null;\n\t// Versions 4.8 and 4.9 of TypeScript for which createExportDeclaration does not support Import Attributes\n\tconst badCreateExportDeclaration = !badDecoratorsAsFirstArgument && factory.createImportAttribute == null;\n\n\tconst missingCreateSatisfiesExpression = factory.createSatisfiesExpression == null;\n\tconst missingCreateClassStaticBlockDeclaration = factory.createClassStaticBlockDeclaration == null;\n\tconst missingCreateUniquePrivateName = factory.createUniquePrivateName == null;\n\tconst missingGetGeneratedPrivateNameForNode = factory.getGeneratedPrivateNameForNode == null;\n\tconst missingCreatePrivateIdentifier = factory.createPrivateIdentifier == null;\n\tconst missingCreateAssertClause = factory.createAssertClause == null;\n\tconst missingCreateAssertEntry = factory.createAssertEntry == null;\n\tconst missingCreateImportTypeAssertionContainer = factory.createImportTypeAssertionContainer == null;\n\tconst missingCreateImportAttributes = factory.createImportAttributes == null;\n\tconst missingCreateImportAttribute = factory.createImportAttribute == null;\n\tconst missingCreateJSDocMemberName = factory.createJSDocMemberName == null;\n\tconst missingCreateJSDocLinkCode = factory.createJSDocLinkCode == null;\n\tconst missingCreateJSDocLinkPlain = factory.createJSDocLinkPlain == null;\n\tconst missingCreateJSDocOverloadTag = factory.createJSDocOverloadTag == null;\n\tconst missingCreateJSDocThrowsTag = factory.createJSDocThrowsTag == null;\n\tconst missingCreateJSDocSatisfiesTag = factory.createJSDocSatisfiesTag == null;\n\tconst missingCreateJSDocImportTag = factory.createJSDocImportTag == null;\n\tconst missingCreateJsxNamespacedName = factory.createJsxNamespacedName == null;\n\tconst missingReplaceModifiers = factory.replaceModifiers == null;\n\tconst missingReplaceDecoratorsAndModifiers = factory.replaceDecoratorsAndModifiers == null;\n\tconst missingReplacePropertyName = factory.replacePropertyName == null;\n\n\tconst needsModifications =\n\t\tbadCreateImportEqualsDeclaration ||\n\t\tbadCreateImportSpecifier ||\n\t\tbadCreateExportSpecifier ||\n\t\tbadCreateImportTypeNode ||\n\t\tbadCreateImportDeclaration ||\n\t\tbadCreateExportDeclaration ||\n\t\tbadCreateMappedTypeNodeA ||\n\t\tbadCreateMappedTypeNodeB ||\n\t\tbadCreateTypeParameterDeclaration ||\n\t\tmissingCreateSatisfiesExpression ||\n\t\tmissingCreateClassStaticBlockDeclaration ||\n\t\tmissingCreateUniquePrivateName ||\n\t\tmissingGetGeneratedPrivateNameForNode ||\n\t\tmissingCreatePrivateIdentifier ||\n\t\tmissingCreateAssertClause ||\n\t\tmissingCreateAssertEntry ||\n\t\tmissingCreateImportTypeAssertionContainer ||\n\t\tmissingCreateImportAttributes ||\n\t\tmissingCreateImportAttribute ||\n\t\tmissingCreateJSDocMemberName ||\n\t\tmissingCreateJSDocLinkCode ||\n\t\tmissingCreateJSDocLinkPlain ||\n\t\tmissingCreateJSDocOverloadTag ||\n\t\tmissingCreateJSDocThrowsTag ||\n\t\tmissingCreateJSDocSatisfiesTag ||\n\t\tmissingCreateJSDocImportTag ||\n\t\tmissingCreateJsxNamespacedName ||\n\t\tmissingReplaceModifiers ||\n\t\tmissingReplaceDecoratorsAndModifiers ||\n\t\tmissingReplacePropertyName ||\n\t\tbadDecoratorsAsFirstArgument;\n\n\tif (needsModifications) {\n\t\t/**\n\t\t * The following helpers are internal TypeScript helpers that have been inlined for reuse inside factory helpers when the full TypeScript namespace is not available\n\t\t */\n\n\t\tconst withOriginal = \"original\" in factory.updateBlock(factory.createBlock([]), []);\n\n\t\tconst setOriginalNode = <T extends TS.Node>(node: T & NodeWithInternalFlags, original: T & NodeWithInternalFlags): T => {\n\t\t\tnode.original = original;\n\t\t\treturn node;\n\t\t};\n\n\t\tconst setTextRangeEnd = <T extends TS.TextRange>(range: T, end: number): T => {\n\t\t\trange.end = end;\n\t\t\treturn range;\n\t\t};\n\n\t\tconst setTextRangePos = <T extends TS.TextRange>(range: T, pos: number): T => {\n\t\t\trange.pos = pos;\n\t\t\treturn range;\n\t\t};\n\n\t\tconst setTextRangePosEnd = <T extends TS.TextRange>(range: T, pos: number, end: number): T => setTextRangeEnd(setTextRangePos(range, pos), end);\n\n\t\tconst setTextRange = <T extends TS.TextRange>(range: T, loc: TS.TextRange | undefined): T => (loc != null ? setTextRangePosEnd(range, loc.pos, loc.end) : range);\n\n\t\tconst updateWithoutOriginal = <T extends TS.Node>(updated: T, original: T): T => {\n\t\t\tif (updated !== original) {\n\t\t\t\tsetTextRange(updated, original);\n\t\t\t}\n\t\t\treturn updated;\n\t\t};\n\t\tconst updateWithOriginal = <T extends TS.Node>(updated: T, original: T): T => {\n\t\t\tif (updated !== original) {\n\t\t\t\tsetOriginalNode(updated, original);\n\t\t\t\tsetTextRange(updated, original);\n\t\t\t}\n\t\t\treturn updated;\n\t\t};\n\n\t\tconst update = withOriginal ? updateWithOriginal : updateWithoutOriginal;\n\n\t\tconst createPrivateIdentifier = missingCreatePrivateIdentifier\n\t\t\t? (() =>\n\t\t\t\t\tfunction (text: string): TS.PrivateIdentifier {\n\t\t\t\t\t\tconst node = factory.createIdentifier(text) as unknown as Mutable<TS.PrivateIdentifier>;\n\t\t\t\t\t\treturn node;\n\t\t\t\t\t})()\n\t\t\t: factory.createPrivateIdentifier;\n\n\t\treturn {\n\t\t\t[\"__compatUpgraded\" as never]: true,\n\t\t\t...factory,\n\t\t\tcreatePrivateIdentifier,\n\t\t\t...(badCreateImportEqualsDeclaration\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createImportEqualsDeclaration(\n\t\t\t\t\t\t\tmodifiers: readonly TS.Modifier[] | undefined,\n\t\t\t\t\t\t\tisTypeOnly: boolean,\n\t\t\t\t\t\t\tname: string | TS.Identifier,\n\t\t\t\t\t\t\tmoduleReference: TS.ModuleReference\n\t\t\t\t\t\t): TS.ImportEqualsDeclaration;\n\t\t\t\t\t\tfunction createImportEqualsDeclaration(\n\t\t\t\t\t\t\tdecorators: readonly TS.Decorator[] | undefined,\n\t\t\t\t\t\t\tmodifiers: readonly TS.Modifier[] | undefined,\n\t\t\t\t\t\t\tisTypeOnly: boolean,\n\t\t\t\t\t\t\tname: string | TS.Identifier,\n\t\t\t\t\t\t\tmoduleReference: TS.ModuleReference\n\t\t\t\t\t\t): TS.ImportEqualsDeclaration;\n\t\t\t\t\t\tfunction createImportEqualsDeclaration(\n\t\t\t\t\t\t\tdecoratorsOrModifiers: readonly TS.Decorator[] | readonly TS.Modifier[] | undefined,\n\t\t\t\t\t\t\tmodifiersOrIsTypeOnly: readonly TS.Modifier[] | boolean | undefined,\n\t\t\t\t\t\t\tisTypeOnlyOrName: boolean | string | TS.Identifier,\n\t\t\t\t\t\t\tnameOrModuleReference: string | TS.Identifier | TS.ModuleReference,\n\t\t\t\t\t\t\tmoduleReferenceOrUndefined?: TS.ModuleReference\n\t\t\t\t\t\t): TS.ImportEqualsDeclaration {\n\t\t\t\t\t\t\tconst isShort = arguments.length <= 4;\n\t\t\t\t\t\t\tconst decorators = isShort ? splitDecoratorsAndModifiers(decoratorsOrModifiers as readonly TS.Modifier[])[0] : (decoratorsOrModifiers as readonly TS.Decorator[]);\n\n\t\t\t\t\t\t\tconst modifiers = isShort ? splitDecoratorsAndModifiers(decoratorsOrModifiers as readonly TS.Modifier[])[1] : (modifiersOrIsTypeOnly as readonly TS.Modifier[]);\n\t\t\t\t\t\t\tconst name = (isShort ? isTypeOnlyOrName : nameOrModuleReference) as string | TS.Identifier;\n\t\t\t\t\t\t\tconst moduleReference = (isShort ? nameOrModuleReference : moduleReferenceOrUndefined) as TS.ModuleReference;\n\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-1-2\").NodeFactory).createImportEqualsDeclaration(\n\t\t\t\t\t\t\t\tdecorators as never,\n\t\t\t\t\t\t\t\tmodifiers as never,\n\t\t\t\t\t\t\t\tname as never,\n\t\t\t\t\t\t\t\tmoduleReference as never\n\t\t\t\t\t\t\t) as unknown as TS.ImportEqualsDeclaration;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateImportEqualsDeclaration(\n\t\t\t\t\t\t\tnode: TS.ImportEqualsDeclaration,\n\t\t\t\t\t\t\tmodifiers: readonly TS.Modifier[] | undefined,\n\t\t\t\t\t\t\tisTypeOnly: boolean,\n\t\t\t\t\t\t\tname: string | TS.Identifier,\n\t\t\t\t\t\t\tmoduleReference: TS.ModuleReference\n\t\t\t\t\t\t): TS.ImportEqualsDeclaration;\n\t\t\t\t\t\tfunction updateImportEqualsDeclaration(\n\t\t\t\t\t\t\tnode: TS.ImportEqualsDeclaration,\n\t\t\t\t\t\t\tdecorators: readonly TS.Decorator[] | undefined,\n\t\t\t\t\t\t\tmodifiers: readonly TS.Modifier[] | undefined,\n\t\t\t\t\t\t\tisTypeOnly: boolean,\n\t\t\t\t\t\t\tname: string | TS.Identifier,\n\t\t\t\t\t\t\tmoduleReference: TS.ModuleReference\n\t\t\t\t\t\t): TS.ImportEqualsDeclaration;\n\t\t\t\t\t\tfunction updateImportEqualsDeclaration(\n\t\t\t\t\t\t\tnode: TS.ImportEqualsDeclaration,\n\t\t\t\t\t\t\tdecoratorsOrModifiers: readonly TS.Decorator[] | readonly TS.Modifier[] | undefined,\n\t\t\t\t\t\t\tmodifiersOrIsTypeOnly: readonly TS.Modifier[] | boolean | undefined,\n\t\t\t\t\t\t\tisTypeOnlyOrName: boolean | string | TS.Identifier,\n\t\t\t\t\t\t\tnameOrModuleReference: string | TS.Identifier | TS.ModuleReference,\n\t\t\t\t\t\t\tmoduleReferenceOrUndefined?: TS.ModuleReference\n\t\t\t\t\t\t): TS.ImportEqualsDeclaration {\n\t\t\t\t\t\t\tconst isShort = arguments.length <= 5;\n\t\t\t\t\t\t\tconst decorators = isShort ? splitDecoratorsAndModifiers(decoratorsOrModifiers as readonly TS.Modifier[])[0] : (decoratorsOrModifiers as readonly TS.Decorator[]);\n\n\t\t\t\t\t\t\tconst modifiers = isShort ? splitDecoratorsAndModifiers(decoratorsOrModifiers as readonly TS.Modifier[])[1] : (modifiersOrIsTypeOnly as readonly TS.Modifier[]);\n\t\t\t\t\t\t\tconst name = (isShort ? isTypeOnlyOrName : nameOrModuleReference) as string | TS.Identifier;\n\t\t\t\t\t\t\tconst moduleReference = (isShort ? nameOrModuleReference : moduleReferenceOrUndefined) as TS.ModuleReference;\n\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-1-2\").NodeFactory).updateImportEqualsDeclaration(\n\t\t\t\t\t\t\t\tnode as never,\n\t\t\t\t\t\t\t\tdecorators as never,\n\t\t\t\t\t\t\t\tmodifiers as never,\n\t\t\t\t\t\t\t\tname as never,\n\t\t\t\t\t\t\t\tmoduleReference as never\n\t\t\t\t\t\t\t) as unknown as TS.ImportEqualsDeclaration;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateImportEqualsDeclaration,\n\t\t\t\t\t\t\tupdateImportEqualsDeclaration\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\t\t\t...(badCreateImportSpecifier\n\t\t\t\t? {\n\t\t\t\t\t\tcreateImportSpecifier(isTypeOnly: boolean, propertyName: TS.Identifier | undefined, name: TS.Identifier): TS.ImportSpecifier {\n\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-4-3\").NodeFactory).createImportSpecifier(propertyName as never, name as never) as unknown as TS.ImportSpecifier;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tupdateImportSpecifier(node: TS.ImportSpecifier, isTypeOnly: boolean, propertyName: TS.Identifier | undefined, name: TS.Identifier): TS.ImportSpecifier {\n\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-4-3\").NodeFactory).updateImportSpecifier(\n\t\t\t\t\t\t\t\tnode as never,\n\t\t\t\t\t\t\t\tpropertyName as never,\n\t\t\t\t\t\t\t\tname as never\n\t\t\t\t\t\t\t) as unknown as TS.ImportSpecifier;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\t...(badCreateExportSpecifier\n\t\t\t\t? {\n\t\t\t\t\t\tcreateExportSpecifier(isTypeOnly: boolean, propertyName: string | TS.Identifier | undefined, name: string | TS.Identifier): TS.ExportSpecifier {\n\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-4-3\").NodeFactory).createExportSpecifier(propertyName as never, name as never) as unknown as TS.ExportSpecifier;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tupdateExportSpecifier(node: TS.ExportSpecifier, isTypeOnly: boolean, propertyName: TS.Identifier | undefined, name: TS.Identifier): TS.ExportSpecifier {\n\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-4-3\").NodeFactory).updateExportSpecifier(\n\t\t\t\t\t\t\t\tnode as never,\n\t\t\t\t\t\t\t\tpropertyName as never,\n\t\t\t\t\t\t\t\tname as never\n\t\t\t\t\t\t\t) as unknown as TS.ExportSpecifier;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\t...(badCreateImportTypeNode\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createImportTypeNode(argument: TS.TypeNode, qualifier?: TS.EntityName, typeArguments?: readonly TS.TypeNode[], isTypeOf?: boolean): TS.ImportTypeNode;\n\t\t\t\t\t\tfunction createImportTypeNode(\n\t\t\t\t\t\t\targument: TS.TypeNode,\n\t\t\t\t\t\t\tattributes?: TS.ImportAttributes,\n\t\t\t\t\t\t\tqualifier?: TS.EntityName,\n\t\t\t\t\t\t\ttypeArguments?: readonly TS.TypeNode[],\n\t\t\t\t\t\t\tisTypeOf?: boolean\n\t\t\t\t\t\t): TS.ImportTypeNode;\n\t\t\t\t\t\tfunction createImportTypeNode(\n\t\t\t\t\t\t\targument: TS.TypeNode,\n\t\t\t\t\t\t\tattributesOrQualifier?: TS.ImportAttributes | TS.EntityName,\n\t\t\t\t\t\t\tqualifierOrTypeArguments?: TS.EntityName | readonly TS.TypeNode[],\n\t\t\t\t\t\t\ttypeArgumentsOrIsTypeOf?: readonly TS.TypeNode[] | boolean,\n\t\t\t\t\t\t\tisTypeOfOrUndefined?: boolean\n\t\t\t\t\t\t): TS.ImportTypeNode {\n\t\t\t\t\t\t\t// Never pass ImportAttributes to the factory function if it doesn't support it\n\t\t\t\t\t\t\tconst qualifier = attributesOrQualifier != null && attributesOrQualifier.kind === 300 /* ImportAttributes */ ? undefined : attributesOrQualifier!;\n\n\t\t\t\t\t\t\tif (arguments.length < 5) {\n\t\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-6-4\").NodeFactory).createImportTypeNode(\n\t\t\t\t\t\t\t\t\targument as never,\n\t\t\t\t\t\t\t\t\tqualifier as never,\n\t\t\t\t\t\t\t\t\tqualifierOrTypeArguments as never,\n\t\t\t\t\t\t\t\t\ttypeArgumentsOrIsTypeOf as never\n\t\t\t\t\t\t\t\t) as unknown as TS.ImportTypeNode;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-6-4\").NodeFactory).createImportTypeNode(\n\t\t\t\t\t\t\t\t\targument as never,\n\t\t\t\t\t\t\t\t\tqualifierOrTypeArguments as never,\n\t\t\t\t\t\t\t\t\ttypeArgumentsOrIsTypeOf as never,\n\t\t\t\t\t\t\t\t\tisTypeOfOrUndefined as never\n\t\t\t\t\t\t\t\t) as unknown as TS.ImportTypeNode;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateImportTypeNode(\n\t\t\t\t\t\t\tnode: TS.ImportTypeNode,\n\t\t\t\t\t\t\targument: TS.TypeNode,\n\t\t\t\t\t\t\tqualifier?: TS.EntityName,\n\t\t\t\t\t\t\ttypeArguments?: readonly TS.TypeNode[],\n\t\t\t\t\t\t\tisTypeOf?: boolean\n\t\t\t\t\t\t): TS.ImportTypeNode;\n\t\t\t\t\t\tfunction updateImportTypeNode(\n\t\t\t\t\t\t\tnode: TS.ImportTypeNode,\n\t\t\t\t\t\t\targument: TS.TypeNode,\n\t\t\t\t\t\t\tattributes?: TS.ImportAttributes,\n\t\t\t\t\t\t\tqualifier?: TS.EntityName,\n\t\t\t\t\t\t\ttypeArguments?: readonly TS.TypeNode[],\n\t\t\t\t\t\t\tisTypeOf?: boolean\n\t\t\t\t\t\t): TS.ImportTypeNode;\n\t\t\t\t\t\tfunction updateImportTypeNode(\n\t\t\t\t\t\t\tnode: TS.ImportTypeNode,\n\t\t\t\t\t\t\targument: TS.TypeNode,\n\t\t\t\t\t\t\tattributesOrQualifier?: TS.ImportAttributes | TS.EntityName,\n\t\t\t\t\t\t\tqualifierOrTypeArguments?: TS.EntityName | readonly TS.TypeNode[],\n\t\t\t\t\t\t\ttypeArgumentsOrIsTypeOf?: readonly TS.TypeNode[] | boolean,\n\t\t\t\t\t\t\tisTypeOfOrUndefined?: boolean\n\t\t\t\t\t\t): TS.ImportTypeNode {\n\t\t\t\t\t\t\t// Never pass ImportAttributes to the factory function if it doesn't support it\n\t\t\t\t\t\t\tconst qualifierOrUndefined = attributesOrQualifier != null && attributesOrQualifier.kind === 300 /* ImportAttributes */ ? undefined : attributesOrQualifier!;\n\n\t\t\t\t\t\t\tif (arguments.length < 6) {\n\t\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-6-4\").NodeFactory).updateImportTypeNode(\n\t\t\t\t\t\t\t\t\tnode as never,\n\t\t\t\t\t\t\t\t\targument as never,\n\t\t\t\t\t\t\t\t\tqualifierOrUndefined as never,\n\t\t\t\t\t\t\t\t\tqualifierOrTypeArguments as never,\n\t\t\t\t\t\t\t\t\ttypeArgumentsOrIsTypeOf as never\n\t\t\t\t\t\t\t\t) as unknown as TS.ImportTypeNode;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-6-4\").NodeFactory).updateImportTypeNode(\n\t\t\t\t\t\t\t\t\tnode as never,\n\t\t\t\t\t\t\t\t\targument as never,\n\t\t\t\t\t\t\t\t\tqualifierOrTypeArguments as never,\n\t\t\t\t\t\t\t\t\ttypeArgumentsOrIsTypeOf as never,\n\t\t\t\t\t\t\t\t\tisTypeOfOrUndefined as never\n\t\t\t\t\t\t\t\t) as unknown as TS.ImportTypeNode;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {createImportTypeNode, updateImportTypeNode};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\t\t\t...(badCreateImportDeclaration\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createImportDeclaration(\n\t\t\t\t\t\t\tmodifiers: readonly TS.ModifierLike[] | undefined,\n\t\t\t\t\t\t\timportClause: TS.ImportClause | undefined,\n\t\t\t\t\t\t\tmoduleSpecifier: TS.Expression,\n\t\t\t\t\t\t\t_?: TS.ImportAttributes\n\t\t\t\t\t\t): TS.ImportDeclaration {\n\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-8-2\").NodeFactory).createImportDeclaration(\n\t\t\t\t\t\t\t\tmodifiers as never,\n\t\t\t\t\t\t\t\timportClause as never,\n\t\t\t\t\t\t\t\tmoduleSpecifier as never\n\t\t\t\t\t\t\t) as unknown as TS.ImportDeclaration;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateImportDeclaration(\n\t\t\t\t\t\t\tnode: TS.ImportDeclaration,\n\t\t\t\t\t\t\tmodifiers: readonly TS.Modifier[] | undefined,\n\t\t\t\t\t\t\timportClause: TS.ImportClause | undefined,\n\t\t\t\t\t\t\tmoduleSpecifier: TS.Expression,\n\t\t\t\t\t\t\t_?: TS.ImportAttributes\n\t\t\t\t\t\t): TS.ImportDeclaration {\n\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-8-2\").NodeFactory).updateImportDeclaration(\n\t\t\t\t\t\t\t\tnode as never,\n\t\t\t\t\t\t\t\tmodifiers as never,\n\t\t\t\t\t\t\t\timportClause as never,\n\t\t\t\t\t\t\t\tmoduleSpecifier as never,\n\t\t\t\t\t\t\t\tundefined\n\t\t\t\t\t\t\t) as unknown as TS.ImportDeclaration;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {createImportDeclaration, updateImportDeclaration};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\t\t\t...(badCreateExportDeclaration\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createExportDeclaration(\n\t\t\t\t\t\t\tmodifiers: readonly TS.ModifierLike[] | undefined,\n\t\t\t\t\t\t\tisTypeOnly: boolean,\n\t\t\t\t\t\t\texportClause: TS.NamedExportBindings | undefined,\n\t\t\t\t\t\t\tmoduleSpecifier?: TS.Expression,\n\t\t\t\t\t\t\t_?: TS.ImportAttributes\n\t\t\t\t\t\t): TS.ExportDeclaration {\n\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-8-2\").NodeFactory).createExportDeclaration(\n\t\t\t\t\t\t\t\tmodifiers as never,\n\t\t\t\t\t\t\t\tisTypeOnly as never,\n\t\t\t\t\t\t\t\texportClause as never,\n\t\t\t\t\t\t\t\tmoduleSpecifier as never\n\t\t\t\t\t\t\t) as unknown as TS.ExportDeclaration;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateExportDeclaration(\n\t\t\t\t\t\t\tnode: TS.ExportDeclaration,\n\t\t\t\t\t\t\tmodifiers: readonly TS.ModifierLike[] | undefined,\n\t\t\t\t\t\t\tisTypeOnly: boolean,\n\t\t\t\t\t\t\texportClause: TS.NamedExportBindings | undefined,\n\t\t\t\t\t\t\tmoduleSpecifier: TS.Expression | undefined,\n\t\t\t\t\t\t\t_: TS.ImportAttributes | undefined\n\t\t\t\t\t\t): TS.ExportDeclaration {\n\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-8-2\").NodeFactory).updateExportDeclaration(\n\t\t\t\t\t\t\t\tnode as never,\n\t\t\t\t\t\t\t\tmodifiers as never,\n\t\t\t\t\t\t\t\tisTypeOnly as never,\n\t\t\t\t\t\t\t\texportClause as never,\n\t\t\t\t\t\t\t\tmoduleSpecifier as never,\n\t\t\t\t\t\t\t\tundefined\n\t\t\t\t\t\t\t) as unknown as TS.ExportDeclaration;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {createExportDeclaration, updateExportDeclaration};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\t\t\t...(badCreateMappedTypeNodeA\n\t\t\t\t? {\n\t\t\t\t\t\tcreateMappedTypeNode(\n\t\t\t\t\t\t\treadonlyToken: TS.ReadonlyKeyword | TS.PlusToken | TS.MinusToken | undefined,\n\t\t\t\t\t\t\ttypeParameter: TS.TypeParameterDeclaration,\n\t\t\t\t\t\t\tnameType: TS.TypeNode | undefined,\n\t\t\t\t\t\t\tquestionToken: TS.QuestionToken | TS.PlusToken | TS.MinusToken | undefined,\n\t\t\t\t\t\t\ttype: TS.TypeNode | undefined\n\t\t\t\t\t\t): TS.MappedTypeNode {\n\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-0-3\").NodeFactory).createMappedTypeNode(\n\t\t\t\t\t\t\t\treadonlyToken as never,\n\t\t\t\t\t\t\t\ttypeParameter as never,\n\t\t\t\t\t\t\t\tquestionToken as never,\n\t\t\t\t\t\t\t\ttype as never\n\t\t\t\t\t\t\t) as unknown as TS.MappedTypeNode;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tupdateMappedTypeNode(\n\t\t\t\t\t\t\tnode: TS.MappedTypeNode,\n\t\t\t\t\t\t\treadonlyToken: TS.ReadonlyKeyword | TS.PlusToken | TS.MinusToken | undefined,\n\t\t\t\t\t\t\ttypeParameter: TS.TypeParameterDeclaration,\n\t\t\t\t\t\t\tnameType: TS.TypeNode | undefined,\n\t\t\t\t\t\t\tquestionToken: TS.QuestionToken | TS.PlusToken | TS.MinusToken | undefined,\n\t\t\t\t\t\t\ttype: TS.TypeNode | undefined\n\t\t\t\t\t\t): TS.MappedTypeNode {\n\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-0-3\").NodeFactory).updateMappedTypeNode(\n\t\t\t\t\t\t\t\tnode as never,\n\t\t\t\t\t\t\t\treadonlyToken as never,\n\t\t\t\t\t\t\t\ttypeParameter as never,\n\t\t\t\t\t\t\t\tquestionToken as never,\n\t\t\t\t\t\t\t\ttype as never\n\t\t\t\t\t\t\t) as unknown as TS.MappedTypeNode;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\t...(badCreateMappedTypeNodeB\n\t\t\t\t? {\n\t\t\t\t\t\tcreateMappedTypeNode(\n\t\t\t\t\t\t\treadonlyToken: TS.ReadonlyKeyword | TS.PlusToken | TS.MinusToken | undefined,\n\t\t\t\t\t\t\ttypeParameter: TS.TypeParameterDeclaration,\n\t\t\t\t\t\t\tnameType: TS.TypeNode | undefined,\n\t\t\t\t\t\t\tquestionToken: TS.QuestionToken | TS.PlusToken | TS.MinusToken | undefined,\n\t\t\t\t\t\t\ttype: TS.TypeNode | undefined,\n\t\t\t\t\t\t\tmembers?: TS.NodeArray<TS.TypeElement>\n\t\t\t\t\t\t): TS.MappedTypeNode {\n\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-4-3\").NodeFactory).createMappedTypeNode(\n\t\t\t\t\t\t\t\treadonlyToken as never,\n\t\t\t\t\t\t\t\ttypeParameter as never,\n\t\t\t\t\t\t\t\tnameType as never,\n\t\t\t\t\t\t\t\tquestionToken as never,\n\t\t\t\t\t\t\t\ttype as never\n\t\t\t\t\t\t\t) as unknown as TS.MappedTypeNode;\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\tupdateMappedTypeNode(\n\t\t\t\t\t\t\tnode: TS.MappedTypeNode,\n\t\t\t\t\t\t\treadonlyToken: TS.ReadonlyKeyword | TS.PlusToken | TS.MinusToken | undefined,\n\t\t\t\t\t\t\ttypeParameter: TS.TypeParameterDeclaration,\n\t\t\t\t\t\t\tnameType: TS.TypeNode | undefined,\n\t\t\t\t\t\t\tquestionToken: TS.QuestionToken | TS.PlusToken | TS.MinusToken | undefined,\n\t\t\t\t\t\t\ttype: TS.TypeNode | undefined,\n\t\t\t\t\t\t\tmembers?: TS.NodeArray<TS.TypeElement>\n\t\t\t\t\t\t): TS.MappedTypeNode {\n\t\t\t\t\t\t\treturn (factory as unknown as import(\"typescript-4-4-3\").NodeFactory).updateMappedTypeNode(\n\t\t\t\t\t\t\t\tnode as never,\n\t\t\t\t\t\t\t\treadonlyToken as never,\n\t\t\t\t\t\t\t\ttypeParameter as never,\n\t\t\t\t\t\t\t\tnameType as never,\n\t\t\t\t\t\t\t\tquestionToken as never,\n\t\t\t\t\t\t\t\ttype as never\n\t\t\t\t\t\t\t) as unknown as TS.MappedTypeNode;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\t...(badCreateTypeParameterDeclaration\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createTypeParameterDeclaration(name: string | TS.Identifier, constraint?: TS.TypeNode, defaultType?: TS.TypeNode): TS.TypeParameterDeclaration;\n\t\t\t\t\t\tfunction createTypeParameterDeclaration(\n\t\t\t\t\t\t\tmodifiers: readonly TS.Modifier[] | undefined,\n\t\t\t\t\t\t\tname: string | TS.Identifier,\n\t\t\t\t\t\t\tconstraint?: TS.TypeNode,\n\t\t\t\t\t\t\tdefaultType?: TS.TypeNode\n\t\t\t\t\t\t): TS.TypeParameterDeclaration;\n\t\t\t\t\t\tfunction createTypeParameterDeclaration(\n\t\t\t\t\t\t\tmodifiersOrName: readonly TS.Modifier[] | string | TS.Identifier | undefined,\n\t\t\t\t\t\t\tnameOrConstraint?: string | TS.Identifier | TS.TypeNode,\n\t\t\t\t\t\t\tconstraintOrDefaultType?: TS.TypeNode,\n\t\t\t\t\t\t\tdefaultTypeOrUndefined?: TS.TypeNode\n\t\t\t\t\t\t): TS.TypeParameterDeclaration {\n\t\t\t\t\t\t\tconst isShort =\n\t\t\t\t\t\t\t\ttypeof modifiersOrName === \"string\" || (modifiersOrName != null && !Array.isArray(modifiersOrName) && \"escapedText\" in modifiersOrName); /* Identifier */\n\t\t\t\t\t\t\tconst modifiers = (isShort ? undefined : modifiersOrName) as TS.Modifier[] | undefined;\n\t\t\t\t\t\t\tconst name = (isShort ? modifiersOrName : nameOrConstraint) as string | TS.Identifier;\n\t\t\t\t\t\t\tconst constraint = (isShort ? nameOrConstraint : constraintOrDefaultType) as TS.TypeNode | undefined;\n\t\t\t\t\t\t\tconst defaultType = (isShort ? constraintOrDefaultType : defaultTypeOrUndefined) as TS.TypeNode | undefined;\n\n\t\t\t\t\t\t\tconst typeParameterDeclaration = (factory as unknown as import(\"typescript-4-6-4\").NodeFactory).createTypeParameterDeclaration(\n\t\t\t\t\t\t\t\tname as never,\n\t\t\t\t\t\t\t\tconstraint as never,\n\t\t\t\t\t\t\t\tdefaultType as never\n\t\t\t\t\t\t\t) as unknown as TS.TypeParameterDeclaration;\n\t\t\t\t\t\t\tif (modifiers != null) {\n\t\t\t\t\t\t\t\t(typeParameterDeclaration as unknown as Mutable<TS.TypeParameterDeclaration>).modifiers = factory.createNodeArray(modifiers);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn typeParameterDeclaration;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateTypeParameterDeclaration(\n\t\t\t\t\t\t\tnode: TS.TypeParameterDeclaration,\n\t\t\t\t\t\t\tname: TS.Identifier,\n\t\t\t\t\t\t\tconstraint?: TS.TypeNode,\n\t\t\t\t\t\t\tdefaultType?: TS.TypeNode\n\t\t\t\t\t\t): TS.TypeParameterDeclaration;\n\t\t\t\t\t\tfunction updateTypeParameterDeclaration(\n\t\t\t\t\t\t\tnode: TS.TypeParameterDeclaration,\n\t\t\t\t\t\t\tmodifiers: readonly TS.Modifier[] | undefined,\n\t\t\t\t\t\t\tname: TS.Identifier,\n\t\t\t\t\t\t\tconstraint?: TS.TypeNode,\n\t\t\t\t\t\t\tdefaultType?: TS.TypeNode\n\t\t\t\t\t\t): TS.TypeParameterDeclaration;\n\t\t\t\t\t\tfunction updateTypeParameterDeclaration(\n\t\t\t\t\t\t\tnode: TS.TypeParameterDeclaration,\n\t\t\t\t\t\t\tmodifiersOrName: readonly TS.Modifier[] | TS.Identifier | undefined,\n\t\t\t\t\t\t\tnameOrConstraint?: string | TS.Identifier | TS.TypeNode,\n\t\t\t\t\t\t\tconstraintOrDefaultType?: TS.TypeNode,\n\t\t\t\t\t\t\tdefaultTypeOrUndefined?: TS.TypeNode\n\t\t\t\t\t\t): TS.TypeParameterDeclaration {\n\t\t\t\t\t\t\tconst isShort = modifiersOrName != null && !Array.isArray(modifiersOrName) && \"escapedText\" in modifiersOrName; /* Identifier */\n\t\t\t\t\t\t\tconst modifiers = (isShort ? undefined : modifiersOrName) as TS.Modifier[] | undefined;\n\t\t\t\t\t\t\tconst name = (isShort ? modifiersOrName : nameOrConstraint) as TS.Identifier;\n\t\t\t\t\t\t\tconst constraint = (isShort ? nameOrConstraint : constraintOrDefaultType) as TS.TypeNode | undefined;\n\t\t\t\t\t\t\tconst defaultType = (isShort ? constraintOrDefaultType : defaultTypeOrUndefined) as TS.TypeNode | undefined;\n\n\t\t\t\t\t\t\tconst typeParameterDeclaration = (factory as unknown as import(\"typescript-4-6-4\").NodeFactory).updateTypeParameterDeclaration(\n\t\t\t\t\t\t\t\tnode as never,\n\t\t\t\t\t\t\t\tname as never,\n\t\t\t\t\t\t\t\tconstraint as never,\n\t\t\t\t\t\t\t\tdefaultType as never\n\t\t\t\t\t\t\t) as unknown as TS.TypeParameterDeclaration;\n\t\t\t\t\t\t\tif (modifiers != null) {\n\t\t\t\t\t\t\t\t(typeParameterDeclaration as unknown as Mutable<TS.TypeParameterDeclaration>).modifiers = factory.createNodeArray(modifiers);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn typeParameterDeclaration;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateTypeParameterDeclaration,\n\t\t\t\t\t\t\tupdateTypeParameterDeclaration\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\t\t\t...(missingCreateSatisfiesExpression\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createSatisfiesExpression(expression: TS.Expression, type: TS.TypeNode): TS.SatisfiesExpression {\n\t\t\t\t\t\t\treturn {...expression} as TS.SatisfiesExpression;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateSatisfiesExpression(node: TS.SatisfiesExpression, expression: TS.Expression, type: TS.TypeNode): TS.SatisfiesExpression {\n\t\t\t\t\t\t\treturn expression === node.expression && type === node.type ? node : update(createSatisfiesExpression(expression, type), node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateSatisfiesExpression,\n\t\t\t\t\t\t\tupdateSatisfiesExpression\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\n\t\t\t...(missingCreateUniquePrivateName\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createUniquePrivateName(text?: string): TS.PrivateIdentifier {\n\t\t\t\t\t\t\tif (text != null && !text.startsWith(\"#\")) {\n\t\t\t\t\t\t\t\tthrow new TypeError(\"First character of private identifier must be #: \" + text);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst node = createPrivateIdentifier(text ?? \"\");\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateUniquePrivateName\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\n\t\t\t...(missingGetGeneratedPrivateNameForNode\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction getGeneratedPrivateNameForNode(node: TS.Node): TS.PrivateIdentifier {\n\t\t\t\t\t\t\treturn createPrivateIdentifier(\"\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tgetGeneratedPrivateNameForNode\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\n\t\t\t...(missingCreateClassStaticBlockDeclaration\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createClassStaticBlockDeclaration(body: TS.Block): TS.ClassStaticBlockDeclaration;\n\t\t\t\t\t\tfunction createClassStaticBlockDeclaration(\n\t\t\t\t\t\t\tdecorators: readonly TS.Decorator[] | undefined,\n\t\t\t\t\t\t\tmodifiers: readonly TS.Modifier[] | undefined,\n\t\t\t\t\t\t\tbody: TS.Block\n\t\t\t\t\t\t): TS.ClassStaticBlockDeclaration;\n\t\t\t\t\t\tfunction createClassStaticBlockDeclaration(\n\t\t\t\t\t\t\tdecoratorsOrBlock: readonly TS.Decorator[] | TS.Block | undefined,\n\t\t\t\t\t\t\tmodifiersOrUndefined?: readonly TS.Modifier[],\n\t\t\t\t\t\t\tbodyOrUndefined?: TS.Block\n\t\t\t\t\t\t): TS.ClassStaticBlockDeclaration {\n\t\t\t\t\t\t\tconst body = arguments.length >= 3 ? bodyOrUndefined! : (decoratorsOrBlock as TS.Block);\n\n\t\t\t\t\t\t\tconst node = factory.createEmptyStatement() as unknown as Mutable<TS.ClassStaticBlockDeclaration>;\n\t\t\t\t\t\t\tnode.body = body;\n\t\t\t\t\t\t\t(node as NodeWithInternalFlags).transformFlags = 8388608 /* ContainsClassFields */;\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateClassStaticBlockDeclaration(node: TS.ClassStaticBlockDeclaration, body: TS.Block): TS.ClassStaticBlockDeclaration;\n\t\t\t\t\t\tfunction updateClassStaticBlockDeclaration(\n\t\t\t\t\t\t\tnode: TS.ClassStaticBlockDeclaration,\n\t\t\t\t\t\t\tdecorators: readonly TS.Decorator[] | undefined,\n\t\t\t\t\t\t\tmodifiers: readonly TS.Modifier[] | undefined,\n\t\t\t\t\t\t\tbody: TS.Block\n\t\t\t\t\t\t): TS.ClassStaticBlockDeclaration;\n\t\t\t\t\t\tfunction updateClassStaticBlockDeclaration(\n\t\t\t\t\t\t\tnode: TS.ClassStaticBlockDeclaration,\n\t\t\t\t\t\t\tdecoratorsOrBlock: readonly TS.Decorator[] | TS.Block | undefined,\n\t\t\t\t\t\t\tmodifiersOrUndefined?: readonly TS.Modifier[],\n\t\t\t\t\t\t\tbodyOrUndefined?: TS.Block\n\t\t\t\t\t\t): TS.ClassStaticBlockDeclaration {\n\t\t\t\t\t\t\tconst body = arguments.length >= 4 ? bodyOrUndefined! : (decoratorsOrBlock as TS.Block);\n\t\t\t\t\t\t\treturn body === node.body ? node : update(createClassStaticBlockDeclaration(body), node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateClassStaticBlockDeclaration,\n\t\t\t\t\t\t\tupdateClassStaticBlockDeclaration\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\n\t\t\t...(missingCreateAssertClause\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createAssertClause(elements: TS.NodeArray<TS.AssertEntry>, multiLine?: boolean): TS.AssertClause {\n\t\t\t\t\t\t\tconst node = factory.createEmptyStatement() as unknown as Mutable<TS.AssertClause>;\n\n\t\t\t\t\t\t\tnode.elements = elements;\n\t\t\t\t\t\t\tnode.multiLine = multiLine;\n\t\t\t\t\t\t\t(node as NodeWithInternalFlags).transformFlags! |= 4 /* ContainsESNext */;\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateAssertClause(node: TS.AssertClause, elements: TS.NodeArray<TS.AssertEntry>, multiLine?: boolean): TS.AssertClause {\n\t\t\t\t\t\t\treturn node.elements !== elements || node.multiLine !== multiLine ? update(createAssertClause(elements, multiLine), node) : node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateAssertClause,\n\t\t\t\t\t\t\tupdateAssertClause\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\n\t\t\t...(missingCreateAssertEntry\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createAssertEntry(name: TS.AssertionKey, value: TS.StringLiteral): TS.AssertEntry {\n\t\t\t\t\t\t\tconst node = factory.createEmptyStatement() as unknown as Mutable<TS.AssertEntry>;\n\n\t\t\t\t\t\t\tnode.name = name;\n\t\t\t\t\t\t\tnode.value = value;\n\t\t\t\t\t\t\t(node as NodeWithInternalFlags).transformFlags! |= 4 /* ContainsESNext */;\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateAssertEntry(node: TS.AssertEntry, name: TS.AssertionKey, value: TS.StringLiteral): TS.AssertEntry {\n\t\t\t\t\t\t\treturn node.name !== name || node.value !== value ? update(createAssertEntry(name, value), node) : node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateAssertEntry,\n\t\t\t\t\t\t\tupdateAssertEntry\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\t\t\t...(missingCreateImportTypeAssertionContainer\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createImportTypeAssertionContainer(clause: TS.AssertClause, multiLine?: boolean): TS.ImportTypeAssertionContainer {\n\t\t\t\t\t\t\tconst node = factory.createEmptyStatement() as unknown as Mutable<TS.ImportTypeAssertionContainer>;\n\t\t\t\t\t\t\tnode.assertClause = clause;\n\t\t\t\t\t\t\tnode.multiLine = multiLine;\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateImportTypeAssertionContainer(node: TS.ImportTypeAssertionContainer, clause: TS.AssertClause, multiLine?: boolean): TS.ImportTypeAssertionContainer {\n\t\t\t\t\t\t\treturn node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateImportTypeAssertionContainer,\n\t\t\t\t\t\t\tupdateImportTypeAssertionContainer\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\n\t\t\t...(missingCreateImportAttributes\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createImportAttributes(elements: TS.NodeArray<TS.ImportAttribute>, multiLine?: boolean): TS.ImportAttributes {\n\t\t\t\t\t\t\tconst node = factory.createEmptyStatement() as unknown as Mutable<TS.ImportAttributes>;\n\t\t\t\t\t\t\tnode.elements = elements;\n\t\t\t\t\t\t\tnode.multiLine = multiLine;\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateImportAttributes(node: TS.ImportAttributes, elements: TS.NodeArray<TS.ImportAttribute>, multiLine?: boolean): TS.ImportAttributes {\n\t\t\t\t\t\t\treturn node.elements !== elements || node.multiLine !== multiLine ? update(createImportAttributes(elements, multiLine), node) : node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateImportAttributes,\n\t\t\t\t\t\t\tupdateImportAttributes\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\n\t\t\t...(missingCreateImportAttribute\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createImportAttribute(name: TS.ImportAttributeName, value: TS.Expression): TS.ImportAttribute {\n\t\t\t\t\t\t\tconst node = factory.createEmptyStatement() as unknown as Mutable<TS.ImportAttribute>;\n\t\t\t\t\t\t\tnode.name = name;\n\t\t\t\t\t\t\tnode.value = value;\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateImportAttribute(node: TS.ImportAttribute, name: TS.ImportAttributeName, value: TS.Expression): TS.ImportAttribute {\n\t\t\t\t\t\t\treturn node.name !== name || node.value !== value ? update(createImportAttribute(name, value), node) : node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateImportAttribute,\n\t\t\t\t\t\t\tupdateImportAttribute\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\n\t\t\t...(missingReplaceModifiers\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction replaceModifiers<T extends TS.HasModifiers>(n: T, modifiers: readonly TS.Modifier[] | TS.ModifierFlags | undefined): T {\n\t\t\t\t\t\t\tlet modifierArray;\n\t\t\t\t\t\t\tif (typeof modifiers === \"number\") {\n\t\t\t\t\t\t\t\tmodifierArray = factory.createModifiersFromModifierFlags(modifiers);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmodifierArray = modifiers;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst clone = \"cloneNode\" in factory ? (factory.cloneNode as (n: T) => Mutable<TS.HasModifiers>)(n) : ({...n} as Mutable<TS.HasModifiers>);\n\t\t\t\t\t\t\tclone.modifiers = factory.createNodeArray(modifierArray);\n\t\t\t\t\t\t\treturn clone as T;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\treplaceModifiers\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\n\t\t\t...(missingReplaceDecoratorsAndModifiers\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction replaceDecoratorsAndModifiers<T extends TS.HasModifiers & TS.HasDecorators>(n: T, modifiers: readonly TS.ModifierLike[] | undefined): T {\n\t\t\t\t\t\t\tconst clone =\n\t\t\t\t\t\t\t\t\"cloneNode\" in factory ? (factory.cloneNode as (n: T) => Mutable<TS.HasModifiers & TS.HasDecorators>)(n) : ({...n} as Mutable<TS.HasModifiers & TS.HasDecorators>);\n\t\t\t\t\t\t\tclone.modifiers = factory.createNodeArray(modifiers);\n\t\t\t\t\t\t\treturn clone as T;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\treplaceDecoratorsAndModifiers\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\n\t\t\t...(missingReplacePropertyName\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction replacePropertyName<\n\t\t\t\t\t\t\tT extends TS.AccessorDeclaration | TS.MethodDeclaration | TS.MethodSignature | TS.PropertyDeclaration | TS.PropertySignature | TS.PropertyAssignment\n\t\t\t\t\t\t>(n: T, name: T[\"name\"]): T {\n\t\t\t\t\t\t\tconst clone = \"cloneNode\" in factory ? (factory.cloneNode as (n: T) => Mutable<T>)(n) : ({...n} as Mutable<T>);\n\t\t\t\t\t\t\tclone.name = name;\n\t\t\t\t\t\t\treturn clone as T;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\treplacePropertyName\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\n\t\t\t...(missingCreateJSDocMemberName\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createJSDocMemberName(left: TS.EntityName | TS.JSDocMemberName, right: TS.Identifier): TS.JSDocMemberName {\n\t\t\t\t\t\t\tconst base = factory.createJSDocComment(undefined, undefined) as unknown as Mutable<TS.JSDoc>;\n\t\t\t\t\t\t\tdelete base.comment;\n\t\t\t\t\t\t\tdelete base.tags;\n\n\t\t\t\t\t\t\tconst node = base as unknown as Mutable<TS.JSDocMemberName>;\n\n\t\t\t\t\t\t\tnode.left = left;\n\t\t\t\t\t\t\tnode.right = right;\n\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateJSDocMemberName(node: TS.JSDocMemberName, left: TS.EntityName | TS.JSDocMemberName, right: TS.Identifier): TS.JSDocMemberName {\n\t\t\t\t\t\t\treturn left === node.left && right === node.right ? node : update(createJSDocMemberName(left, right), node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateJSDocMemberName,\n\t\t\t\t\t\t\tupdateJSDocMemberName\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\t\t\t...(missingCreateJSDocLinkCode\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createJSDocLinkCode(name: TS.EntityName | TS.JSDocMemberName | undefined, text: string): TS.JSDocLinkCode {\n\t\t\t\t\t\t\tconst base = factory.createJSDocComment(undefined, undefined) as unknown as Mutable<TS.JSDoc>;\n\t\t\t\t\t\t\tdelete base.comment;\n\t\t\t\t\t\t\tdelete base.tags;\n\n\t\t\t\t\t\t\tconst node = base as unknown as Mutable<TS.JSDocLinkCode>;\n\n\t\t\t\t\t\t\tnode.name = name;\n\t\t\t\t\t\t\tnode.text = text;\n\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateJSDocLinkCode(node: TS.JSDocLinkCode, name: TS.EntityName | TS.JSDocMemberName | undefined, text: string): TS.JSDocLinkCode {\n\t\t\t\t\t\t\treturn name === node.name && text === node.text ? node : update(createJSDocLinkCode(name, text), node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateJSDocLinkCode,\n\t\t\t\t\t\t\tupdateJSDocLinkCode\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\t\t\t...(missingCreateJSDocLinkPlain\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createJSDocLinkPlain(name: TS.EntityName | TS.JSDocMemberName | undefined, text: string): TS.JSDocLinkPlain {\n\t\t\t\t\t\t\tconst base = factory.createJSDocComment(undefined, undefined) as unknown as Mutable<TS.JSDoc>;\n\t\t\t\t\t\t\tdelete base.comment;\n\t\t\t\t\t\t\tdelete base.tags;\n\n\t\t\t\t\t\t\tconst node = base as unknown as Mutable<TS.JSDocLinkPlain>;\n\n\t\t\t\t\t\t\tnode.name = name;\n\t\t\t\t\t\t\tnode.text = text;\n\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateJSDocLinkPlain(node: TS.JSDocLinkPlain, name: TS.EntityName | TS.JSDocMemberName | undefined, text: string): TS.JSDocLinkPlain {\n\t\t\t\t\t\t\treturn name === node.name && text === node.text ? node : update(createJSDocLinkPlain(name, text), node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateJSDocLinkPlain,\n\t\t\t\t\t\t\tupdateJSDocLinkPlain\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\t\t\t...(missingCreateJSDocOverloadTag\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createJSDocOverloadTag(\n\t\t\t\t\t\t\ttagName: TS.Identifier | undefined,\n\t\t\t\t\t\t\ttypeExpression: TS.JSDocSignature,\n\t\t\t\t\t\t\tcomment?: string | TS.NodeArray<TS.JSDocComment>\n\t\t\t\t\t\t): TS.JSDocOverloadTag {\n\t\t\t\t\t\t\tconst base = factory.createJSDocComment(undefined, undefined) as unknown as Mutable<TS.JSDoc>;\n\t\t\t\t\t\t\tdelete base.comment;\n\t\t\t\t\t\t\tdelete base.tags;\n\n\t\t\t\t\t\t\tconst node = base as unknown as Mutable<TS.JSDocOverloadTag>;\n\n\t\t\t\t\t\t\tif (tagName != null) node.tagName = tagName;\n\t\t\t\t\t\t\tnode.typeExpression = typeExpression;\n\t\t\t\t\t\t\tnode.comment = comment;\n\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateJSDocOverloadTag(\n\t\t\t\t\t\t\tnode: TS.JSDocOverloadTag,\n\t\t\t\t\t\t\ttagName: TS.Identifier | undefined,\n\t\t\t\t\t\t\ttypeExpression: TS.JSDocSignature,\n\t\t\t\t\t\t\tcomment?: string | TS.NodeArray<TS.JSDocComment>\n\t\t\t\t\t\t): TS.JSDocOverloadTag {\n\t\t\t\t\t\t\treturn tagName === node.tagName && typeExpression === node.typeExpression && comment === node.comment\n\t\t\t\t\t\t\t\t? node\n\t\t\t\t\t\t\t\t: update(createJSDocOverloadTag(tagName, typeExpression, comment), node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateJSDocOverloadTag,\n\t\t\t\t\t\t\tupdateJSDocOverloadTag\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\t\t\t...(missingCreateJSDocThrowsTag\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createJSDocThrowsTag(\n\t\t\t\t\t\t\ttagName: TS.Identifier,\n\t\t\t\t\t\t\ttypeExpression: TS.JSDocTypeExpression | undefined,\n\t\t\t\t\t\t\tcomment?: string | TS.NodeArray<TS.JSDocComment>\n\t\t\t\t\t\t): TS.JSDocThrowsTag {\n\t\t\t\t\t\t\tconst base = factory.createJSDocComment(undefined, undefined) as unknown as Mutable<TS.JSDoc>;\n\t\t\t\t\t\t\tdelete base.comment;\n\t\t\t\t\t\t\tdelete base.tags;\n\n\t\t\t\t\t\t\tconst node = base as unknown as Mutable<TS.JSDocThrowsTag>;\n\n\t\t\t\t\t\t\tif (tagName != null) node.tagName = tagName;\n\t\t\t\t\t\t\tnode.typeExpression = typeExpression;\n\t\t\t\t\t\t\tnode.comment = comment;\n\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateJSDocThrowsTag(\n\t\t\t\t\t\t\tnode: TS.JSDocThrowsTag,\n\t\t\t\t\t\t\ttagName: TS.Identifier | undefined,\n\t\t\t\t\t\t\ttypeExpression: TS.JSDocTypeExpression,\n\t\t\t\t\t\t\tcomment?: string | TS.NodeArray<TS.JSDocComment>\n\t\t\t\t\t\t): TS.JSDocThrowsTag {\n\t\t\t\t\t\t\treturn tagName === node.tagName && typeExpression === node.typeExpression && comment === node.comment\n\t\t\t\t\t\t\t\t? node\n\t\t\t\t\t\t\t\t: update(createJSDocThrowsTag(tagName ?? node.tagName, typeExpression, comment), node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateJSDocThrowsTag,\n\t\t\t\t\t\t\tupdateJSDocThrowsTag\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\t\t\t...(missingCreateJSDocSatisfiesTag\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createJSDocSatisfiesTag(\n\t\t\t\t\t\t\ttagName: TS.Identifier | undefined,\n\t\t\t\t\t\t\ttypeExpression: TS.JSDocTypeExpression,\n\t\t\t\t\t\t\tcomment?: string | TS.NodeArray<TS.JSDocComment>\n\t\t\t\t\t\t): TS.JSDocSatisfiesTag {\n\t\t\t\t\t\t\tconst base = factory.createJSDocComment(undefined, undefined) as unknown as Mutable<TS.JSDoc>;\n\t\t\t\t\t\t\tdelete base.comment;\n\t\t\t\t\t\t\tdelete base.tags;\n\n\t\t\t\t\t\t\tconst node = base as unknown as Mutable<TS.JSDocSatisfiesTag>;\n\n\t\t\t\t\t\t\tif (tagName != null) node.tagName = tagName;\n\t\t\t\t\t\t\tnode.typeExpression = typeExpression;\n\t\t\t\t\t\t\tnode.comment = comment;\n\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateJSDocSatisfiesTag(\n\t\t\t\t\t\t\tnode: TS.JSDocSatisfiesTag,\n\t\t\t\t\t\t\ttagName: TS.Identifier | undefined,\n\t\t\t\t\t\t\ttypeExpression: TS.JSDocTypeExpression,\n\t\t\t\t\t\t\tcomment: string | TS.NodeArray<TS.JSDocComment> | undefined\n\t\t\t\t\t\t): TS.JSDocSatisfiesTag {\n\t\t\t\t\t\t\treturn tagName === node.tagName && typeExpression === node.typeExpression && comment === node.comment\n\t\t\t\t\t\t\t\t? node\n\t\t\t\t\t\t\t\t: update(createJSDocSatisfiesTag(tagName, typeExpression, comment), node);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tcreateJSDocSatisfiesTag,\n\t\t\t\t\t\t\tupdateJSDocSatisfiesTag\n\t\t\t\t\t\t};\n\t\t\t\t\t})()\n\t\t\t\t: {}),\n\t\t\t...(missingCreateJSDocImportTag\n\t\t\t\t? (() => {\n\t\t\t\t\t\tfunction createJSDocImportTag(\n\t\t\t\t\t\t\ttagName: TS.Identifier | undefined,\n\t\t\t\t\t\t\timportClause: TS.ImportClause | undefined,\n\t\t\t\t\t\t\tmoduleSpecifier: TS.Expression,\n\t\t\t\t\t\t\tattributes?: TS.ImportAttributes,\n\t\t\t\t\t\t\tcomment?: string | TS.NodeArray<TS.JSDocComment>\n\t\t\t\t\t\t): TS.JSDocImportTag {\n\t\t\t\t\t\t\tconst base = factory.createJSDocComment(undefined, undefined) as unknown as Mutable<TS.JSDoc>;\n\t\t\t\t\t\t\tdelete base.comment;\n\t\t\t\t\t\t\tdelete base.tags;\n\n\t\t\t\t\t\t\tconst node = base as unknown as Mutable<TS.JSDocImportTag>;\n\n\t\t\t\t\t\t\tif (tagName != null) node.tagName = tagName;\n\t\t\t\t\t\t\tnode.comment = comment;\n\t\t\t\t\t\t\tnode.importClause = importClause;\n\t\t\t\t\t\t\tnode.moduleSpecifier = moduleSpecifier;\n\t\t\t\t\t\t\tnode.attributes = attributes;\n\n\t\t\t\t\t\t\treturn node;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction updateJSDocImportTag(\n\t\t\t\t\t\t\tnode: TS.JSDocImportTag,\n\t\t\t\t\t\t\ttagName: TS.Identifier | undefined,\n\t\t\t\t\t\t\ti