// Code generated by _scripts/generate-ts-ast.ts. DO NOT EDIT.
import { NodeFlags } from "#enums/nodeFlags";
import { SyntaxKind } from "#enums/syntaxKind";
import { TokenFlags } from "#enums/tokenFlags";
import { getTokenPosOfNode } from "./astnav.js";
import { cloneSourceFileData } from "./utils.js";
import { forEachChildOfJSDocParameterTag, forEachChildOfJSDocPropertyTag, } from "./visitor.js";
export class NodeObject {
    kind;
    flags = 0;
    /** @internal Synthetic factory nodes are never fork-remapped, so raw == flags. */
    get _rawFlags() { return this.flags; }
    pos = -1;
    end = -1;
    parent = undefined;
    _data;
    constructor(kind, data) {
        this.kind = kind;
        this._data = data;
    }
    get ambientModuleNames() {
        return this._data?.ambientModuleNames;
    }
    get argument() {
        return this._data?.argument;
    }
    get argumentExpression() {
        return this._data?.argumentExpression;
    }
    get arguments() {
        return this._data?.arguments;
    }
    get assertsModifier() {
        return this._data?.assertsModifier;
    }
    get asteriskToken() {
        return this._data?.asteriskToken;
    }
    get attributes() {
        return this._data?.attributes;
    }
    get awaitModifier() {
        return this._data?.awaitModifier;
    }
    get block() {
        return this._data?.block;
    }
    get body() {
        return this._data?.body;
    }
    get caseBlock() {
        return this._data?.caseBlock;
    }
    get catchClause() {
        return this._data?.catchClause;
    }
    get checkType() {
        return this._data?.checkType;
    }
    get children() {
        return this._data?.children;
    }
    get className() {
        return this._data?.className;
    }
    get clauses() {
        return this._data?.clauses;
    }
    get closingElement() {
        return this._data?.closingElement;
    }
    get closingFragment() {
        return this._data?.closingFragment;
    }
    get colonToken() {
        return this._data?.colonToken;
    }
    get comment() {
        return this._data?.comment;
    }
    get condition() {
        return this._data?.condition;
    }
    get constraint() {
        return this._data?.constraint;
    }
    get containsOnlyTriviaWhiteSpaces() {
        return this._data?.containsOnlyTriviaWhiteSpaces;
    }
    get declarationList() {
        return this._data?.declarationList;
    }
    get declarations() {
        return this._data?.declarations;
    }
    get defaultType() {
        return this._data?.defaultType;
    }
    get dotDotDotToken() {
        return this._data?.dotDotDotToken;
    }
    get elementType() {
        return this._data?.elementType;
    }
    get elements() {
        return this._data?.elements;
    }
    get elseStatement() {
        return this._data?.elseStatement;
    }
    get endOfFileToken() {
        return this._data?.endOfFileToken;
    }
    get equalsGreaterThanToken() {
        return this._data?.equalsGreaterThanToken;
    }
    get equalsToken() {
        return this._data?.equalsToken;
    }
    get exclamationToken() {
        return this._data?.exclamationToken;
    }
    get exportClause() {
        return this._data?.exportClause;
    }
    get exprName() {
        return this._data?.exprName;
    }
    get expression() {
        return this._data?.expression;
    }
    get extendsType() {
        return this._data?.extendsType;
    }
    get externalModuleIndicator() {
        return this._data?.externalModuleIndicator;
    }
    get falseType() {
        return this._data?.falseType;
    }
    get fileName() {
        return this._data?.fileName;
    }
    get finallyBlock() {
        return this._data?.finallyBlock;
    }
    get head() {
        return this._data?.head;
    }
    get heritageClauses() {
        return this._data?.heritageClauses;
    }
    get importClause() {
        return this._data?.importClause;
    }
    get imports() {
        return this._data?.imports;
    }
    get incrementor() {
        return this._data?.incrementor;
    }
    get indexType() {
        return this._data?.indexType;
    }
    get initializer() {
        return this._data?.initializer;
    }
    get isArrayType() {
        return this._data?.isArrayType;
    }
    get isBracketed() {
        return this._data?.isBracketed;
    }
    get isDeclarationFile() {
        return this._data?.isDeclarationFile;
    }
    get isExportEquals() {
        return this._data?.isExportEquals;
    }
    get isNameFirst() {
        return this._data?.isNameFirst;
    }
    get isSpread() {
        return this._data?.isSpread;
    }
    get isTypeOf() {
        return this._data?.isTypeOf;
    }
    get isTypeOnly() {
        return this._data?.isTypeOnly;
    }
    get jsdocPropertyTags() {
        return this._data?.jsdocPropertyTags;
    }
    get keyword() {
        return this._data?.keyword;
    }
    get keywordToken() {
        return this._data?.keywordToken;
    }
    get label() {
        return this._data?.label;
    }
    get languageVariant() {
        return this._data?.languageVariant;
    }
    get left() {
        return this._data?.left;
    }
    get libReferenceDirectives() {
        return this._data?.libReferenceDirectives;
    }
    get literal() {
        return this._data?.literal;
    }
    get members() {
        return this._data?.members;
    }
    get modifiers() {
        return this._data?.modifiers;
    }
    get moduleAugmentations() {
        return this._data?.moduleAugmentations;
    }
    get moduleReference() {
        return this._data?.moduleReference;
    }
    get moduleSpecifier() {
        return this._data?.moduleSpecifier;
    }
    get multiLine() {
        return this._data?.multiLine;
    }
    get name() {
        return this._data?.name;
    }
    get nameExpression() {
        return this._data?.nameExpression;
    }
    get nameType() {
        return this._data?.nameType;
    }
    get namedBindings() {
        return this._data?.namedBindings;
    }
    get namespace() {
        return this._data?.namespace;
    }
    get objectAssignmentInitializer() {
        return this._data?.objectAssignmentInitializer;
    }
    get objectType() {
        return this._data?.objectType;
    }
    get openingElement() {
        return this._data?.openingElement;
    }
    get openingFragment() {
        return this._data?.openingFragment;
    }
    get operand() {
        return this._data?.operand;
    }
    get operator() {
        return this._data?.operator;
    }
    get operatorToken() {
        return this._data?.operatorToken;
    }
    get parameterName() {
        return this._data?.parameterName;
    }
    get parameters() {
        return this._data?.parameters;
    }
    get path() {
        return this._data?.path;
    }
    get phaseModifier() {
        return this._data?.phaseModifier;
    }
    get postfixToken() {
        return this._data?.postfixToken;
    }
    get properties() {
        return this._data?.properties;
    }
    get propertyName() {
        return this._data?.propertyName;
    }
    get qualifier() {
        return this._data?.qualifier;
    }
    get questionDotToken() {
        return this._data?.questionDotToken;
    }
    get questionToken() {
        return this._data?.questionToken;
    }
    get rawText() {
        return this._data?.rawText;
    }
    get readonlyToken() {
        return this._data?.readonlyToken;
    }
    get referencedFiles() {
        return this._data?.referencedFiles;
    }
    get right() {
        return this._data?.right;
    }
    get scriptKind() {
        return this._data?.scriptKind;
    }
    get statement() {
        return this._data?.statement;
    }
    get statements() {
        return this._data?.statements;
    }
    get tag() {
        return this._data?.tag;
    }
    get tagName() {
        return this._data?.tagName;
    }
    get tags() {
        return this._data?.tags;
    }
    get template() {
        return this._data?.template;
    }
    get templateFlags() {
        return this._data?.templateFlags;
    }
    get templateSpans() {
        return this._data?.templateSpans;
    }
    get text() {
        return this._data?.text;
    }
    get thenStatement() {
        return this._data?.thenStatement;
    }
    get thisArg() {
        return this._data?.thisArg;
    }
    get token() {
        return this._data?.token;
    }
    get tokenCache() {
        return this._data?.tokenCache;
    }
    get tokenFlags() {
        return this._data?.tokenFlags;
    }
    get trueType() {
        return this._data?.trueType;
    }
    get tryBlock() {
        return this._data?.tryBlock;
    }
    get tupleNameSource() {
        return this._data?.tupleNameSource;
    }
    get type() {
        return this._data?.type;
    }
    get typeArguments() {
        return this._data?.typeArguments;
    }
    get typeExpression() {
        return this._data?.typeExpression;
    }
    get typeName() {
        return this._data?.typeName;
    }
    get typeParameter() {
        return this._data?.typeParameter;
    }
    get typeParameters() {
        return this._data?.typeParameters;
    }
    get typeReferenceDirectives() {
        return this._data?.typeReferenceDirectives;
    }
    get types() {
        return this._data?.types;
    }
    get value() {
        return this._data?.value;
    }
    get variableDeclaration() {
        return this._data?.variableDeclaration;
    }
    get whenFalse() {
        return this._data?.whenFalse;
    }
    get whenTrue() {
        return this._data?.whenTrue;
    }
    forEachChild(visitor, visitArray) {
        const fn = forEachChildTable[this.kind];
        return fn ? fn(this._data, visitor, visitArray) : undefined;
    }
    getSourceFile() {
        let node = this;
        while (node.parent)
            node = node.parent;
        return node;
    }
    getStart(sourceFile, includeJsDocComment) {
        return getTokenPosOfNode(this, sourceFile ?? this.getSourceFile(), includeJsDocComment);
    }
    getFullStart() {
        return this.pos;
    }
    getEnd() {
        return this.end;
    }
    getWidth(sourceFile) {
        return this.getEnd() - this.getStart(sourceFile);
    }
    getFullWidth() {
        return this.end - this.pos;
    }
    getLeadingTriviaWidth(sourceFile) {
        return this.getStart(sourceFile) - this.pos;
    }
    getFullText(sourceFile) {
        return (sourceFile ?? this.getSourceFile()).text.substring(this.pos, this.end);
    }
    getText(sourceFile) {
        sourceFile ??= this.getSourceFile();
        return sourceFile.text.substring(this.getStart(sourceFile), this.end);
    }
}
function isNodeArray(array) {
    return "pos" in array && "end" in array;
}
export function createNodeArray(elements, pos = -1, end = -1) {
    if (isNodeArray(elements))
        return elements;
    const arr = elements.slice();
    arr.pos = pos;
    arr.end = end;
    return arr;
}
export function cloneNode(node) {
    const data = cloneNodeData(node);
    const clone = new NodeObject(node.kind, data);
    clone.flags = node.flags;
    clone.pos = node.pos;
    clone.end = node.end;
    return clone;
}
function cloneNodeData(node) {
    const n = node;
    switch (node.kind) {
        case SyntaxKind.Identifier:
            return { text: n.text };
        case SyntaxKind.PrivateIdentifier:
            return { text: n.text };
        case SyntaxKind.QualifiedName:
            return { left: n.left, right: n.right };
        case SyntaxKind.ComputedPropertyName:
            return { expression: n.expression };
        case SyntaxKind.Decorator:
            return { expression: n.expression };
        case SyntaxKind.IfStatement:
            return { expression: n.expression, thenStatement: n.thenStatement, elseStatement: n.elseStatement };
        case SyntaxKind.DoStatement:
            return { statement: n.statement, expression: n.expression };
        case SyntaxKind.WhileStatement:
            return { expression: n.expression, statement: n.statement };
        case SyntaxKind.ForStatement:
            return { initializer: n.initializer, condition: n.condition, incrementor: n.incrementor, statement: n.statement };
        case SyntaxKind.BreakStatement:
            return { label: n.label };
        case SyntaxKind.ContinueStatement:
            return { label: n.label };
        case SyntaxKind.ReturnStatement:
            return { expression: n.expression };
        case SyntaxKind.WithStatement:
            return { expression: n.expression, statement: n.statement };
        case SyntaxKind.SwitchStatement:
            return { expression: n.expression, caseBlock: n.caseBlock };
        case SyntaxKind.CaseBlock:
            return { clauses: n.clauses };
        case SyntaxKind.ThrowStatement:
            return { expression: n.expression };
        case SyntaxKind.TryStatement:
            return { tryBlock: n.tryBlock, catchClause: n.catchClause, finallyBlock: n.finallyBlock };
        case SyntaxKind.CatchClause:
            return { variableDeclaration: n.variableDeclaration, block: n.block };
        case SyntaxKind.LabeledStatement:
            return { label: n.label, statement: n.statement };
        case SyntaxKind.ExpressionStatement:
            return { expression: n.expression };
        case SyntaxKind.Block:
            return { statements: n.statements, multiLine: n.multiLine };
        case SyntaxKind.VariableStatement:
            return { modifiers: n.modifiers, declarationList: n.declarationList };
        case SyntaxKind.VariableDeclaration:
            return { name: n.name, exclamationToken: n.exclamationToken, type: n.type, initializer: n.initializer };
        case SyntaxKind.VariableDeclarationList:
            return { declarations: n.declarations };
        case SyntaxKind.Parameter:
            return { modifiers: n.modifiers, dotDotDotToken: n.dotDotDotToken, name: n.name, questionToken: n.questionToken, type: n.type, initializer: n.initializer };
        case SyntaxKind.BindingElement:
            return { dotDotDotToken: n.dotDotDotToken, propertyName: n.propertyName, name: n.name, initializer: n.initializer };
        case SyntaxKind.MissingDeclaration:
            return { modifiers: n.modifiers };
        case SyntaxKind.FunctionDeclaration:
            return { modifiers: n.modifiers, asteriskToken: n.asteriskToken, name: n.name, typeParameters: n.typeParameters, parameters: n.parameters, type: n.type, body: n.body };
        case SyntaxKind.ClassDeclaration:
            return { modifiers: n.modifiers, name: n.name, typeParameters: n.typeParameters, heritageClauses: n.heritageClauses, members: n.members };
        case SyntaxKind.ClassExpression:
            return { modifiers: n.modifiers, name: n.name, typeParameters: n.typeParameters, heritageClauses: n.heritageClauses, members: n.members };
        case SyntaxKind.HeritageClause:
            return { token: n.token, types: n.types };
        case SyntaxKind.InterfaceDeclaration:
            return { modifiers: n.modifiers, name: n.name, typeParameters: n.typeParameters, heritageClauses: n.heritageClauses, members: n.members };
        case SyntaxKind.TypeAliasDeclaration:
        case SyntaxKind.JSTypeAliasDeclaration:
            return { modifiers: n.modifiers, name: n.name, typeParameters: n.typeParameters, type: n.type };
        case SyntaxKind.EnumMember:
            return { name: n.name, initializer: n.initializer };
        case SyntaxKind.EnumDeclaration:
            return { modifiers: n.modifiers, name: n.name, members: n.members };
        case SyntaxKind.ModuleBlock:
            return { statements: n.statements };
        case SyntaxKind.ImportDeclaration:
        case SyntaxKind.JSImportDeclaration:
            return { modifiers: n.modifiers, importClause: n.importClause, moduleSpecifier: n.moduleSpecifier, attributes: n.attributes };
        case SyntaxKind.ExternalModuleReference:
            return { expression: n.expression };
        case SyntaxKind.NamespaceImport:
            return { name: n.name };
        case SyntaxKind.NamedImports:
            return { elements: n.elements };
        case SyntaxKind.ExportAssignment:
            return { modifiers: n.modifiers, isExportEquals: n.isExportEquals, type: n.type, expression: n.expression };
        case SyntaxKind.NamespaceExportDeclaration:
            return { modifiers: n.modifiers, name: n.name };
        case SyntaxKind.NamespaceExport:
            return { name: n.name };
        case SyntaxKind.NamedExports:
            return { elements: n.elements };
        case SyntaxKind.ExportSpecifier:
            return { isTypeOnly: n.isTypeOnly, propertyName: n.propertyName, name: n.name };
        case SyntaxKind.CallSignature:
            return { typeParameters: n.typeParameters, parameters: n.parameters, type: n.type };
        case SyntaxKind.ConstructSignature:
            return { typeParameters: n.typeParameters, parameters: n.parameters, type: n.type };
        case SyntaxKind.Constructor:
            return { modifiers: n.modifiers, typeParameters: n.typeParameters, parameters: n.parameters, type: n.type, body: n.body };
        case SyntaxKind.GetAccessor:
            return { modifiers: n.modifiers, name: n.name, typeParameters: n.typeParameters, parameters: n.parameters, type: n.type, body: n.body };
        case SyntaxKind.SetAccessor:
            return { modifiers: n.modifiers, name: n.name, typeParameters: n.typeParameters, parameters: n.parameters, type: n.type, body: n.body };
        case SyntaxKind.IndexSignature:
            return { modifiers: n.modifiers, parameters: n.parameters, type: n.type };
        case SyntaxKind.MethodSignature:
            return { modifiers: n.modifiers, name: n.name, postfixToken: n.postfixToken, typeParameters: n.typeParameters, parameters: n.parameters, type: n.type };
        case SyntaxKind.MethodDeclaration:
            return { modifiers: n.modifiers, asteriskToken: n.asteriskToken, name: n.name, postfixToken: n.postfixToken, typeParameters: n.typeParameters, parameters: n.parameters, type: n.type, body: n.body };
        case SyntaxKind.PropertySignature:
            return { modifiers: n.modifiers, name: n.name, postfixToken: n.postfixToken, type: n.type, initializer: n.initializer };
        case SyntaxKind.PropertyDeclaration:
            return { modifiers: n.modifiers, name: n.name, postfixToken: n.postfixToken, type: n.type, initializer: n.initializer };
        case SyntaxKind.ClassStaticBlockDeclaration:
            return { modifiers: n.modifiers, body: n.body };
        case SyntaxKind.StringLiteral:
            return { text: n.text, tokenFlags: n.tokenFlags };
        case SyntaxKind.NumericLiteral:
            return { text: n.text, tokenFlags: n.tokenFlags };
        case SyntaxKind.BigIntLiteral:
            return { text: n.text, tokenFlags: n.tokenFlags };
        case SyntaxKind.RegularExpressionLiteral:
            return { text: n.text, tokenFlags: n.tokenFlags };
        case SyntaxKind.NoSubstitutionTemplateLiteral:
            return { text: n.text, templateFlags: n.templateFlags };
        case SyntaxKind.BinaryExpression:
            return { modifiers: n.modifiers, left: n.left, type: n.type, operatorToken: n.operatorToken, right: n.right };
        case SyntaxKind.PrefixUnaryExpression:
            return { operator: n.operator, operand: n.operand };
        case SyntaxKind.PostfixUnaryExpression:
            return { operand: n.operand, operator: n.operator };
        case SyntaxKind.YieldExpression:
            return { asteriskToken: n.asteriskToken, expression: n.expression };
        case SyntaxKind.ArrowFunction:
            return { modifiers: n.modifiers, typeParameters: n.typeParameters, parameters: n.parameters, type: n.type, equalsGreaterThanToken: n.equalsGreaterThanToken, body: n.body };
        case SyntaxKind.FunctionExpression:
            return { modifiers: n.modifiers, asteriskToken: n.asteriskToken, name: n.name, typeParameters: n.typeParameters, parameters: n.parameters, type: n.type, body: n.body };
        case SyntaxKind.AsExpression:
            return { expression: n.expression, type: n.type };
        case SyntaxKind.SatisfiesExpression:
            return { expression: n.expression, type: n.type };
        case SyntaxKind.ConditionalExpression:
            return { condition: n.condition, questionToken: n.questionToken, whenTrue: n.whenTrue, colonToken: n.colonToken, whenFalse: n.whenFalse };
        case SyntaxKind.PropertyAccessExpression:
            return { expression: n.expression, questionDotToken: n.questionDotToken, name: n.name };
        case SyntaxKind.ElementAccessExpression:
            return { expression: n.expression, questionDotToken: n.questionDotToken, argumentExpression: n.argumentExpression };
        case SyntaxKind.CallExpression:
            return { expression: n.expression, questionDotToken: n.questionDotToken, typeArguments: n.typeArguments, arguments: n.arguments };
        case SyntaxKind.NewExpression:
            return { expression: n.expression, typeArguments: n.typeArguments, arguments: n.arguments };
        case SyntaxKind.MetaProperty:
            return { keywordToken: n.keywordToken, name: n.name };
        case SyntaxKind.NonNullExpression:
            return { expression: n.expression };
        case SyntaxKind.SpreadElement:
            return { expression: n.expression };
        case SyntaxKind.TemplateExpression:
            return { head: n.head, templateSpans: n.templateSpans };
        case SyntaxKind.TemplateSpan:
            return { expression: n.expression, literal: n.literal };
        case SyntaxKind.TaggedTemplateExpression:
            return { tag: n.tag, questionDotToken: n.questionDotToken, typeArguments: n.typeArguments, template: n.template };
        case SyntaxKind.ParenthesizedExpression:
            return { expression: n.expression };
        case SyntaxKind.ArrayLiteralExpression:
            return { elements: n.elements, multiLine: n.multiLine };
        case SyntaxKind.ObjectLiteralExpression:
            return { properties: n.properties, multiLine: n.multiLine };
        case SyntaxKind.SpreadAssignment:
            return { expression: n.expression };
        case SyntaxKind.PropertyAssignment:
            return { modifiers: n.modifiers, name: n.name, postfixToken: n.postfixToken, type: n.type, initializer: n.initializer };
        case SyntaxKind.ShorthandPropertyAssignment:
            return { modifiers: n.modifiers, name: n.name, postfixToken: n.postfixToken, type: n.type, equalsToken: n.equalsToken, objectAssignmentInitializer: n.objectAssignmentInitializer };
        case SyntaxKind.DeleteExpression:
            return { expression: n.expression };
        case SyntaxKind.TypeOfExpression:
            return { expression: n.expression };
        case SyntaxKind.VoidExpression:
            return { expression: n.expression };
        case SyntaxKind.AwaitExpression:
            return { expression: n.expression };
        case SyntaxKind.TypeAssertionExpression:
            return { type: n.type, expression: n.expression };
        case SyntaxKind.UnionType:
            return { types: n.types };
        case SyntaxKind.IntersectionType:
            return { types: n.types };
        case SyntaxKind.ConditionalType:
            return { checkType: n.checkType, extendsType: n.extendsType, trueType: n.trueType, falseType: n.falseType };
        case SyntaxKind.TypeOperator:
            return { operator: n.operator, type: n.type };
        case SyntaxKind.InferType:
            return { typeParameter: n.typeParameter };
        case SyntaxKind.ArrayType:
            return { elementType: n.elementType };
        case SyntaxKind.IndexedAccessType:
            return { objectType: n.objectType, indexType: n.indexType };
        case SyntaxKind.TypeReference:
            return { typeName: n.typeName, typeArguments: n.typeArguments };
        case SyntaxKind.ExpressionWithTypeArguments:
            return { expression: n.expression, typeArguments: n.typeArguments };
        case SyntaxKind.LiteralType:
            return { literal: n.literal };
        case SyntaxKind.TypePredicate:
            return { assertsModifier: n.assertsModifier, parameterName: n.parameterName, type: n.type };
        case SyntaxKind.ImportAttribute:
            return { name: n.name, value: n.value };
        case SyntaxKind.ImportAttributes:
            return { token: n.token, attributes: n.attributes, multiLine: n.multiLine };
        case SyntaxKind.TypeQuery:
            return { exprName: n.exprName, typeArguments: n.typeArguments };
        case SyntaxKind.MappedType:
            return { readonlyToken: n.readonlyToken, typeParameter: n.typeParameter, nameType: n.nameType, questionToken: n.questionToken, type: n.type, members: n.members };
        case SyntaxKind.TypeLiteral:
            return { members: n.members };
        case SyntaxKind.TupleType:
            return { elements: n.elements };
        case SyntaxKind.NamedTupleMember:
            return { dotDotDotToken: n.dotDotDotToken, name: n.name, questionToken: n.questionToken, type: n.type };
        case SyntaxKind.OptionalType:
            return { type: n.type };
        case SyntaxKind.RestType:
            return { type: n.type };
        case SyntaxKind.ParenthesizedType:
            return { type: n.type };
        case SyntaxKind.FunctionType:
            return { typeParameters: n.typeParameters, parameters: n.parameters, type: n.type };
        case SyntaxKind.ConstructorType:
            return { modifiers: n.modifiers, typeParameters: n.typeParameters, parameters: n.parameters, type: n.type };
        case SyntaxKind.TemplateHead:
            return { text: n.text, rawText: n.rawText, templateFlags: n.templateFlags };
        case SyntaxKind.TemplateMiddle:
            return { text: n.text, rawText: n.rawText, templateFlags: n.templateFlags };
        case SyntaxKind.TemplateTail:
            return { text: n.text, rawText: n.rawText, templateFlags: n.templateFlags };
        case SyntaxKind.TemplateLiteralType:
            return { head: n.head, templateSpans: n.templateSpans };
        case SyntaxKind.TemplateLiteralTypeSpan:
            return { type: n.type, literal: n.literal };
        case SyntaxKind.SyntheticExpression:
            return { type: n.type, isSpread: n.isSpread, tupleNameSource: n.tupleNameSource };
        case SyntaxKind.PartiallyEmittedExpression:
            return { expression: n.expression };
        case SyntaxKind.JsxElement:
            return { openingElement: n.openingElement, children: n.children, closingElement: n.closingElement };
        case SyntaxKind.JsxAttributes:
            return { properties: n.properties };
        case SyntaxKind.JsxNamespacedName:
            return { namespace: n.namespace, name: n.name };
        case SyntaxKind.JsxOpeningElement:
            return { tagName: n.tagName, typeArguments: n.typeArguments, attributes: n.attributes };
        case SyntaxKind.JsxSelfClosingElement:
            return { tagName: n.tagName, typeArguments: n.typeArguments, attributes: n.attributes };
        case SyntaxKind.JsxFragment:
            return { openingFragment: n.openingFragment, children: n.children, closingFragment: n.closingFragment };
        case SyntaxKind.JsxAttribute:
            return { name: n.name, initializer: n.initializer };
        case SyntaxKind.JsxSpreadAttribute:
            return { expression: n.expression };
        case SyntaxKind.JsxClosingElement:
            return { tagName: n.tagName };
        case SyntaxKind.JsxExpression:
            return { dotDotDotToken: n.dotDotDotToken, expression: n.expression };
        case SyntaxKind.JsxText:
            return { text: n.text, containsOnlyTriviaWhiteSpaces: n.containsOnlyTriviaWhiteSpaces };
        case SyntaxKind.SyntaxList:
            return { children: n.children };
        case SyntaxKind.JSDoc:
            return { comment: n.comment, tags: n.tags };
        case SyntaxKind.JSDocTypeExpression:
            return { type: n.type };
        case SyntaxKind.JSDocNonNullableType:
            return { type: n.type };
        case SyntaxKind.JSDocNullableType:
            return { type: n.type };
        case SyntaxKind.JSDocVariadicType:
            return { type: n.type };
        case SyntaxKind.JSDocOptionalType:
            return { type: n.type };
        case SyntaxKind.JSDocTypeTag:
            return { tagName: n.tagName, typeExpression: n.typeExpression, comment: n.comment };
        case SyntaxKind.JSDocUnknownTag:
            return { tagName: n.tagName, comment: n.comment };
        case SyntaxKind.JSDocTemplateTag:
            return { tagName: n.tagName, constraint: n.constraint, typeParameters: n.typeParameters, comment: n.comment };
        case SyntaxKind.JSDocReturnTag:
            return { tagName: n.tagName, typeExpression: n.typeExpression, comment: n.comment };
        case SyntaxKind.JSDocPublicTag:
            return { tagName: n.tagName, comment: n.comment };
        case SyntaxKind.JSDocPrivateTag:
            return { tagName: n.tagName, comment: n.comment };
        case SyntaxKind.JSDocProtectedTag:
            return { tagName: n.tagName, comment: n.comment };
        case SyntaxKind.JSDocReadonlyTag:
            return { tagName: n.tagName, comment: n.comment };
        case SyntaxKind.JSDocOverrideTag:
            return { tagName: n.tagName, comment: n.comment };
        case SyntaxKind.JSDocDeprecatedTag:
            return { tagName: n.tagName, comment: n.comment };
        case SyntaxKind.JSDocSeeTag:
            return { tagName: n.tagName, nameExpression: n.nameExpression, comment: n.comment };
        case SyntaxKind.JSDocImplementsTag:
            return { tagName: n.tagName, className: n.className, comment: n.comment };
        case SyntaxKind.JSDocAugmentsTag:
            return { tagName: n.tagName, className: n.className, comment: n.comment };
        case SyntaxKind.JSDocSatisfiesTag:
            return { tagName: n.tagName, typeExpression: n.typeExpression, comment: n.comment };
        case SyntaxKind.JSDocThrowsTag:
            return { tagName: n.tagName, typeExpression: n.typeExpression, comment: n.comment };
        case SyntaxKind.JSDocThisTag:
            return { tagName: n.tagName, typeExpression: n.typeExpression, comment: n.comment };
        case SyntaxKind.JSDocImportTag:
            return { tagName: n.tagName, importClause: n.importClause, moduleSpecifier: n.moduleSpecifier, attributes: n.attributes, comment: n.comment };
        case SyntaxKind.JSDocCallbackTag:
            return { tagName: n.tagName, typeExpression: n.typeExpression, name: n.name, comment: n.comment };
        case SyntaxKind.JSDocOverloadTag:
            return { tagName: n.tagName, typeExpression: n.typeExpression, comment: n.comment };
        case SyntaxKind.JSDocTypedefTag:
            return { tagName: n.tagName, typeExpression: n.typeExpression, name: n.name, comment: n.comment };
        case SyntaxKind.JSDocSignature:
            return { typeParameters: n.typeParameters, parameters: n.parameters, type: n.type };
        case SyntaxKind.JSDocNameReference:
            return { name: n.name };
        case SyntaxKind.ModuleDeclaration:
            return { modifiers: n.modifiers, keyword: n.keyword, name: n.name, body: n.body };
        case SyntaxKind.ImportEqualsDeclaration:
            return { modifiers: n.modifiers, isTypeOnly: n.isTypeOnly, name: n.name, moduleReference: n.moduleReference };
        case SyntaxKind.ExportDeclaration:
            return { modifiers: n.modifiers, isTypeOnly: n.isTypeOnly, exportClause: n.exportClause, moduleSpecifier: n.moduleSpecifier, attributes: n.attributes };
        case SyntaxKind.ImportType:
            return { isTypeOf: n.isTypeOf, argument: n.argument, attributes: n.attributes, qualifier: n.qualifier, typeArguments: n.typeArguments };
        case SyntaxKind.ImportClause:
            return { phaseModifier: n.phaseModifier, name: n.name, namedBindings: n.namedBindings };
        case SyntaxKind.ImportSpecifier:
            return { isTypeOnly: n.isTypeOnly, propertyName: n.propertyName, name: n.name };
        case SyntaxKind.JSDocText:
            return { text: n.text };
        case SyntaxKind.JSDocLink:
            return { name: n.name, text: n.text };
        case SyntaxKind.JSDocLinkPlain:
            return { name: n.name, text: n.text };
        case SyntaxKind.JSDocLinkCode:
            return { name: n.name, text: n.text };
        case SyntaxKind.TypeParameter:
            return { modifiers: n.modifiers, name: n.name, constraint: n.constraint, expression: n.expression, defaultType: n.defaultType };
        case SyntaxKind.SyntheticReferenceExpression:
            return { expression: n.expression, thisArg: n.thisArg };
        case SyntaxKind.JSDocTypeLiteral:
            return { jsdocPropertyTags: n.jsdocPropertyTags, isArrayType: n.isArrayType };
        case SyntaxKind.ForInStatement:
            return { awaitModifier: n.awaitModifier, initializer: n.initializer, expression: n.expression, statement: n.statement };
        case SyntaxKind.ForOfStatement:
            return { awaitModifier: n.awaitModifier, initializer: n.initializer, expression: n.expression, statement: n.statement };
        case SyntaxKind.CaseClause:
            return { expression: n.expression, statements: n.statements };
        case SyntaxKind.DefaultClause:
            return { expression: n.expression, statements: n.statements };
        case SyntaxKind.ObjectBindingPattern:
            return { elements: n.elements };
        case SyntaxKind.ArrayBindingPattern:
            return { elements: n.elements };
        case SyntaxKind.JSDocParameterTag:
            return { tagName: n.tagName, name: n.name, isBracketed: n.isBracketed, typeExpression: n.typeExpression, isNameFirst: n.isNameFirst, comment: n.comment };
        case SyntaxKind.JSDocPropertyTag:
            return { tagName: n.tagName, name: n.name, isBracketed: n.isBracketed, typeExpression: n.typeExpression, isNameFirst: n.isNameFirst, comment: n.comment };
        case SyntaxKind.SourceFile:
            return cloneSourceFileData(n);
        default:
            return undefined;
    }
}
const forEachChildTable = {
    [SyntaxKind.QualifiedName]: (data, cbNode, cbNodes) => visitNode(cbNode, data.left) ||
        visitNode(cbNode, data.right),
    [SyntaxKind.ComputedPropertyName]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.Decorator]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.IfStatement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression) ||
        visitNode(cbNode, data.thenStatement) ||
        visitNode(cbNode, data.elseStatement),
    [SyntaxKind.DoStatement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.statement) ||
        visitNode(cbNode, data.expression),
    [SyntaxKind.WhileStatement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression) ||
        visitNode(cbNode, data.statement),
    [SyntaxKind.ForStatement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.initializer) ||
        visitNode(cbNode, data.condition) ||
        visitNode(cbNode, data.incrementor) ||
        visitNode(cbNode, data.statement),
    [SyntaxKind.BreakStatement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.label),
    [SyntaxKind.ContinueStatement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.label),
    [SyntaxKind.ReturnStatement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.WithStatement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression) ||
        visitNode(cbNode, data.statement),
    [SyntaxKind.SwitchStatement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression) ||
        visitNode(cbNode, data.caseBlock),
    [SyntaxKind.CaseBlock]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.clauses),
    [SyntaxKind.ThrowStatement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.TryStatement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tryBlock) ||
        visitNode(cbNode, data.catchClause) ||
        visitNode(cbNode, data.finallyBlock),
    [SyntaxKind.CatchClause]: (data, cbNode, cbNodes) => visitNode(cbNode, data.variableDeclaration) ||
        visitNode(cbNode, data.block),
    [SyntaxKind.LabeledStatement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.label) ||
        visitNode(cbNode, data.statement),
    [SyntaxKind.ExpressionStatement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.Block]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.statements),
    [SyntaxKind.VariableStatement]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.declarationList),
    [SyntaxKind.VariableDeclaration]: (data, cbNode, cbNodes) => visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.exclamationToken) ||
        visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.initializer),
    [SyntaxKind.VariableDeclarationList]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.declarations),
    [SyntaxKind.Parameter]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.dotDotDotToken) ||
        visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.questionToken) ||
        visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.initializer),
    [SyntaxKind.BindingElement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.dotDotDotToken) ||
        visitNode(cbNode, data.propertyName) ||
        visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.initializer),
    [SyntaxKind.MissingDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers),
    [SyntaxKind.FunctionDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.asteriskToken) ||
        visitNode(cbNode, data.name) ||
        visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.parameters) ||
        visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.body),
    [SyntaxKind.ClassDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.heritageClauses) ||
        visitNodes(cbNode, cbNodes, data.members),
    [SyntaxKind.ClassExpression]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.heritageClauses) ||
        visitNodes(cbNode, cbNodes, data.members),
    [SyntaxKind.HeritageClause]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.types),
    [SyntaxKind.InterfaceDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.heritageClauses) ||
        visitNodes(cbNode, cbNodes, data.members),
    [SyntaxKind.TypeAliasDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNode(cbNode, data.type),
    [SyntaxKind.JSTypeAliasDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNode(cbNode, data.type),
    [SyntaxKind.EnumMember]: (data, cbNode, cbNodes) => visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.initializer),
    [SyntaxKind.EnumDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNodes(cbNode, cbNodes, data.members),
    [SyntaxKind.ModuleBlock]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.statements),
    [SyntaxKind.ImportDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.importClause) ||
        visitNode(cbNode, data.moduleSpecifier) ||
        visitNode(cbNode, data.attributes),
    [SyntaxKind.JSImportDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.importClause) ||
        visitNode(cbNode, data.moduleSpecifier) ||
        visitNode(cbNode, data.attributes),
    [SyntaxKind.ExternalModuleReference]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.NamespaceImport]: (data, cbNode, cbNodes) => visitNode(cbNode, data.name),
    [SyntaxKind.NamedImports]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.elements),
    [SyntaxKind.ExportAssignment]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.expression),
    [SyntaxKind.NamespaceExportDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name),
    [SyntaxKind.NamespaceExport]: (data, cbNode, cbNodes) => visitNode(cbNode, data.name),
    [SyntaxKind.NamedExports]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.elements),
    [SyntaxKind.ExportSpecifier]: (data, cbNode, cbNodes) => visitNode(cbNode, data.propertyName) ||
        visitNode(cbNode, data.name),
    [SyntaxKind.CallSignature]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.parameters) ||
        visitNode(cbNode, data.type),
    [SyntaxKind.ConstructSignature]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.parameters) ||
        visitNode(cbNode, data.type),
    [SyntaxKind.Constructor]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.parameters) ||
        visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.body),
    [SyntaxKind.GetAccessor]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.parameters) ||
        visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.body),
    [SyntaxKind.SetAccessor]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.parameters) ||
        visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.body),
    [SyntaxKind.IndexSignature]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNodes(cbNode, cbNodes, data.parameters) ||
        visitNode(cbNode, data.type),
    [SyntaxKind.MethodSignature]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.postfixToken) ||
        visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.parameters) ||
        visitNode(cbNode, data.type),
    [SyntaxKind.MethodDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.asteriskToken) ||
        visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.postfixToken) ||
        visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.parameters) ||
        visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.body),
    [SyntaxKind.PropertySignature]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.postfixToken) ||
        visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.initializer),
    [SyntaxKind.PropertyDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.postfixToken) ||
        visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.initializer),
    [SyntaxKind.ClassStaticBlockDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.body),
    [SyntaxKind.BinaryExpression]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.left) ||
        visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.operatorToken) ||
        visitNode(cbNode, data.right),
    [SyntaxKind.PrefixUnaryExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.operand),
    [SyntaxKind.PostfixUnaryExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.operand),
    [SyntaxKind.YieldExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.asteriskToken) ||
        visitNode(cbNode, data.expression),
    [SyntaxKind.ArrowFunction]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.parameters) ||
        visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.equalsGreaterThanToken) ||
        visitNode(cbNode, data.body),
    [SyntaxKind.FunctionExpression]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.asteriskToken) ||
        visitNode(cbNode, data.name) ||
        visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.parameters) ||
        visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.body),
    [SyntaxKind.AsExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression) ||
        visitNode(cbNode, data.type),
    [SyntaxKind.SatisfiesExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression) ||
        visitNode(cbNode, data.type),
    [SyntaxKind.ConditionalExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.condition) ||
        visitNode(cbNode, data.questionToken) ||
        visitNode(cbNode, data.whenTrue) ||
        visitNode(cbNode, data.colonToken) ||
        visitNode(cbNode, data.whenFalse),
    [SyntaxKind.PropertyAccessExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression) ||
        visitNode(cbNode, data.questionDotToken) ||
        visitNode(cbNode, data.name),
    [SyntaxKind.ElementAccessExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression) ||
        visitNode(cbNode, data.questionDotToken) ||
        visitNode(cbNode, data.argumentExpression),
    [SyntaxKind.CallExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression) ||
        visitNode(cbNode, data.questionDotToken) ||
        visitNodes(cbNode, cbNodes, data.typeArguments) ||
        visitNodes(cbNode, cbNodes, data.arguments),
    [SyntaxKind.NewExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression) ||
        visitNodes(cbNode, cbNodes, data.typeArguments) ||
        visitNodes(cbNode, cbNodes, data.arguments),
    [SyntaxKind.MetaProperty]: (data, cbNode, cbNodes) => visitNode(cbNode, data.name),
    [SyntaxKind.NonNullExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.SpreadElement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.TemplateExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.head) ||
        visitNodes(cbNode, cbNodes, data.templateSpans),
    [SyntaxKind.TemplateSpan]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression) ||
        visitNode(cbNode, data.literal),
    [SyntaxKind.TaggedTemplateExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tag) ||
        visitNode(cbNode, data.questionDotToken) ||
        visitNodes(cbNode, cbNodes, data.typeArguments) ||
        visitNode(cbNode, data.template),
    [SyntaxKind.ParenthesizedExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.ArrayLiteralExpression]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.elements),
    [SyntaxKind.ObjectLiteralExpression]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.properties),
    [SyntaxKind.SpreadAssignment]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.PropertyAssignment]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.postfixToken) ||
        visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.initializer),
    [SyntaxKind.ShorthandPropertyAssignment]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.postfixToken) ||
        visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.equalsToken) ||
        visitNode(cbNode, data.objectAssignmentInitializer),
    [SyntaxKind.DeleteExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.TypeOfExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.VoidExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.AwaitExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.TypeAssertionExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.expression),
    [SyntaxKind.UnionType]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.types),
    [SyntaxKind.IntersectionType]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.types),
    [SyntaxKind.ConditionalType]: (data, cbNode, cbNodes) => visitNode(cbNode, data.checkType) ||
        visitNode(cbNode, data.extendsType) ||
        visitNode(cbNode, data.trueType) ||
        visitNode(cbNode, data.falseType),
    [SyntaxKind.TypeOperator]: (data, cbNode, cbNodes) => visitNode(cbNode, data.type),
    [SyntaxKind.InferType]: (data, cbNode, cbNodes) => visitNode(cbNode, data.typeParameter),
    [SyntaxKind.ArrayType]: (data, cbNode, cbNodes) => visitNode(cbNode, data.elementType),
    [SyntaxKind.IndexedAccessType]: (data, cbNode, cbNodes) => visitNode(cbNode, data.objectType) ||
        visitNode(cbNode, data.indexType),
    [SyntaxKind.TypeReference]: (data, cbNode, cbNodes) => visitNode(cbNode, data.typeName) ||
        visitNodes(cbNode, cbNodes, data.typeArguments),
    [SyntaxKind.ExpressionWithTypeArguments]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression) ||
        visitNodes(cbNode, cbNodes, data.typeArguments),
    [SyntaxKind.LiteralType]: (data, cbNode, cbNodes) => visitNode(cbNode, data.literal),
    [SyntaxKind.TypePredicate]: (data, cbNode, cbNodes) => visitNode(cbNode, data.assertsModifier) ||
        visitNode(cbNode, data.parameterName) ||
        visitNode(cbNode, data.type),
    [SyntaxKind.ImportAttribute]: (data, cbNode, cbNodes) => visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.value),
    [SyntaxKind.ImportAttributes]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.attributes),
    [SyntaxKind.TypeQuery]: (data, cbNode, cbNodes) => visitNode(cbNode, data.exprName) ||
        visitNodes(cbNode, cbNodes, data.typeArguments),
    [SyntaxKind.MappedType]: (data, cbNode, cbNodes) => visitNode(cbNode, data.readonlyToken) ||
        visitNode(cbNode, data.typeParameter) ||
        visitNode(cbNode, data.nameType) ||
        visitNode(cbNode, data.questionToken) ||
        visitNode(cbNode, data.type) ||
        visitNodes(cbNode, cbNodes, data.members),
    [SyntaxKind.TypeLiteral]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.members),
    [SyntaxKind.TupleType]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.elements),
    [SyntaxKind.NamedTupleMember]: (data, cbNode, cbNodes) => visitNode(cbNode, data.dotDotDotToken) ||
        visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.questionToken) ||
        visitNode(cbNode, data.type),
    [SyntaxKind.OptionalType]: (data, cbNode, cbNodes) => visitNode(cbNode, data.type),
    [SyntaxKind.RestType]: (data, cbNode, cbNodes) => visitNode(cbNode, data.type),
    [SyntaxKind.ParenthesizedType]: (data, cbNode, cbNodes) => visitNode(cbNode, data.type),
    [SyntaxKind.FunctionType]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.parameters) ||
        visitNode(cbNode, data.type),
    [SyntaxKind.ConstructorType]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.parameters) ||
        visitNode(cbNode, data.type),
    [SyntaxKind.TemplateLiteralType]: (data, cbNode, cbNodes) => visitNode(cbNode, data.head) ||
        visitNodes(cbNode, cbNodes, data.templateSpans),
    [SyntaxKind.TemplateLiteralTypeSpan]: (data, cbNode, cbNodes) => visitNode(cbNode, data.type) ||
        visitNode(cbNode, data.literal),
    [SyntaxKind.SyntheticExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tupleNameSource),
    [SyntaxKind.PartiallyEmittedExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.JsxElement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.openingElement) ||
        visitNodes(cbNode, cbNodes, data.children) ||
        visitNode(cbNode, data.closingElement),
    [SyntaxKind.JsxAttributes]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.properties),
    [SyntaxKind.JsxNamespacedName]: (data, cbNode, cbNodes) => visitNode(cbNode, data.namespace) ||
        visitNode(cbNode, data.name),
    [SyntaxKind.JsxOpeningElement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNodes(cbNode, cbNodes, data.typeArguments) ||
        visitNode(cbNode, data.attributes),
    [SyntaxKind.JsxSelfClosingElement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNodes(cbNode, cbNodes, data.typeArguments) ||
        visitNode(cbNode, data.attributes),
    [SyntaxKind.JsxFragment]: (data, cbNode, cbNodes) => visitNode(cbNode, data.openingFragment) ||
        visitNodes(cbNode, cbNodes, data.children) ||
        visitNode(cbNode, data.closingFragment),
    [SyntaxKind.JsxAttribute]: (data, cbNode, cbNodes) => visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.initializer),
    [SyntaxKind.JsxSpreadAttribute]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression),
    [SyntaxKind.JsxClosingElement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName),
    [SyntaxKind.JsxExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.dotDotDotToken) ||
        visitNode(cbNode, data.expression),
    [SyntaxKind.SyntaxList]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.children),
    [SyntaxKind.JSDoc]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.comment) ||
        visitNodes(cbNode, cbNodes, data.tags),
    [SyntaxKind.JSDocTypeExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.type),
    [SyntaxKind.JSDocNonNullableType]: (data, cbNode, cbNodes) => visitNode(cbNode, data.type),
    [SyntaxKind.JSDocNullableType]: (data, cbNode, cbNodes) => visitNode(cbNode, data.type),
    [SyntaxKind.JSDocVariadicType]: (data, cbNode, cbNodes) => visitNode(cbNode, data.type),
    [SyntaxKind.JSDocOptionalType]: (data, cbNode, cbNodes) => visitNode(cbNode, data.type),
    [SyntaxKind.JSDocTypeTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNode(cbNode, data.typeExpression) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocUnknownTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocTemplateTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNode(cbNode, data.constraint) ||
        visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocReturnTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNode(cbNode, data.typeExpression) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocPublicTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocPrivateTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocProtectedTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocReadonlyTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocOverrideTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocDeprecatedTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocSeeTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNode(cbNode, data.nameExpression) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocImplementsTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNode(cbNode, data.className) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocAugmentsTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNode(cbNode, data.className) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocSatisfiesTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNode(cbNode, data.typeExpression) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocThrowsTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNode(cbNode, data.typeExpression) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocThisTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNode(cbNode, data.typeExpression) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocImportTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNode(cbNode, data.importClause) ||
        visitNode(cbNode, data.moduleSpecifier) ||
        visitNode(cbNode, data.attributes) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocCallbackTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNode(cbNode, data.typeExpression) ||
        visitNode(cbNode, data.name) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocOverloadTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNode(cbNode, data.typeExpression) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocTypedefTag]: (data, cbNode, cbNodes) => visitNode(cbNode, data.tagName) ||
        visitNode(cbNode, data.typeExpression) ||
        visitNode(cbNode, data.name) ||
        visitNodes(cbNode, cbNodes, data.comment),
    [SyntaxKind.JSDocSignature]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.typeParameters) ||
        visitNodes(cbNode, cbNodes, data.parameters) ||
        visitNode(cbNode, data.type),
    [SyntaxKind.JSDocNameReference]: (data, cbNode, cbNodes) => visitNode(cbNode, data.name),
    [SyntaxKind.ModuleDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.body),
    [SyntaxKind.ImportEqualsDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.moduleReference),
    [SyntaxKind.ExportDeclaration]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.exportClause) ||
        visitNode(cbNode, data.moduleSpecifier) ||
        visitNode(cbNode, data.attributes),
    [SyntaxKind.ImportType]: (data, cbNode, cbNodes) => visitNode(cbNode, data.argument) ||
        visitNode(cbNode, data.attributes) ||
        visitNode(cbNode, data.qualifier) ||
        visitNodes(cbNode, cbNodes, data.typeArguments),
    [SyntaxKind.ImportClause]: (data, cbNode, cbNodes) => visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.namedBindings),
    [SyntaxKind.ImportSpecifier]: (data, cbNode, cbNodes) => visitNode(cbNode, data.propertyName) ||
        visitNode(cbNode, data.name),
    [SyntaxKind.JSDocLink]: (data, cbNode, cbNodes) => visitNode(cbNode, data.name),
    [SyntaxKind.JSDocLinkPlain]: (data, cbNode, cbNodes) => visitNode(cbNode, data.name),
    [SyntaxKind.JSDocLinkCode]: (data, cbNode, cbNodes) => visitNode(cbNode, data.name),
    [SyntaxKind.TypeParameter]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.modifiers) ||
        visitNode(cbNode, data.name) ||
        visitNode(cbNode, data.constraint) ||
        visitNode(cbNode, data.expression) ||
        visitNode(cbNode, data.defaultType),
    [SyntaxKind.SyntheticReferenceExpression]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression) ||
        visitNode(cbNode, data.thisArg),
    [SyntaxKind.JSDocTypeLiteral]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.jsdocPropertyTags),
    [SyntaxKind.ForInStatement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.awaitModifier) ||
        visitNode(cbNode, data.initializer) ||
        visitNode(cbNode, data.expression) ||
        visitNode(cbNode, data.statement),
    [SyntaxKind.ForOfStatement]: (data, cbNode, cbNodes) => visitNode(cbNode, data.awaitModifier) ||
        visitNode(cbNode, data.initializer) ||
        visitNode(cbNode, data.expression) ||
        visitNode(cbNode, data.statement),
    [SyntaxKind.CaseClause]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression) ||
        visitNodes(cbNode, cbNodes, data.statements),
    [SyntaxKind.DefaultClause]: (data, cbNode, cbNodes) => visitNode(cbNode, data.expression) ||
        visitNodes(cbNode, cbNodes, data.statements),
    [SyntaxKind.ObjectBindingPattern]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.elements),
    [SyntaxKind.ArrayBindingPattern]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.elements),
    [SyntaxKind.JSDocParameterTag]: forEachChildOfJSDocParameterTag,
    [SyntaxKind.JSDocPropertyTag]: forEachChildOfJSDocPropertyTag,
    [SyntaxKind.SourceFile]: (data, cbNode, cbNodes) => visitNodes(cbNode, cbNodes, data.statements) ||
        visitNode(cbNode, data.endOfFileToken),
};
function visitNode(cbNode, node) {
    return node ? cbNode(node) : undefined;
}
function visitNodes(cbNode, cbNodes, nodes) {
    if (!nodes)
        return undefined;
    if (cbNodes)
        return cbNodes(nodes);
    for (const node of nodes) {
        const result = cbNode(node);
        if (result)
            return result;
    }
    return undefined;
}
export function createToken(kind) {
    return new NodeObject(kind, undefined);
}
export function createIdentifier(text) {
    return new NodeObject(SyntaxKind.Identifier, {
        text,
    });
}
export function createPrivateIdentifier(text) {
    return new NodeObject(SyntaxKind.PrivateIdentifier, {
        text,
    });
}
export function createQualifiedName(left, right) {
    return new NodeObject(SyntaxKind.QualifiedName, {
        left,
        right,
    });
}
export function createComputedPropertyName(expression) {
    return new NodeObject(SyntaxKind.ComputedPropertyName, {
        expression,
    });
}
export function createDecorator(expression) {
    return new NodeObject(SyntaxKind.Decorator, {
        expression,
    });
}
export function createEmptyStatement() {
    return new NodeObject(SyntaxKind.EmptyStatement, undefined);
}
export function createIfStatement(expression, thenStatement, elseStatement) {
    return new NodeObject(SyntaxKind.IfStatement, {
        expression,
        thenStatement,
        elseStatement,
    });
}
export function createDoStatement(statement, expression) {
    return new NodeObject(SyntaxKind.DoStatement, {
        statement,
        expression,
    });
}
export function createWhileStatement(expression, statement) {
    return new NodeObject(SyntaxKind.WhileStatement, {
        expression,
        statement,
    });
}
export function createForStatement(initializer, condition, incrementor, statement) {
    return new NodeObject(SyntaxKind.ForStatement, {
        initializer,
        condition,
        incrementor,
        statement,
    });
}
export function createBreakStatement(label) {
    return new NodeObject(SyntaxKind.BreakStatement, {
        label,
    });
}
export function createContinueStatement(label) {
    return new NodeObject(SyntaxKind.ContinueStatement, {
        label,
    });
}
export function createReturnStatement(expression) {
    return new NodeObject(SyntaxKind.ReturnStatement, {
        expression,
    });
}
export function createWithStatement(expression, statement) {
    return new NodeObject(SyntaxKind.WithStatement, {
        expression,
        statement,
    });
}
export function createSwitchStatement(expression, caseBlock) {
    return new NodeObject(SyntaxKind.SwitchStatement, {
        expression,
        caseBlock,
    });
}
export function createCaseBlock(clauses) {
    return new NodeObject(SyntaxKind.CaseBlock, {
        clauses: createNodeArray(clauses),
    });
}
export function createThrowStatement(expression) {
    return new NodeObject(SyntaxKind.ThrowStatement, {
        expression,
    });
}
export function createTryStatement(tryBlock, catchClause, finallyBlock) {
    return new NodeObject(SyntaxKind.TryStatement, {
        tryBlock,
        catchClause,
        finallyBlock,
    });
}
export function createCatchClause(variableDeclaration, block) {
    return new NodeObject(SyntaxKind.CatchClause, {
        variableDeclaration,
        block,
    });
}
export function createDebuggerStatement() {
    return new NodeObject(SyntaxKind.DebuggerStatement, undefined);
}
export function createLabeledStatement(label, statement) {
    return new NodeObject(SyntaxKind.LabeledStatement, {
        label,
        statement,
    });
}
export function createExpressionStatement(expression) {
    return new NodeObject(SyntaxKind.ExpressionStatement, {
        expression,
    });
}
export function createBlock(statements, multiLine) {
    return new NodeObject(SyntaxKind.Block, {
        statements: createNodeArray(statements),
        multiLine,
    });
}
export function createVariableStatement(modifiers, declarationList) {
    return new NodeObject(SyntaxKind.VariableStatement, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        declarationList,
    });
}
export function createVariableDeclaration(name, exclamationToken, type, initializer) {
    return new NodeObject(SyntaxKind.VariableDeclaration, {
        name,
        exclamationToken,
        type,
        initializer,
    });
}
export function createVariableDeclarationList(declarations, flags) {
    const node = new NodeObject(SyntaxKind.VariableDeclarationList, {
        declarations: createNodeArray(declarations),
    });
    node.flags = flags;
    return node;
}
export function createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) {
    return new NodeObject(SyntaxKind.Parameter, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        dotDotDotToken,
        name,
        questionToken,
        type,
        initializer,
    });
}
export function createBindingElement(dotDotDotToken, propertyName, name, initializer) {
    return new NodeObject(SyntaxKind.BindingElement, {
        dotDotDotToken,
        propertyName,
        name,
        initializer,
    });
}
export function createMissingDeclaration(modifiers) {
    return new NodeObject(SyntaxKind.MissingDeclaration, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
    });
}
export function createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
    return new NodeObject(SyntaxKind.FunctionDeclaration, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        asteriskToken,
        name,
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        parameters: createNodeArray(parameters),
        type,
        body,
    });
}
export function createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
    return new NodeObject(SyntaxKind.ClassDeclaration, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        name,
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        heritageClauses: heritageClauses ? createNodeArray(heritageClauses) : undefined,
        members: createNodeArray(members),
    });
}
export function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) {
    return new NodeObject(SyntaxKind.ClassExpression, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        name,
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        heritageClauses: heritageClauses ? createNodeArray(heritageClauses) : undefined,
        members: createNodeArray(members),
    });
}
export function createHeritageClause(token, types) {
    return new NodeObject(SyntaxKind.HeritageClause, {
        token,
        types: createNodeArray(types),
    });
}
export function createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members) {
    return new NodeObject(SyntaxKind.InterfaceDeclaration, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        name,
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        heritageClauses: heritageClauses ? createNodeArray(heritageClauses) : undefined,
        members: createNodeArray(members),
    });
}
export function createTypeAliasDeclaration(modifiers, name, typeParameters, type) {
    return new NodeObject(SyntaxKind.TypeAliasDeclaration, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        name,
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        type,
    });
}
export function createEnumMember(name, initializer) {
    return new NodeObject(SyntaxKind.EnumMember, {
        name,
        initializer,
    });
}
export function createEnumDeclaration(modifiers, name, members) {
    return new NodeObject(SyntaxKind.EnumDeclaration, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        name,
        members: createNodeArray(members),
    });
}
export function createModuleBlock(statements) {
    return new NodeObject(SyntaxKind.ModuleBlock, {
        statements: createNodeArray(statements),
    });
}
export function createNotEmittedStatement() {
    return new NodeObject(SyntaxKind.NotEmittedStatement, undefined);
}
export function createNotEmittedTypeElement() {
    return new NodeObject(SyntaxKind.NotEmittedTypeElement, undefined);
}
export function createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) {
    return new NodeObject(SyntaxKind.ImportDeclaration, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        importClause,
        moduleSpecifier,
        attributes,
    });
}
export function createExternalModuleReference(expression) {
    return new NodeObject(SyntaxKind.ExternalModuleReference, {
        expression,
    });
}
export function createNamespaceImport(name) {
    return new NodeObject(SyntaxKind.NamespaceImport, {
        name,
    });
}
export function createNamedImports(elements) {
    return new NodeObject(SyntaxKind.NamedImports, {
        elements: createNodeArray(elements),
    });
}
export function createExportAssignment(modifiers, isExportEquals = false, type, expression) {
    return new NodeObject(SyntaxKind.ExportAssignment, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        isExportEquals,
        type,
        expression,
    });
}
export function createNamespaceExportDeclaration(modifiers, name) {
    return new NodeObject(SyntaxKind.NamespaceExportDeclaration, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        name,
    });
}
export function createNamespaceExport(name) {
    return new NodeObject(SyntaxKind.NamespaceExport, {
        name,
    });
}
export function createNamedExports(elements) {
    return new NodeObject(SyntaxKind.NamedExports, {
        elements: createNodeArray(elements),
    });
}
export function createExportSpecifier(isTypeOnly = false, propertyName, name) {
    return new NodeObject(SyntaxKind.ExportSpecifier, {
        isTypeOnly,
        propertyName,
        name,
    });
}
export function createCallSignatureDeclaration(typeParameters, parameters, type) {
    return new NodeObject(SyntaxKind.CallSignature, {
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        parameters: createNodeArray(parameters),
        type,
    });
}
export function createConstructSignatureDeclaration(typeParameters, parameters, type) {
    return new NodeObject(SyntaxKind.ConstructSignature, {
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        parameters: createNodeArray(parameters),
        type,
    });
}
export function createConstructorDeclaration(modifiers, typeParameters, parameters, type, body) {
    return new NodeObject(SyntaxKind.Constructor, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        parameters: createNodeArray(parameters),
        type,
        body,
    });
}
export function createGetAccessorDeclaration(modifiers, name, typeParameters, parameters, type, body) {
    return new NodeObject(SyntaxKind.GetAccessor, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        name,
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        parameters: createNodeArray(parameters),
        type,
        body,
    });
}
export function createSetAccessorDeclaration(modifiers, name, typeParameters, parameters, type, body) {
    return new NodeObject(SyntaxKind.SetAccessor, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        name,
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        parameters: createNodeArray(parameters),
        type,
        body,
    });
}
export function createIndexSignatureDeclaration(modifiers, parameters, type) {
    return new NodeObject(SyntaxKind.IndexSignature, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        parameters: createNodeArray(parameters),
        type,
    });
}
export function createMethodSignatureDeclaration(modifiers, name, postfixToken, typeParameters, parameters, type) {
    return new NodeObject(SyntaxKind.MethodSignature, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        name,
        postfixToken,
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        parameters: createNodeArray(parameters),
        type,
    });
}
export function createMethodDeclaration(modifiers, asteriskToken, name, postfixToken, typeParameters, parameters, type, body) {
    return new NodeObject(SyntaxKind.MethodDeclaration, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        asteriskToken,
        name,
        postfixToken,
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        parameters: createNodeArray(parameters),
        type,
        body,
    });
}
export function createPropertySignatureDeclaration(modifiers, name, postfixToken, type, initializer) {
    return new NodeObject(SyntaxKind.PropertySignature, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        name,
        postfixToken,
        type,
        initializer,
    });
}
export function createPropertyDeclaration(modifiers, name, postfixToken, type, initializer) {
    return new NodeObject(SyntaxKind.PropertyDeclaration, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        name,
        postfixToken,
        type,
        initializer,
    });
}
export function createSemicolonClassElement() {
    return new NodeObject(SyntaxKind.SemicolonClassElement, undefined);
}
export function createClassStaticBlockDeclaration(modifiers, body) {
    return new NodeObject(SyntaxKind.ClassStaticBlockDeclaration, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        body,
    });
}
export function createOmittedExpression() {
    return new NodeObject(SyntaxKind.OmittedExpression, undefined);
}
export function createKeywordExpression(kind) {
    return new NodeObject(kind, undefined);
}
export function createStringLiteral(text, tokenFlags) {
    return new NodeObject(SyntaxKind.StringLiteral, {
        text,
        tokenFlags,
    });
}
export function createNumericLiteral(text, tokenFlags) {
    return new NodeObject(SyntaxKind.NumericLiteral, {
        text,
        tokenFlags,
    });
}
export function createBigIntLiteral(text, tokenFlags) {
    return new NodeObject(SyntaxKind.BigIntLiteral, {
        text,
        tokenFlags,
    });
}
export function createRegularExpressionLiteral(text, tokenFlags) {
    return new NodeObject(SyntaxKind.RegularExpressionLiteral, {
        text,
        tokenFlags,
    });
}
export function createNoSubstitutionTemplateLiteral(text, templateFlags) {
    return new NodeObject(SyntaxKind.NoSubstitutionTemplateLiteral, {
        text,
        templateFlags,
    });
}
export function createBinaryExpression(modifiers, left, type, operatorToken, right) {
    return new NodeObject(SyntaxKind.BinaryExpression, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        left,
        type,
        operatorToken,
        right,
    });
}
export function createPrefixUnaryExpression(operator, operand) {
    return new NodeObject(SyntaxKind.PrefixUnaryExpression, {
        operator,
        operand,
    });
}
export function createPostfixUnaryExpression(operand, operator) {
    return new NodeObject(SyntaxKind.PostfixUnaryExpression, {
        operand,
        operator,
    });
}
export function createYieldExpression(asteriskToken, expression) {
    return new NodeObject(SyntaxKind.YieldExpression, {
        asteriskToken,
        expression,
    });
}
export function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
    return new NodeObject(SyntaxKind.ArrowFunction, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        parameters: createNodeArray(parameters),
        type,
        equalsGreaterThanToken,
        body,
    });
}
export function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
    return new NodeObject(SyntaxKind.FunctionExpression, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        asteriskToken,
        name,
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        parameters: createNodeArray(parameters),
        type,
        body,
    });
}
export function createAsExpression(expression, type) {
    return new NodeObject(SyntaxKind.AsExpression, {
        expression,
        type,
    });
}
export function createSatisfiesExpression(expression, type) {
    return new NodeObject(SyntaxKind.SatisfiesExpression, {
        expression,
        type,
    });
}
export function createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) {
    return new NodeObject(SyntaxKind.ConditionalExpression, {
        condition,
        questionToken,
        whenTrue,
        colonToken,
        whenFalse,
    });
}
export function createPropertyAccessExpression(expression, questionDotToken, name, flags) {
    const node = new NodeObject(SyntaxKind.PropertyAccessExpression, {
        expression,
        questionDotToken,
        name,
    });
    node.flags = flags;
    return node;
}
export function createElementAccessExpression(expression, questionDotToken, argumentExpression, flags) {
    const node = new NodeObject(SyntaxKind.ElementAccessExpression, {
        expression,
        questionDotToken,
        argumentExpression,
    });
    node.flags = flags;
    return node;
}
export function createCallExpression(expression, questionDotToken, typeArguments, arguments_, flags) {
    const node = new NodeObject(SyntaxKind.CallExpression, {
        expression,
        questionDotToken,
        typeArguments: typeArguments ? createNodeArray(typeArguments) : undefined,
        arguments: createNodeArray(arguments_),
    });
    node.flags = flags;
    return node;
}
export function createNewExpression(expression, typeArguments, arguments_) {
    return new NodeObject(SyntaxKind.NewExpression, {
        expression,
        typeArguments: typeArguments ? createNodeArray(typeArguments) : undefined,
        arguments: arguments_ ? createNodeArray(arguments_) : undefined,
    });
}
export function createMetaProperty(keywordToken, name) {
    return new NodeObject(SyntaxKind.MetaProperty, {
        keywordToken,
        name,
    });
}
export function createNonNullExpression(expression, flags) {
    const node = new NodeObject(SyntaxKind.NonNullExpression, {
        expression,
    });
    node.flags = flags;
    return node;
}
export function createSpreadElement(expression) {
    return new NodeObject(SyntaxKind.SpreadElement, {
        expression,
    });
}
export function createTemplateExpression(head, templateSpans) {
    return new NodeObject(SyntaxKind.TemplateExpression, {
        head,
        templateSpans: createNodeArray(templateSpans),
    });
}
export function createTemplateSpan(expression, literal) {
    return new NodeObject(SyntaxKind.TemplateSpan, {
        expression,
        literal,
    });
}
export function createTaggedTemplateExpression(tag, questionDotToken, typeArguments, template, flags) {
    const node = new NodeObject(SyntaxKind.TaggedTemplateExpression, {
        tag,
        questionDotToken,
        typeArguments: typeArguments ? createNodeArray(typeArguments) : undefined,
        template,
    });
    node.flags = flags;
    return node;
}
export function createParenthesizedExpression(expression) {
    return new NodeObject(SyntaxKind.ParenthesizedExpression, {
        expression,
    });
}
export function createArrayLiteralExpression(elements, multiLine) {
    return new NodeObject(SyntaxKind.ArrayLiteralExpression, {
        elements: createNodeArray(elements),
        multiLine,
    });
}
export function createObjectLiteralExpression(properties, multiLine) {
    return new NodeObject(SyntaxKind.ObjectLiteralExpression, {
        properties: createNodeArray(properties),
        multiLine,
    });
}
export function createSpreadAssignment(expression) {
    return new NodeObject(SyntaxKind.SpreadAssignment, {
        expression,
    });
}
export function createPropertyAssignment(modifiers, name, postfixToken, type, initializer) {
    return new NodeObject(SyntaxKind.PropertyAssignment, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        name,
        postfixToken,
        type,
        initializer,
    });
}
export function createShorthandPropertyAssignment(modifiers, name, postfixToken, type, equalsToken, objectAssignmentInitializer) {
    return new NodeObject(SyntaxKind.ShorthandPropertyAssignment, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        name,
        postfixToken,
        type,
        equalsToken,
        objectAssignmentInitializer,
    });
}
export function createDeleteExpression(expression) {
    return new NodeObject(SyntaxKind.DeleteExpression, {
        expression,
    });
}
export function createTypeOfExpression(expression) {
    return new NodeObject(SyntaxKind.TypeOfExpression, {
        expression,
    });
}
export function createVoidExpression(expression) {
    return new NodeObject(SyntaxKind.VoidExpression, {
        expression,
    });
}
export function createAwaitExpression(expression) {
    return new NodeObject(SyntaxKind.AwaitExpression, {
        expression,
    });
}
export function createTypeAssertion(type, expression) {
    return new NodeObject(SyntaxKind.TypeAssertionExpression, {
        type,
        expression,
    });
}
export function createKeywordTypeNode(kind) {
    return new NodeObject(kind, undefined);
}
export function createUnionTypeNode(types) {
    return new NodeObject(SyntaxKind.UnionType, {
        types: createNodeArray(types),
    });
}
export function createIntersectionTypeNode(types) {
    return new NodeObject(SyntaxKind.IntersectionType, {
        types: createNodeArray(types),
    });
}
export function createConditionalTypeNode(checkType, extendsType, trueType, falseType) {
    return new NodeObject(SyntaxKind.ConditionalType, {
        checkType,
        extendsType,
        trueType,
        falseType,
    });
}
export function createTypeOperatorNode(operator, type) {
    return new NodeObject(SyntaxKind.TypeOperator, {
        operator,
        type,
    });
}
export function createInferTypeNode(typeParameter) {
    return new NodeObject(SyntaxKind.InferType, {
        typeParameter,
    });
}
export function createArrayTypeNode(elementType) {
    return new NodeObject(SyntaxKind.ArrayType, {
        elementType,
    });
}
export function createIndexedAccessTypeNode(objectType, indexType) {
    return new NodeObject(SyntaxKind.IndexedAccessType, {
        objectType,
        indexType,
    });
}
export function createTypeReferenceNode(typeName, typeArguments) {
    return new NodeObject(SyntaxKind.TypeReference, {
        typeName,
        typeArguments: typeArguments ? createNodeArray(typeArguments) : undefined,
    });
}
export function createExpressionWithTypeArguments(expression, typeArguments) {
    return new NodeObject(SyntaxKind.ExpressionWithTypeArguments, {
        expression,
        typeArguments: typeArguments ? createNodeArray(typeArguments) : undefined,
    });
}
export function createLiteralTypeNode(literal) {
    return new NodeObject(SyntaxKind.LiteralType, {
        literal,
    });
}
export function createThisTypeNode() {
    return new NodeObject(SyntaxKind.ThisType, undefined);
}
export function createTypePredicateNode(assertsModifier, parameterName, type) {
    return new NodeObject(SyntaxKind.TypePredicate, {
        assertsModifier,
        parameterName,
        type,
    });
}
export function createImportAttribute(name, value) {
    return new NodeObject(SyntaxKind.ImportAttribute, {
        name,
        value,
    });
}
export function createImportAttributes(token, attributes, multiLine) {
    return new NodeObject(SyntaxKind.ImportAttributes, {
        token,
        attributes: createNodeArray(attributes),
        multiLine,
    });
}
export function createTypeQueryNode(exprName, typeArguments) {
    return new NodeObject(SyntaxKind.TypeQuery, {
        exprName,
        typeArguments: typeArguments ? createNodeArray(typeArguments) : undefined,
    });
}
export function createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) {
    return new NodeObject(SyntaxKind.MappedType, {
        readonlyToken,
        typeParameter,
        nameType,
        questionToken,
        type,
        members: members ? createNodeArray(members) : undefined,
    });
}
export function createTypeLiteralNode(members) {
    return new NodeObject(SyntaxKind.TypeLiteral, {
        members: createNodeArray(members),
    });
}
export function createTupleTypeNode(elements) {
    return new NodeObject(SyntaxKind.TupleType, {
        elements: createNodeArray(elements),
    });
}
export function createNamedTupleMember(dotDotDotToken, name, questionToken, type) {
    return new NodeObject(SyntaxKind.NamedTupleMember, {
        dotDotDotToken,
        name,
        questionToken,
        type,
    });
}
export function createOptionalTypeNode(type) {
    return new NodeObject(SyntaxKind.OptionalType, {
        type,
    });
}
export function createRestTypeNode(type) {
    return new NodeObject(SyntaxKind.RestType, {
        type,
    });
}
export function createParenthesizedTypeNode(type) {
    return new NodeObject(SyntaxKind.ParenthesizedType, {
        type,
    });
}
export function createFunctionTypeNode(typeParameters, parameters, type) {
    return new NodeObject(SyntaxKind.FunctionType, {
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        parameters: createNodeArray(parameters),
        type,
    });
}
export function createConstructorTypeNode(modifiers, typeParameters, parameters, type) {
    return new NodeObject(SyntaxKind.ConstructorType, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        parameters: createNodeArray(parameters),
        type,
    });
}
export function createTemplateHead(text, rawText, templateFlags) {
    return new NodeObject(SyntaxKind.TemplateHead, {
        text,
        rawText,
        templateFlags,
    });
}
export function createTemplateMiddle(text, rawText, templateFlags) {
    return new NodeObject(SyntaxKind.TemplateMiddle, {
        text,
        rawText,
        templateFlags,
    });
}
export function createTemplateTail(text, rawText, templateFlags) {
    return new NodeObject(SyntaxKind.TemplateTail, {
        text,
        rawText,
        templateFlags,
    });
}
export function createTemplateLiteralTypeNode(head, templateSpans) {
    return new NodeObject(SyntaxKind.TemplateLiteralType, {
        head,
        templateSpans: createNodeArray(templateSpans),
    });
}
export function createTemplateLiteralTypeSpan(type, literal) {
    return new NodeObject(SyntaxKind.TemplateLiteralTypeSpan, {
        type,
        literal,
    });
}
export function createSyntheticExpression(type, isSpread, tupleNameSource) {
    return new NodeObject(SyntaxKind.SyntheticExpression, {
        type,
        isSpread,
        tupleNameSource,
    });
}
export function createPartiallyEmittedExpression(expression) {
    return new NodeObject(SyntaxKind.PartiallyEmittedExpression, {
        expression,
    });
}
export function createJsxElement(openingElement, children, closingElement) {
    return new NodeObject(SyntaxKind.JsxElement, {
        openingElement,
        children: createNodeArray(children),
        closingElement,
    });
}
export function createJsxAttributes(properties) {
    return new NodeObject(SyntaxKind.JsxAttributes, {
        properties: createNodeArray(properties),
    });
}
export function createJsxNamespacedName(namespace, name) {
    return new NodeObject(SyntaxKind.JsxNamespacedName, {
        namespace,
        name,
    });
}
export function createJsxOpeningElement(tagName, typeArguments, attributes) {
    return new NodeObject(SyntaxKind.JsxOpeningElement, {
        tagName,
        typeArguments: typeArguments ? createNodeArray(typeArguments) : undefined,
        attributes,
    });
}
export function createJsxSelfClosingElement(tagName, typeArguments, attributes) {
    return new NodeObject(SyntaxKind.JsxSelfClosingElement, {
        tagName,
        typeArguments: typeArguments ? createNodeArray(typeArguments) : undefined,
        attributes,
    });
}
export function createJsxFragment(openingFragment, children, closingFragment) {
    return new NodeObject(SyntaxKind.JsxFragment, {
        openingFragment,
        children: createNodeArray(children),
        closingFragment,
    });
}
export function createJsxOpeningFragment() {
    return new NodeObject(SyntaxKind.JsxOpeningFragment, undefined);
}
export function createJsxClosingFragment() {
    return new NodeObject(SyntaxKind.JsxClosingFragment, undefined);
}
export function createJsxAttribute(name, initializer) {
    return new NodeObject(SyntaxKind.JsxAttribute, {
        name,
        initializer,
    });
}
export function createJsxSpreadAttribute(expression) {
    return new NodeObject(SyntaxKind.JsxSpreadAttribute, {
        expression,
    });
}
export function createJsxClosingElement(tagName) {
    return new NodeObject(SyntaxKind.JsxClosingElement, {
        tagName,
    });
}
export function createJsxExpression(dotDotDotToken, expression) {
    return new NodeObject(SyntaxKind.JsxExpression, {
        dotDotDotToken,
        expression,
    });
}
export function createJsxText(text, containsOnlyTriviaWhiteSpaces) {
    return new NodeObject(SyntaxKind.JsxText, {
        text,
        containsOnlyTriviaWhiteSpaces,
    });
}
export function createSyntaxList(children) {
    return new NodeObject(SyntaxKind.SyntaxList, {
        children,
    });
}
export function createJSDoc(comment, tags) {
    return new NodeObject(SyntaxKind.JSDoc, {
        comment: createNodeArray(comment),
        tags: tags ? createNodeArray(tags) : undefined,
    });
}
export function createJSDocTypeExpression(type) {
    return new NodeObject(SyntaxKind.JSDocTypeExpression, {
        type,
    });
}
export function createJSDocNonNullableType(type) {
    return new NodeObject(SyntaxKind.JSDocNonNullableType, {
        type,
    });
}
export function createJSDocNullableType(type) {
    return new NodeObject(SyntaxKind.JSDocNullableType, {
        type,
    });
}
export function createJSDocAllType() {
    return new NodeObject(SyntaxKind.JSDocAllType, undefined);
}
export function createJSDocVariadicType(type) {
    return new NodeObject(SyntaxKind.JSDocVariadicType, {
        type,
    });
}
export function createJSDocOptionalType(type) {
    return new NodeObject(SyntaxKind.JSDocOptionalType, {
        type,
    });
}
export function createJSDocTypeTag(tagName, typeExpression, comment) {
    return new NodeObject(SyntaxKind.JSDocTypeTag, {
        tagName,
        typeExpression,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocUnknownTag(tagName, comment) {
    return new NodeObject(SyntaxKind.JSDocUnknownTag, {
        tagName,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocTemplateTag(tagName, constraint, typeParameters, comment) {
    return new NodeObject(SyntaxKind.JSDocTemplateTag, {
        tagName,
        constraint,
        typeParameters: createNodeArray(typeParameters),
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocReturnTag(tagName, typeExpression, comment) {
    return new NodeObject(SyntaxKind.JSDocReturnTag, {
        tagName,
        typeExpression,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocPublicTag(tagName, comment) {
    return new NodeObject(SyntaxKind.JSDocPublicTag, {
        tagName,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocPrivateTag(tagName, comment) {
    return new NodeObject(SyntaxKind.JSDocPrivateTag, {
        tagName,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocProtectedTag(tagName, comment) {
    return new NodeObject(SyntaxKind.JSDocProtectedTag, {
        tagName,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocReadonlyTag(tagName, comment) {
    return new NodeObject(SyntaxKind.JSDocReadonlyTag, {
        tagName,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocOverrideTag(tagName, comment) {
    return new NodeObject(SyntaxKind.JSDocOverrideTag, {
        tagName,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocDeprecatedTag(tagName, comment) {
    return new NodeObject(SyntaxKind.JSDocDeprecatedTag, {
        tagName,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocSeeTag(tagName, nameExpression, comment) {
    return new NodeObject(SyntaxKind.JSDocSeeTag, {
        tagName,
        nameExpression,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocImplementsTag(tagName, className, comment) {
    return new NodeObject(SyntaxKind.JSDocImplementsTag, {
        tagName,
        className,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocAugmentsTag(tagName, className, comment) {
    return new NodeObject(SyntaxKind.JSDocAugmentsTag, {
        tagName,
        className,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocSatisfiesTag(tagName, typeExpression, comment) {
    return new NodeObject(SyntaxKind.JSDocSatisfiesTag, {
        tagName,
        typeExpression,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocThrowsTag(tagName, typeExpression, comment) {
    return new NodeObject(SyntaxKind.JSDocThrowsTag, {
        tagName,
        typeExpression,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocThisTag(tagName, typeExpression, comment) {
    return new NodeObject(SyntaxKind.JSDocThisTag, {
        tagName,
        typeExpression,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comment) {
    return new NodeObject(SyntaxKind.JSDocImportTag, {
        tagName,
        importClause,
        moduleSpecifier,
        attributes,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocCallbackTag(tagName, typeExpression, name, comment) {
    return new NodeObject(SyntaxKind.JSDocCallbackTag, {
        tagName,
        typeExpression,
        name,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocOverloadTag(tagName, typeExpression, comment) {
    return new NodeObject(SyntaxKind.JSDocOverloadTag, {
        tagName,
        typeExpression,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocTypedefTag(tagName, typeExpression, name, comment) {
    return new NodeObject(SyntaxKind.JSDocTypedefTag, {
        tagName,
        typeExpression,
        name,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocSignature(typeParameters, parameters, type) {
    return new NodeObject(SyntaxKind.JSDocSignature, {
        typeParameters: typeParameters ? createNodeArray(typeParameters) : undefined,
        parameters: createNodeArray(parameters),
        type,
    });
}
export function createJSDocNameReference(name) {
    return new NodeObject(SyntaxKind.JSDocNameReference, {
        name,
    });
}
export function createModuleDeclaration(modifiers, keyword, name, body) {
    return new NodeObject(SyntaxKind.ModuleDeclaration, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        keyword,
        name,
        body,
    });
}
export function createImportEqualsDeclaration(modifiers, isTypeOnly = false, name, moduleReference) {
    return new NodeObject(SyntaxKind.ImportEqualsDeclaration, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        isTypeOnly,
        name,
        moduleReference,
    });
}
export function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
    return new NodeObject(SyntaxKind.ExportDeclaration, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        isTypeOnly,
        exportClause,
        moduleSpecifier,
        attributes,
    });
}
export function createImportTypeNode(isTypeOf = false, argument, attributes, qualifier, typeArguments) {
    return new NodeObject(SyntaxKind.ImportType, {
        isTypeOf,
        argument,
        attributes,
        qualifier,
        typeArguments: typeArguments ? createNodeArray(typeArguments) : undefined,
    });
}
export function createImportClause(phaseModifier, name, namedBindings) {
    return new NodeObject(SyntaxKind.ImportClause, {
        phaseModifier,
        name,
        namedBindings,
    });
}
export function createImportSpecifier(isTypeOnly = false, propertyName, name) {
    return new NodeObject(SyntaxKind.ImportSpecifier, {
        isTypeOnly,
        propertyName,
        name,
    });
}
export function createJSDocText(text) {
    return new NodeObject(SyntaxKind.JSDocText, {
        text,
    });
}
export function createJSDocLink(name, text) {
    return new NodeObject(SyntaxKind.JSDocLink, {
        name,
        text,
    });
}
export function createJSDocLinkPlain(name, text) {
    return new NodeObject(SyntaxKind.JSDocLinkPlain, {
        name,
        text,
    });
}
export function createJSDocLinkCode(name, text) {
    return new NodeObject(SyntaxKind.JSDocLinkCode, {
        name,
        text,
    });
}
export function createTypeParameterDeclaration(modifiers, name, constraint, expression, defaultType) {
    return new NodeObject(SyntaxKind.TypeParameter, {
        modifiers: modifiers ? createNodeArray(modifiers) : undefined,
        name,
        constraint,
        expression,
        defaultType,
    });
}
export function createSyntheticReferenceExpression(expression, thisArg) {
    return new NodeObject(SyntaxKind.SyntheticReferenceExpression, {
        expression,
        thisArg,
    });
}
export function createJSDocTypeLiteral(jsdocPropertyTags, isArrayType) {
    return new NodeObject(SyntaxKind.JSDocTypeLiteral, {
        jsdocPropertyTags,
        isArrayType,
    });
}
export function createForInStatement(awaitModifier, initializer, expression, statement) {
    return new NodeObject(SyntaxKind.ForInStatement, {
        awaitModifier,
        initializer,
        expression,
        statement,
    });
}
export function createForOfStatement(awaitModifier, initializer, expression, statement) {
    return new NodeObject(SyntaxKind.ForOfStatement, {
        awaitModifier,
        initializer,
        expression,
        statement,
    });
}
export function createCaseClause(expression, statements) {
    return new NodeObject(SyntaxKind.CaseClause, {
        expression,
        statements: createNodeArray(statements),
    });
}
export function createDefaultClause(expression, statements) {
    return new NodeObject(SyntaxKind.DefaultClause, {
        expression,
        statements: createNodeArray(statements),
    });
}
export function createObjectBindingPattern(elements) {
    return new NodeObject(SyntaxKind.ObjectBindingPattern, {
        elements: createNodeArray(elements),
    });
}
export function createArrayBindingPattern(elements) {
    return new NodeObject(SyntaxKind.ArrayBindingPattern, {
        elements: createNodeArray(elements),
    });
}
export function createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
    return new NodeObject(SyntaxKind.JSDocParameterTag, {
        tagName,
        name,
        isBracketed,
        typeExpression,
        isNameFirst,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) {
    return new NodeObject(SyntaxKind.JSDocPropertyTag, {
        tagName,
        name,
        isBracketed,
        typeExpression,
        isNameFirst,
        comment: comment ? createNodeArray(comment) : undefined,
    });
}
export function updateQualifiedName(node, left, right) {
    return node.left !== left || node.right !== right ? createQualifiedName(left, right) : node;
}
export function updateComputedPropertyName(node, expression) {
    return node.expression !== expression ? createComputedPropertyName(expression) : node;
}
export function updateDecorator(node, expression) {
    return node.expression !== expression ? createDecorator(expression) : node;
}
export function updateIfStatement(node, expression, thenStatement, elseStatement) {
    return node.expression !== expression || node.thenStatement !== thenStatement || node.elseStatement !== elseStatement ? createIfStatement(expression, thenStatement, elseStatement) : node;
}
export function updateDoStatement(node, statement, expression) {
    return node.statement !== statement || node.expression !== expression ? createDoStatement(statement, expression) : node;
}
export function updateWhileStatement(node, expression, statement) {
    return node.expression !== expression || node.statement !== statement ? createWhileStatement(expression, statement) : node;
}
export function updateForStatement(node, initializer, condition, incrementor, statement) {
    return node.initializer !== initializer || node.condition !== condition || node.incrementor !== incrementor || node.statement !== statement ? createForStatement(initializer, condition, incrementor, statement) : node;
}
export function updateBreakStatement(node, label) {
    return node.label !== label ? createBreakStatement(label) : node;
}
export function updateContinueStatement(node, label) {
    return node.label !== label ? createContinueStatement(label) : node;
}
export function updateReturnStatement(node, expression) {
    return node.expression !== expression ? createReturnStatement(expression) : node;
}
export function updateWithStatement(node, expression, statement) {
    return node.expression !== expression || node.statement !== statement ? createWithStatement(expression, statement) : node;
}
export function updateSwitchStatement(node, expression, caseBlock) {
    return node.expression !== expression || node.caseBlock !== caseBlock ? createSwitchStatement(expression, caseBlock) : node;
}
export function updateCaseBlock(node, clauses) {
    return node.clauses !== clauses ? createCaseBlock(clauses) : node;
}
export function updateThrowStatement(node, expression) {
    return node.expression !== expression ? createThrowStatement(expression) : node;
}
export function updateTryStatement(node, tryBlock, catchClause, finallyBlock) {
    return node.tryBlock !== tryBlock || node.catchClause !== catchClause || node.finallyBlock !== finallyBlock ? createTryStatement(tryBlock, catchClause, finallyBlock) : node;
}
export function updateCatchClause(node, variableDeclaration, block) {
    return node.variableDeclaration !== variableDeclaration || node.block !== block ? createCatchClause(variableDeclaration, block) : node;
}
export function updateLabeledStatement(node, label, statement) {
    return node.label !== label || node.statement !== statement ? createLabeledStatement(label, statement) : node;
}
export function updateExpressionStatement(node, expression) {
    return node.expression !== expression ? createExpressionStatement(expression) : node;
}
export function updateBlock(node, statements) {
    return node.statements !== statements ? createBlock(statements, node.multiLine) : node;
}
export function updateVariableStatement(node, modifiers, declarationList) {
    return node.modifiers !== modifiers || node.declarationList !== declarationList ? createVariableStatement(modifiers, declarationList) : node;
}
export function updateVariableDeclaration(node, name, exclamationToken, type, initializer) {
    return node.name !== name || node.exclamationToken !== exclamationToken || node.type !== type || node.initializer !== initializer ? createVariableDeclaration(name, exclamationToken, type, initializer) : node;
}
export function updateVariableDeclarationList(node, declarations) {
    return node.declarations !== declarations ? createVariableDeclarationList(declarations, node.flags) : node;
}
export function updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) {
    return node.modifiers !== modifiers || node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type || node.initializer !== initializer ? createParameterDeclaration(modifiers, dotDotDotToken, name, questionToken, type, initializer) : node;
}
export function updateBindingElement(node, dotDotDotToken, propertyName, name, initializer) {
    return node.dotDotDotToken !== dotDotDotToken || node.propertyName !== propertyName || node.name !== name || node.initializer !== initializer ? createBindingElement(dotDotDotToken, propertyName, name, initializer) : node;
}
export function updateMissingDeclaration(node, modifiers) {
    return node.modifiers !== modifiers ? createMissingDeclaration(modifiers) : node;
}
export function updateFunctionDeclaration(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
    return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? createFunctionDeclaration(modifiers, asteriskToken, name, typeParameters, parameters, type, body) : node;
}
export function updateClassDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) {
    return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? createClassDeclaration(modifiers, name, typeParameters, heritageClauses, members) : node;
}
export function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) {
    return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? createClassExpression(modifiers, name, typeParameters, heritageClauses, members) : node;
}
export function updateHeritageClause(node, types) {
    return node.types !== types ? createHeritageClause(node.token, types) : node;
}
export function updateInterfaceDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) {
    return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.heritageClauses !== heritageClauses || node.members !== members ? createInterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, members) : node;
}
export function updateTypeAliasDeclaration(node, modifiers, name, typeParameters, type) {
    return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.type !== type ? createTypeAliasDeclaration(modifiers, name, typeParameters, type) : node;
}
export function updateEnumMember(node, name, initializer) {
    return node.name !== name || node.initializer !== initializer ? createEnumMember(name, initializer) : node;
}
export function updateEnumDeclaration(node, modifiers, name, members) {
    return node.modifiers !== modifiers || node.name !== name || node.members !== members ? createEnumDeclaration(modifiers, name, members) : node;
}
export function updateModuleBlock(node, statements) {
    return node.statements !== statements ? createModuleBlock(statements) : node;
}
export function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, attributes) {
    return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) : node;
}
export function updateExternalModuleReference(node, expression) {
    return node.expression !== expression ? createExternalModuleReference(expression) : node;
}
export function updateNamespaceImport(node, name) {
    return node.name !== name ? createNamespaceImport(name) : node;
}
export function updateNamedImports(node, elements) {
    return node.elements !== elements ? createNamedImports(elements) : node;
}
export function updateExportAssignment(node, modifiers, type, expression) {
    return node.modifiers !== modifiers || node.type !== type || node.expression !== expression ? createExportAssignment(modifiers, node.isExportEquals, type, expression) : node;
}
export function updateNamespaceExportDeclaration(node, modifiers, name) {
    return node.modifiers !== modifiers || node.name !== name ? createNamespaceExportDeclaration(modifiers, name) : node;
}
export function updateNamespaceExport(node, name) {
    return node.name !== name ? createNamespaceExport(name) : node;
}
export function updateNamedExports(node, elements) {
    return node.elements !== elements ? createNamedExports(elements) : node;
}
export function updateExportSpecifier(node, propertyName, name) {
    return node.propertyName !== propertyName || node.name !== name ? createExportSpecifier(node.isTypeOnly, propertyName, name) : node;
}
export function updateCallSignatureDeclaration(node, typeParameters, parameters, type) {
    return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? createCallSignatureDeclaration(typeParameters, parameters, type) : node;
}
export function updateConstructSignatureDeclaration(node, typeParameters, parameters, type) {
    return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? createConstructSignatureDeclaration(typeParameters, parameters, type) : node;
}
export function updateConstructorDeclaration(node, modifiers, typeParameters, parameters, type, body) {
    return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? createConstructorDeclaration(modifiers, typeParameters, parameters, type, body) : node;
}
export function updateGetAccessorDeclaration(node, modifiers, name, typeParameters, parameters, type, body) {
    return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? createGetAccessorDeclaration(modifiers, name, typeParameters, parameters, type, body) : node;
}
export function updateSetAccessorDeclaration(node, modifiers, name, typeParameters, parameters, type, body) {
    return node.modifiers !== modifiers || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? createSetAccessorDeclaration(modifiers, name, typeParameters, parameters, type, body) : node;
}
export function updateIndexSignatureDeclaration(node, modifiers, parameters, type) {
    return node.modifiers !== modifiers || node.parameters !== parameters || node.type !== type ? createIndexSignatureDeclaration(modifiers, parameters, type) : node;
}
export function updateMethodSignatureDeclaration(node, modifiers, name, postfixToken, typeParameters, parameters, type) {
    return node.modifiers !== modifiers || node.name !== name || node.postfixToken !== postfixToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? createMethodSignatureDeclaration(modifiers, name, postfixToken, typeParameters, parameters, type) : node;
}
export function updateMethodDeclaration(node, modifiers, asteriskToken, name, postfixToken, typeParameters, parameters, type, body) {
    return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name || node.postfixToken !== postfixToken || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? createMethodDeclaration(modifiers, asteriskToken, name, postfixToken, typeParameters, parameters, type, body) : node;
}
export function updatePropertySignatureDeclaration(node, modifiers, name, postfixToken, type, initializer) {
    return node.modifiers !== modifiers || node.name !== name || node.postfixToken !== postfixToken || node.type !== type || node.initializer !== initializer ? createPropertySignatureDeclaration(modifiers, name, postfixToken, type, initializer) : node;
}
export function updatePropertyDeclaration(node, modifiers, name, postfixToken, type, initializer) {
    return node.modifiers !== modifiers || node.name !== name || node.postfixToken !== postfixToken || node.type !== type || node.initializer !== initializer ? createPropertyDeclaration(modifiers, name, postfixToken, type, initializer) : node;
}
export function updateClassStaticBlockDeclaration(node, modifiers, body) {
    return node.modifiers !== modifiers || node.body !== body ? createClassStaticBlockDeclaration(modifiers, body) : node;
}
export function updateBinaryExpression(node, modifiers, left, type, operatorToken, right) {
    return node.modifiers !== modifiers || node.left !== left || node.type !== type || node.operatorToken !== operatorToken || node.right !== right ? createBinaryExpression(modifiers, left, type, operatorToken, right) : node;
}
export function updatePrefixUnaryExpression(node, operand) {
    return node.operand !== operand ? createPrefixUnaryExpression(node.operator, operand) : node;
}
export function updatePostfixUnaryExpression(node, operand) {
    return node.operand !== operand ? createPostfixUnaryExpression(operand, node.operator) : node;
}
export function updateYieldExpression(node, asteriskToken, expression) {
    return node.asteriskToken !== asteriskToken || node.expression !== expression ? createYieldExpression(asteriskToken, expression) : node;
}
export function updateArrowFunction(node, modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) {
    return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.equalsGreaterThanToken !== equalsGreaterThanToken || node.body !== body ? createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) : node;
}
export function updateFunctionExpression(node, modifiers, asteriskToken, name, typeParameters, parameters, type, body) {
    return node.modifiers !== modifiers || node.asteriskToken !== asteriskToken || node.name !== name || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type || node.body !== body ? createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) : node;
}
export function updateAsExpression(node, expression, type) {
    return node.expression !== expression || node.type !== type ? createAsExpression(expression, type) : node;
}
export function updateSatisfiesExpression(node, expression, type) {
    return node.expression !== expression || node.type !== type ? createSatisfiesExpression(expression, type) : node;
}
export function updateConditionalExpression(node, condition, questionToken, whenTrue, colonToken, whenFalse) {
    return node.condition !== condition || node.questionToken !== questionToken || node.whenTrue !== whenTrue || node.colonToken !== colonToken || node.whenFalse !== whenFalse ? createConditionalExpression(condition, questionToken, whenTrue, colonToken, whenFalse) : node;
}
export function updatePropertyAccessExpression(node, expression, questionDotToken, name) {
    return node.expression !== expression || node.questionDotToken !== questionDotToken || node.name !== name ? createPropertyAccessExpression(expression, questionDotToken, name, node.flags) : node;
}
export function updateElementAccessExpression(node, expression, questionDotToken, argumentExpression) {
    return node.expression !== expression || node.questionDotToken !== questionDotToken || node.argumentExpression !== argumentExpression ? createElementAccessExpression(expression, questionDotToken, argumentExpression, node.flags) : node;
}
export function updateCallExpression(node, expression, questionDotToken, typeArguments, arguments_) {
    return node.expression !== expression || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.arguments !== arguments_ ? createCallExpression(expression, questionDotToken, typeArguments, arguments_, node.flags) : node;
}
export function updateNewExpression(node, expression, typeArguments, arguments_) {
    return node.expression !== expression || node.typeArguments !== typeArguments || node.arguments !== arguments_ ? createNewExpression(expression, typeArguments, arguments_) : node;
}
export function updateMetaProperty(node, name) {
    return node.name !== name ? createMetaProperty(node.keywordToken, name) : node;
}
export function updateNonNullExpression(node, expression) {
    return node.expression !== expression ? createNonNullExpression(expression, node.flags) : node;
}
export function updateSpreadElement(node, expression) {
    return node.expression !== expression ? createSpreadElement(expression) : node;
}
export function updateTemplateExpression(node, head, templateSpans) {
    return node.head !== head || node.templateSpans !== templateSpans ? createTemplateExpression(head, templateSpans) : node;
}
export function updateTemplateSpan(node, expression, literal) {
    return node.expression !== expression || node.literal !== literal ? createTemplateSpan(expression, literal) : node;
}
export function updateTaggedTemplateExpression(node, tag, questionDotToken, typeArguments, template) {
    return node.tag !== tag || node.questionDotToken !== questionDotToken || node.typeArguments !== typeArguments || node.template !== template ? createTaggedTemplateExpression(tag, questionDotToken, typeArguments, template, node.flags) : node;
}
export function updateParenthesizedExpression(node, expression) {
    return node.expression !== expression ? createParenthesizedExpression(expression) : node;
}
export function updateArrayLiteralExpression(node, elements) {
    return node.elements !== elements ? createArrayLiteralExpression(elements, node.multiLine) : node;
}
export function updateObjectLiteralExpression(node, properties) {
    return node.properties !== properties ? createObjectLiteralExpression(properties, node.multiLine) : node;
}
export function updateSpreadAssignment(node, expression) {
    return node.expression !== expression ? createSpreadAssignment(expression) : node;
}
export function updatePropertyAssignment(node, modifiers, name, postfixToken, type, initializer) {
    return node.modifiers !== modifiers || node.name !== name || node.postfixToken !== postfixToken || node.type !== type || node.initializer !== initializer ? createPropertyAssignment(modifiers, name, postfixToken, type, initializer) : node;
}
export function updateShorthandPropertyAssignment(node, modifiers, name, postfixToken, type, equalsToken, objectAssignmentInitializer) {
    return node.modifiers !== modifiers || node.name !== name || node.postfixToken !== postfixToken || node.type !== type || node.equalsToken !== equalsToken || node.objectAssignmentInitializer !== objectAssignmentInitializer ? createShorthandPropertyAssignment(modifiers, name, postfixToken, type, equalsToken, objectAssignmentInitializer) : node;
}
export function updateDeleteExpression(node, expression) {
    return node.expression !== expression ? createDeleteExpression(expression) : node;
}
export function updateTypeOfExpression(node, expression) {
    return node.expression !== expression ? createTypeOfExpression(expression) : node;
}
export function updateVoidExpression(node, expression) {
    return node.expression !== expression ? createVoidExpression(expression) : node;
}
export function updateAwaitExpression(node, expression) {
    return node.expression !== expression ? createAwaitExpression(expression) : node;
}
export function updateTypeAssertion(node, type, expression) {
    return node.type !== type || node.expression !== expression ? createTypeAssertion(type, expression) : node;
}
export function updateUnionTypeNode(node, types) {
    return node.types !== types ? createUnionTypeNode(types) : node;
}
export function updateIntersectionTypeNode(node, types) {
    return node.types !== types ? createIntersectionTypeNode(types) : node;
}
export function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) {
    return node.checkType !== checkType || node.extendsType !== extendsType || node.trueType !== trueType || node.falseType !== falseType ? createConditionalTypeNode(checkType, extendsType, trueType, falseType) : node;
}
export function updateTypeOperatorNode(node, type) {
    return node.type !== type ? createTypeOperatorNode(node.operator, type) : node;
}
export function updateInferTypeNode(node, typeParameter) {
    return node.typeParameter !== typeParameter ? createInferTypeNode(typeParameter) : node;
}
export function updateArrayTypeNode(node, elementType) {
    return node.elementType !== elementType ? createArrayTypeNode(elementType) : node;
}
export function updateIndexedAccessTypeNode(node, objectType, indexType) {
    return node.objectType !== objectType || node.indexType !== indexType ? createIndexedAccessTypeNode(objectType, indexType) : node;
}
export function updateTypeReferenceNode(node, typeName, typeArguments) {
    return node.typeName !== typeName || node.typeArguments !== typeArguments ? createTypeReferenceNode(typeName, typeArguments) : node;
}
export function updateExpressionWithTypeArguments(node, expression, typeArguments) {
    return node.expression !== expression || node.typeArguments !== typeArguments ? createExpressionWithTypeArguments(expression, typeArguments) : node;
}
export function updateLiteralTypeNode(node, literal) {
    return node.literal !== literal ? createLiteralTypeNode(literal) : node;
}
export function updateTypePredicateNode(node, assertsModifier, parameterName, type) {
    return node.assertsModifier !== assertsModifier || node.parameterName !== parameterName || node.type !== type ? createTypePredicateNode(assertsModifier, parameterName, type) : node;
}
export function updateImportAttribute(node, name, value) {
    return node.name !== name || node.value !== value ? createImportAttribute(name, value) : node;
}
export function updateImportAttributes(node, attributes) {
    return node.attributes !== attributes ? createImportAttributes(node.token, attributes, node.multiLine) : node;
}
export function updateTypeQueryNode(node, exprName, typeArguments) {
    return node.exprName !== exprName || node.typeArguments !== typeArguments ? createTypeQueryNode(exprName, typeArguments) : node;
}
export function updateMappedTypeNode(node, readonlyToken, typeParameter, nameType, questionToken, type, members) {
    return node.readonlyToken !== readonlyToken || node.typeParameter !== typeParameter || node.nameType !== nameType || node.questionToken !== questionToken || node.type !== type || node.members !== members ? createMappedTypeNode(readonlyToken, typeParameter, nameType, questionToken, type, members) : node;
}
export function updateTypeLiteralNode(node, members) {
    return node.members !== members ? createTypeLiteralNode(members) : node;
}
export function updateTupleTypeNode(node, elements) {
    return node.elements !== elements ? createTupleTypeNode(elements) : node;
}
export function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) {
    return node.dotDotDotToken !== dotDotDotToken || node.name !== name || node.questionToken !== questionToken || node.type !== type ? createNamedTupleMember(dotDotDotToken, name, questionToken, type) : node;
}
export function updateOptionalTypeNode(node, type) {
    return node.type !== type ? createOptionalTypeNode(type) : node;
}
export function updateRestTypeNode(node, type) {
    return node.type !== type ? createRestTypeNode(type) : node;
}
export function updateParenthesizedTypeNode(node, type) {
    return node.type !== type ? createParenthesizedTypeNode(type) : node;
}
export function updateFunctionTypeNode(node, typeParameters, parameters, type) {
    return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? createFunctionTypeNode(typeParameters, parameters, type) : node;
}
export function updateConstructorTypeNode(node, modifiers, typeParameters, parameters, type) {
    return node.modifiers !== modifiers || node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? createConstructorTypeNode(modifiers, typeParameters, parameters, type) : node;
}
export function updateTemplateLiteralTypeNode(node, head, templateSpans) {
    return node.head !== head || node.templateSpans !== templateSpans ? createTemplateLiteralTypeNode(head, templateSpans) : node;
}
export function updateTemplateLiteralTypeSpan(node, type, literal) {
    return node.type !== type || node.literal !== literal ? createTemplateLiteralTypeSpan(type, literal) : node;
}
export function updateSyntheticExpression(node, tupleNameSource) {
    return node.tupleNameSource !== tupleNameSource ? createSyntheticExpression(node.type, node.isSpread, tupleNameSource) : node;
}
export function updatePartiallyEmittedExpression(node, expression) {
    return node.expression !== expression ? createPartiallyEmittedExpression(expression) : node;
}
export function updateJsxElement(node, openingElement, children, closingElement) {
    return node.openingElement !== openingElement || node.children !== children || node.closingElement !== closingElement ? createJsxElement(openingElement, children, closingElement) : node;
}
export function updateJsxAttributes(node, properties) {
    return node.properties !== properties ? createJsxAttributes(properties) : node;
}
export function updateJsxNamespacedName(node, namespace, name) {
    return node.namespace !== namespace || node.name !== name ? createJsxNamespacedName(namespace, name) : node;
}
export function updateJsxOpeningElement(node, tagName, typeArguments, attributes) {
    return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? createJsxOpeningElement(tagName, typeArguments, attributes) : node;
}
export function updateJsxSelfClosingElement(node, tagName, typeArguments, attributes) {
    return node.tagName !== tagName || node.typeArguments !== typeArguments || node.attributes !== attributes ? createJsxSelfClosingElement(tagName, typeArguments, attributes) : node;
}
export function updateJsxFragment(node, openingFragment, children, closingFragment) {
    return node.openingFragment !== openingFragment || node.children !== children || node.closingFragment !== closingFragment ? createJsxFragment(openingFragment, children, closingFragment) : node;
}
export function updateJsxAttribute(node, name, initializer) {
    return node.name !== name || node.initializer !== initializer ? createJsxAttribute(name, initializer) : node;
}
export function updateJsxSpreadAttribute(node, expression) {
    return node.expression !== expression ? createJsxSpreadAttribute(expression) : node;
}
export function updateJsxClosingElement(node, tagName) {
    return node.tagName !== tagName ? createJsxClosingElement(tagName) : node;
}
export function updateJsxExpression(node, dotDotDotToken, expression) {
    return node.dotDotDotToken !== dotDotDotToken || node.expression !== expression ? createJsxExpression(dotDotDotToken, expression) : node;
}
export function updateSyntaxList(node, children) {
    return node.children !== children ? createSyntaxList(children) : node;
}
export function updateJSDoc(node, comment, tags) {
    return node.comment !== comment || node.tags !== tags ? createJSDoc(comment, tags) : node;
}
export function updateJSDocTypeExpression(node, type) {
    return node.type !== type ? createJSDocTypeExpression(type) : node;
}
export function updateJSDocNonNullableType(node, type) {
    return node.type !== type ? createJSDocNonNullableType(type) : node;
}
export function updateJSDocNullableType(node, type) {
    return node.type !== type ? createJSDocNullableType(type) : node;
}
export function updateJSDocVariadicType(node, type) {
    return node.type !== type ? createJSDocVariadicType(type) : node;
}
export function updateJSDocOptionalType(node, type) {
    return node.type !== type ? createJSDocOptionalType(type) : node;
}
export function updateJSDocTypeTag(node, tagName, typeExpression, comment) {
    return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? createJSDocTypeTag(tagName, typeExpression, comment) : node;
}
export function updateJSDocUnknownTag(node, tagName, comment) {
    return node.tagName !== tagName || node.comment !== comment ? createJSDocUnknownTag(tagName, comment) : node;
}
export function updateJSDocTemplateTag(node, tagName, constraint, typeParameters, comment) {
    return node.tagName !== tagName || node.constraint !== constraint || node.typeParameters !== typeParameters || node.comment !== comment ? createJSDocTemplateTag(tagName, constraint, typeParameters, comment) : node;
}
export function updateJSDocReturnTag(node, tagName, typeExpression, comment) {
    return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? createJSDocReturnTag(tagName, typeExpression, comment) : node;
}
export function updateJSDocPublicTag(node, tagName, comment) {
    return node.tagName !== tagName || node.comment !== comment ? createJSDocPublicTag(tagName, comment) : node;
}
export function updateJSDocPrivateTag(node, tagName, comment) {
    return node.tagName !== tagName || node.comment !== comment ? createJSDocPrivateTag(tagName, comment) : node;
}
export function updateJSDocProtectedTag(node, tagName, comment) {
    return node.tagName !== tagName || node.comment !== comment ? createJSDocProtectedTag(tagName, comment) : node;
}
export function updateJSDocReadonlyTag(node, tagName, comment) {
    return node.tagName !== tagName || node.comment !== comment ? createJSDocReadonlyTag(tagName, comment) : node;
}
export function updateJSDocOverrideTag(node, tagName, comment) {
    return node.tagName !== tagName || node.comment !== comment ? createJSDocOverrideTag(tagName, comment) : node;
}
export function updateJSDocDeprecatedTag(node, tagName, comment) {
    return node.tagName !== tagName || node.comment !== comment ? createJSDocDeprecatedTag(tagName, comment) : node;
}
export function updateJSDocSeeTag(node, tagName, nameExpression, comment) {
    return node.tagName !== tagName || node.nameExpression !== nameExpression || node.comment !== comment ? createJSDocSeeTag(tagName, nameExpression, comment) : node;
}
export function updateJSDocImplementsTag(node, tagName, className, comment) {
    return node.tagName !== tagName || node.className !== className || node.comment !== comment ? createJSDocImplementsTag(tagName, className, comment) : node;
}
export function updateJSDocAugmentsTag(node, tagName, className, comment) {
    return node.tagName !== tagName || node.className !== className || node.comment !== comment ? createJSDocAugmentsTag(tagName, className, comment) : node;
}
export function updateJSDocSatisfiesTag(node, tagName, typeExpression, comment) {
    return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? createJSDocSatisfiesTag(tagName, typeExpression, comment) : node;
}
export function updateJSDocThrowsTag(node, tagName, typeExpression, comment) {
    return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? createJSDocThrowsTag(tagName, typeExpression, comment) : node;
}
export function updateJSDocThisTag(node, tagName, typeExpression, comment) {
    return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? createJSDocThisTag(tagName, typeExpression, comment) : node;
}
export function updateJSDocImportTag(node, tagName, importClause, moduleSpecifier, attributes, comment) {
    return node.tagName !== tagName || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes || node.comment !== comment ? createJSDocImportTag(tagName, importClause, moduleSpecifier, attributes, comment) : node;
}
export function updateJSDocCallbackTag(node, tagName, typeExpression, name, comment) {
    return node.tagName !== tagName || node.typeExpression !== typeExpression || node.name !== name || node.comment !== comment ? createJSDocCallbackTag(tagName, typeExpression, name, comment) : node;
}
export function updateJSDocOverloadTag(node, tagName, typeExpression, comment) {
    return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? createJSDocOverloadTag(tagName, typeExpression, comment) : node;
}
export function updateJSDocTypedefTag(node, tagName, typeExpression, name, comment) {
    return node.tagName !== tagName || node.typeExpression !== typeExpression || node.name !== name || node.comment !== comment ? createJSDocTypedefTag(tagName, typeExpression, name, comment) : node;
}
export function updateJSDocSignature(node, typeParameters, parameters, type) {
    return node.typeParameters !== typeParameters || node.parameters !== parameters || node.type !== type ? createJSDocSignature(typeParameters, parameters, type) : node;
}
export function updateJSDocNameReference(node, name) {
    return node.name !== name ? createJSDocNameReference(name) : node;
}
export function updateModuleDeclaration(node, modifiers, name, body) {
    return node.modifiers !== modifiers || node.name !== name || node.body !== body ? createModuleDeclaration(modifiers, node.keyword, name, body) : node;
}
export function updateImportEqualsDeclaration(node, modifiers, name, moduleReference) {
    return node.modifiers !== modifiers || node.name !== name || node.moduleReference !== moduleReference ? createImportEqualsDeclaration(modifiers, node.isTypeOnly, name, moduleReference) : node;
}
export function updateExportDeclaration(node, modifiers, exportClause, moduleSpecifier, attributes) {
    return node.modifiers !== modifiers || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? createExportDeclaration(modifiers, node.isTypeOnly, exportClause, moduleSpecifier, attributes) : node;
}
export function updateImportTypeNode(node, argument, attributes, qualifier, typeArguments) {
    return node.argument !== argument || node.attributes !== attributes || node.qualifier !== qualifier || node.typeArguments !== typeArguments ? createImportTypeNode(node.isTypeOf, argument, attributes, qualifier, typeArguments) : node;
}
export function updateImportClause(node, name, namedBindings) {
    return node.name !== name || node.namedBindings !== namedBindings ? createImportClause(node.phaseModifier, name, namedBindings) : node;
}
export function updateImportSpecifier(node, propertyName, name) {
    return node.propertyName !== propertyName || node.name !== name ? createImportSpecifier(node.isTypeOnly, propertyName, name) : node;
}
export function updateJSDocLink(node, name) {
    return node.name !== name ? createJSDocLink(name, node.text) : node;
}
export function updateJSDocLinkPlain(node, name) {
    return node.name !== name ? createJSDocLinkPlain(name, node.text) : node;
}
export function updateJSDocLinkCode(node, name) {
    return node.name !== name ? createJSDocLinkCode(name, node.text) : node;
}
export function updateTypeParameterDeclaration(node, modifiers, name, constraint, expression, defaultType) {
    return node.modifiers !== modifiers || node.name !== name || node.constraint !== constraint || node.expression !== expression || node.defaultType !== defaultType ? createTypeParameterDeclaration(modifiers, name, constraint, expression, defaultType) : node;
}
export function updateSyntheticReferenceExpression(node, expression, thisArg) {
    return node.expression !== expression || node.thisArg !== thisArg ? createSyntheticReferenceExpression(expression, thisArg) : node;
}
export function updateJSDocTypeLiteral(node, jsdocPropertyTags) {
    return node.jsdocPropertyTags !== jsdocPropertyTags ? createJSDocTypeLiteral(jsdocPropertyTags, node.isArrayType) : node;
}
export function updateForInStatement(node, awaitModifier, initializer, expression, statement) {
    return node.awaitModifier !== awaitModifier || node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? createForInStatement(awaitModifier, initializer, expression, statement) : node;
}
export function updateForOfStatement(node, awaitModifier, initializer, expression, statement) {
    return node.awaitModifier !== awaitModifier || node.initializer !== initializer || node.expression !== expression || node.statement !== statement ? createForOfStatement(awaitModifier, initializer, expression, statement) : node;
}
export function updateCaseClause(node, expression, statements) {
    return node.expression !== expression || node.statements !== statements ? createCaseClause(expression, statements) : node;
}
export function updateDefaultClause(node, expression, statements) {
    return node.expression !== expression || node.statements !== statements ? createDefaultClause(expression, statements) : node;
}
export function updateObjectBindingPattern(node, elements) {
    return node.elements !== elements ? createObjectBindingPattern(elements) : node;
}
export function updateArrayBindingPattern(node, elements) {
    return node.elements !== elements ? createArrayBindingPattern(elements) : node;
}
export function updateJSDocParameterTag(node, tagName, name, typeExpression, comment) {
    return node.tagName !== tagName || node.name !== name || node.typeExpression !== typeExpression || node.comment !== comment ? createJSDocParameterTag(tagName, name, node.isBracketed, typeExpression, node.isNameFirst, comment) : node;
}
export function updateJSDocPropertyTag(node, tagName, name, typeExpression, comment) {
    return node.tagName !== tagName || node.name !== name || node.typeExpression !== typeExpression || node.comment !== comment ? createJSDocPropertyTag(tagName, name, node.isBracketed, typeExpression, node.isNameFirst, comment) : node;
}
export function createSourceFile(statements, endOfFileToken, text, fileName, path) {
    return new NodeObject(SyntaxKind.SourceFile, {
        statements: createNodeArray(statements),
        endOfFileToken,
        text,
        fileName,
        path,
    });
}
function cloneSourceFileWithChanges(source, statements, endOfFileToken) {
    return new NodeObject(SyntaxKind.SourceFile, {
        ...cloneSourceFileData(source),
        statements: createNodeArray(statements),
        endOfFileToken,
    });
}
export function updateSourceFile(node, statements, endOfFileToken) {
    return node.statements !== statements || node.endOfFileToken !== endOfFileToken
        ? cloneSourceFileWithChanges(node, statements, endOfFileToken)
        : node;
}
//# sourceMappingURL=factory.generated.js.map