function createDeclaration(tag) {
    var _a;
    const { typeExpression } = tag;
    if (!typeExpression)
      return;
    const typeName = (_a = tag.name) == null ? void 0 : _a.getText();
    if (!typeName)
      return;
    if (typeExpression.kind === 329 /* JSDocTypeLiteral */) {
      return createInterfaceForTypeLiteral(typeName, typeExpression);
    }
    if (typeExpression.kind === 316 /* JSDocTypeExpression */) {
      return createTypeAliasForTypeExpression(typeName, typeExpression);
    }
  }
${newLine} * `;
      }
    }
    changes.replaceRange(sourceFile, { pos, end }, declaration, { prefix, suffix });
  }
  function getLeftAndRightSiblings(typedefNode) {
    const commentNode = typedefNode.parent;
    const maxChildIndex = commentNode.getChildCount() - 1;
    const currentNodeIndex = commentNode.getChildren().findIndex(
      (n) => n.getStart() === typedefNode.getStart() && n.getEnd() === typedefNode.getEnd()
    );
    const leftSibling = currentNodeIndex > 0 ? commentNode.getChildAt(currentNodeIndex - 1) : void 0;
    const rightSibling = currentNodeIndex < maxChildIndex ? commentNode.getChildAt(currentNodeIndex + 1) : void 0;
    return { leftSibling, rightSibling };
  }
  function findEndOfTextBetween(jsDocComment, from, to) {
    const comment = jsDocComment.getText().substring(from - jsDocComment.getStart(), to - jsDocComment.getStart());
    for (let i = comment.length; i > 0; i--) {
      if (!/[