docs: private static TsType extractOriginalTsType(TsType type) {
          if (type instanceof TsType.OptionalType) {
              return extractOriginalTsType(((TsType.OptionalType)type).type);
          }
          if (type instanceof TsType.UnionType) {
              TsType.UnionType union = (TsType.UnionType)type;
              List<TsType> originalTypes = new ArrayList<>();
              for (TsType curType : union.types) {
                  if (isOriginalTsType(curType)) {
                      originalTypes.add(curType);
                  }
              }
              return originalTypes.size() == 1
                  ? extractOriginalTsType(originalTypes.get(0))
                  : type;
          }
          if (type instanceof TsType.BasicArrayType) {
              return extractOriginalTsType(((TsType.BasicArrayType)type).elementType);
          }
          return type;
      }