From 1755b8be532ecb946408b59cd5d6be84f4985828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 01/18] Tweak source jar generation (don't keep src/main/scala), don't write source files when not needed in plugin (fixes #118) --- .../internal/importer/Phase3Compile.scala | 74 +++++++++---------- .../importer/ScalaJsBundlerDepFile.scala | 2 +- .../importer/build/ContentForPublish.scala | 21 +----- .../internal/importer/build/SbtProject.scala | 2 +- .../converter/internal/importer/Ci.scala | 1 + .../internal/importer/ImporterHarness.scala | 3 +- .../converter/internal/Deps.scala | 2 +- .../converter/internal/ImportTypings.scala | 1 + .../converter/internal/ZincCompiler.scala | 2 - ...lablyTypedConverterExternalNpmPlugin.scala | 3 +- .../plugin/ScalablyTypedConverterPlugin.scala | 3 +- .../plugin/ScalablyTypedPluginBase.scala | 2 +- .../internal/ts/parser/TsParser.scala | 13 +++- 13 files changed, 59 insertions(+), 70 deletions(-) diff --git a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase3Compile.scala b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase3Compile.scala index c6878508d7..bb8598c068 100644 --- a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase3Compile.scala +++ b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase3Compile.scala @@ -13,7 +13,6 @@ import org.scalablytyped.converter.internal.scalajs._ import org.scalablytyped.converter.internal.scalajs.flavours.FlavourImpl import org.scalablytyped.converter.internal.sets.SetOps import org.scalablytyped.converter.internal.ts.TsIdentLibrary -import os.RelPath import scala.collection.immutable.SortedSet import scala.concurrent.Await @@ -36,6 +35,7 @@ class Phase3Compile( softWrites: Boolean, flavour: FlavourImpl, generateScalaJsBundlerFile: Boolean, + ensureSourceFilesWritten: Boolean, ) extends Phase[Source, Phase2Res, PublishedSbtProject] { val ScalaFiles: PartialFunction[(os.RelPath, Array[Byte]), Array[Byte]] = { @@ -85,9 +85,7 @@ class Phase3Compile( require(sourceFilesBase.nonEmpty, "no files found") val sourceFiles: Map[os.RelPath, Array[Byte]] = - sourceFilesBase mapValues { - case (bytes, _) => bytes - } + sourceFilesBase mapValues { case (bytes, _) => bytes } val newestChange: Instant = sourceFilesBase.foldLeft(Instant.MIN) { @@ -95,7 +93,8 @@ class Phase3Compile( if (acc isBefore instant) instant else acc } - val metadataOpt = None + val externalDeps: Set[Dep] = buildJson.dependencies ++ flavour.dependencies + val sbtLayout = ContentSbtProject( v = versions, comments = NoComments, @@ -104,25 +103,25 @@ class Phase3Compile( version = VersionHack.TemplateValue, publishUser = publishUser, localDeps = IArray.fromTraversable(deps.values), - deps = buildJson.dependencies.map(identity), + deps = externalDeps, scalaFiles = sourceFiles, resources = Map(), projectName = projectName, - metadataOpt = metadataOpt, + metadataOpt = None, declaredVersion = None, ) go( logger = logger, deps = deps, - externalDeps = buildJson.dependencies ++ flavour.dependencies, + externalDeps = externalDeps, source = source, name = source.libName.value, sbtLayout = sbtLayout, compilerPaths = CompilerPaths(versions, source.path), deleteUnknownFiles = false, makeVersion = digest => s"${constants.DateTimePattern.format(newestChange)}-${digest.hexString.take(6)}", - metadataOpt = metadataOpt, + metadataOpt = None, ) } @@ -144,9 +143,8 @@ class Phase3Compile( val compilerPaths = CompilerPaths.of(versions, targetFolder, lib.libName) val externalDeps = flavour.dependencies - val resources: Map[RelPath, Array[Byte]] = - if (generateScalaJsBundlerFile) - ScalaJsBundlerDepFile(compilerPaths.classesDir, lib.source.libName, lib.libVersion) + val resources: Map[os.RelPath, Array[Byte]] = + if (generateScalaJsBundlerFile) ScalaJsBundlerDepFile(lib.source.libName, lib.libVersion) else Map() val sbtLayout = ContentSbtProject( @@ -197,8 +195,10 @@ class Phase3Compile( val digest = Digest.of(sbtLayout.all collect ScalaFiles) val finalVersion = makeVersion(digest) val allFilesProperVersion = VersionHack.templateVersion(sbtLayout, finalVersion) - //Next line is that actually spits out files - files.sync(allFilesProperVersion.all, compilerPaths.baseDir, deleteUnknownFiles, softWrites) + + if (ensureSourceFilesWritten) { + files.sync(allFilesProperVersion.all, compilerPaths.baseDir, deleteUnknownFiles, softWrites) + } val reference = Dep.ScalaJs(organization, name, finalVersion) @@ -208,11 +208,10 @@ class Phase3Compile( reference, )(compilerPaths.baseDir, deps, metadataOpt) - val existing: IvyLayout[os.Path, Synced] = - IvyLayout[Synced](sbtProject, Synced.Unchanged, Synced.Unchanged, Synced.Unchanged, Synced.Unchanged) - .mapFiles(publishFolder / _) + val existing: IvyLayout[os.Path, Unit] = + IvyLayout(sbtProject, (), (), (), ()).mapFiles(publishFolder / _) - val jarFile = existing.jarFile._1 + val jarFile = existing.jarFile._1 val lockFile = jarFile / os.up / ".lock" FileLocking.withLock(lockFile.toNIO) { _ => @@ -220,11 +219,11 @@ class Phase3Compile( logger warn s"Using cached build $jarFile" PhaseRes.Ok(PublishedSbtProject(sbtProject)(compilerPaths.classesDir, existing, None)) } else { - { - implicit val wd = os.home - % rm ("-Rf", compilerPaths.classesDir) - } + remove(compilerPaths.classesDir) os.makeDir.all(compilerPaths.classesDir) + if (!ensureSourceFilesWritten) { + files.sync(allFilesProperVersion.all, compilerPaths.baseDir, deleteUnknownFiles, softWrites) + } val jarDeps: Set[Compiler.InternalDep] = deps.values.to[Set].map(x => Compiler.InternalDepJar(x.localIvyFiles.jarFile._1)) @@ -238,20 +237,16 @@ class Phase3Compile( compiler.compile(name, digest, compilerPaths, jarDeps, externalDeps) match { case Right(()) => val writtenIvyFiles: IvyLayout[os.Path, Synced] = - build - .ContentForPublish( - versions, - compilerPaths, - sbtProject, - ZonedDateTime.now(), - allFilesProperVersion, - externalDeps, - ) - .mapFiles(p => publishFolder / p) - .mapValues(files.softWriteBytes) + ContentForPublish( + versions, + compilerPaths, + sbtProject, + ZonedDateTime.now(), + externalDeps, + ).mapFiles(p => publishFolder / p).mapValues(files.softWriteBytes) val elapsed = System.currentTimeMillis - t0 - logger warn s"Built ${jarFile} in $elapsed ms" + logger warn s"Built $jarFile in $elapsed ms" PhaseRes.Ok(PublishedSbtProject(sbtProject)(compilerPaths.classesDir, writtenIvyFiles, None)) @@ -260,13 +255,16 @@ class Phase3Compile( PhaseRes.Failure(Map(source -> Right(s"Compilation failed"))) } - { - implicit val wd = os.home - % rm ("-Rf", compilerPaths.targetDir) - } + remove(compilerPaths.targetDir) ret } } } + + /* don't use `os.remove` as it's much slower */ + def remove(p: os.Path): Unit = { + implicit val wd = os.home + % rm ("-Rf", p) + } } diff --git a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ScalaJsBundlerDepFile.scala b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ScalaJsBundlerDepFile.scala index 867fed4441..259ffc92d9 100644 --- a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ScalaJsBundlerDepFile.scala +++ b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ScalaJsBundlerDepFile.scala @@ -25,7 +25,7 @@ object ScalaJsBundlerDepFile { implicit val Decoder: Decoder[NpmDependencies] = deriveDecoder[NpmDependencies] } - def apply(dir: os.Path, libName: TsIdentLibrary, v: LibraryVersion): Map[os.RelPath, Array[Byte]] = + def apply(libName: TsIdentLibrary, v: LibraryVersion): Map[os.RelPath, Array[Byte]] = (v.libraryVersion, v.inGit) match { case (Some(version), None) if libName =/= ts.TsIdent.std => val deps = List(Map(libName.value -> version)) diff --git a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/build/ContentForPublish.scala b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/build/ContentForPublish.scala index 22bb1981e5..c283dd0dc6 100644 --- a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/build/ContentForPublish.scala +++ b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/build/ContentForPublish.scala @@ -17,13 +17,12 @@ object ContentForPublish { paths: CompilerPaths, p: SbtProject, publication: ZonedDateTime, - sourceFiles: Layout[os.RelPath, Array[Byte]], externalDeps: Set[Dep], ): IvyLayout[os.RelPath, Array[Byte]] = IvyLayout( p = p, jarFile = createJar(publication)(paths.classesDir), - sourceFile = createJar(sourceFiles, publication), + sourceFile = createJar(publication)(paths.sourcesDir), ivyFile = fromXml(ivy(v, p, publication, externalDeps)), pomFile = fromXml(pom(v, p, externalDeps)), ) @@ -65,24 +64,6 @@ object ContentForPublish { baos.toByteArray } - def createJar(sourceFiles: Layout[os.RelPath, Array[Byte]], publication: ZonedDateTime): Array[Byte] = { - val baos = new ByteArrayOutputStream(1024 * 1024) - val jar = new JarOutputStream(baos, createManifest()) - - try { - sourceFiles.all.foreach { - case (relFile, contents) => - val entry = new JarEntry(relFile.toString) - entry.setTime(publication.toEpochSecond) - jar.putNextEntry(entry) - jar.write(contents) - jar.closeEntry() - } - } finally jar.close() - - baos.toByteArray - } - def ivy(v: Versions, p: SbtProject, publication: ZonedDateTime, externalDeps: Set[Dep]): Elem = { val artifactName = p.reference.mangledArtifact(v) diff --git a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/build/SbtProject.scala b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/build/SbtProject.scala index dc8e1166c9..5c0f2d4184 100644 --- a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/build/SbtProject.scala +++ b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/build/SbtProject.scala @@ -17,7 +17,7 @@ case class SbtProject(name: String, artifactId: String, reference: Dep.ScalaJs)( case class PublishedSbtProject(project: SbtProject)( val classfileDir: os.Path, - val localIvyFiles: IvyLayout[os.Path, Synced], + val localIvyFiles: IvyLayout[os.Path, _], val publishedOpt: Option[Unit], ) diff --git a/importer/src/main/scala/org/scalablytyped/converter/internal/importer/Ci.scala b/importer/src/main/scala/org/scalablytyped/converter/internal/importer/Ci.scala index 2ebfd2b8c0..7e83f22ee6 100644 --- a/importer/src/main/scala/org/scalablytyped/converter/internal/importer/Ci.scala +++ b/importer/src/main/scala/org/scalablytyped/converter/internal/importer/Ci.scala @@ -353,6 +353,7 @@ class Ci(config: Ci.Config, paths: Ci.Paths) { softWrites = config.softWrites, flavour = flavour, generateScalaJsBundlerFile = true, + ensureSourceFilesWritten = true, ), "build", ) diff --git a/importer/src/test/scala/org/scalablytyped/converter/internal/importer/ImporterHarness.scala b/importer/src/test/scala/org/scalablytyped/converter/internal/importer/ImporterHarness.scala index 7ee59fc3fd..282129dde4 100644 --- a/importer/src/test/scala/org/scalablytyped/converter/internal/importer/ImporterHarness.scala +++ b/importer/src/test/scala/org/scalablytyped/converter/internal/importer/ImporterHarness.scala @@ -83,9 +83,10 @@ trait ImporterHarness extends AnyFunSuite { publishUser = "oyvindberg", publishFolder = publishFolder, metadataFetcher = Npmjs.No, - softWrites = false, + softWrites = true, flavour = flavour, generateScalaJsBundlerFile = true, + ensureSourceFilesWritten = true, ), "build", ) diff --git a/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/Deps.scala b/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/Deps.scala index 368a9f3186..353e1791dd 100644 --- a/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/Deps.scala +++ b/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/Deps.scala @@ -1,4 +1,4 @@ -package scala.org.scalablytyped.converter.internal +package org.scalablytyped.converter.internal import org.scalablytyped.converter.internal.scalajs.{Dep, Versions} import sbt.librarymanagement.ModuleID diff --git a/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/ImportTypings.scala b/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/ImportTypings.scala index 1beffd46fc..495e6f7930 100644 --- a/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/ImportTypings.scala +++ b/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/ImportTypings.scala @@ -98,6 +98,7 @@ object ImportTypings { resolve = fromNodeModules.libraryResolver, softWrites = true, generateScalaJsBundlerFile = false, + ensureSourceFilesWritten = false, ), "build", ) diff --git a/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/ZincCompiler.scala b/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/ZincCompiler.scala index 6f670a8e83..10d9bd86f5 100644 --- a/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/ZincCompiler.scala +++ b/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/ZincCompiler.scala @@ -19,8 +19,6 @@ import sbt.librarymanagement.DependencyResolution import xsbti.CompileFailed import xsbti.compile.{CompileOrder => _, _} -import scala.org.scalablytyped.converter.internal.Deps - class ZincCompiler(inputs: Inputs, logger: Logger[Unit], versions: Versions, resolve: Dep => Array[File]) extends Compiler { private lazy val incCompiler: IncrementalCompiler = ZincUtil.defaultIncrementalCompiler diff --git a/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterExternalNpmPlugin.scala b/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterExternalNpmPlugin.scala index 90caef9c55..aca60d3b6b 100644 --- a/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterExternalNpmPlugin.scala +++ b/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterExternalNpmPlugin.scala @@ -9,11 +9,10 @@ import org.scalablytyped.converter.internal.importer.jsonCodecs.PackageJsonDepsD import org.scalablytyped.converter.internal.importer.{Json, SharedInput} import org.scalablytyped.converter.internal.scalajs.{Dep, Name, Versions} import org.scalablytyped.converter.internal.ts.{PackageJsonDeps, TsIdentLibrary} -import org.scalablytyped.converter.internal.{BuildInfo, Digest, IArray, ImportTypings, InFolder, WrapSbtLogger} +import org.scalablytyped.converter.internal.{BuildInfo, Deps, Digest, IArray, ImportTypings, InFolder, WrapSbtLogger} import sbt.Keys._ import sbt._ -import scala.org.scalablytyped.converter.internal.Deps import scala.util.Try object ScalablyTypedConverterExternalNpmPlugin extends AutoPlugin { diff --git a/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterPlugin.scala b/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterPlugin.scala index d4ac13f2f3..96ef35ff38 100644 --- a/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterPlugin.scala +++ b/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterPlugin.scala @@ -9,12 +9,11 @@ import com.olvind.logging.{Formatter, LogLevel} import org.scalablytyped.converter.internal.importer.{Json, SharedInput} import org.scalablytyped.converter.internal.scalajs.{Name, Versions} import org.scalablytyped.converter.internal.ts.TsIdentLibrary -import org.scalablytyped.converter.internal.{BuildInfo, Digest, IArray, ImportTypings, InFolder, WrapSbtLogger} +import org.scalablytyped.converter.internal.{BuildInfo, Deps, Digest, IArray, ImportTypings, InFolder, WrapSbtLogger} import sbt.Keys._ import sbt._ import scalajsbundler.sbtplugin.{NpmUpdateTasks, PackageJsonTasks, ScalaJSBundlerPlugin} -import scala.org.scalablytyped.converter.internal.Deps import scala.util.Try object ScalablyTypedConverterPlugin extends AutoPlugin { diff --git a/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedPluginBase.scala b/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedPluginBase.scala index 4f317924a3..ea310be5ea 100644 --- a/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedPluginBase.scala +++ b/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedPluginBase.scala @@ -5,7 +5,7 @@ import java.io.File import org.portablescala.sbtplatformdeps.PlatformDepsPlugin import org.scalablytyped.converter import org.scalablytyped.converter.internal.importer.EnabledTypeMappingExpansion -import org.scalablytyped.converter.internal.{ZincCompiler, constants} +import org.scalablytyped.converter.internal.{constants, ZincCompiler} import sbt.Tags.Tag import sbt._ import sbt.librarymanagement.ModuleID diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/parser/TsParser.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/parser/TsParser.scala index f3ea952f92..34c1a46c95 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/parser/TsParser.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/parser/TsParser.scala @@ -338,7 +338,18 @@ class TsParser(path: Option[(os.Path, Int)]) extends StdTokenParsers with Parser comments ~ isDeclared ~ (isAbstract <~ "class") ~ (hack.? ~ tsTypeParams).? ~ parent ~ implements ~ tsMembers ^^ { case cs ~ decl ~ abs ~ Some(ident ~ tparams) ~ par ~ impl ~ members => - TsDeclClass(cs, decl, abs, ident.getOrElse(TsIdent.default), tparams, par, impl, members, JsLocation.Zero, CodePath.NoPath) + TsDeclClass( + cs, + decl, + abs, + ident.getOrElse(TsIdent.default), + tparams, + par, + impl, + members, + JsLocation.Zero, + CodePath.NoPath, + ) case cs ~ decl ~ abs ~ None ~ par ~ impl ~ members => TsDeclClass(cs, decl, abs, TsIdent.default, Empty, par, impl, members, JsLocation.Zero, CodePath.NoPath) } From 1171fcd694b8c6f88a11f7f7c34b4d91ad463be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 02/18] Improve parser: - Support for the longhand assert is ... types - Better support for expressions. Parenthesis and bitshift operators both didnt really work well. It's still the bare minimum we can get away with - Now parses 100% of DT :) - Handle tuples with rest types which are not directly arrays - Handle `-readonly` in type mappings --- .../internal/importer/ImportType.scala | 45 ++++---- .../internal/ts/parser/LexerTests.scala | 13 +++ .../internal/ts/parser/ParserTests.scala | 105 +++++++++++++++--- .../internal/ts/parser/SuchTestMuchFail.scala | 4 +- .../internal/ts/parser/TypeExpansion.scala | 12 ++ .../internal/ts/TreeTransformation.scala | 3 +- .../internal/ts/TsTypeFormatter.scala | 10 +- .../internal/ts/parser/TsLexer.scala | 26 +---- .../internal/ts/parser/TsParser.scala | 65 +++++++---- .../ts/transforms/ExpandTypeMappings.scala | 4 +- .../converter/internal/ts/trees.scala | 30 +++-- 11 files changed, 220 insertions(+), 97 deletions(-) diff --git a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ImportType.scala b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ImportType.scala index 2820c6965c..96f6788fee 100644 --- a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ImportType.scala +++ b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ImportType.scala @@ -205,15 +205,27 @@ class ImportType(stdNames: QualifiedName.StdNames) { case TsTypeKeyOf(_) => TypeRef.String - case TsTypeTuple(StrippedRepeat(targs)) => - TypeRef( - QualifiedName.Array, - IArray(TypeRef.Union(targs map apply(wildcards.maybeAllow, scope, importName), false)), - NoComments, - ) - case TsTypeTuple(targs) => - TypeRef.Tuple(targs map apply(wildcards.maybeAllow, scope, importName)) + targs match { + case IArray.initLast(init, TsTypeRepeated(repeated)) => + ts.FollowAliases(scope)(repeated) match { + case TsTypeRef( + _, + TsQIdent.Std.Array | TsQIdent.Std.ReadonlyArray | TsQIdent.Array | TsQIdent.ReadonlyArray, + IArray.exactlyOne(elem), + ) => + TypeRef( + importName(TsQIdent.Array), + IArray(apply(wildcards, scope, importName)(TsTypeUnion(init :+ elem))).distinct, + NoComments, + ) + case other => + val c = Comment.warning(s"repeated non-array type: ${TsTypeFormatter(other)}") + TypeRef(importName(TsQIdent.Array), Empty, Comments(c)) + } + case nonRepeating => + TypeRef.Tuple(nonRepeating map apply(wildcards.maybeAllow, scope, importName)) + } case TsTypeRepeated(underlying) => TypeRef.Repeated(apply(wildcards, scope, importName)(underlying), NoComments) @@ -226,8 +238,8 @@ class ImportType(stdNames: QualifiedName.StdNames) { TypeRef.Boolean } - case TsTypeAsserts(ident) => - TypeRef.Boolean.withComments(Comments(s"/* asserts ${ident.value} */")) + case TsTypeAsserts(ident, isOpt) => + TypeRef.Boolean.withComments(Comments(s"/* asserts ${ident.value} ${isOpt.fold("")("is " + _)}*/")) case TsTypeLiteral(lit) => lit match { @@ -301,17 +313,4 @@ class ImportType(stdNames: QualifiedName.StdNames) { orAny(wildcards, scope / param, importName)(param.tpe) withOptional param.isOptional withComments Comments( s"/* ${param.name.value} */", ) - - private object StrippedRepeat { - def unapply(types: IArray[TsType]): Option[IArray[TsType]] = { - var found = false - val ret = types.map { - case TsTypeRepeated(x) => - found = true - x - case other => other - } - if (found) Some(ret) else None - } - } } diff --git a/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/LexerTests.scala b/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/LexerTests.scala index 9743f788d1..dd0a564c16 100644 --- a/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/LexerTests.scala +++ b/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/LexerTests.scala @@ -19,9 +19,22 @@ final class LexerTests extends AnyFunSuite with Matchers { TsLexer.CommentLineToken("//A\n"), ) } + test("string literal") { shouldParseAs("`a`", TsLexer.stringLiteral)( TsLexer.StringLit("a"), ) } + + test("-readonly") { + shouldParseAs("-readonly", TsLexer.token)( + TsLexer.Keyword("-readonly"), + ) + } + + test("...") { + shouldParseAs("...", TsLexer.token)( + TsLexer.Keyword("..."), + ) + } } diff --git a/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/ParserTests.scala b/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/ParserTests.scala index cad31399eb..c9e2c796c2 100644 --- a/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/ParserTests.scala +++ b/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/ParserTests.scala @@ -1202,7 +1202,7 @@ final class ParserTests extends AnyFunSuite { TsMemberTypeMapped( NoComments, level = ProtectionLevel.Default, - isReadOnly = false, + readonly = ReadonlyModifier.Noop, key = TsIdent("P"), from = TsTypeKeyOf(TsTypeRef(NoComments, TsQIdent.of("T"), Empty)), optionalize = OptionalModifier.Optionalize, @@ -1239,7 +1239,7 @@ final class ParserTests extends AnyFunSuite { TsMemberTypeMapped( comments = NoComments, level = ProtectionLevel.Default, - isReadOnly = false, + readonly = ReadonlyModifier.Noop, key = TsIdent("P"), from = TsTypeRef(NoComments, TsQIdent.of("K"), Empty), optionalize = OptionalModifier.Noop, @@ -1268,7 +1268,7 @@ final class ParserTests extends AnyFunSuite { TsMemberTypeMapped( NoComments, level = ProtectionLevel.Default, - isReadOnly = false, + readonly = ReadonlyModifier.Noop, key = TsIdent("P"), from = TsTypeKeyOf(T), optionalize = OptionalModifier.Noop, @@ -1337,7 +1337,7 @@ type Readonly = { TsMemberTypeMapped( comments = NoComments, level = ProtectionLevel.Default, - isReadOnly = true, + readonly = ReadonlyModifier.Yes, key = TsIdentSimple("P"), from = TsTypeKeyOf(T), optionalize = Noop, @@ -2142,7 +2142,7 @@ type Readonly = { TsMemberTypeMapped( NoComments, ProtectionLevel.Default, - isReadOnly = false, + ReadonlyModifier.Noop, TsIdentSimple("P"), TsTypeKeyOf(T), OptionalModifier.Deoptionalize, @@ -2349,7 +2349,7 @@ type Readonly = { IArray( TsTypeRef(NoComments, TsQIdent.number, Empty), TsTypeRef(NoComments, TsQIdent.number, Empty), - TsTypeRepeated(TsTypeRef(NoComments, TsQIdent.of("T"), Empty)), + TsTypeRepeated(TsTypeRef(NoComments, TsQIdent.Array, IArray(TsTypeRef(NoComments, TsQIdent.of("T"), Empty)))), ), ), ) @@ -2516,7 +2516,7 @@ export {}; TsMemberTypeMapped( NoComments, ProtectionLevel.Default, - isReadOnly = false, + ReadonlyModifier.Noop, TsIdentSimple("key"), T, OptionalModifier.Optionalize, @@ -2525,12 +2525,74 @@ export {}; ) } + test("-readonly") { + shouldParseAs("""{-readonly [P in keyof T]: number}""", TsParser.tsMembers)( + IArray( + TsMemberTypeMapped( + NoComments, + ProtectionLevel.Default, + ReadonlyModifier.No, + TsIdentSimple("P"), + TsTypeKeyOf(T), + Noop, + TsTypeRef.number, + ), + ), + ) + } + test("asserts types") { shouldParseAs("""asserts assertion""", TsParser.tsType)( - TsTypeAsserts(TsIdent("assertion")), + TsTypeAsserts(TsIdent("assertion"), None), + ) + shouldParseAs("""asserts actual is T""".stripMargin, TsParser.tsType)(TsTypeAsserts(TsIdent("actual"), Some(T))) + } + + test("[string, ...PrimitiveArray]") { + shouldParseAs("""[string, ...PrimitiveArray]""", TsParser.tsTypeTuple)( + TsTypeTuple(IArray(TsTypeRef.string, TsTypeRepeated(TsTypeRef.of(TsIdentSimple("PrimitiveArray"))))), + ) + } + + test("expr with parents") { + shouldParseAs("""(1 << 2)""", TsParser.expr)( + TsExpr.BinaryOp(TsExpr.Literal(TsLiteralNumber("1")), "<<", TsExpr.Literal(TsLiteralNumber("2"))), ) } + test("stray ;") { + shouldParseAs( + """|class A { + | ; + | public operator: string + |}""".stripMargin, + TsParser.tsDecl, + )( + TsDeclClass( + NoComments, + declared = false, + isAbstract = false, + TsIdentSimple("A"), + IArray(), + None, + IArray(), + IArray( + TsMemberProperty( + NoComments, + ProtectionLevel.Default, + TsIdentSimple("operator"), + Some(TsTypeRef(NoComments, TsQIdent.string, IArray())), + None, + isStatic = false, + isReadOnly = false, + isOptional = false, + ), + ), + Zero, + CodePath.NoPath, + ), + ) + } test("expr") { shouldParseAs( """export declare const start = ActionTypes.Start""", @@ -2574,7 +2636,7 @@ export {}; TsExpr.Ref(TsTypeRef(NoComments, TsQIdent(IArray(TsIdentSimple("WARNING"))), Empty)), ), ) - shouldParseAs("""(LoggingLevel.ERROR)(6 + 7)""", TsParser.expr)( + shouldParseAs("""LoggingLevel.ERROR(6 + 7)""", TsParser.expr)( TsExpr.Call( TsExpr.Ref( TsTypeRef(NoComments, TsQIdent(IArray(TsIdentSimple("LoggingLevel"), TsIdentSimple("ERROR"))), Empty), @@ -2603,10 +2665,27 @@ export {}; ), ) - shouldParseAs("""1e-7""", TsParser.expr)(TsExpr.Literal(TsLiteralNumber("1e-7"))) + shouldParseAs("""1e-7""", TsParser.expr)( + TsExpr.Literal(TsLiteralNumber("1e-7")), + ) + + shouldParseAs("""(0x000FFFF2 + 2)""", TsParser.expr)( + TsExpr.BinaryOp(TsExpr.Literal(TsLiteralNumber("0x000FFFF2")), "+", TsExpr.Literal(TsLiteralNumber("2"))), + ) + shouldParseAs("""(4)""", TsParser.expr)( + TsExpr.Literal(TsLiteralNumber("4")), + ) -// shouldParseAs("""(0x000FFFFF + 1) >> 1""", TsParser.expr)( -// null -// ) + shouldParseAs("""(4) >> 2""", TsParser.expr)( + TsExpr.BinaryOp(TsExpr.Literal(TsLiteralNumber("4")), ">>", TsExpr.Literal(TsLiteralNumber("2"))), + ) + + shouldParseAs("""(0x000FFFFF + 1) >> 2""", TsParser.expr)( + TsExpr.BinaryOp( + TsExpr.BinaryOp(TsExpr.Literal(TsLiteralNumber("0x000FFFFF")), "+", TsExpr.Literal(TsLiteralNumber("1"))), + ">>", + TsExpr.Literal(TsLiteralNumber("2")), + ), + ) } } diff --git a/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/SuchTestMuchFail.scala b/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/SuchTestMuchFail.scala index 701052fcd6..02528f404e 100644 --- a/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/SuchTestMuchFail.scala +++ b/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/SuchTestMuchFail.scala @@ -16,7 +16,7 @@ object SuchTestMuchFail extends App { DTUpToDate(new Cmd(logger, None), args.contains("-offline"), defaultCacheFolder, constants.DefinitelyTypedRepo) val criterion: Double = - 99.5 + 100.0 def banner(): Unit = println(s"\n${"*" * 80}\n") @@ -34,7 +34,7 @@ object SuchTestMuchFail extends App { .filter(_.toString.endsWith(".d.ts")) .toSeq - val parser = PersistingParser(Some(parseTempFolder.toNIO), IArray(dtFolder), logger.void) + val parser = PersistingParser(None, IArray(dtFolder), logger.void) val parsed: Seq[(os.Path, Either[String, TsParsedFile])] = allFiles.par.map { path: os.Path => diff --git a/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansion.scala b/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansion.scala index cd00441495..af4b594eb9 100644 --- a/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansion.scala +++ b/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansion.scala @@ -48,4 +48,16 @@ type AA = Partial out.alias.shouldBe(TsTypeUnion(IArray("c", "d", "e", "f").map(str => TsTypeLiteral(TsLiteralString(str))))) } + + test("Except from union type") { + pending + val out = run(s""" +type Exclude = T extends U ? never : T; +export declare type PanelMode = 'time' | 'date' | 'week' | 'month' | 'year' | 'decade'; +export declare type PickerMode = Exclude; +""").extract[TsDeclTypeAlias]("PickerMode") + + val Out = IArray("time", "date", "week", "month", "year").map(x => TsTypeLiteral(TsLiteralString(x))) + out.alias.shouldBe(TsTypeUnion(Out)) + } } diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/TreeTransformation.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/TreeTransformation.scala index 7d1d098bc0..7683dc82e8 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/TreeTransformation.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/TreeTransformation.scala @@ -342,8 +342,9 @@ trait TreeTransformation[T] { self => final def visitTsTypeAsserts(t: T)(x: TsTypeAsserts): TsTypeAsserts = { val xx = enterTsTypeAsserts(withTree(t, x))(x) + val tt = withTree(t, xx) xx match { - case TsTypeAsserts(_1) => TsTypeAsserts(_1) + case TsTypeAsserts(_1, _2) => TsTypeAsserts(_1, _2 map visitTsTypeRef(tt)) } } diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/TsTypeFormatter.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/TsTypeFormatter.scala index c751b1b83e..599b47237f 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/TsTypeFormatter.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/TsTypeFormatter.scala @@ -81,10 +81,14 @@ object TsTypeFormatter { valueType.map(tpe => s": ${apply(tpe)}"), ).flatten.mkString(" ").replaceAllLiterally(" ?", "?") - case TsMemberTypeMapped(_, l, isReadOnly, key, from, optionalize, to) => + case TsMemberTypeMapped(_, l, readonly, key, from, optionalize, to) => List[Option[String]]( level(l), - if (isReadOnly) Some("readonly") else None, + readonly match { + case ReadonlyModifier.Noop => None + case ReadonlyModifier.Yes => Some("readonly") + case ReadonlyModifier.No => Some("-readonly") + }, Some("["), Some(key.value), Some("in"), @@ -121,7 +125,7 @@ object TsTypeFormatter { case TsTypeKeyOf(key) => s"keyof ${apply(key)}" case TsTypeLookup(from, key) => s"${apply(from)}[${apply(key)}]" case TsTypeThis() => "this" - case TsTypeAsserts(ident) => "asserts " + ident.value + case TsTypeAsserts(ident, isOpt) => "asserts " + ident.value + isOpt.fold("")("is " + _) case TsTypeUnion(types) => types map apply mkString " | " case TsTypeIntersect(types) => types map apply mkString " & " case TsTypeConditional(pred, ifTrue, ifFalse) => s"${apply(pred)} ? ${apply(ifTrue)} : ${apply(ifFalse)}" diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/parser/TsLexer.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/parser/TsLexer.scala index ae142bdfe0..455373c360 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/parser/TsLexer.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/parser/TsLexer.scala @@ -99,7 +99,7 @@ object TsLexer extends Lexical with StdTokens with ParserHelpers with ImplicitCo val decimal = stringOf1(digit | '.' | '-' | 'e') <~ 'n'.? ^^ NumericLit // yeah yeah, good enough for us - hexNumericLiteral | decimal + hexNumericLiteral | decimal.filter(_.chars.exists(_.isDigit)) } val stringLiteral: Parser[StringLit] = { @@ -125,33 +125,15 @@ object TsLexer extends Lexical with StdTokens with ParserHelpers with ImplicitCo // format: off val delimiters = List( "{", "}", "(", ")", "[", "]", "<", ">", - ".", ";", ",", "?", ":", "=", "|", "&", "*", + ".", ";", ",", "?", ":", "=", "|", "&", "*", "+", "-", "^", "/", "%", // TypeScript-specific - "...", "=>", "-?", "+?", + "...", "=>", "-?", "+?", "-readonly", ) // format: on (delimiters.sortBy(_.length) map parseDelim) .foldRight(failure("no matching delimiter"): Parser[Keyword])((x, y) => y | x) } - val ops = List("+", "-", "^", "|", "*", "/", "%", "as", "<<", ">>") - - val operators: Parser[Keyword] = { - /* construct parser for delimiters by |'ing together the parsers for the - * individual delimiters, starting with the longest one -- otherwise a - * delimiter D will never be matched if there is another delimiter that is - * a prefix of D - */ - def parse(s: String): Parser[Keyword] = - accept(s.toList) ^^ (_ => Keyword(s)) - - /** The set of delimiters (ordering does not matter) */ - // format: off - // format: on - (ops.sortBy(_.length) map parse) - .foldRight(failure("no matching operator"): Parser[Keyword])((x, y) => y | x) - } - private val newLine: Parser[Char] = ('\r'.? ~ '\n') ^^ (_ => '\n') @@ -210,7 +192,7 @@ object TsLexer extends Lexical with StdTokens with ParserHelpers with ImplicitCo } override val token: Parser[Token] = { - val base = identifier | directive | comment | delim | numericLiteral | stringLiteral | operators | shebang | EofCh ^^^ EOF + val base = identifier | directive | comment | numericLiteral | stringLiteral | delim | shebang | EofCh ^^^ EOF val ignore = (newLine | whitespaceChar).* diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/parser/TsParser.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/parser/TsParser.scala index 34c1a46c95..e655e197c8 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/parser/TsParser.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/parser/TsParser.scala @@ -19,7 +19,7 @@ class TsParser(path: Option[(os.Path, Int)]) extends StdTokenParsers with Parser override val lexical: TsLexer.type = TsLexer protected def perhapsParens[T](p: Parser[T]): Parser[T] = - p | Parser("(") ~> p <~ ")" + p | ("(" ~> p <~ ")") /** enable direct use of parsers with strings **/ implicit def FromString[T](p: Parser[T]): String => ParseResult[T] = @@ -70,12 +70,16 @@ class TsParser(path: Option[(os.Path, Int)]) extends StdTokenParsers with Parser }, ) - val operator: Parser[String] = - accept( - "Operator", { - case lexical.Keyword(chars) if lexical.ops.contains(chars) => chars - }, - ) + val operator: Parser[String] = { + val ops = List("+", "-", "^", "|", "*", "/", "%", "as") + + /* handle specially, since they will occur as two separate tokens */ + val `<<` = "<" ~> "<" ^^ (_ => "<<") + val `>>` = ">" ~> ">" ^^ (_ => ">>") + val other = accept("Operator", { case lexical.Keyword(chars) if ops contains chars => chars }) + + `<<` | `>>` | other + } val comment: Parser[Comment] = accept( @@ -424,16 +428,20 @@ class TsParser(path: Option[(os.Path, Int)]) extends StdTokenParsers with Parser typeAnnotation.? lazy val expr: Parser[TsExpr] = { - lazy val lit: Parser[TsExpr.Literal] = tsLiteral ^^ TsExpr.Literal - lazy val ref: Parser[TsExpr.Ref] = ("{}" ^^ (_ => TsTypeRef.Object) | tsTypeRef) ^^ TsExpr.Ref - lazy val call: Parser[TsExpr.Call] = ref ~ ("(" ~> repsep(expr, ",") <~ ")") ^^ TsExpr.Call - lazy val unary: Parser[TsExpr.Unary] = (operator ~ expr) ^^ TsExpr.Unary - lazy val base: Parser[TsExpr] = perhapsParens(lit | call | unary | ref) + val lit: Parser[TsExpr.Literal] = tsLiteral ^^ TsExpr.Literal + val ref: Parser[TsExpr.Ref] = tsTypeRefNoParens ^^ TsExpr.Ref + val call: Parser[TsExpr.Call] = ref ~ ("(" ~> repsep(expr, ",") <~ ")") ^^ TsExpr.Call + val unary: Parser[TsExpr.Unary] = (operator ~ expr) ^^ TsExpr.Unary - lazy val binaryOp: Parser[TsExpr.BinaryOp] = (base ~ operator ~ expr) ^^ TsExpr.BinaryOp + val base: Parser[TsExpr] = perhapsParens(lit | call | unary | ref) - perhapsParens(binaryOp | base) + lazy val binaryOp: Parser[TsExpr.BinaryOp] = { + val first = ("(" ~> binaryOp <~ ")") | base /* avoid left recursion for ever */ + (first ~ operator ~ expr) ^^ TsExpr.BinaryOp + } + + perhapsParens(binaryOp) | base } lazy val baseTypeDesc: Parser[TsType] = { @@ -452,7 +460,7 @@ class TsParser(path: Option[(os.Path, Int)]) extends StdTokenParsers with Parser | "(" ~> tsType <~ ")" | tsLiteral ^^ TsTypeLiteral | "this" ~> success(TsTypeThis()) - | "asserts" ~> tsIdent ^^ TsTypeAsserts + | "asserts" ~> tsIdent ~ ("is" ~> tsTypeRef).? ^^ TsTypeAsserts | tsTypeKeyOf | "infer" ~> typeParam ^^ TsTypeInfer | "readonly" ~> tsType @@ -491,9 +499,7 @@ class TsParser(path: Option[(os.Path, Int)]) extends StdTokenParsers with Parser lazy val tsTypeTuple: Parser[TsTypeTuple] = { val tsTypeRepeated: Parser[TsTypeRepeated] = - "..." ~>! tsType ^? { - case ArrayType(t) => TsTypeRepeated(t) - } + "..." ~>! tsType ^^ TsTypeRepeated val normal: Parser[TsType] = tsType ~ "?".isDefined ^^ { @@ -504,7 +510,7 @@ class TsParser(path: Option[(os.Path, Int)]) extends StdTokenParsers with Parser "[" ~>! ((tsTypeRepeated | normal) <~ delimMaybeComment(',').?).** <~ "]" ^^ TsTypeTuple } - lazy val tsTypeRef: Parser[TsTypeRef] = { + lazy val tsTypeRefNoParens: Parser[TsTypeRef] = { val typeArgs: Parser[IArray[TsType]] = ("<" ~> rep1_(tsType <~ delimMaybeComment(',').?) <~ ">") | success(IArray.Empty) @@ -512,11 +518,13 @@ class TsParser(path: Option[(os.Path, Int)]) extends StdTokenParsers with Parser val empty = "{" ~> "}" ^^ (_ => TsTypeRef.`object`) - perhapsParens(base | empty) + base | empty } + lazy val tsTypeRef: Parser[TsTypeRef] = perhapsParens(tsTypeRefNoParens) + lazy val tsMembers: Parser[IArray[TsMember]] = - memo("{" ~>! (tsMember <~! (";" | ",").*).** <~ comments.? <~ "}") + memo("{" ~>! ";".? ~> (tsMember <~! (";" | ",").*).** <~ comments.? <~ "}") lazy val tsMemberNamed: Parser[TsMember] = { @@ -556,7 +564,15 @@ class TsParser(path: Option[(os.Path, Int)]) extends StdTokenParsers with Parser case _ => OptionalModifier.Noop } - comments ~ protectionLevel ~ "readonly".isDefined ~ ("[" ~> tsIdent <~ "in") ~! (tsType <~ "]") ~ opt ~ typeAnnotation ^^ TsMemberTypeMapped + val readonly: Parser[ReadonlyModifier] = { + ("readonly" | "-readonly").? ^^ { + case Some("readonly") => ReadonlyModifier.Yes + case Some("-readonly") => ReadonlyModifier.No + case _ => ReadonlyModifier.Noop + } + } + + comments ~ protectionLevel ~ readonly ~ ("[" ~> tsIdent <~ "in") ~! (tsType <~ "]") ~ opt ~ typeAnnotation ^^ TsMemberTypeMapped } lazy val tsMember: Parser[TsMember] = { @@ -632,8 +648,9 @@ class TsParser(path: Option[(os.Path, Int)]) extends StdTokenParsers with Parser def unapply(typeRef: TsTypeRef): Option[TsType] = typeRef match { - case TsTypeRef(NoComments, TsQIdent.Array, IArray.exactlyOne(elem)) => Some(elem) - case _ => None + case TsTypeRef(NoComments, TsQIdent.Array, IArray.exactlyOne(elem)) => Some(elem) + case TsTypeRef(NoComments, TsQIdent.ReadonlyArray, IArray.exactlyOne(elem)) => Some(elem) + case _ => None } } } diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala index c927b55cae..a4d4b6a311 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala @@ -278,7 +278,7 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { case IsTypeMapping(TsMemberTypeMapped(_, _, _, _, from: TsTypeRef, _, _)) if scope.isAbstract(from.name) => Problems(IArray(NotStatic(scope, from))) - case IsTypeMapping(TsMemberTypeMapped(_, level, isReadOnly, keyRef, from, optionalize, to)) => + case IsTypeMapping(TsMemberTypeMapped(_, level, readOnly, keyRef, from, optionalize, to)) => evaluateKeys(scope)(from).map { keys => val all = IArray.fromTraversable(keys).map { key => val replaced = Replace(TsTypeRef.of(keyRef), key).visitTsType(scope)(to) @@ -295,7 +295,7 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { tpe = Some(base), expr = None, isStatic = false, - isReadOnly = isReadOnly, + isReadOnly = readOnly(false), //todo! isOptional = optionalize(wasOptional), ) } diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/trees.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/trees.scala index adcc347794..ce5d0686a5 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/trees.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/trees.scala @@ -443,11 +443,12 @@ object TsQIdent { val Primitive = Set(any, bigint, number, boolean, never, `null`, `object`, string, symbol, undefined, unknown, void) - val Array: TsQIdent = TsQIdent.of("Array") - val Boolean: TsQIdent = TsQIdent.of("Boolean") - val Function: TsQIdent = TsQIdent.of("Function") - val Object: TsQIdent = TsQIdent.of("Object") - val String: TsQIdent = TsQIdent.of("String") + val Array: TsQIdent = TsQIdent.of("Array") + val ReadonlyArray: TsQIdent = TsQIdent.of("ReadonlyArray") + val Boolean: TsQIdent = TsQIdent.of("Boolean") + val Function: TsQIdent = TsQIdent.of("Function") + val Object: TsQIdent = TsQIdent.of("Object") + val String: TsQIdent = TsQIdent.of("String") object Std { val Array = TsQIdent(IArray(TsIdent.std, TsIdent("Array"))) @@ -498,7 +499,7 @@ final case class TsTypeConstructor(signature: TsTypeFunction) extends TsType final case class TsTypeIs(ident: TsIdent, tpe: TsType) extends TsType -final case class TsTypeAsserts(ident: TsIdentSimple) extends TsType +final case class TsTypeAsserts(ident: TsIdentSimple, isOpt: Option[TsTypeRef]) extends TsType final case class TsTypeTuple(tparams: IArray[TsType]) extends TsType @@ -622,10 +623,25 @@ object OptionalModifier { case object Deoptionalize extends OptionalModifier } +sealed trait ReadonlyModifier { + def apply(wasReadonly: Boolean): Boolean = + this match { + case ReadonlyModifier.Noop => wasReadonly + case ReadonlyModifier.Yes => true + case ReadonlyModifier.No => false + } +} + +object ReadonlyModifier { + case object Noop extends ReadonlyModifier + case object Yes extends ReadonlyModifier + case object No extends ReadonlyModifier +} + final case class TsMemberTypeMapped( comments: Comments, level: ProtectionLevel, - isReadOnly: Boolean, + readonly: ReadonlyModifier, key: TsIdent, from: TsType, optionalize: OptionalModifier, From 5d21c6548c7541a44ca9785d29c13ea3a367b3a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 03/18] Fix type parameters for fallback mechanism for `Record` --- .../converter/internal/importer/ImportType.scala | 4 ++-- .../check-japgolly/c/componentstest/build.sbt | 6 +++--- .../check-japgolly/r/react-bootstrap/build.sbt | 6 +++--- .../check-japgolly/r/react-contextmenu/build.sbt | 6 +++--- .../check-japgolly/r/react-dropzone/build.sbt | 6 +++--- .../check-japgolly/r/react-select/build.sbt | 6 +++--- .../check-japgolly/r/react/build.sbt | 4 ++-- .../check-japgolly/s/semantic-ui-react/build.sbt | 6 +++--- .../stardust-ui__react-component-event-listener/build.sbt | 6 +++--- .../s/stardust-ui__react-component-ref/build.sbt | 6 +++--- .../react-integration-test/check-japgolly/s/std/build.sbt | 2 +- .../std/src/main/scala/typingsJapgolly/std/package.scala | 2 +- .../check-slinky/c/componentstest/build.sbt | 6 +++--- .../check-slinky/r/react-bootstrap/build.sbt | 6 +++--- .../check-slinky/r/react-contextmenu/build.sbt | 6 +++--- .../check-slinky/r/react-dropzone/build.sbt | 6 +++--- .../check-slinky/r/react-select/build.sbt | 6 +++--- .../react-integration-test/check-slinky/r/react/build.sbt | 4 ++-- .../check-slinky/s/semantic-ui-react/build.sbt | 6 +++--- .../stardust-ui__react-component-event-listener/build.sbt | 6 +++--- .../s/stardust-ui__react-component-ref/build.sbt | 6 +++--- .../react-integration-test/check-slinky/s/std/build.sbt | 2 +- .../s/std/src/main/scala/typingsSlinky/std/package.scala | 2 +- .../check/c/componentstest/build.sbt | 6 +++--- .../check/r/react-bootstrap/build.sbt | 6 +++--- .../check/r/react-contextmenu/build.sbt | 6 +++--- .../check/r/react-dropzone/build.sbt | 6 +++--- .../react-integration-test/check/r/react-select/build.sbt | 6 +++--- .../react-integration-test/check/r/react/build.sbt | 4 ++-- .../check/s/semantic-ui-react/build.sbt | 6 +++--- .../stardust-ui__react-component-event-listener/build.sbt | 6 +++--- .../check/s/stardust-ui__react-component-ref/build.sbt | 6 +++--- .../react-integration-test/check/s/std/build.sbt | 2 +- .../check/s/std/src/main/scala/typings/std/package.scala | 2 +- .../test/resources/type-mappings/check/s/std/build.sbt | 2 +- .../check/s/std/src/main/scala/typings/std/package.scala | 2 +- .../type-mappings/check/t/type-mappings/build.sbt | 4 ++-- .../test/resources/void-elements/check/s/std/build.sbt | 2 +- .../check/s/std/src/main/scala/typings/std/package.scala | 2 +- .../void-elements/check/v/void-elements/build.sbt | 4 ++-- importer/src/test/resources/vue/check/s/std/build.sbt | 2 +- .../check/s/std/src/main/scala/typings/std/package.scala | 2 +- .../test/resources/vue/check/s/storybook__vue/build.sbt | 8 ++++---- .../src/test/resources/vue/check/v/vue-resource/build.sbt | 4 ++-- .../src/test/resources/vue/check/v/vue-scrollto/build.sbt | 6 +++--- importer/src/test/resources/vue/check/v/vue/build.sbt | 4 ++-- .../src/test/resources/vue/check/w/webpack-env/build.sbt | 4 ++-- .../org/scalablytyped/converter/internal/ts/trees.scala | 2 +- 48 files changed, 110 insertions(+), 110 deletions(-) diff --git a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ImportType.scala b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ImportType.scala index 96f6788fee..6437790edc 100644 --- a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ImportType.scala +++ b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/ImportType.scala @@ -120,8 +120,8 @@ class ImportType(stdNames: QualifiedName.StdNames) { def c = Comments(Comment.warning(s"Unsupported type mapping: \n${TsTypeFormatter(tpe)}\n")) scope.stack collectFirst { - case x: TsDeclTypeAlias if x.name === TsIdent.Record => - TypeRef.StringDictionary(TypeRef(ImportName(x.tparams.head.name)), NoComments) + case x: TsDeclTypeAlias if x.codePath.forceHasPath.codePath === TsQIdent.Std.Record => + TypeRef.StringDictionary(TypeRef(ImportName(x.tparams(1).name)), NoComments) case x: TsNamedDecl => TypeRef.Intersection(IArray(TypeRef.StringLiteral(x.name.value), base)).withComments(c) } getOrElse base.withComments(c) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt index 24d4012e97..15aac42e37 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "componentstest" -version := "0.0-unknown-4c9246" +version := "0.0-unknown-450911" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8e06d7", - "org.scalablytyped" %%% "std" % "0.0-unknown-c63dde") + "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-bootstrap/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-bootstrap/build.sbt index 415e9c3c1b..0878af164f 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-bootstrap/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-bootstrap/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-bootstrap" -version := "0.32-3748f7" +version := "0.32-679545" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8e06d7", - "org.scalablytyped" %%% "std" % "0.0-unknown-c63dde") + "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-contextmenu/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-contextmenu/build.sbt index 9dfcceadfa..fc531fec32 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-contextmenu/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-contextmenu/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-contextmenu" -version := "2.13.0-deefba" +version := "2.13.0-40b38c" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8e06d7", - "org.scalablytyped" %%% "std" % "0.0-unknown-c63dde") + "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt index e1277e4a70..33723b6770 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-8e16fd" +version := "10.1.10-646140" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8e06d7", - "org.scalablytyped" %%% "std" % "0.0-unknown-c63dde") + "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-select/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-select/build.sbt index e093875a7b..fa84fd2681 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-select/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-select/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-select" -version := "0.0-unknown-4fee73" +version := "0.0-unknown-30f6e8" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8e06d7", - "org.scalablytyped" %%% "std" % "0.0-unknown-c63dde") + "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/build.sbt index 439401d1ea..dd98fbd950 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react" -version := "16.9.2-8e06d7" +version := "16.9.2-578572" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "std" % "0.0-unknown-c63dde") + "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt index 6f67e67c7b..57ba91eef4 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "semantic-ui-react" -version := "0.0-unknown-adfd95" +version := "0.0-unknown-de4fd1" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8e06d7", - "org.scalablytyped" %%% "std" % "0.0-unknown-c63dde") + "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/build.sbt index 88d973b9c6..ec755db054 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-event-listener" -version := "0.38.0-b57dea" +version := "0.38.0-bbd7a6" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8e06d7", - "org.scalablytyped" %%% "std" % "0.0-unknown-c63dde") + "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/build.sbt index 9f6c7afa87..952055b5ba 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-ref" -version := "0.38.0-4e928b" +version := "0.38.0-524ec6" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8e06d7", - "org.scalablytyped" %%% "std" % "0.0-unknown-c63dde") + "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/std/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/s/std/build.sbt index fc2dfd272a..de5f0ba0df 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/std/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-c63dde" +version := "0.0-unknown-266f11" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/package.scala b/importer/src/test/resources/react-integration-test/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/package.scala index 755cfafdec..1d400298d5 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/package.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/package.scala @@ -92,7 +92,7 @@ package object std { /** * Construct a type with a set of properties K of type T */ - type Record[K /* <: java.lang.String */, T] = org.scalablytyped.runtime.StringDictionary[K] + type Record[K /* <: java.lang.String */, T] = org.scalablytyped.runtime.StringDictionary[T] type SVGCircleElement = org.scalajs.dom.raw.SVGElement type SVGClipPathElement = org.scalajs.dom.raw.SVGElement type SVGDefsElement = org.scalajs.dom.raw.SVGElement diff --git a/importer/src/test/resources/react-integration-test/check-slinky/c/componentstest/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/c/componentstest/build.sbt index 40fee1ccb9..5914cc65a5 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/c/componentstest/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/c/componentstest/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "componentstest" -version := "0.0-unknown-0d4f1a" +version := "0.0-unknown-0b39d4" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-acd257", - "org.scalablytyped" %%% "std" % "0.0-unknown-de926c") + "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt index 092cd4262b..999d5f650d 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-bootstrap" -version := "0.32-f2498d" +version := "0.32-afbf48" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-acd257", - "org.scalablytyped" %%% "std" % "0.0-unknown-de926c") + "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/build.sbt index ec566bea20..dccebc4d24 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-contextmenu" -version := "2.13.0-b9f93e" +version := "2.13.0-30779b" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-acd257", - "org.scalablytyped" %%% "std" % "0.0-unknown-de926c") + "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt index 953938f6d5..d5a2293d83 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-5ab964" +version := "10.1.10-10b962" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-acd257", - "org.scalablytyped" %%% "std" % "0.0-unknown-de926c") + "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-select/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-select/build.sbt index c2b83c053c..1e61fe781c 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-select/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-select/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-select" -version := "0.0-unknown-353f4c" +version := "0.0-unknown-82d633" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-acd257", - "org.scalablytyped" %%% "std" % "0.0-unknown-de926c") + "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react/build.sbt index 9641d7db7f..2c28cd5986 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react" -version := "16.9.2-acd257" +version := "16.9.2-3ccb0b" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "std" % "0.0-unknown-de926c") + "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt index 7b29768f3a..5bbd3f1492 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "semantic-ui-react" -version := "0.0-unknown-ddb9b3" +version := "0.0-unknown-9764a5" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-acd257", - "org.scalablytyped" %%% "std" % "0.0-unknown-de926c") + "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/build.sbt index bdd8304e13..764b9420dc 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-event-listener" -version := "0.38.0-e9fad7" +version := "0.38.0-b3b6b4" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-acd257", - "org.scalablytyped" %%% "std" % "0.0-unknown-de926c") + "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/build.sbt index 305b065891..5e5ebde33f 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-ref" -version := "0.38.0-61aaf8" +version := "0.38.0-dc4ac6" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-acd257", - "org.scalablytyped" %%% "std" % "0.0-unknown-de926c") + "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/std/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/s/std/build.sbt index 3388279c81..a61ddab49e 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/std/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-de926c" +version := "0.0-unknown-18a94a" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/std/src/main/scala/typingsSlinky/std/package.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/std/src/main/scala/typingsSlinky/std/package.scala index 53bdebcd77..f65d85b899 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/std/src/main/scala/typingsSlinky/std/package.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/std/src/main/scala/typingsSlinky/std/package.scala @@ -92,7 +92,7 @@ package object std { /** * Construct a type with a set of properties K of type T */ - type Record[K /* <: java.lang.String */, T] = org.scalablytyped.runtime.StringDictionary[K] + type Record[K /* <: java.lang.String */, T] = org.scalablytyped.runtime.StringDictionary[T] type SVGCircleElement = org.scalajs.dom.raw.SVGElement type SVGClipPathElement = org.scalajs.dom.raw.SVGElement type SVGDefsElement = org.scalajs.dom.raw.SVGElement diff --git a/importer/src/test/resources/react-integration-test/check/c/componentstest/build.sbt b/importer/src/test/resources/react-integration-test/check/c/componentstest/build.sbt index 71fef6559b..305db2e397 100644 --- a/importer/src/test/resources/react-integration-test/check/c/componentstest/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/c/componentstest/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "componentstest" -version := "0.0-unknown-969b2a" +version := "0.0-unknown-b2ed2c" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-902b24", - "org.scalablytyped" %%% "std" % "0.0-unknown-d75406") + "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/r/react-bootstrap/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react-bootstrap/build.sbt index d25fb26b45..61102c0be2 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-bootstrap/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react-bootstrap/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-bootstrap" -version := "0.32-e40074" +version := "0.32-2b6ea3" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-902b24", - "org.scalablytyped" %%% "std" % "0.0-unknown-d75406") + "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/r/react-contextmenu/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react-contextmenu/build.sbt index fd5dbeba93..9ff7978088 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-contextmenu/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react-contextmenu/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-contextmenu" -version := "2.13.0-6c9f33" +version := "2.13.0-0a906a" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-902b24", - "org.scalablytyped" %%% "std" % "0.0-unknown-d75406") + "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt index 4979a83a1a..e52262d957 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-8a9d32" +version := "10.1.10-23ecdc" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-902b24", - "org.scalablytyped" %%% "std" % "0.0-unknown-d75406") + "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/r/react-select/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react-select/build.sbt index eb22303557..8800b86914 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-select/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react-select/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-select" -version := "0.0-unknown-fcca8b" +version := "0.0-unknown-4324c3" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-902b24", - "org.scalablytyped" %%% "std" % "0.0-unknown-d75406") + "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/r/react/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react/build.sbt index 4c26279ded..7d8e845f1a 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "react" -version := "16.9.2-902b24" +version := "16.9.2-8547e4" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "std" % "0.0-unknown-d75406") + "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/s/semantic-ui-react/build.sbt b/importer/src/test/resources/react-integration-test/check/s/semantic-ui-react/build.sbt index 92e76c2186..50ff61f3ee 100644 --- a/importer/src/test/resources/react-integration-test/check/s/semantic-ui-react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/s/semantic-ui-react/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "semantic-ui-react" -version := "0.0-unknown-3a77d8" +version := "0.0-unknown-55d14e" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-902b24", - "org.scalablytyped" %%% "std" % "0.0-unknown-d75406") + "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/build.sbt b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/build.sbt index 742f372229..5ae6304552 100644 --- a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-event-listener" -version := "0.38.0-2dc415" +version := "0.38.0-c742c1" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-902b24", - "org.scalablytyped" %%% "std" % "0.0-unknown-d75406") + "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/build.sbt b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/build.sbt index ed53ecaa76..19360a8bf6 100644 --- a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-ref" -version := "0.38.0-8a254d" +version := "0.38.0-bc663c" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-902b24", - "org.scalablytyped" %%% "std" % "0.0-unknown-d75406") + "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/s/std/build.sbt b/importer/src/test/resources/react-integration-test/check/s/std/build.sbt index ea34b09f1e..1de647738a 100644 --- a/importer/src/test/resources/react-integration-test/check/s/std/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-d75406" +version := "0.0-unknown-624b5b" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check/s/std/src/main/scala/typings/std/package.scala b/importer/src/test/resources/react-integration-test/check/s/std/src/main/scala/typings/std/package.scala index a83a87db62..c6760df4e8 100644 --- a/importer/src/test/resources/react-integration-test/check/s/std/src/main/scala/typings/std/package.scala +++ b/importer/src/test/resources/react-integration-test/check/s/std/src/main/scala/typings/std/package.scala @@ -92,7 +92,7 @@ package object std { /** * Construct a type with a set of properties K of type T */ - type Record[K /* <: java.lang.String */, T] = org.scalablytyped.runtime.StringDictionary[K] + type Record[K /* <: java.lang.String */, T] = org.scalablytyped.runtime.StringDictionary[T] type SVGCircleElement = typings.std.SVGElement type SVGClipPathElement = typings.std.SVGElement type SVGDefsElement = typings.std.SVGElement diff --git a/importer/src/test/resources/type-mappings/check/s/std/build.sbt b/importer/src/test/resources/type-mappings/check/s/std/build.sbt index fc3dbeed98..c0e8d4d1fb 100644 --- a/importer/src/test/resources/type-mappings/check/s/std/build.sbt +++ b/importer/src/test/resources/type-mappings/check/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-a0fa89" +version := "0.0-unknown-3b61b9" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/type-mappings/check/s/std/src/main/scala/typings/std/package.scala b/importer/src/test/resources/type-mappings/check/s/std/src/main/scala/typings/std/package.scala index 7c74429e63..f394286f38 100644 --- a/importer/src/test/resources/type-mappings/check/s/std/src/main/scala/typings/std/package.scala +++ b/importer/src/test/resources/type-mappings/check/s/std/src/main/scala/typings/std/package.scala @@ -45,7 +45,7 @@ package object std { /** * Construct a type with a set of properties K of type T */ - type Record[K /* <: java.lang.String */, T] = org.scalablytyped.runtime.StringDictionary[K] + type Record[K /* <: java.lang.String */, T] = org.scalablytyped.runtime.StringDictionary[T] /** * Make all properties in T required */ diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/build.sbt b/importer/src/test/resources/type-mappings/check/t/type-mappings/build.sbt index d71db65452..0ffc3831dc 100644 --- a/importer/src/test/resources/type-mappings/check/t/type-mappings/build.sbt +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "type-mappings" -version := "0.0-unknown-b2fc95" +version := "0.0-unknown-288553" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "std" % "0.0-unknown-a0fa89") + "org.scalablytyped" %%% "std" % "0.0-unknown-3b61b9") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/void-elements/check/s/std/build.sbt b/importer/src/test/resources/void-elements/check/s/std/build.sbt index 24aa0ec389..25bba37075 100644 --- a/importer/src/test/resources/void-elements/check/s/std/build.sbt +++ b/importer/src/test/resources/void-elements/check/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-05e66e" +version := "0.0-unknown-e2f8ec" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/void-elements/check/s/std/src/main/scala/typings/std/package.scala b/importer/src/test/resources/void-elements/check/s/std/src/main/scala/typings/std/package.scala index 3fdf737c3e..9c58c47d9a 100644 --- a/importer/src/test/resources/void-elements/check/s/std/src/main/scala/typings/std/package.scala +++ b/importer/src/test/resources/void-elements/check/s/std/src/main/scala/typings/std/package.scala @@ -8,5 +8,5 @@ package object std { type Partial[T] = /* import warning: importer.ImportType#apply c Unsupported type mapping: {[ P in keyof T ]:? T[P]} */ typings.std.stdStrings.Partial with T - type Record[K /* <: java.lang.String */, T] = org.scalablytyped.runtime.StringDictionary[K] + type Record[K /* <: java.lang.String */, T] = org.scalablytyped.runtime.StringDictionary[T] } diff --git a/importer/src/test/resources/void-elements/check/v/void-elements/build.sbt b/importer/src/test/resources/void-elements/check/v/void-elements/build.sbt index 1cbf91de04..1bac0c95be 100644 --- a/importer/src/test/resources/void-elements/check/v/void-elements/build.sbt +++ b/importer/src/test/resources/void-elements/check/v/void-elements/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "void-elements" -version := "3.1-7db42e" +version := "3.1-b6d9a3" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "std" % "0.0-unknown-05e66e") + "org.scalablytyped" %%% "std" % "0.0-unknown-e2f8ec") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/vue/check/s/std/build.sbt b/importer/src/test/resources/vue/check/s/std/build.sbt index 8b0be27783..3745d018e3 100644 --- a/importer/src/test/resources/vue/check/s/std/build.sbt +++ b/importer/src/test/resources/vue/check/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-16b1df" +version := "0.0-unknown-a660db" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/vue/check/s/std/src/main/scala/typings/std/package.scala b/importer/src/test/resources/vue/check/s/std/src/main/scala/typings/std/package.scala index 1ef6b36566..ab4c5f2495 100644 --- a/importer/src/test/resources/vue/check/s/std/src/main/scala/typings/std/package.scala +++ b/importer/src/test/resources/vue/check/s/std/src/main/scala/typings/std/package.scala @@ -10,5 +10,5 @@ package object std { type Readonly[T] = /* import warning: importer.ImportType#apply c Unsupported type mapping: {readonly [ P in keyof T ]: T[P]} */ typings.std.stdStrings.Readonly with T - type Record[K /* <: java.lang.String */, T] = org.scalablytyped.runtime.StringDictionary[K] + type Record[K /* <: java.lang.String */, T] = org.scalablytyped.runtime.StringDictionary[T] } diff --git a/importer/src/test/resources/vue/check/s/storybook__vue/build.sbt b/importer/src/test/resources/vue/check/s/storybook__vue/build.sbt index d9b42fbc28..090ab888b2 100644 --- a/importer/src/test/resources/vue/check/s/storybook__vue/build.sbt +++ b/importer/src/test/resources/vue/check/s/storybook__vue/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "storybook__vue" -version := "3.3-005a05" +version := "3.3-5a6db2" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "std" % "0.0-unknown-16b1df", - "org.scalablytyped" %%% "vue" % "2.5.13-157c85", - "org.scalablytyped" %%% "webpack-env" % "1.13-b3cada") + "org.scalablytyped" %%% "std" % "0.0-unknown-a660db", + "org.scalablytyped" %%% "vue" % "2.5.13-38a981", + "org.scalablytyped" %%% "webpack-env" % "1.13-63a4e2") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/vue/check/v/vue-resource/build.sbt b/importer/src/test/resources/vue/check/v/vue-resource/build.sbt index 3c7d47df4f..ce5f8dd510 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/build.sbt +++ b/importer/src/test/resources/vue/check/v/vue-resource/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "vue-resource" -version := "0.9.3-9d9743" +version := "0.9.3-aad490" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "std" % "0.0-unknown-16b1df") + "org.scalablytyped" %%% "std" % "0.0-unknown-a660db") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/vue/check/v/vue-scrollto/build.sbt b/importer/src/test/resources/vue/check/v/vue-scrollto/build.sbt index 01376692cf..be0564c531 100644 --- a/importer/src/test/resources/vue/check/v/vue-scrollto/build.sbt +++ b/importer/src/test/resources/vue/check/v/vue-scrollto/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "vue-scrollto" -version := "2.7-1d7a7a" +version := "2.7-023155" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "std" % "0.0-unknown-16b1df", - "org.scalablytyped" %%% "vue" % "2.5.13-157c85") + "org.scalablytyped" %%% "std" % "0.0-unknown-a660db", + "org.scalablytyped" %%% "vue" % "2.5.13-38a981") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/vue/check/v/vue/build.sbt b/importer/src/test/resources/vue/check/v/vue/build.sbt index 98974b6ad3..9f37c212ca 100644 --- a/importer/src/test/resources/vue/check/v/vue/build.sbt +++ b/importer/src/test/resources/vue/check/v/vue/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "vue" -version := "2.5.13-157c85" +version := "2.5.13-38a981" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "std" % "0.0-unknown-16b1df") + "org.scalablytyped" %%% "std" % "0.0-unknown-a660db") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/vue/check/w/webpack-env/build.sbt b/importer/src/test/resources/vue/check/w/webpack-env/build.sbt index d352c13491..2133821002 100644 --- a/importer/src/test/resources/vue/check/w/webpack-env/build.sbt +++ b/importer/src/test/resources/vue/check/w/webpack-env/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "webpack-env" -version := "1.13-b3cada" +version := "1.13-63a4e2" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "std" % "0.0-unknown-16b1df") + "org.scalablytyped" %%% "std" % "0.0-unknown-a660db") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/trees.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/trees.scala index ce5d0686a5..dc9749ca4c 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/trees.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/trees.scala @@ -403,7 +403,6 @@ object TsIdent { val namespacedCls: TsIdentSimple = TsIdent("Class") val Symbol: TsIdentSimple = TsIdent("Symbol") val Global: TsIdentSimple = TsIdent("_Global_") - val Record: TsIdentSimple = TsIdent("Record") val dummy: TsIdentSimple = TsIdent("dummy") val dummyLibrary: TsIdentLibrary = TsIdentLibrarySimple("dummyLibrary") @@ -460,6 +459,7 @@ object TsQIdent { val PromiseLike = TsQIdent(IArray(TsIdent.std, TsIdent("PromiseLike"))) val Readonly = TsQIdent(IArray(TsIdent.std, TsIdent("Readonly"))) val ReadonlyArray = TsQIdent(IArray(TsIdent.std, TsIdent("ReadonlyArray"))) + val Record = TsQIdent(IArray(TsIdent.std, TsIdent("Record"))) val String = TsQIdent(IArray(TsIdent.std, TsIdent("String"))) } } From fdd26df8da1dea4e3f919cafecb101bc15bc3cad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 04/18] Fix #116, clean shouldnt trigger conversion --- .../converter/plugin/ScalablyTypedPluginBase.scala | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedPluginBase.scala b/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedPluginBase.scala index ea310be5ea..33a1030285 100644 --- a/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedPluginBase.scala +++ b/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedPluginBase.scala @@ -107,10 +107,18 @@ object ScalablyTypedPluginBase extends AutoPlugin { import autoImport._ import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport.scalaJSVersion + /* work around private[sbt] */ + def cleanIvyHack = { + import scala.language.reflectiveCalls + (Keys: { val cleanIvy: TaskKey[Unit] }).cleanIvy + } + override lazy val projectSettings = Seq( /* This is where we add our generated artifacts to the project for compilation */ Keys.allDependencies ++= stImport.value.toSeq, + /* This originally ended up calling `allDependencies`, which is inconvenient */ + cleanIvyHack := {}, Keys.scalacOptions ++= { val isScalaJs1 = !scalaJSVersion.startsWith("0.6") From 6ae2cd6c4f44e923c8ddb18f33de2a4a4c825344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 05/18] Fix two sources of circular trees --- .../ts/modules/HandleCommonJsModules.scala | 18 ++++++++++++++++++ .../ts/transforms/QualifyReferences.scala | 15 +++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/HandleCommonJsModules.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/HandleCommonJsModules.scala index 115368ac27..ee5aa76ffc 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/HandleCommonJsModules.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/HandleCommonJsModules.scala @@ -159,6 +159,24 @@ object HandleCommonJsModules extends TreeTransformationScopedChanges { } case other => other } + + override def leaveTsDeclNamespace(t: Unit)(x: TsDeclNamespace): TsDeclNamespace = { + /* workaround for this pattern, which ends up as `type Compiler = Compiler` + * namespace webpack { + * interface Compiler {} + * namespace compiler { + * type Compiler = webpack.Compiler + * } + * } + * export = webpack; + * */ + val newMembers = x.members.filter { + case TsDeclTypeAlias(_, _, name, _, TsTypeRef(_, TsQIdent(IArray.exactlyOne(name2)), _), _) => + name2 =/= name + case _ => true + } + x.copy(members = newMembers) + } } EraseNamespaceRefs.visitTsDeclModule(())(mod.withMembers(patchedNewMembers)) diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/QualifyReferences.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/QualifyReferences.scala index f3b5703f4d..2b39643b15 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/QualifyReferences.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/QualifyReferences.scala @@ -18,6 +18,21 @@ class QualifyReferences(skipValidation: Boolean) extends TreeTransformationScope multiple.find(_.name.parts.contains(TsIdent.std)).getOrElse(multiple.head) } + /** special case because apparently this makes sense: + * ```typescript + * import {Options} from '...' + * export type Options = Options + * ``` + */ + override def enterTsDeclTypeAlias(scope: TsTreeScope)(ta: TsDeclTypeAlias): TsDeclTypeAlias = + ta.alias match { + case x: TsTypeRef => + val picker = Picker.ButNot(Picker.Types, ta) + val newAlias = TsTypeIntersect.simplified(resolveTypeRef(scope, x, picker)) + ta.copy(alias = newAlias) + case _ => ta + } + /* Special case because sometimes classes inherit from an interface with the same name */ override def enterTsDeclClass(scope: TsTreeScope)(x: TsDeclClass): TsDeclClass = { val picker = Picker.ButNot(Picker.Types, x) From 99cc65033ef8dc49c6205dfedf3668922ccab327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 06/18] Don't run dependency resolution on the compile threadpool, especially not with a timeout shorter than a long compile --- .../converter/internal/importer/build/BloopCompiler.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/importer/src/main/scala/org/scalablytyped/converter/internal/importer/build/BloopCompiler.scala b/importer/src/main/scala/org/scalablytyped/converter/internal/importer/build/BloopCompiler.scala index 4c23c5d4ce..6a81f6feed 100644 --- a/importer/src/main/scala/org/scalablytyped/converter/internal/importer/build/BloopCompiler.scala +++ b/importer/src/main/scala/org/scalablytyped/converter/internal/importer/build/BloopCompiler.scala @@ -105,7 +105,7 @@ class BloopCompiler private ( val classPath = { val fromExternalDeps: Array[AbsolutePath] = - Await.result(BloopCompiler.resolve(versions, externalDeps.toArray: _*)(ec), 10.seconds) + Await.result(BloopCompiler.resolve(versions, externalDeps.toArray: _*)(ExecutionContext.global), Duration.Inf) val fromDependencyJars: Set[AbsolutePath] = deps.collect { case Compiler.InternalDepJar(jar) => AbsolutePath(jar.toIO) } From 61c521b3833280bf157ef4f0936d1217177b0c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 07/18] Don't use class loader cache to make OOMs in memory-constrained sbt less likely --- .../scalablytyped/converter/internal/ZincCompiler.scala | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/ZincCompiler.scala b/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/ZincCompiler.scala index 10d9bd86f5..b46fd5b257 100644 --- a/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/ZincCompiler.scala +++ b/sbt-converter06/src/main/scala/org/scalablytyped/converter/internal/ZincCompiler.scala @@ -58,12 +58,6 @@ class ZincCompiler(inputs: Inputs, logger: Logger[Unit], versions: Versions, res } object ZincCompiler { - private val classLoaderCacheKey = AttributeKey[ClassLoaderCache]( - "class-loader-cache", - "Caches class loaders based on the classpath entries and last modified times.", - 10, - ) - val task = Def.task { import Keys._ import org.scalablytyped.converter.plugin.ScalablyTypedPluginBase.autoImport._ @@ -125,7 +119,7 @@ object ZincCompiler { dependencyResolution = resolver, compilerBridgeSource = scalaCompilerBridgeSource.value, scalaJarsTarget = zincDir, - classLoaderCache = st.get(classLoaderCacheKey), + classLoaderCache = None, log = sbtLogger, ) From b5ca33fc89ae5c387190117f6480195bd770174d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 08/18] Improve type expansions. Enable for ~all libraries - Don't inline all intersection types - Don't unnecessarily inline interfaces and type aliases with a parent/alias we inline - Support type mappings for type alias to unions of literals --- .../EnabledTypeMappingExpansion.scala | 76 +----- .../importer/Phase1ReadTypescript.scala | 2 +- .../check-japgolly/r/react-dropzone/build.sbt | 2 +- ...oneState.scala => AnonAcceptedFiles.scala} | 8 +- ...ropzonePropsRefAttributesDropzoneRef.scala | 125 --------- .../components/ReactDropzone.scala | 81 ++---- .../reactDropzone/mod/DropzoneProps.scala | 54 +--- .../reactDropzone/mod/default.scala | 4 +- .../reactDropzone/mod/package.scala | 1 + .../check-slinky/r/react-dropzone/build.sbt | 2 +- ...oneState.scala => AnonAcceptedFiles.scala} | 8 +- ...ropzonePropsRefAttributesDropzoneRef.scala | 132 ---------- .../components/ReactDropzone.scala | 57 +--- .../reactDropzone/mod/DropzoneProps.scala | 54 +--- .../reactDropzone/mod/default.scala | 4 +- .../reactDropzone/mod/package.scala | 1 + .../check/r/react-dropzone/build.sbt | 2 +- ...oneState.scala => AnonAcceptedFiles.scala} | 8 +- ...ropzonePropsRefAttributesDropzoneRef.scala | 132 ---------- .../reactDropzone/mod/DropzoneProps.scala | 54 +--- .../typings/reactDropzone/mod/default.scala | 4 +- .../typings/reactDropzone/mod/package.scala | 1 + .../reactDropzoneComponents.scala | 6 +- .../reactDropzone/reactDropzoneProps.scala | 6 +- .../check/t/type-mappings/build.sbt | 2 +- .../scala/typings/typeMappings/AnonGet.scala | 13 + .../typings/typeMappings/AnonGetSet.scala | 21 ++ .../scala/typings/typeMappings/Excluded.scala | 33 +++ .../typings/typeMappings/IProxiedPerson.scala | 22 ++ .../typings/typeMappings/NamePerson.scala | 21 ++ .../typings/typeMappings/PartialPerson.scala | 23 ++ .../typings/typeMappings/PersonRecord.scala | 22 ++ .../typings/typeMappings/ProxiedPerson.scala | 22 ++ .../typings/typeMappings/ReadonlyPerson.scala | 22 ++ .../typings/typeMappings/RequiredPerson.scala | 22 ++ .../typeMappings/TypographyStyle.scala | 37 +++ .../typeMappings/TypographyStyleOptions.scala | 41 +++ .../{AnonAgeName.scala => U.scala} | 9 +- .../main/scala/typings/typeMappings/V.scala | 21 ++ .../scala/typings/typeMappings/package.scala | 28 -- .../typeMappings/typeMappingsStrings.scala | 35 --- ...xpansion.scala => TypeExpansionTest.scala} | 56 +++- .../internal/scalajs/FollowAliases.scala | 2 + .../scalajs/flavours/GenCompanions.scala | 18 +- .../ts/transforms/ExpandTypeMappings.scala | 245 ++++++++++-------- .../ts/transforms/ResolveTypeLookups.scala | 18 +- .../converter/internal/ts/trees.scala | 2 +- 47 files changed, 598 insertions(+), 961 deletions(-) rename importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/{mod/DropzoneState.scala => AnonAcceptedFiles.scala} (54%) delete mode 100644 importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/DropzonePropsRefAttributesDropzoneRef.scala rename importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/{mod/DropzoneState.scala => AnonAcceptedFiles.scala} (53%) delete mode 100644 importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/DropzonePropsRefAttributesDropzoneRef.scala rename importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/{mod/DropzoneState.scala => AnonAcceptedFiles.scala} (53%) delete mode 100644 importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/DropzonePropsRefAttributesDropzoneRef.scala create mode 100644 importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonGet.scala create mode 100644 importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonGetSet.scala create mode 100644 importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/Excluded.scala create mode 100644 importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/IProxiedPerson.scala create mode 100644 importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/NamePerson.scala create mode 100644 importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/PartialPerson.scala create mode 100644 importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/PersonRecord.scala create mode 100644 importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/ProxiedPerson.scala create mode 100644 importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/ReadonlyPerson.scala create mode 100644 importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/RequiredPerson.scala create mode 100644 importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/TypographyStyle.scala create mode 100644 importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/TypographyStyleOptions.scala rename importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/{AnonAgeName.scala => U.scala} (63%) create mode 100644 importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/V.scala rename importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/{TypeExpansion.scala => TypeExpansionTest.scala} (50%) diff --git a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/EnabledTypeMappingExpansion.scala b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/EnabledTypeMappingExpansion.scala index 7723d43226..95c533c007 100644 --- a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/EnabledTypeMappingExpansion.scala +++ b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/EnabledTypeMappingExpansion.scala @@ -1,81 +1,9 @@ package org.scalablytyped.converter.internal.importer import org.scalablytyped.converter.Selection -import org.scalablytyped.converter.internal.ts.{TsIdentLibrary, TsIdentLibraryScoped, TsIdentLibrarySimple} +import org.scalablytyped.converter.internal.ts.TsIdentLibrary object EnabledTypeMappingExpansion { val DefaultSelection: Selection[TsIdentLibrary] = - Selection.NoneExcept( - TsIdentLibrary("amap-js-api"), - TsIdentLibrary("antd"), - TsIdentLibrary("instagram-private-api"), - TsIdentLibrary("jest-config"), - TsIdentLibrary("react-autosuggest"), - TsIdentLibrary("react-dropzone"), - TsIdentLibrary("react-native"), - TsIdentLibrary("react-onsenui"), - TsIdentLibrary("react-select"), - TsIdentLibraryScoped("ant-design", "colors"), - TsIdentLibraryScoped("ant-design", "create-react-context"), - TsIdentLibraryScoped("ant-design", "dark-theme"), - TsIdentLibraryScoped("ant-design", "icons"), - TsIdentLibraryScoped("ant-design", "icons-angular"), - TsIdentLibraryScoped("ant-design", "icons-react"), - TsIdentLibraryScoped("ant-design", "icons-react-native"), - TsIdentLibraryScoped("ant-design", "icons-vue"), - TsIdentLibraryScoped("ant-design", "pro-layout"), - TsIdentLibraryScoped("ant-design", "react-native"), - TsIdentLibraryScoped("material-ui", "core"), - TsIdentLibraryScoped("material-ui", "icons"), - TsIdentLibraryScoped("material-ui", "lab"), - TsIdentLibraryScoped("material-ui", "system"), - TsIdentLibraryScoped("material-ui", "utils"), - TsIdentLibraryScoped("nivo", "annotations"), - TsIdentLibraryScoped("nivo", "axes"), - TsIdentLibraryScoped("nivo", "bar"), - TsIdentLibraryScoped("nivo", "bullet"), - TsIdentLibraryScoped("nivo", "calendar"), - TsIdentLibraryScoped("nivo", "chord"), - TsIdentLibraryScoped("nivo", "circle-packing"), - TsIdentLibraryScoped("nivo", "colors"), - TsIdentLibraryScoped("nivo", "core"), - TsIdentLibraryScoped("nivo", "generators"), - TsIdentLibraryScoped("nivo", "geo"), - TsIdentLibraryScoped("nivo", "heatmap"), - TsIdentLibraryScoped("nivo", "legends"), - TsIdentLibraryScoped("nivo", "line"), - TsIdentLibraryScoped("nivo", "parallel-coordinates"), - TsIdentLibraryScoped("nivo", "pie"), - TsIdentLibraryScoped("nivo", "radar"), - TsIdentLibraryScoped("nivo", "sankey"), - TsIdentLibraryScoped("nivo", "scales"), - TsIdentLibraryScoped("nivo", "scatterplot"), - TsIdentLibraryScoped("nivo", "stream"), - TsIdentLibraryScoped("nivo", "sunburst"), - TsIdentLibraryScoped("nivo", "tooltip"), - TsIdentLibraryScoped("nivo", "treemap"), - TsIdentLibraryScoped("nivo", "voronoi"), - TsIdentLibraryScoped("nivo", "waffle"), - TsIdentLibraryScoped("react-navigation", "core"), - TsIdentLibraryScoped("react-navigation", "native"), - TsIdentLibraryScoped("tensorflow", "tfjs"), - TsIdentLibraryScoped("tensorflow", "tfjs-converter"), - TsIdentLibraryScoped("tensorflow", "tfjs-core"), - TsIdentLibraryScoped("tensorflow", "tfjs-data"), - TsIdentLibraryScoped("tensorflow", "tfjs-layers"), - TsIdentLibraryScoped("tensorflow", "tfjs-node"), - TsIdentLibraryScoped("uifabric", "foundation"), - TsIdentLibraryScoped("uifabric", "icons"), - TsIdentLibraryScoped("uifabric", "merge-styles"), - TsIdentLibraryScoped("uifabric", "react-hooks"), - TsIdentLibraryScoped("uifabric", "set-version"), - TsIdentLibraryScoped("uifabric", "styling"), - TsIdentLibraryScoped("uifabric", "utilities"), - TsIdentLibrarySimple("react-navigation"), - TsIdentLibrarySimple("react-navigation-drawer"), - TsIdentLibrarySimple("react-navigation-material-bottom-tabs"), - TsIdentLibrarySimple("react-navigation-stack"), - TsIdentLibrary("@storybook/api"), - TsIdentLibrary("styled-components"), - ) + Selection.AllExcept("std", "prop-types", "react").map(TsIdentLibrary.apply) } diff --git a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase1ReadTypescript.scala b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase1ReadTypescript.scala index 670ec63471..66167961b3 100644 --- a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase1ReadTypescript.scala +++ b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase1ReadTypescript.scala @@ -234,7 +234,7 @@ object Phase1ReadTypescript { T.DefaultedTypeArguments.visitTsParsedFile(scope.caching), //after FlattenTrees T.InlineTrivialParents.visitTsParsedFile(scope.caching), //after FlattenTrees and DefaultedTypeArguments if (expandTypeMappings(libName)) T.ExpandTypeMappings.visitTsParsedFile(scope.caching) else identity, // before ExtractInterfaces - if (expandTypeMappings(libName)) T.ExpandTypeMappings.After(libName, scope) else identity, // before ExtractInterfaces + if (expandTypeMappings(libName)) T.ExpandTypeMappings.After.visitTsParsedFile(scope) else identity, // before ExtractInterfaces ( T.SimplifyConditionals >> // after ExpandTypeMappings T.TypeAliasToConstEnum >> diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt index 33723b6770..15ef838871 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-646140" +version := "10.1.10-2fd88e" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/DropzoneState.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/AnonAcceptedFiles.scala similarity index 54% rename from importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/DropzoneState.scala rename to importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/AnonAcceptedFiles.scala index 555d58f158..8cc34e026e 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/DropzoneState.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/AnonAcceptedFiles.scala @@ -1,15 +1,16 @@ -package typingsJapgolly.reactDropzone.mod +package typingsJapgolly.reactDropzone import japgolly.scalajs.react.raw.React.RefHandle import org.scalajs.dom.raw.HTMLElement import org.scalajs.dom.raw.HTMLInputElement +import typingsJapgolly.reactDropzone.mod.DropzoneInputProps +import typingsJapgolly.reactDropzone.mod.DropzoneRootProps import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ -/* Inlined react-dropzone.react-dropzone.DropzoneRef & { isFocused :boolean, isDragActive :boolean, isDragAccept :boolean, isDragReject :boolean, isFileDialogActive :boolean, draggedFiles :std.Array, acceptedFiles :std.Array, rejectedFiles :std.Array, rootRef :react.react.RefObject, inputRef :react.react.RefObject, getRootProps (props ? : react-dropzone.react-dropzone.DropzoneRootProps): react-dropzone.react-dropzone.DropzoneRootProps, getInputProps (props ? : react-dropzone.react-dropzone.DropzoneInputProps): react-dropzone.react-dropzone.DropzoneInputProps} */ @js.native -trait DropzoneState extends js.Object { +trait AnonAcceptedFiles extends js.Object { var acceptedFiles: js.Array[ /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ ] = js.native @@ -30,6 +31,5 @@ trait DropzoneState extends js.Object { def getInputProps(props: DropzoneInputProps): DropzoneInputProps = js.native def getRootProps(): DropzoneRootProps = js.native def getRootProps(props: DropzoneRootProps): DropzoneRootProps = js.native - def open(): Unit = js.native } diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/DropzonePropsRefAttributesDropzoneRef.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/DropzonePropsRefAttributesDropzoneRef.scala deleted file mode 100644 index 6cfa500ba8..0000000000 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/DropzonePropsRefAttributesDropzoneRef.scala +++ /dev/null @@ -1,125 +0,0 @@ -package typingsJapgolly.reactDropzone - -import japgolly.scalajs.react.Callback -import japgolly.scalajs.react.CallbackTo -import japgolly.scalajs.react.ReactDragEventFrom -import japgolly.scalajs.react.raw.React.Ref -import org.scalajs.dom.raw.HTMLElement -import typingsJapgolly.react.mod.DragEventHandler -import typingsJapgolly.react.mod.Key -import typingsJapgolly.react.mod._Global_.JSX.Element -import typingsJapgolly.reactDropzone.mod.DropEvent -import typingsJapgolly.reactDropzone.mod.DropzoneState -import scala.scalajs.js -import scala.scalajs.js.`|` -import scala.scalajs.js.annotation._ - -/* Inlined react-dropzone.react-dropzone.DropzoneProps & react.react.RefAttributes */ -@js.native -trait DropzonePropsRefAttributesDropzoneRef extends js.Object { - var accept: js.UndefOr[String | js.Array[String]] = js.native - var children: js.UndefOr[js.Function1[/* state */ DropzoneState, Element]] = js.native - var disabled: js.UndefOr[Boolean] = js.native - var getFilesFromEvent: js.UndefOr[ - js.Function1[ - /* event */ DropEvent, - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify Promise> */ _ - ] - ] = js.native - var key: js.UndefOr[Key] = js.native - var maxSize: js.UndefOr[Double] = js.native - var minSize: js.UndefOr[Double] = js.native - var multiple: js.UndefOr[Boolean] = js.native - var noClick: js.UndefOr[Boolean] = js.native - var noDrag: js.UndefOr[Boolean] = js.native - var noDragEventsBubbling: js.UndefOr[Boolean] = js.native - var noKeyboard: js.UndefOr[Boolean] = js.native - var onDragEnter: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDragLeave: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDragOver: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDrop: js.UndefOr[ - js.Function3[ - /* acceptedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* rejectedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onDropAccepted: js.UndefOr[ - js.Function2[ - /* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onDropRejected: js.UndefOr[ - js.Function2[ - /* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onFileDialogCancel: js.UndefOr[js.Function0[Unit]] = js.native - var preventDropOnDocument: js.UndefOr[Boolean] = js.native - var ref: js.UndefOr[Ref] = js.native -} - -object DropzonePropsRefAttributesDropzoneRef { - @scala.inline - def apply( - accept: String | js.Array[String] = null, - children: /* state */ DropzoneState => CallbackTo[Element] = null, - disabled: js.UndefOr[Boolean] = js.undefined, - getFilesFromEvent: /* event */ DropEvent => CallbackTo[js.Any] = null, - key: Key = null, - maxSize: Int | Double = null, - minSize: Int | Double = null, - multiple: js.UndefOr[Boolean] = js.undefined, - noClick: js.UndefOr[Boolean] = js.undefined, - noDrag: js.UndefOr[Boolean] = js.undefined, - noDragEventsBubbling: js.UndefOr[Boolean] = js.undefined, - noKeyboard: js.UndefOr[Boolean] = js.undefined, - onDragEnter: ReactDragEventFrom[HTMLElement] => Callback = null, - onDragLeave: ReactDragEventFrom[HTMLElement] => Callback = null, - onDragOver: ReactDragEventFrom[HTMLElement] => Callback = null, - onDrop: (/* acceptedFiles */ js.Array[js.Any], /* rejectedFiles */ js.Array[js.Any], /* event */ DropEvent) => Callback = null, - onDropAccepted: (/* files */ js.Array[js.Any], /* event */ DropEvent) => Callback = null, - onDropRejected: (/* files */ js.Array[js.Any], /* event */ DropEvent) => Callback = null, - onFileDialogCancel: js.UndefOr[Callback] = js.undefined, - preventDropOnDocument: js.UndefOr[Boolean] = js.undefined, - ref: Ref = null - ): DropzonePropsRefAttributesDropzoneRef = { - val __obj = js.Dynamic.literal() - if (accept != null) __obj.updateDynamic("accept")(accept.asInstanceOf[js.Any]) - if (children != null) __obj.updateDynamic("children")(js.Any.fromFunction1((t0: /* state */ typingsJapgolly.reactDropzone.mod.DropzoneState) => children(t0).runNow())) - if (!js.isUndefined(disabled)) __obj.updateDynamic("disabled")(disabled.asInstanceOf[js.Any]) - if (getFilesFromEvent != null) __obj.updateDynamic("getFilesFromEvent")(js.Any.fromFunction1((t0: /* event */ typingsJapgolly.reactDropzone.mod.DropEvent) => getFilesFromEvent(t0).runNow())) - if (key != null) __obj.updateDynamic("key")(key.asInstanceOf[js.Any]) - if (maxSize != null) __obj.updateDynamic("maxSize")(maxSize.asInstanceOf[js.Any]) - if (minSize != null) __obj.updateDynamic("minSize")(minSize.asInstanceOf[js.Any]) - if (!js.isUndefined(multiple)) __obj.updateDynamic("multiple")(multiple.asInstanceOf[js.Any]) - if (!js.isUndefined(noClick)) __obj.updateDynamic("noClick")(noClick.asInstanceOf[js.Any]) - if (!js.isUndefined(noDrag)) __obj.updateDynamic("noDrag")(noDrag.asInstanceOf[js.Any]) - if (!js.isUndefined(noDragEventsBubbling)) __obj.updateDynamic("noDragEventsBubbling")(noDragEventsBubbling.asInstanceOf[js.Any]) - if (!js.isUndefined(noKeyboard)) __obj.updateDynamic("noKeyboard")(noKeyboard.asInstanceOf[js.Any]) - if (onDragEnter != null) __obj.updateDynamic("onDragEnter")(js.Any.fromFunction1((t0: japgolly.scalajs.react.ReactDragEventFrom[org.scalajs.dom.raw.HTMLElement]) => onDragEnter(t0).runNow())) - if (onDragLeave != null) __obj.updateDynamic("onDragLeave")(js.Any.fromFunction1((t0: japgolly.scalajs.react.ReactDragEventFrom[org.scalajs.dom.raw.HTMLElement]) => onDragLeave(t0).runNow())) - if (onDragOver != null) __obj.updateDynamic("onDragOver")(js.Any.fromFunction1((t0: japgolly.scalajs.react.ReactDragEventFrom[org.scalajs.dom.raw.HTMLElement]) => onDragOver(t0).runNow())) - if (onDrop != null) __obj.updateDynamic("onDrop")(js.Any.fromFunction3((t0: /* acceptedFiles */ js.Array[js.Any], t1: /* rejectedFiles */ js.Array[js.Any], t2: /* event */ typingsJapgolly.reactDropzone.mod.DropEvent) => onDrop(t0, t1, t2).runNow())) - if (onDropAccepted != null) __obj.updateDynamic("onDropAccepted")(js.Any.fromFunction2((t0: /* files */ js.Array[js.Any], t1: /* event */ typingsJapgolly.reactDropzone.mod.DropEvent) => onDropAccepted(t0, t1).runNow())) - if (onDropRejected != null) __obj.updateDynamic("onDropRejected")(js.Any.fromFunction2((t0: /* files */ js.Array[js.Any], t1: /* event */ typingsJapgolly.reactDropzone.mod.DropEvent) => onDropRejected(t0, t1).runNow())) - onFileDialogCancel.foreach(p => __obj.updateDynamic("onFileDialogCancel")(p.toJsFn)) - if (!js.isUndefined(preventDropOnDocument)) __obj.updateDynamic("preventDropOnDocument")(preventDropOnDocument.asInstanceOf[js.Any]) - if (ref != null) __obj.updateDynamic("ref")(ref.asInstanceOf[js.Any]) - __obj.asInstanceOf[DropzonePropsRefAttributesDropzoneRef] - } -} - diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/components/ReactDropzone.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/components/ReactDropzone.scala index 5c5397c751..1704d3a5f1 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/components/ReactDropzone.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/components/ReactDropzone.scala @@ -1,80 +1,45 @@ package typingsJapgolly.reactDropzone.components -import japgolly.scalajs.react.Callback -import japgolly.scalajs.react.CallbackTo +import japgolly.scalajs.react.CtorType.ChildArg import japgolly.scalajs.react.Key -import japgolly.scalajs.react.ReactDragEventFrom -import japgolly.scalajs.react.component.JsForwardRef.UnmountedWithRoot -import japgolly.scalajs.react.raw.React.Ref +import japgolly.scalajs.react.component.Js.MountedWithRawType +import japgolly.scalajs.react.component.Js.RawMounted +import japgolly.scalajs.react.component.Js.UnmountedSimple import org.scalablytyped.runtime.StringDictionary -import org.scalajs.dom.raw.HTMLElement -import typingsJapgolly.react.mod._Global_.JSX.Element -import typingsJapgolly.reactDropzone.DropzonePropsRefAttributesDropzoneRef -import typingsJapgolly.reactDropzone.mod.DropEvent -import typingsJapgolly.reactDropzone.mod.DropzoneState +import typingsJapgolly.react.mod.RefAttributes +import typingsJapgolly.reactDropzone.mod.DropzoneProps +import typingsJapgolly.reactDropzone.mod.DropzoneRef import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ +/* This component has complicated props, you'll have to assemble `props` yourself using js.Dynamic.literal(...) or similar. */ object ReactDropzone { def apply( - accept: String | js.Array[String] = null, - disabled: js.UndefOr[Boolean] = js.undefined, - getFilesFromEvent: /* event */ DropEvent => CallbackTo[js.Any] = null, - maxSize: Int | Double = null, - minSize: Int | Double = null, - multiple: js.UndefOr[Boolean] = js.undefined, - noClick: js.UndefOr[Boolean] = js.undefined, - noDrag: js.UndefOr[Boolean] = js.undefined, - noDragEventsBubbling: js.UndefOr[Boolean] = js.undefined, - noKeyboard: js.UndefOr[Boolean] = js.undefined, - onDragEnter: ReactDragEventFrom[HTMLElement] => Callback = null, - onDragLeave: ReactDragEventFrom[HTMLElement] => Callback = null, - onDragOver: ReactDragEventFrom[HTMLElement] => Callback = null, - onDrop: (/* acceptedFiles */ js.Array[js.Any], /* rejectedFiles */ js.Array[js.Any], /* event */ DropEvent) => Callback = null, - onDropAccepted: (/* files */ js.Array[js.Any], /* event */ DropEvent) => Callback = null, - onDropRejected: (/* files */ js.Array[js.Any], /* event */ DropEvent) => Callback = null, - onFileDialogCancel: js.UndefOr[Callback] = js.undefined, - preventDropOnDocument: js.UndefOr[Boolean] = js.undefined, + props: DropzoneProps with RefAttributes[DropzoneRef] with js.Object, key: js.UndefOr[Key] = js.undefined, _overrides: StringDictionary[js.Any] = null )( - children: /* state */ DropzoneState => CallbackTo[Element] = null - ): UnmountedWithRoot[ - DropzonePropsRefAttributesDropzoneRef, - Ref, - Unit, - DropzonePropsRefAttributesDropzoneRef + children: ChildArg* + ): UnmountedSimple[ + DropzoneProps with RefAttributes[DropzoneRef] with js.Object, + MountedWithRawType[ + DropzoneProps with RefAttributes[DropzoneRef] with js.Object, + js.Object, + RawMounted[DropzoneProps with RefAttributes[DropzoneRef] with js.Object, js.Object] + ] ] = { val __obj = js.Dynamic.literal() - if (children != null) __obj.updateDynamic("children")(js.Any.fromFunction1((t0: /* state */ typingsJapgolly.reactDropzone.mod.DropzoneState) => children(t0).runNow())) - if (accept != null) __obj.updateDynamic("accept")(accept.asInstanceOf[js.Any]) - if (!js.isUndefined(disabled)) __obj.updateDynamic("disabled")(disabled.asInstanceOf[js.Any]) - if (getFilesFromEvent != null) __obj.updateDynamic("getFilesFromEvent")(js.Any.fromFunction1((t0: /* event */ typingsJapgolly.reactDropzone.mod.DropEvent) => getFilesFromEvent(t0).runNow())) - if (maxSize != null) __obj.updateDynamic("maxSize")(maxSize.asInstanceOf[js.Any]) - if (minSize != null) __obj.updateDynamic("minSize")(minSize.asInstanceOf[js.Any]) - if (!js.isUndefined(multiple)) __obj.updateDynamic("multiple")(multiple.asInstanceOf[js.Any]) - if (!js.isUndefined(noClick)) __obj.updateDynamic("noClick")(noClick.asInstanceOf[js.Any]) - if (!js.isUndefined(noDrag)) __obj.updateDynamic("noDrag")(noDrag.asInstanceOf[js.Any]) - if (!js.isUndefined(noDragEventsBubbling)) __obj.updateDynamic("noDragEventsBubbling")(noDragEventsBubbling.asInstanceOf[js.Any]) - if (!js.isUndefined(noKeyboard)) __obj.updateDynamic("noKeyboard")(noKeyboard.asInstanceOf[js.Any]) - if (onDragEnter != null) __obj.updateDynamic("onDragEnter")(js.Any.fromFunction1((t0: japgolly.scalajs.react.ReactDragEventFrom[org.scalajs.dom.raw.HTMLElement]) => onDragEnter(t0).runNow())) - if (onDragLeave != null) __obj.updateDynamic("onDragLeave")(js.Any.fromFunction1((t0: japgolly.scalajs.react.ReactDragEventFrom[org.scalajs.dom.raw.HTMLElement]) => onDragLeave(t0).runNow())) - if (onDragOver != null) __obj.updateDynamic("onDragOver")(js.Any.fromFunction1((t0: japgolly.scalajs.react.ReactDragEventFrom[org.scalajs.dom.raw.HTMLElement]) => onDragOver(t0).runNow())) - if (onDrop != null) __obj.updateDynamic("onDrop")(js.Any.fromFunction3((t0: /* acceptedFiles */ js.Array[js.Any], t1: /* rejectedFiles */ js.Array[js.Any], t2: /* event */ typingsJapgolly.reactDropzone.mod.DropEvent) => onDrop(t0, t1, t2).runNow())) - if (onDropAccepted != null) __obj.updateDynamic("onDropAccepted")(js.Any.fromFunction2((t0: /* files */ js.Array[js.Any], t1: /* event */ typingsJapgolly.reactDropzone.mod.DropEvent) => onDropAccepted(t0, t1).runNow())) - if (onDropRejected != null) __obj.updateDynamic("onDropRejected")(js.Any.fromFunction2((t0: /* files */ js.Array[js.Any], t1: /* event */ typingsJapgolly.reactDropzone.mod.DropEvent) => onDropRejected(t0, t1).runNow())) - onFileDialogCancel.foreach(p => __obj.updateDynamic("onFileDialogCancel")(p.toJsFn)) - if (!js.isUndefined(preventDropOnDocument)) __obj.updateDynamic("preventDropOnDocument")(preventDropOnDocument.asInstanceOf[js.Any]) + js.Dynamic.global.Object.assign(__obj, props) key.foreach(k => __obj.updateDynamic("key")(k.asInstanceOf[js.Any])) if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) - val f = japgolly.scalajs.react.JsForwardRefComponent.force[ - typingsJapgolly.reactDropzone.DropzonePropsRefAttributesDropzoneRef, - japgolly.scalajs.react.Children.None, - japgolly.scalajs.react.raw.React.Ref](this.componentImport) - f(__obj.asInstanceOf[typingsJapgolly.reactDropzone.DropzonePropsRefAttributesDropzoneRef]) + val f = japgolly.scalajs.react.JsComponent[ + typingsJapgolly.reactDropzone.mod.DropzoneProps with typingsJapgolly.react.mod.RefAttributes[typingsJapgolly.reactDropzone.mod.DropzoneRef] with js.Object, + japgolly.scalajs.react.Children.Varargs, + js.Object](this.componentImport) + f(__obj.asInstanceOf[typingsJapgolly.reactDropzone.mod.DropzoneProps with typingsJapgolly.react.mod.RefAttributes[typingsJapgolly.reactDropzone.mod.DropzoneRef] with js.Object])(children: _*) } @JSImport("react-dropzone", JSImport.Default) @js.native diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/DropzoneProps.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/DropzoneProps.scala index 2526d66225..2b0235258a 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/DropzoneProps.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/DropzoneProps.scala @@ -4,66 +4,14 @@ import japgolly.scalajs.react.Callback import japgolly.scalajs.react.CallbackTo import japgolly.scalajs.react.ReactDragEventFrom import org.scalajs.dom.raw.HTMLElement -import typingsJapgolly.react.mod.DragEventHandler import typingsJapgolly.react.mod._Global_.JSX.Element import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ -/* Inlined parent react-dropzone.react-dropzone.DropzoneOptions */ @js.native -trait DropzoneProps extends js.Object { - var accept: js.UndefOr[String | js.Array[String]] = js.native +trait DropzoneProps extends DropzoneOptions { var children: js.UndefOr[js.Function1[/* state */ DropzoneState, Element]] = js.native - var disabled: js.UndefOr[Boolean] = js.native - var getFilesFromEvent: js.UndefOr[ - js.Function1[ - /* event */ DropEvent, - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify Promise> */ _ - ] - ] = js.native - var maxSize: js.UndefOr[Double] = js.native - var minSize: js.UndefOr[Double] = js.native - var multiple: js.UndefOr[Boolean] = js.native - var noClick: js.UndefOr[Boolean] = js.native - var noDrag: js.UndefOr[Boolean] = js.native - var noDragEventsBubbling: js.UndefOr[Boolean] = js.native - var noKeyboard: js.UndefOr[Boolean] = js.native - var onDragEnter: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDragLeave: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDragOver: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDrop: js.UndefOr[ - js.Function3[ - /* acceptedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* rejectedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onDropAccepted: js.UndefOr[ - js.Function2[ - /* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onDropRejected: js.UndefOr[ - js.Function2[ - /* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onFileDialogCancel: js.UndefOr[js.Function0[Unit]] = js.native - var preventDropOnDocument: js.UndefOr[Boolean] = js.native } object DropzoneProps { diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/default.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/default.scala index 273911a9b4..1b203fc744 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/default.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/default.scala @@ -1,7 +1,7 @@ package typingsJapgolly.reactDropzone.mod +import typingsJapgolly.react.mod.RefAttributes import typingsJapgolly.react.mod._Global_.JSX.Element -import typingsJapgolly.reactDropzone.DropzonePropsRefAttributesDropzoneRef import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @@ -9,6 +9,6 @@ import scala.scalajs.js.annotation._ @JSImport("react-dropzone", JSImport.Default) @js.native object default extends js.Object { - def apply(props: DropzonePropsRefAttributesDropzoneRef): Element = js.native + def apply(props: DropzoneProps with RefAttributes[DropzoneRef]): Element = js.native } diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/package.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/package.scala index 91f72dff56..da525d97af 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/package.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/package.scala @@ -6,4 +6,5 @@ import scala.scalajs.js.annotation._ package object mod { type DropEvent = japgolly.scalajs.react.ReactDragEventFrom[org.scalajs.dom.raw.HTMLElement] | japgolly.scalajs.react.ReactEventFrom[org.scalajs.dom.raw.HTMLInputElement] | org.scalajs.dom.raw.DragEvent | org.scalajs.dom.raw.Event + type DropzoneState = typingsJapgolly.reactDropzone.mod.DropzoneRef with typingsJapgolly.reactDropzone.AnonAcceptedFiles } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt index d5a2293d83..adaa0929f8 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-10b962" +version := "10.1.10-0c490e" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/DropzoneState.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/AnonAcceptedFiles.scala similarity index 53% rename from importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/DropzoneState.scala rename to importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/AnonAcceptedFiles.scala index 39120ec021..a2f5706098 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/DropzoneState.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/AnonAcceptedFiles.scala @@ -1,15 +1,16 @@ -package typingsSlinky.reactDropzone.mod +package typingsSlinky.reactDropzone import org.scalajs.dom.raw.HTMLElement import org.scalajs.dom.raw.HTMLInputElement import slinky.core.facade.ReactRef +import typingsSlinky.reactDropzone.mod.DropzoneInputProps +import typingsSlinky.reactDropzone.mod.DropzoneRootProps import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ -/* Inlined react-dropzone.react-dropzone.DropzoneRef & { isFocused :boolean, isDragActive :boolean, isDragAccept :boolean, isDragReject :boolean, isFileDialogActive :boolean, draggedFiles :std.Array, acceptedFiles :std.Array, rejectedFiles :std.Array, rootRef :react.react.RefObject, inputRef :react.react.RefObject, getRootProps (props ? : react-dropzone.react-dropzone.DropzoneRootProps): react-dropzone.react-dropzone.DropzoneRootProps, getInputProps (props ? : react-dropzone.react-dropzone.DropzoneInputProps): react-dropzone.react-dropzone.DropzoneInputProps} */ @js.native -trait DropzoneState extends js.Object { +trait AnonAcceptedFiles extends js.Object { var acceptedFiles: js.Array[ /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ ] = js.native @@ -30,6 +31,5 @@ trait DropzoneState extends js.Object { def getInputProps(props: DropzoneInputProps): DropzoneInputProps = js.native def getRootProps(): DropzoneRootProps = js.native def getRootProps(props: DropzoneRootProps): DropzoneRootProps = js.native - def open(): Unit = js.native } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/DropzonePropsRefAttributesDropzoneRef.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/DropzonePropsRefAttributesDropzoneRef.scala deleted file mode 100644 index b556b34df7..0000000000 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/DropzonePropsRefAttributesDropzoneRef.scala +++ /dev/null @@ -1,132 +0,0 @@ -package typingsSlinky.reactDropzone - -import org.scalajs.dom.raw.HTMLElement -import typingsSlinky.react.mod.DragEvent -import typingsSlinky.react.mod.DragEventHandler -import typingsSlinky.react.mod.Key -import typingsSlinky.react.mod.Ref -import typingsSlinky.react.mod._Global_.JSX.Element -import typingsSlinky.reactDropzone.mod.DropEvent -import typingsSlinky.reactDropzone.mod.DropzoneRef -import typingsSlinky.reactDropzone.mod.DropzoneState -import scala.scalajs.js -import scala.scalajs.js.`|` -import scala.scalajs.js.annotation._ - -/* Inlined react-dropzone.react-dropzone.DropzoneProps & react.react.RefAttributes */ -@js.native -trait DropzonePropsRefAttributesDropzoneRef extends js.Object { - var accept: js.UndefOr[String | js.Array[String]] = js.native - var children: js.UndefOr[js.Function1[/* state */ DropzoneState, Element]] = js.native - var disabled: js.UndefOr[Boolean] = js.native - var getFilesFromEvent: js.UndefOr[ - js.Function1[ - /* event */ DropEvent, - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify Promise> */ _ - ] - ] = js.native - var key: js.UndefOr[Key] = js.native - var maxSize: js.UndefOr[Double] = js.native - var minSize: js.UndefOr[Double] = js.native - var multiple: js.UndefOr[Boolean] = js.native - var noClick: js.UndefOr[Boolean] = js.native - var noDrag: js.UndefOr[Boolean] = js.native - var noDragEventsBubbling: js.UndefOr[Boolean] = js.native - var noKeyboard: js.UndefOr[Boolean] = js.native - var onDragEnter: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDragLeave: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDragOver: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDrop: js.UndefOr[ - js.Function3[ - /* acceptedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* rejectedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onDropAccepted: js.UndefOr[ - js.Function2[ - /* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onDropRejected: js.UndefOr[ - js.Function2[ - /* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onFileDialogCancel: js.UndefOr[js.Function0[Unit]] = js.native - var preventDropOnDocument: js.UndefOr[Boolean] = js.native - var ref: js.UndefOr[Ref[DropzoneRef]] = js.native -} - -object DropzonePropsRefAttributesDropzoneRef { - @scala.inline - def apply( - accept: String | js.Array[String] = null, - children: /* state */ DropzoneState => Element = null, - disabled: js.UndefOr[Boolean] = js.undefined, - getFilesFromEvent: /* event */ DropEvent => /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify Promise> */ _ = null, - key: Key = null, - maxSize: Int | Double = null, - minSize: Int | Double = null, - multiple: js.UndefOr[Boolean] = js.undefined, - noClick: js.UndefOr[Boolean] = js.undefined, - noDrag: js.UndefOr[Boolean] = js.undefined, - noDragEventsBubbling: js.UndefOr[Boolean] = js.undefined, - noKeyboard: js.UndefOr[Boolean] = js.undefined, - onDragEnter: DragEvent[HTMLElement] => Unit = null, - onDragLeave: DragEvent[HTMLElement] => Unit = null, - onDragOver: DragEvent[HTMLElement] => Unit = null, - onDrop: (/* acceptedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], /* rejectedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], /* event */ DropEvent) => Unit = null, - onDropAccepted: (/* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], /* event */ DropEvent) => Unit = null, - onDropRejected: (/* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], /* event */ DropEvent) => Unit = null, - onFileDialogCancel: () => Unit = null, - preventDropOnDocument: js.UndefOr[Boolean] = js.undefined, - ref: Ref[DropzoneRef] = null - ): DropzonePropsRefAttributesDropzoneRef = { - val __obj = js.Dynamic.literal() - if (accept != null) __obj.updateDynamic("accept")(accept.asInstanceOf[js.Any]) - if (children != null) __obj.updateDynamic("children")(js.Any.fromFunction1(children)) - if (!js.isUndefined(disabled)) __obj.updateDynamic("disabled")(disabled.asInstanceOf[js.Any]) - if (getFilesFromEvent != null) __obj.updateDynamic("getFilesFromEvent")(js.Any.fromFunction1(getFilesFromEvent)) - if (key != null) __obj.updateDynamic("key")(key.asInstanceOf[js.Any]) - if (maxSize != null) __obj.updateDynamic("maxSize")(maxSize.asInstanceOf[js.Any]) - if (minSize != null) __obj.updateDynamic("minSize")(minSize.asInstanceOf[js.Any]) - if (!js.isUndefined(multiple)) __obj.updateDynamic("multiple")(multiple.asInstanceOf[js.Any]) - if (!js.isUndefined(noClick)) __obj.updateDynamic("noClick")(noClick.asInstanceOf[js.Any]) - if (!js.isUndefined(noDrag)) __obj.updateDynamic("noDrag")(noDrag.asInstanceOf[js.Any]) - if (!js.isUndefined(noDragEventsBubbling)) __obj.updateDynamic("noDragEventsBubbling")(noDragEventsBubbling.asInstanceOf[js.Any]) - if (!js.isUndefined(noKeyboard)) __obj.updateDynamic("noKeyboard")(noKeyboard.asInstanceOf[js.Any]) - if (onDragEnter != null) __obj.updateDynamic("onDragEnter")(js.Any.fromFunction1(onDragEnter)) - if (onDragLeave != null) __obj.updateDynamic("onDragLeave")(js.Any.fromFunction1(onDragLeave)) - if (onDragOver != null) __obj.updateDynamic("onDragOver")(js.Any.fromFunction1(onDragOver)) - if (onDrop != null) __obj.updateDynamic("onDrop")(js.Any.fromFunction3(onDrop)) - if (onDropAccepted != null) __obj.updateDynamic("onDropAccepted")(js.Any.fromFunction2(onDropAccepted)) - if (onDropRejected != null) __obj.updateDynamic("onDropRejected")(js.Any.fromFunction2(onDropRejected)) - if (onFileDialogCancel != null) __obj.updateDynamic("onFileDialogCancel")(js.Any.fromFunction0(onFileDialogCancel)) - if (!js.isUndefined(preventDropOnDocument)) __obj.updateDynamic("preventDropOnDocument")(preventDropOnDocument.asInstanceOf[js.Any]) - if (ref != null) __obj.updateDynamic("ref")(ref.asInstanceOf[js.Any]) - __obj.asInstanceOf[DropzonePropsRefAttributesDropzoneRef] - } -} - diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/components/ReactDropzone.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/components/ReactDropzone.scala index 7577ec1422..676d1aab28 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/components/ReactDropzone.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/components/ReactDropzone.scala @@ -1,67 +1,22 @@ package typingsSlinky.reactDropzone.components -import org.scalablytyped.runtime.StringDictionary -import slinky.core.BuildingComponent import slinky.core.ExternalComponentWithAttributesWithRefType -import slinky.core.TagMod import slinky.web.html.`*`.tag -import typingsSlinky.react.mod.Ref -import typingsSlinky.reactDropzone.DropzonePropsRefAttributesDropzoneRef -import typingsSlinky.reactDropzone.mod.DropEvent +import typingsSlinky.react.mod.RefAttributes +import typingsSlinky.reactDropzone.mod.DropzoneProps +import typingsSlinky.reactDropzone.mod.DropzoneRef import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ +/* This component has complicated props, you'll have to assemble `props` yourself using js.Dynamic.literal(...) or similar. QualifiedName(IArray(Name())) was not a @ScalaJSDefined trait */ object ReactDropzone - extends ExternalComponentWithAttributesWithRefType[tag.type, Ref[js.Any] with js.Object] { + extends ExternalComponentWithAttributesWithRefType[tag.type, js.Object] { @JSImport("react-dropzone", JSImport.Default) @js.native object componentImport extends js.Object override val component: String | js.Object = this.componentImport - /* The following DOM/SVG props were specified: disabled, multiple, onDragEnter, onDragLeave, onDragOver */ - def apply( - accept: String | js.Array[String] = null, - getFilesFromEvent: /* event */ DropEvent => /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify Promise> */ _ = null, - maxSize: Int | Double = null, - minSize: Int | Double = null, - noClick: js.UndefOr[Boolean] = js.undefined, - noDrag: js.UndefOr[Boolean] = js.undefined, - noDragEventsBubbling: js.UndefOr[Boolean] = js.undefined, - noKeyboard: js.UndefOr[Boolean] = js.undefined, - onDrop: (/* acceptedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], /* rejectedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], /* event */ DropEvent) => Unit = null, - onDropAccepted: (/* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], /* event */ DropEvent) => Unit = null, - onDropRejected: (/* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], /* event */ DropEvent) => Unit = null, - onFileDialogCancel: () => Unit = null, - preventDropOnDocument: js.UndefOr[Boolean] = js.undefined, - _overrides: StringDictionary[js.Any] = null - ): BuildingComponent[tag.type, Ref[js.Any] with js.Object] = { - val __obj = js.Dynamic.literal() - if (accept != null) __obj.updateDynamic("accept")(accept.asInstanceOf[js.Any]) - if (getFilesFromEvent != null) __obj.updateDynamic("getFilesFromEvent")(js.Any.fromFunction1(getFilesFromEvent)) - if (maxSize != null) __obj.updateDynamic("maxSize")(maxSize.asInstanceOf[js.Any]) - if (minSize != null) __obj.updateDynamic("minSize")(minSize.asInstanceOf[js.Any]) - if (!js.isUndefined(noClick)) __obj.updateDynamic("noClick")(noClick.asInstanceOf[js.Any]) - if (!js.isUndefined(noDrag)) __obj.updateDynamic("noDrag")(noDrag.asInstanceOf[js.Any]) - if (!js.isUndefined(noDragEventsBubbling)) __obj.updateDynamic("noDragEventsBubbling")(noDragEventsBubbling.asInstanceOf[js.Any]) - if (!js.isUndefined(noKeyboard)) __obj.updateDynamic("noKeyboard")(noKeyboard.asInstanceOf[js.Any]) - if (onDrop != null) __obj.updateDynamic("onDrop")(js.Any.fromFunction3(onDrop)) - if (onDropAccepted != null) __obj.updateDynamic("onDropAccepted")(js.Any.fromFunction2(onDropAccepted)) - if (onDropRejected != null) __obj.updateDynamic("onDropRejected")(js.Any.fromFunction2(onDropRejected)) - if (onFileDialogCancel != null) __obj.updateDynamic("onFileDialogCancel")(js.Any.fromFunction0(onFileDialogCancel)) - if (!js.isUndefined(preventDropOnDocument)) __obj.updateDynamic("preventDropOnDocument")(preventDropOnDocument.asInstanceOf[js.Any]) - if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) - super.apply(__obj.asInstanceOf[Props]) - } - def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, Ref[js.Any] with js.Object] = new slinky.core.BuildingComponent[slinky.web.html.`*`.tag.type, typingsSlinky.react.mod.Ref[js.Any] with js.Object](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) - type Props = DropzonePropsRefAttributesDropzoneRef + type Props = DropzoneProps with RefAttributes[DropzoneRef] } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/DropzoneProps.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/DropzoneProps.scala index 17143f5d31..450a2633a1 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/DropzoneProps.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/DropzoneProps.scala @@ -2,66 +2,14 @@ package typingsSlinky.reactDropzone.mod import org.scalajs.dom.raw.HTMLElement import typingsSlinky.react.mod.DragEvent -import typingsSlinky.react.mod.DragEventHandler import typingsSlinky.react.mod._Global_.JSX.Element import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ -/* Inlined parent react-dropzone.react-dropzone.DropzoneOptions */ @js.native -trait DropzoneProps extends js.Object { - var accept: js.UndefOr[String | js.Array[String]] = js.native +trait DropzoneProps extends DropzoneOptions { var children: js.UndefOr[js.Function1[/* state */ DropzoneState, Element]] = js.native - var disabled: js.UndefOr[Boolean] = js.native - var getFilesFromEvent: js.UndefOr[ - js.Function1[ - /* event */ DropEvent, - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify Promise> */ _ - ] - ] = js.native - var maxSize: js.UndefOr[Double] = js.native - var minSize: js.UndefOr[Double] = js.native - var multiple: js.UndefOr[Boolean] = js.native - var noClick: js.UndefOr[Boolean] = js.native - var noDrag: js.UndefOr[Boolean] = js.native - var noDragEventsBubbling: js.UndefOr[Boolean] = js.native - var noKeyboard: js.UndefOr[Boolean] = js.native - var onDragEnter: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDragLeave: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDragOver: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDrop: js.UndefOr[ - js.Function3[ - /* acceptedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* rejectedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onDropAccepted: js.UndefOr[ - js.Function2[ - /* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onDropRejected: js.UndefOr[ - js.Function2[ - /* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onFileDialogCancel: js.UndefOr[js.Function0[Unit]] = js.native - var preventDropOnDocument: js.UndefOr[Boolean] = js.native } object DropzoneProps { diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/default.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/default.scala index 5c78ab8d80..c0ffa34f3f 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/default.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/default.scala @@ -1,7 +1,7 @@ package typingsSlinky.reactDropzone.mod +import typingsSlinky.react.mod.RefAttributes import typingsSlinky.react.mod._Global_.JSX.Element -import typingsSlinky.reactDropzone.DropzonePropsRefAttributesDropzoneRef import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @@ -9,6 +9,6 @@ import scala.scalajs.js.annotation._ @JSImport("react-dropzone", JSImport.Default) @js.native object default extends js.Object { - def apply(props: DropzonePropsRefAttributesDropzoneRef): Element = js.native + def apply(props: DropzoneProps with RefAttributes[DropzoneRef]): Element = js.native } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/package.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/package.scala index 785cfca5fb..fe5636c85f 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/package.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/package.scala @@ -6,4 +6,5 @@ import scala.scalajs.js.annotation._ package object mod { type DropEvent = typingsSlinky.react.mod.DragEvent[org.scalajs.dom.raw.HTMLElement] | typingsSlinky.react.mod.ChangeEvent[org.scalajs.dom.raw.HTMLInputElement] | org.scalajs.dom.raw.DragEvent | org.scalajs.dom.raw.Event + type DropzoneState = typingsSlinky.reactDropzone.mod.DropzoneRef with typingsSlinky.reactDropzone.AnonAcceptedFiles } diff --git a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt index e52262d957..3e9ae22a63 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-23ecdc" +version := "10.1.10-26f1d4" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/DropzoneState.scala b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/AnonAcceptedFiles.scala similarity index 53% rename from importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/DropzoneState.scala rename to importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/AnonAcceptedFiles.scala index 48ec3d5eba..8ada05edf8 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/DropzoneState.scala +++ b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/AnonAcceptedFiles.scala @@ -1,15 +1,16 @@ -package typings.reactDropzone.mod +package typings.reactDropzone import typings.react.mod.RefObject +import typings.reactDropzone.mod.DropzoneInputProps +import typings.reactDropzone.mod.DropzoneRootProps import typings.std.HTMLElement import typings.std.HTMLInputElement import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ -/* Inlined react-dropzone.react-dropzone.DropzoneRef & { isFocused :boolean, isDragActive :boolean, isDragAccept :boolean, isDragReject :boolean, isFileDialogActive :boolean, draggedFiles :std.Array, acceptedFiles :std.Array, rejectedFiles :std.Array, rootRef :react.react.RefObject, inputRef :react.react.RefObject, getRootProps (props ? : react-dropzone.react-dropzone.DropzoneRootProps): react-dropzone.react-dropzone.DropzoneRootProps, getInputProps (props ? : react-dropzone.react-dropzone.DropzoneInputProps): react-dropzone.react-dropzone.DropzoneInputProps} */ @js.native -trait DropzoneState extends js.Object { +trait AnonAcceptedFiles extends js.Object { var acceptedFiles: js.Array[ /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ ] = js.native @@ -30,6 +31,5 @@ trait DropzoneState extends js.Object { def getInputProps(props: DropzoneInputProps): DropzoneInputProps = js.native def getRootProps(): DropzoneRootProps = js.native def getRootProps(props: DropzoneRootProps): DropzoneRootProps = js.native - def open(): Unit = js.native } diff --git a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/DropzonePropsRefAttributesDropzoneRef.scala b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/DropzonePropsRefAttributesDropzoneRef.scala deleted file mode 100644 index 9ca085d1da..0000000000 --- a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/DropzonePropsRefAttributesDropzoneRef.scala +++ /dev/null @@ -1,132 +0,0 @@ -package typings.reactDropzone - -import typings.react.mod.DragEvent -import typings.react.mod.DragEventHandler -import typings.react.mod.Key -import typings.react.mod.Ref -import typings.react.mod._Global_.JSX.Element -import typings.reactDropzone.mod.DropEvent -import typings.reactDropzone.mod.DropzoneRef -import typings.reactDropzone.mod.DropzoneState -import typings.std.HTMLElement -import scala.scalajs.js -import scala.scalajs.js.`|` -import scala.scalajs.js.annotation._ - -/* Inlined react-dropzone.react-dropzone.DropzoneProps & react.react.RefAttributes */ -@js.native -trait DropzonePropsRefAttributesDropzoneRef extends js.Object { - var accept: js.UndefOr[String | js.Array[String]] = js.native - var children: js.UndefOr[js.Function1[/* state */ DropzoneState, Element]] = js.native - var disabled: js.UndefOr[Boolean] = js.native - var getFilesFromEvent: js.UndefOr[ - js.Function1[ - /* event */ DropEvent, - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify Promise> */ _ - ] - ] = js.native - var key: js.UndefOr[Key] = js.native - var maxSize: js.UndefOr[Double] = js.native - var minSize: js.UndefOr[Double] = js.native - var multiple: js.UndefOr[Boolean] = js.native - var noClick: js.UndefOr[Boolean] = js.native - var noDrag: js.UndefOr[Boolean] = js.native - var noDragEventsBubbling: js.UndefOr[Boolean] = js.native - var noKeyboard: js.UndefOr[Boolean] = js.native - var onDragEnter: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDragLeave: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDragOver: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDrop: js.UndefOr[ - js.Function3[ - /* acceptedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* rejectedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onDropAccepted: js.UndefOr[ - js.Function2[ - /* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onDropRejected: js.UndefOr[ - js.Function2[ - /* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onFileDialogCancel: js.UndefOr[js.Function0[Unit]] = js.native - var preventDropOnDocument: js.UndefOr[Boolean] = js.native - var ref: js.UndefOr[Ref[DropzoneRef]] = js.native -} - -object DropzonePropsRefAttributesDropzoneRef { - @scala.inline - def apply( - accept: String | js.Array[String] = null, - children: /* state */ DropzoneState => Element = null, - disabled: js.UndefOr[Boolean] = js.undefined, - getFilesFromEvent: /* event */ DropEvent => /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify Promise> */ _ = null, - key: Key = null, - maxSize: Int | Double = null, - minSize: Int | Double = null, - multiple: js.UndefOr[Boolean] = js.undefined, - noClick: js.UndefOr[Boolean] = js.undefined, - noDrag: js.UndefOr[Boolean] = js.undefined, - noDragEventsBubbling: js.UndefOr[Boolean] = js.undefined, - noKeyboard: js.UndefOr[Boolean] = js.undefined, - onDragEnter: DragEvent[HTMLElement] => Unit = null, - onDragLeave: DragEvent[HTMLElement] => Unit = null, - onDragOver: DragEvent[HTMLElement] => Unit = null, - onDrop: (/* acceptedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], /* rejectedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], /* event */ DropEvent) => Unit = null, - onDropAccepted: (/* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], /* event */ DropEvent) => Unit = null, - onDropRejected: (/* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], /* event */ DropEvent) => Unit = null, - onFileDialogCancel: () => Unit = null, - preventDropOnDocument: js.UndefOr[Boolean] = js.undefined, - ref: Ref[DropzoneRef] = null - ): DropzonePropsRefAttributesDropzoneRef = { - val __obj = js.Dynamic.literal() - if (accept != null) __obj.updateDynamic("accept")(accept.asInstanceOf[js.Any]) - if (children != null) __obj.updateDynamic("children")(js.Any.fromFunction1(children)) - if (!js.isUndefined(disabled)) __obj.updateDynamic("disabled")(disabled.asInstanceOf[js.Any]) - if (getFilesFromEvent != null) __obj.updateDynamic("getFilesFromEvent")(js.Any.fromFunction1(getFilesFromEvent)) - if (key != null) __obj.updateDynamic("key")(key.asInstanceOf[js.Any]) - if (maxSize != null) __obj.updateDynamic("maxSize")(maxSize.asInstanceOf[js.Any]) - if (minSize != null) __obj.updateDynamic("minSize")(minSize.asInstanceOf[js.Any]) - if (!js.isUndefined(multiple)) __obj.updateDynamic("multiple")(multiple.asInstanceOf[js.Any]) - if (!js.isUndefined(noClick)) __obj.updateDynamic("noClick")(noClick.asInstanceOf[js.Any]) - if (!js.isUndefined(noDrag)) __obj.updateDynamic("noDrag")(noDrag.asInstanceOf[js.Any]) - if (!js.isUndefined(noDragEventsBubbling)) __obj.updateDynamic("noDragEventsBubbling")(noDragEventsBubbling.asInstanceOf[js.Any]) - if (!js.isUndefined(noKeyboard)) __obj.updateDynamic("noKeyboard")(noKeyboard.asInstanceOf[js.Any]) - if (onDragEnter != null) __obj.updateDynamic("onDragEnter")(js.Any.fromFunction1(onDragEnter)) - if (onDragLeave != null) __obj.updateDynamic("onDragLeave")(js.Any.fromFunction1(onDragLeave)) - if (onDragOver != null) __obj.updateDynamic("onDragOver")(js.Any.fromFunction1(onDragOver)) - if (onDrop != null) __obj.updateDynamic("onDrop")(js.Any.fromFunction3(onDrop)) - if (onDropAccepted != null) __obj.updateDynamic("onDropAccepted")(js.Any.fromFunction2(onDropAccepted)) - if (onDropRejected != null) __obj.updateDynamic("onDropRejected")(js.Any.fromFunction2(onDropRejected)) - if (onFileDialogCancel != null) __obj.updateDynamic("onFileDialogCancel")(js.Any.fromFunction0(onFileDialogCancel)) - if (!js.isUndefined(preventDropOnDocument)) __obj.updateDynamic("preventDropOnDocument")(preventDropOnDocument.asInstanceOf[js.Any]) - if (ref != null) __obj.updateDynamic("ref")(ref.asInstanceOf[js.Any]) - __obj.asInstanceOf[DropzonePropsRefAttributesDropzoneRef] - } -} - diff --git a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/DropzoneProps.scala b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/DropzoneProps.scala index c29eb56e99..3b3740aabb 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/DropzoneProps.scala +++ b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/DropzoneProps.scala @@ -1,67 +1,15 @@ package typings.reactDropzone.mod import typings.react.mod.DragEvent -import typings.react.mod.DragEventHandler import typings.react.mod._Global_.JSX.Element import typings.std.HTMLElement import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ -/* Inlined parent react-dropzone.react-dropzone.DropzoneOptions */ @js.native -trait DropzoneProps extends js.Object { - var accept: js.UndefOr[String | js.Array[String]] = js.native +trait DropzoneProps extends DropzoneOptions { var children: js.UndefOr[js.Function1[/* state */ DropzoneState, Element]] = js.native - var disabled: js.UndefOr[Boolean] = js.native - var getFilesFromEvent: js.UndefOr[ - js.Function1[ - /* event */ DropEvent, - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify Promise> */ _ - ] - ] = js.native - var maxSize: js.UndefOr[Double] = js.native - var minSize: js.UndefOr[Double] = js.native - var multiple: js.UndefOr[Boolean] = js.native - var noClick: js.UndefOr[Boolean] = js.native - var noDrag: js.UndefOr[Boolean] = js.native - var noDragEventsBubbling: js.UndefOr[Boolean] = js.native - var noKeyboard: js.UndefOr[Boolean] = js.native - var onDragEnter: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDragLeave: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDragOver: js.UndefOr[DragEventHandler[HTMLElement]] = js.native - var onDrop: js.UndefOr[ - js.Function3[ - /* acceptedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* rejectedFiles */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onDropAccepted: js.UndefOr[ - js.Function2[ - /* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onDropRejected: js.UndefOr[ - js.Function2[ - /* files */ js.Array[ - /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ - ], - /* event */ DropEvent, - Unit - ] - ] = js.native - var onFileDialogCancel: js.UndefOr[js.Function0[Unit]] = js.native - var preventDropOnDocument: js.UndefOr[Boolean] = js.native } object DropzoneProps { diff --git a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/default.scala b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/default.scala index c945acdcda..4f67534420 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/default.scala +++ b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/default.scala @@ -1,7 +1,7 @@ package typings.reactDropzone.mod +import typings.react.mod.RefAttributes import typings.react.mod._Global_.JSX.Element -import typings.reactDropzone.DropzonePropsRefAttributesDropzoneRef import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @@ -9,6 +9,6 @@ import scala.scalajs.js.annotation._ @JSImport("react-dropzone", JSImport.Default) @js.native object default extends js.Object { - def apply(props: DropzonePropsRefAttributesDropzoneRef): Element = js.native + def apply(props: DropzoneProps with RefAttributes[DropzoneRef]): Element = js.native } diff --git a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/package.scala b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/package.scala index a4e6723fe7..3d00fb0d9b 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/package.scala +++ b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/package.scala @@ -6,4 +6,5 @@ import scala.scalajs.js.annotation._ package object mod { type DropEvent = typings.react.mod.DragEvent[typings.std.HTMLElement] | typings.react.mod.ChangeEvent[typings.std.HTMLInputElement] | typings.std.DragEvent | typings.std.Event + type DropzoneState = typings.reactDropzone.mod.DropzoneRef with typings.reactDropzone.AnonAcceptedFiles } diff --git a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/reactDropzoneComponents.scala b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/reactDropzoneComponents.scala index da29f7e131..c4968d6c55 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/reactDropzoneComponents.scala +++ b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/reactDropzoneComponents.scala @@ -1,12 +1,16 @@ package typings.reactDropzone import typings.react.mod.ComponentType +import typings.react.mod.RefAttributes +import typings.reactDropzone.mod.DropzoneProps +import typings.reactDropzone.mod.DropzoneRef import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ object reactDropzoneComponents extends reactDropzoneProps { @scala.inline - def ReactDropzone: ComponentType[ReactDropzoneProps] = typings.reactDropzone.mod.default.asInstanceOf[typings.react.mod.ComponentType[ReactDropzoneProps]] + def ReactDropzone: ComponentType[DropzoneProps with RefAttributes[DropzoneRef]] = typings.reactDropzone.mod.default.asInstanceOf[typings.react.mod.ComponentType[ + typings.reactDropzone.mod.DropzoneProps with typings.react.mod.RefAttributes[typings.reactDropzone.mod.DropzoneRef]]] } diff --git a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/reactDropzoneProps.scala b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/reactDropzoneProps.scala index 77ca7736b4..2b069a17cb 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/reactDropzoneProps.scala +++ b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/reactDropzoneProps.scala @@ -4,9 +4,5 @@ import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ -trait reactDropzoneProps { - @scala.inline - def ReactDropzoneProps: DropzonePropsRefAttributesDropzoneRef.type = typings.reactDropzone.DropzonePropsRefAttributesDropzoneRef - type ReactDropzoneProps = DropzonePropsRefAttributesDropzoneRef -} +trait reactDropzoneProps diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/build.sbt b/importer/src/test/resources/type-mappings/check/t/type-mappings/build.sbt index 0ffc3831dc..95f73e4893 100644 --- a/importer/src/test/resources/type-mappings/check/t/type-mappings/build.sbt +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "type-mappings" -version := "0.0-unknown-288553" +version := "0.0-unknown-b657a8" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonGet.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonGet.scala new file mode 100644 index 0000000000..d4838bedcd --- /dev/null +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonGet.scala @@ -0,0 +1,13 @@ +package typings.typeMappings + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait AnonGet extends js.Object { + def get(): js.UndefOr[Double | Null] = js.native + def set(): Unit = js.native + def set(v: Double): Unit = js.native +} + diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonGetSet.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonGetSet.scala new file mode 100644 index 0000000000..57a853b96e --- /dev/null +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonGetSet.scala @@ -0,0 +1,21 @@ +package typings.typeMappings + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait AnonGetSet extends js.Object { + def get(): String = js.native + def set(v: String): Unit = js.native +} + +object AnonGetSet { + @scala.inline + def apply(get: () => String, set: String => Unit): AnonGetSet = { + val __obj = js.Dynamic.literal(get = js.Any.fromFunction0(get), set = js.Any.fromFunction1(set)) + + __obj.asInstanceOf[AnonGetSet] + } +} + diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/Excluded.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/Excluded.scala new file mode 100644 index 0000000000..325503f534 --- /dev/null +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/Excluded.scala @@ -0,0 +1,33 @@ +package typings.typeMappings + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +/* Inlined type-mappings.Omit */ +@js.native +trait Excluded extends js.Object { + var fontFamily: String = js.native + var fontSize: String = js.native + var fontWeight: String = js.native + var letterSpacing: String = js.native + var lineHeight: String = js.native + var textTransform: String = js.native +} + +object Excluded { + @scala.inline + def apply( + fontFamily: String, + fontSize: String, + fontWeight: String, + letterSpacing: String, + lineHeight: String, + textTransform: String + ): Excluded = { + val __obj = js.Dynamic.literal(fontFamily = fontFamily.asInstanceOf[js.Any], fontSize = fontSize.asInstanceOf[js.Any], fontWeight = fontWeight.asInstanceOf[js.Any], letterSpacing = letterSpacing.asInstanceOf[js.Any], lineHeight = lineHeight.asInstanceOf[js.Any], textTransform = textTransform.asInstanceOf[js.Any]) + + __obj.asInstanceOf[Excluded] + } +} + diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/IProxiedPerson.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/IProxiedPerson.scala new file mode 100644 index 0000000000..01459c2f28 --- /dev/null +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/IProxiedPerson.scala @@ -0,0 +1,22 @@ +package typings.typeMappings + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +/* Inlined parent type-mappings.Proxify */ +@js.native +trait IProxiedPerson extends js.Object { + var age: AnonGet = js.native + var name: AnonGetSet = js.native +} + +object IProxiedPerson { + @scala.inline + def apply(age: AnonGet, name: AnonGetSet): IProxiedPerson = { + val __obj = js.Dynamic.literal(age = age.asInstanceOf[js.Any], name = name.asInstanceOf[js.Any]) + + __obj.asInstanceOf[IProxiedPerson] + } +} + diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/NamePerson.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/NamePerson.scala new file mode 100644 index 0000000000..fc3c8946ef --- /dev/null +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/NamePerson.scala @@ -0,0 +1,21 @@ +package typings.typeMappings + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +/* Inlined std.Pick */ +@js.native +trait NamePerson extends js.Object { + var name: String = js.native +} + +object NamePerson { + @scala.inline + def apply(name: String): NamePerson = { + val __obj = js.Dynamic.literal(name = name.asInstanceOf[js.Any]) + + __obj.asInstanceOf[NamePerson] + } +} + diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/PartialPerson.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/PartialPerson.scala new file mode 100644 index 0000000000..bea105f8b2 --- /dev/null +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/PartialPerson.scala @@ -0,0 +1,23 @@ +package typings.typeMappings + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +/* Inlined std.Partial */ +@js.native +trait PartialPerson extends js.Object { + var age: js.UndefOr[Double] = js.native + var name: js.UndefOr[String] = js.native +} + +object PartialPerson { + @scala.inline + def apply(age: Int | Double = null, name: String = null): PartialPerson = { + val __obj = js.Dynamic.literal() + if (age != null) __obj.updateDynamic("age")(age.asInstanceOf[js.Any]) + if (name != null) __obj.updateDynamic("name")(name.asInstanceOf[js.Any]) + __obj.asInstanceOf[PartialPerson] + } +} + diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/PersonRecord.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/PersonRecord.scala new file mode 100644 index 0000000000..31baf07fb8 --- /dev/null +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/PersonRecord.scala @@ -0,0 +1,22 @@ +package typings.typeMappings + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +/* Inlined std.Record<'name' | 'age', string> */ +@js.native +trait PersonRecord extends js.Object { + var age: String = js.native + var name: String = js.native +} + +object PersonRecord { + @scala.inline + def apply(age: String, name: String): PersonRecord = { + val __obj = js.Dynamic.literal(age = age.asInstanceOf[js.Any], name = name.asInstanceOf[js.Any]) + + __obj.asInstanceOf[PersonRecord] + } +} + diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/ProxiedPerson.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/ProxiedPerson.scala new file mode 100644 index 0000000000..de1f0b9e08 --- /dev/null +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/ProxiedPerson.scala @@ -0,0 +1,22 @@ +package typings.typeMappings + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +/* Inlined type-mappings.Proxify */ +@js.native +trait ProxiedPerson extends js.Object { + var age: AnonGet = js.native + var name: AnonGetSet = js.native +} + +object ProxiedPerson { + @scala.inline + def apply(age: AnonGet, name: AnonGetSet): ProxiedPerson = { + val __obj = js.Dynamic.literal(age = age.asInstanceOf[js.Any], name = name.asInstanceOf[js.Any]) + + __obj.asInstanceOf[ProxiedPerson] + } +} + diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/ReadonlyPerson.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/ReadonlyPerson.scala new file mode 100644 index 0000000000..e88cdd713d --- /dev/null +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/ReadonlyPerson.scala @@ -0,0 +1,22 @@ +package typings.typeMappings + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +/* Inlined std.Readonly */ +@js.native +trait ReadonlyPerson extends js.Object { + val age: js.UndefOr[Double] = js.native + val name: String = js.native +} + +object ReadonlyPerson { + @scala.inline + def apply(name: String, age: Int | Double = null): ReadonlyPerson = { + val __obj = js.Dynamic.literal(name = name.asInstanceOf[js.Any]) + if (age != null) __obj.updateDynamic("age")(age.asInstanceOf[js.Any]) + __obj.asInstanceOf[ReadonlyPerson] + } +} + diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/RequiredPerson.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/RequiredPerson.scala new file mode 100644 index 0000000000..1812dd4de4 --- /dev/null +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/RequiredPerson.scala @@ -0,0 +1,22 @@ +package typings.typeMappings + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +/* Inlined std.Required */ +@js.native +trait RequiredPerson extends js.Object { + var age: Double = js.native + var name: String = js.native +} + +object RequiredPerson { + @scala.inline + def apply(age: Double, name: String): RequiredPerson = { + val __obj = js.Dynamic.literal(age = age.asInstanceOf[js.Any], name = name.asInstanceOf[js.Any]) + + __obj.asInstanceOf[RequiredPerson] + } +} + diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/TypographyStyle.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/TypographyStyle.scala new file mode 100644 index 0000000000..7c25b6558b --- /dev/null +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/TypographyStyle.scala @@ -0,0 +1,37 @@ +package typings.typeMappings + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +/* Inlined std.Required> & std.Partial> */ +@js.native +trait TypographyStyle extends js.Object { + var color: String = js.native + var fontFamily: String = js.native + var fontSize: String = js.native + var fontWeight: String = js.native + var letterSpacing: js.UndefOr[String] = js.native + var lineHeight: js.UndefOr[String] = js.native + var textTransform: js.UndefOr[String] = js.native +} + +object TypographyStyle { + @scala.inline + def apply( + color: String, + fontFamily: String, + fontSize: String, + fontWeight: String, + letterSpacing: String = null, + lineHeight: String = null, + textTransform: String = null + ): TypographyStyle = { + val __obj = js.Dynamic.literal(color = color.asInstanceOf[js.Any], fontFamily = fontFamily.asInstanceOf[js.Any], fontSize = fontSize.asInstanceOf[js.Any], fontWeight = fontWeight.asInstanceOf[js.Any]) + if (letterSpacing != null) __obj.updateDynamic("letterSpacing")(letterSpacing.asInstanceOf[js.Any]) + if (lineHeight != null) __obj.updateDynamic("lineHeight")(lineHeight.asInstanceOf[js.Any]) + if (textTransform != null) __obj.updateDynamic("textTransform")(textTransform.asInstanceOf[js.Any]) + __obj.asInstanceOf[TypographyStyle] + } +} + diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/TypographyStyleOptions.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/TypographyStyleOptions.scala new file mode 100644 index 0000000000..a3ba69862e --- /dev/null +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/TypographyStyleOptions.scala @@ -0,0 +1,41 @@ +package typings.typeMappings + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +/* Inlined std.Partial */ +@js.native +trait TypographyStyleOptions extends js.Object { + var color: js.UndefOr[String] = js.native + var fontFamily: js.UndefOr[String] = js.native + var fontSize: js.UndefOr[String] = js.native + var fontWeight: js.UndefOr[String] = js.native + var letterSpacing: js.UndefOr[String] = js.native + var lineHeight: js.UndefOr[String] = js.native + var textTransform: js.UndefOr[String] = js.native +} + +object TypographyStyleOptions { + @scala.inline + def apply( + color: String = null, + fontFamily: String = null, + fontSize: String = null, + fontWeight: String = null, + letterSpacing: String = null, + lineHeight: String = null, + textTransform: String = null + ): TypographyStyleOptions = { + val __obj = js.Dynamic.literal() + if (color != null) __obj.updateDynamic("color")(color.asInstanceOf[js.Any]) + if (fontFamily != null) __obj.updateDynamic("fontFamily")(fontFamily.asInstanceOf[js.Any]) + if (fontSize != null) __obj.updateDynamic("fontSize")(fontSize.asInstanceOf[js.Any]) + if (fontWeight != null) __obj.updateDynamic("fontWeight")(fontWeight.asInstanceOf[js.Any]) + if (letterSpacing != null) __obj.updateDynamic("letterSpacing")(letterSpacing.asInstanceOf[js.Any]) + if (lineHeight != null) __obj.updateDynamic("lineHeight")(lineHeight.asInstanceOf[js.Any]) + if (textTransform != null) __obj.updateDynamic("textTransform")(textTransform.asInstanceOf[js.Any]) + __obj.asInstanceOf[TypographyStyleOptions] + } +} + diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonAgeName.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/U.scala similarity index 63% rename from importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonAgeName.scala rename to importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/U.scala index 8bca91d9d3..789740bec1 100644 --- a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonAgeName.scala +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/U.scala @@ -4,18 +4,19 @@ import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ +/* Inlined std.Pick<{ name :string, age :number}, 'name' | 'age'> */ @js.native -trait AnonAgeName extends js.Object { +trait U extends js.Object { var age: Double = js.native var name: String = js.native } -object AnonAgeName { +object U { @scala.inline - def apply(age: Double, name: String): AnonAgeName = { + def apply(age: Double, name: String): U = { val __obj = js.Dynamic.literal(age = age.asInstanceOf[js.Any], name = name.asInstanceOf[js.Any]) - __obj.asInstanceOf[AnonAgeName] + __obj.asInstanceOf[U] } } diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/V.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/V.scala new file mode 100644 index 0000000000..095857d294 --- /dev/null +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/V.scala @@ -0,0 +1,21 @@ +package typings.typeMappings + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +/* Inlined std.Pick<{ name :string, age :number}, 'age'> */ +@js.native +trait V extends js.Object { + var age: Double = js.native +} + +object V { + @scala.inline + def apply(age: Double): V = { + val __obj = js.Dynamic.literal(age = age.asInstanceOf[js.Any]) + + __obj.asInstanceOf[V] + } +} + diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/package.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/package.scala index 3a347ad843..6de7c51651 100644 --- a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/package.scala +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/package.scala @@ -5,44 +5,16 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ package object typeMappings { - type Excluded = typings.typeMappings.Omit[typings.typeMappings.CSSProperties, typings.typeMappings.typeMappingsStrings.color] type IPersonRecord = typings.typeMappings.PersonRecord - type IProxiedPerson = typings.typeMappings.Proxify[typings.typeMappings.Person] - type NamePerson = typings.std.Pick[typings.typeMappings.Person, typings.typeMappings.typeMappingsStrings.name] type NewedPerson = typings.std.InstanceType[org.scalablytyped.runtime.Instantiable0[typings.typeMappings.Person]] type NonNullablePerson = typings.std.NonNullable[typings.typeMappings.Person] type Omit[T, K /* <: java.lang.String */] = typings.std.Pick[T, typings.std.Exclude[java.lang.String, K]] - type PartialPerson = typings.std.Partial[typings.typeMappings.Person] - type PersonRecord = typings.std.Record[ - typings.typeMappings.typeMappingsStrings.name | typings.typeMappings.typeMappingsStrings.age, - java.lang.String - ] - type ProxiedPerson = typings.typeMappings.Proxify[typings.typeMappings.Person] type Proxify[T] = /* import warning: importer.ImportType#apply c Unsupported type mapping: {[ P in keyof T ]: {get (): T[P], set (v : T[P]): void}} */ typings.typeMappings.typeMappingsStrings.Proxify with js.Any - type ReadonlyPerson = typings.typeMappings.Person - type RequiredPerson = typings.std.Required[typings.typeMappings.Person] type ReturnedPerson = typings.std.ReturnType[js.Function0[typings.typeMappings.Person]] type T = typings.std.Pick[ typings.typeMappings.AnonName | typings.typeMappings.AnonAge, typings.typeMappings.typeMappingsStrings.name with typings.typeMappings.typeMappingsStrings.age ] - type TypographyStyle = (typings.std.Required[ - typings.std.Pick[ - typings.typeMappings.CSSProperties, - typings.typeMappings.typeMappingsStrings.fontFamily | typings.typeMappings.typeMappingsStrings.fontSize | typings.typeMappings.typeMappingsStrings.fontWeight | typings.typeMappings.typeMappingsStrings.color - ] - ]) with (typings.std.Partial[ - typings.std.Pick[ - typings.typeMappings.CSSProperties, - typings.typeMappings.typeMappingsStrings.letterSpacing | typings.typeMappings.typeMappingsStrings.lineHeight | typings.typeMappings.typeMappingsStrings.textTransform - ] - ]) - type TypographyStyleOptions = /* InlineNestedIdentityAlias: typings.std.Partial*/ typings.typeMappings.TypographyStyle - type U = typings.std.Pick[ - typings.typeMappings.AnonAgeName, - typings.typeMappings.typeMappingsStrings.name | typings.typeMappings.typeMappingsStrings.age - ] - type V = typings.std.Pick[typings.typeMappings.AnonAgeName, typings.typeMappings.typeMappingsStrings.age] } diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/typeMappingsStrings.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/typeMappingsStrings.scala index 5b7dc91634..16eebce3be 100644 --- a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/typeMappingsStrings.scala +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/typeMappingsStrings.scala @@ -11,49 +11,14 @@ object typeMappingsStrings { @js.native sealed trait age extends js.Object - @js.native - sealed trait color extends js.Object - - @js.native - sealed trait fontFamily extends js.Object - - @js.native - sealed trait fontSize extends js.Object - - @js.native - sealed trait fontWeight extends js.Object - - @js.native - sealed trait letterSpacing extends js.Object - - @js.native - sealed trait lineHeight extends js.Object - @js.native sealed trait name extends js.Object - @js.native - sealed trait textTransform extends js.Object - @scala.inline def Proxify: Proxify = "Proxify".asInstanceOf[Proxify] @scala.inline def age: age = "age".asInstanceOf[age] @scala.inline - def color: color = "color".asInstanceOf[color] - @scala.inline - def fontFamily: fontFamily = "fontFamily".asInstanceOf[fontFamily] - @scala.inline - def fontSize: fontSize = "fontSize".asInstanceOf[fontSize] - @scala.inline - def fontWeight: fontWeight = "fontWeight".asInstanceOf[fontWeight] - @scala.inline - def letterSpacing: letterSpacing = "letterSpacing".asInstanceOf[letterSpacing] - @scala.inline - def lineHeight: lineHeight = "lineHeight".asInstanceOf[lineHeight] - @scala.inline def name: name = "name".asInstanceOf[name] - @scala.inline - def textTransform: textTransform = "textTransform".asInstanceOf[textTransform] } diff --git a/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansion.scala b/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansionTest.scala similarity index 50% rename from importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansion.scala rename to importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansionTest.scala index af4b594eb9..c04eca06ff 100644 --- a/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansion.scala +++ b/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansionTest.scala @@ -5,7 +5,7 @@ package parser import org.scalatest.funsuite.AnyFunSuite import org.scalatest.matchers.should.Matchers -class TypeExpansion extends AnyFunSuite with Matchers with TypeExpansionHarness { +class TypeExpansionTest extends AnyFunSuite with Matchers with TypeExpansionHarness { test("Partial") { @@ -50,14 +50,60 @@ type AA = Partial } test("Except from union type") { - pending val out = run(s""" type Exclude = T extends U ? never : T; export declare type PanelMode = 'time' | 'date' | 'week' | 'month' | 'year' | 'decade'; export declare type PickerMode = Exclude; -""").extract[TsDeclTypeAlias]("PickerMode") +""").extract[TsDeclEnum]("PickerMode") + + val expected = Set("time", "date", "week", "month", "year") + + out.members.map(_.name.value).toSet.shouldBe(expected) + } + + test("circular") { + val out = run(s""" + + interface ToJsonOutput { + children?: Array; + } + + interface Array{} +""").extract[TsDeclInterface]("ToJsonOutput") + + val expected = + TsMemberProperty( + NoComments, + ProtectionLevel.Default, + TsIdentSimple("children"), + Some( + TsTypeRef( + NoComments, + TsQIdent(IArray(TsIdentLibrarySimple("testing"), TsIdentSimple("Array"))), + IArray( + TsTypeIntersect( + IArray( + TsTypeRef( + NoComments, + TsQIdent(IArray(TsIdentLibrarySimple("testing"), TsIdentSimple("ToJsonOutput"))), + IArray(), + ), + TsTypeRef( + NoComments, + TsQIdent(IArray(TsIdentLibrarySimple("testing"), TsIdentSimple("Anon_Name"))), + IArray(), + ), + ), + ), + ), + ), + ), + None, + false, + false, + true, + ) - val Out = IArray("time", "date", "week", "month", "year").map(x => TsTypeLiteral(TsLiteralString(x))) - out.alias.shouldBe(TsTypeUnion(Out)) + out.membersByName(TsIdent("children")).shouldBe(IArray(expected)) } } diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/FollowAliases.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/FollowAliases.scala index 7899c2ab19..db0460ecce 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/FollowAliases.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/FollowAliases.scala @@ -6,6 +6,8 @@ object FollowAliases { tpe match { case TypeRef.Union(types) => TypeRef.Union(types map FollowAliases(scope), sort = false) + case TypeRef.Intersection(types) => + TypeRef.Intersection(types map FollowAliases(scope)) case other if TypeRef.Primitive(other) => other case other if scope.isAbstract(other) => other case TypeRef.undefined => TypeRef.undefined diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenCompanions.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenCompanions.scala index b446d1d924..f9d68b74b7 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenCompanions.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenCompanions.scala @@ -37,7 +37,7 @@ final class GenCompanions(memberToProp: MemberToProp, findProps: FindProps) exte .map(method => ModuleTree(Empty, cls.name, Empty, IArray(method), NoComments, cls.codePath, isOverride = false), ) - .filter(ensureNotTooManyStrings) + .filter(ensureNotTooManyStrings(scope)) IArray.fromOptions(Some(cls), modOpt) @@ -49,7 +49,7 @@ final class GenCompanions(memberToProp: MemberToProp, findProps: FindProps) exte val modOpt: Option[ModuleTree] = Some(ModuleTree(Empty, cls.name, Empty, methods, NoComments, cls.codePath, isOverride = false)) - .filter(ensureNotTooManyStrings) + .filter(ensureNotTooManyStrings(scope)) IArray.fromOptions(Some(cls), modOpt) } @@ -63,13 +63,19 @@ final class GenCompanions(memberToProp: MemberToProp, findProps: FindProps) exte * [E] [E-1] Error while emitting typingsJapgolly/csstype/csstypeMod/StandardLonghandPropertiesHyphenFallback$ * [E] UTF8 string too large */ - def ensureNotTooManyStrings(mod: ModuleTree): Boolean = { + def ensureNotTooManyStrings(scope: TreeScope)(mod: ModuleTree): Boolean = { val MaxWeight = 32768 // an estimate. If you see the error again, decrease this + object Dealias extends TreeTransformation { + override def leaveTypeRef(scope: TreeScope)(s: TypeRef): TypeRef = FollowAliases(scope)(s) + } + var stringLength = 0 - TreeTraverse.foreach(mod) { - case QualifiedName(parts) => parts.foreach(p => stringLength += p.unescaped.length) - case _ => () + + TreeTraverse.foreach(Dealias.visitModuleTree(scope)(mod)) { + case name: QualifiedName => + name.parts.foreach(p => stringLength += p.unescaped.length) + case _ => () } stringLength < MaxWeight diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala index a4d4b6a311..cca86d6d8b 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala @@ -5,59 +5,56 @@ package transforms import org.scalablytyped.converter.internal.ts.TsTreeScope.LoopDetector object ExpandTypeMappings extends TreeTransformationScopedChanges { - val Debug = false object After extends TreeTransformationScopedChanges { - def apply(inLibrary: TsIdentLibrary, scope: TsTreeScope)(file: TsParsedFile): TsParsedFile = { - val store = new ExtractInterfaces.ConflictHandlingStore(inLibrary) - val V = new V(store) - val asd = V.visitTsParsedFile(scope)(file) - - asd.copy(members = asd.members ++ IArray.fromTraversable(store.interfaces.values)) + private object Unqualify extends TreeTransformationUnit { + override def enterTsQIdent(t: Unit)(x: TsQIdent): TsQIdent = + x.copy(parts = IArray(x.parts.last)) } - class V(store: ExtractInterfaces.ConflictHandlingStore) extends TreeTransformationScopedChanges { - - object Unqualify extends TreeTransformationUnit { - override def enterTsQIdent(t: Unit)(x: TsQIdent): TsQIdent = - x.copy(parts = IArray(x.parts.last)) + override def enterTsType(scope: TsTreeScope)(x: TsType): TsType = { + def tooDeep = { + val numTypeObjects = scope.stack.count { + case TsTypeObject(_, _) => true; + case _ => false + } + numTypeObjects > 2 } - override def enterTsType(scope: TsTreeScope)(x: TsType): TsType = - AllMembersFor.forType(scope)(x) match { - case Problems(problems) => - if (Debug) { - AllMembersFor.forType(scope)(x) - problems.foreach(p => scope.logger.warn(p.toString)) - } - x + def refersAbstract = + TsTreeTraverse + .collect(x) { + case TsTypeRef(_, name @ TsQIdent(IArray.exactlyOne(_)), Empty) if scope.isAbstract(name) => name + } + .nonEmpty - case Ok(newMembers, true) => - val nameHint = TsTypeFormatter(Unqualify.visitTsType(())(x)).filter(_.isLetterOrDigit).take(50) + if (tooDeep || refersAbstract) return x - val notices = Comments( - List( - Comment("/* Inlined " + TsTypeFormatter(x) + " */\n"), - CommentData(Markers.NameHint(nameHint)), - ), - ) - TsTypeObject(notices, newMembers) - case _ => x - } + AllMembersFor.forType(scope, LoopDetector.initial)(x) match { + case Problems(_) => + x + case Ok(newMembers, true) => + val nameHint = TsTypeFormatter(Unqualify.visitTsType(())(x)).filter(_.isLetterOrDigit).take(50) + + val notices = Comments( + List( + Comment("/* Inlined " + TsTypeFormatter(x) + " */\n"), + CommentData(Markers.NameHint(nameHint)), + ), + ) + TsTypeObject(notices, newMembers) + case _ => x + } } } override def enterTsDecl(scope: TsTreeScope)(x: TsDecl): TsDecl = x match { case i: TsDeclInterface => - AllMembersFor.forInterface(scope)(i) match { - case Problems(problems) => - if (Debug) { - AllMembersFor.forInterface(scope)(i) - problems.foreach(p => scope.logger.warn(p.toString)) - } + AllMembersFor.forInterface(scope, LoopDetector.initial)(i) match { + case Problems(_) => i case Ok(newMembers, true) => val notices = Comments( @@ -71,27 +68,28 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { case _ => x } - case TsDeclTypeAlias(comments, declared, name, tparams, alias, codePath) + case ta @ TsDeclTypeAlias(comments, declared, name, tparams, alias, codePath) if !comments.has(Markers.IsTrivial) && !pointsToConcreteType(scope, alias) => - AllMembersFor.forType(scope)(alias) match { - case Problems(problems) => - if (Debug) { - AllMembersFor.forType(scope)(alias) - problems.foreach(p => scope.logger.warn(p.toString)) + AllMembersFor.forType(scope, LoopDetector.initial)(alias) match { + case Problems(_) => + evaluateKeys(scope, LoopDetector.initial)(alias) match { + case Ok(value, true) => + val notice = Comment("/* Inlined " + TsTypeFormatter(alias) + " */\n") + ta.copy( + comments = comments + notice, + alias = TsTypeUnion.simplified(IArray.fromTraversable(value).map(TsTypeLiteral)), + ) + case Ok(_, false) => + ta + case Problems(_) => + ta } - x case Ok(newMembers, true) => - TsDeclInterface( - comments + Comment("/* Inlined " + TsTypeFormatter(alias) + " */\n"), - declared, - name, - tparams, - Empty, - newMembers, - codePath, - ) + val notice = Comment("/* Inlined " + TsTypeFormatter(alias) + " */\n") + TsDeclInterface(comments + notice, declared, name, tparams, Empty, newMembers, codePath) case _ => x } + case _ => x } @@ -170,21 +168,21 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { case class UnsupportedTM(scope: TsTreeScope, tm: TsMemberTypeMapped) extends Problem case class CouldNotPickKeys(scope: TsTreeScope, keys: Set[String]) extends Problem - final case class Replace(key: TsType, name: String) extends TreeTransformationScopedChanges { + final case class Replace(key: TsType, name: TsLiteral, ld: LoopDetector) extends TreeTransformationScopedChanges { override def enterTsType(scope: TsTreeScope)(x: TsType): TsType = x match { - case `key` => TsTypeLiteral(TsLiteralString(name)) + case `key` => TsTypeLiteral(name) case TsTypeLookup(from, `key`) => val foundType: Option[TsType] = - AllMembersFor.forType(scope)(from) match { + AllMembersFor.forType(scope, ld)(from) match { case Ok(members, _) => members collectFirst { - case TsMemberProperty(_, _, TsIdent(`name`), tpeOpt, _, false, _, isOptional) => + case TsMemberProperty(_, _, TsIdent(name.literal), tpeOpt, _, false, _, isOptional) => ResolveTypeLookups.optional( tpeOpt.fold[TsType](TsTypeRef.any)(visitTsType(scope)), isOptional, ) - case TsMemberFunction(_, _, TsIdent(`name`), signature, false, _, isOptional) => + case TsMemberFunction(_, _, TsIdent(name.literal), signature, false, _, isOptional) => ResolveTypeLookups.optional( visitTsType(scope)(TsTypeFunction(signature)), isOptional, @@ -203,56 +201,60 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { } } - def evaluateKeys(scope: TsTreeScope)(keys: TsType): Res[Set[String]] = { - def keysFor(members: IArray[TsMember]): IArray[String] = + def evaluateKeys(scope: TsTreeScope, ld: LoopDetector)(keys: TsType): Res[Set[TsLiteral]] = { + def keysFor(members: IArray[TsMember]): IArray[TsLiteral] = members collect { - case x: TsMemberProperty => x.name.value - case x: TsMemberFunction => x.name.value + case x: TsMemberProperty => TsLiteralString(x.name.value) + case x: TsMemberFunction => TsLiteralString(x.name.value) } - val res = FollowAliases(scope)(keys) match { + val res: Res[Set[TsLiteral]] = FollowAliases(scope)(keys) match { case tr: TsTypeRef if scope.isAbstract(tr.name) => Problems(IArray(NotStatic(scope, tr))) case tr: TsTypeRef => - val res = scope.lookupInternal(Picker.Types, tr.name.parts, LoopDetector.initial) collectFirst { + val res: Option[Res[Set[TsLiteral]]] = scope.lookupInternal(Picker.Types, tr.name.parts, LoopDetector.initial) collectFirst { case (x: TsDeclTypeAlias, _) => - evaluateKeys(scope)(FillInTParams(x, tr.tparams).alias) + evaluateKeys(scope, ld)(FillInTParams(x, tr.tparams).alias) case (x: TsDeclInterface, _) => val names = FillInTParams(x, tr.tparams).members.collect { - case TsMemberProperty(_, _, name, _, _, _, _, _) => name.value - case TsMemberFunction(_, _, name, _, _, _, _) => name.value + case TsMemberProperty(_, _, name, _, _, _, _, _) => TsLiteralString(name.value) + case TsMemberFunction(_, _, name, _, _, _, _) => TsLiteralString(name.value) } Ok(names.toSet, wasRewritten = false) case (x: TsDeclEnum, _) if x.isConst => val names = x.members.collect { - case TsEnumMember(_, _, Some(TsExpr.Literal(lit))) => lit.literal + case TsEnumMember(_, _, Some(TsExpr.Literal(lit))) => lit } Ok(names.toSet, wasRewritten = false) } res.getOrElse(Problems(IArray(TypeNotFound(scope, tr)))) - case TsTypeLiteral(literal) => Ok(Set(literal.literal), wasRewritten = false) + case TsTypeLiteral(literal) => Ok(Set(literal), wasRewritten = false) case TsTypeKeyOf(key) => - AllMembersFor.forType(scope)(key).map(ms => keysFor(ms).toSet) + AllMembersFor.forType(scope, ld)(key).map(ms => keysFor(ms).toSet) case TsTypeObject(_, members) => Ok(keysFor(members).toSet, wasRewritten = false) case TsTypeUnion(types) => Res - .sequence(types.filterNot(_ === TsTypeRef.never).map(evaluateKeys(scope))) + .sequence(types.filterNot(_ === TsTypeRef.never).map(evaluateKeys(scope, ld))) .map(_.toSet.flatten) // Exclude case TsTypeConditional(TsTypeExtends(t, u), TsTypeRef.never, t2) if t === t2 => - for { - kt <- evaluateKeys(scope)(t) - ku <- evaluateKeys(scope)(u) + val ret = for { + kt <- evaluateKeys(scope, ld)(t) + ku <- evaluateKeys(scope, ld)(u) } yield kt -- ku + ret.withIsRewritten + // Extract case TsTypeConditional(TsTypeExtends(t, u), t2, TsTypeRef.never) if t === t2 => - for { - kt <- evaluateKeys(scope)(t) - ku <- evaluateKeys(scope)(u) + val ret = for { + kt <- evaluateKeys(scope, ld)(t) + ku <- evaluateKeys(scope, ld)(u) } yield kt.intersect(ku) + + ret.withIsRewritten case x => Problems(IArray(NotKeysFromTarget(scope, x))) } res @@ -270,18 +272,18 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { } object AllMembersFor { - def forType(scope: TsTreeScope)(tpe: TsType): Res[IArray[TsMember]] = + def forType(scope: TsTreeScope, ld: LoopDetector)(tpe: TsType): Res[IArray[TsMember]] = tpe match { - case x: TsTypeRef => apply(scope)(x) + case x: TsTypeRef => apply(scope, ld)(x) case x: TsTypeIntersect => - Res.sequence(x.types.map(forType(scope))).map(_.flatten).withIsRewritten + Res.sequence(x.types.map(forType(scope, ld))).map(_.flatten) case IsTypeMapping(TsMemberTypeMapped(_, _, _, _, from: TsTypeRef, _, _)) if scope.isAbstract(from.name) => Problems(IArray(NotStatic(scope, from))) case IsTypeMapping(TsMemberTypeMapped(_, level, readOnly, keyRef, from, optionalize, to)) => - evaluateKeys(scope)(from).map { keys => + evaluateKeys(scope, ld)(from).map { keys => val all = IArray.fromTraversable(keys).map { key => - val replaced = Replace(TsTypeRef.of(keyRef), key).visitTsType(scope)(to) + val replaced = Replace(TsTypeRef.of(keyRef), key, ld).visitTsType(scope)(to) val memberType = ResolveTypeLookups.visitTsType(scope)(replaced) val (base, wasOptional) = memberType match { case OptionalType(unwrapped) => (unwrapped, true) @@ -291,7 +293,7 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { TsMemberProperty( comments = NoComments, level = level, - name = TsIdent(key), + name = TsIdent(key.literal), tpe = Some(base), expr = None, isStatic = false, @@ -329,8 +331,8 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { // } yield picked // foo case TsTypeConditional(pred, ifTrue, ifFalse) => - if (evaluatePredicate(pred)) forType(scope)(ifTrue) - else forType(scope)(ifFalse) + if (evaluatePredicate(pred)) forType(scope, ld)(ifTrue) + else forType(scope, ld)(ifFalse) case x: TsTypeExtends => Problems(IArray(InvalidType(scope, x))) case x: TsTypeInfer => Problems(IArray(InvalidType(scope, x))) @@ -345,6 +347,7 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { case x: TsTypeLookup => Problems(IArray(InvalidType(scope, x))) case x: TsTypeThis => Problems(IArray(InvalidType(scope, x))) case x: TsTypeUnion => Problems(IArray(InvalidType(scope, x))) + case x: TsTypeAsserts => Problems(IArray(InvalidType(scope, x))) } def extract(members: IArray[TsMember], wanted: Set[String]): Option[IArray[TsMember]] = @@ -353,9 +356,20 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { case x: TsMemberProperty if wanted(x.name.value) => x }.nonEmptyOpt - def forInterface(newScope: TsTreeScope)(i: TsDeclInterface): Res[IArray[TsMember]] = + def limitInlining[T <: AnyRef](scope: TsTreeScope, parent: TsTypeRef, res: Res[IArray[T]]): Res[IArray[T]] = + res match { + case res @ Ok(value, true) => + val allAbstract = parent.tparams.forall { + case TsTypeRef(_, name, Empty) if scope.isAbstract(name) => true + case _ => false + } + if (allAbstract) Ok(value, wasRewritten = false) else res + case res => res + } + + def forInterface(newScope: TsTreeScope, ld: LoopDetector)(i: TsDeclInterface): Res[IArray[TsMember]] = Res - .sequence(i.inheritance.map(AllMembersFor(newScope))) + .sequence(i.inheritance.map(p => limitInlining(newScope, p, AllMembersFor(newScope, ld)(p)))) .map(fromParents => handleOverridingFields(i.members, fromParents)) /* would want to do this for methods too, and in a more principled way. */ @@ -366,39 +380,44 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { fromThis ++ parentsFields.filterNot(x => thisFieldOverrides(x.name)) ++ parentsRest } - def apply(scope: TsTreeScope)(typeRef: TsTypeRef): Res[IArray[TsMember]] = { - val enableCache = scope.root.cache.isDefined && typeRef.tparams.forall(_.isInstanceOf[TsTypeRef]) - if (enableCache) { - if (scope.root.cache.get.typeMappings.contains(typeRef)) { - return scope.root.cache.get.typeMappings(typeRef) - } - } - - val res = scope.lookupInternal(Picker.Types, typeRef.name.parts, LoopDetector.initial) collectFirst { - case (x: TsDeclInterface, newScope) => - FillInTParams(x, typeRef.tparams) match { - case i: TsDeclInterface => forInterface(newScope)(i) + def apply(scope: TsTreeScope, _ld: LoopDetector)(typeRef: TsTypeRef): Res[IArray[TsMember]] = + _ld.including(typeRef, scope.root) match { + case Left(()) => + Problems(IArray(Loop(scope))) + case Right(ld) => + val enableCache = scope.root.cache.isDefined && typeRef.tparams.forall(_.isInstanceOf[TsTypeRef]) + if (enableCache) { + if (scope.root.cache.get.typeMappings.contains(typeRef)) { + return scope.root.cache.get.typeMappings(typeRef) + } } - case (x: TsDeclClass, newScope) => - FillInTParams(x, typeRef.tparams) match { - case TsDeclClass(_, _, _, _, _, parent, implements, members, _, _) => - Res - .sequence((implements ++ IArray.fromOption(parent)).map(AllMembersFor(newScope))) - .map(fromParents => handleOverridingFields(members, fromParents)) + val res = scope.lookupInternal(Picker.Types, typeRef.name.parts, ld) collectFirst { + case (x: TsDeclInterface, newScope) => + FillInTParams(x, typeRef.tparams) match { + case i: TsDeclInterface => forInterface(newScope, ld)(i) + } + + case (x: TsDeclClass, newScope) => + FillInTParams(x, typeRef.tparams) match { + case TsDeclClass(_, _, _, _, _, parent, implements, members, _, _) => + Res + .sequence((implements ++ IArray.fromOption(parent)).map(AllMembersFor(newScope, ld))) + .map(fromParents => handleOverridingFields(members, fromParents)) + } + + case (x: TsDeclTypeAlias, _) => + forType(scope, ld)(FillInTParams(x, typeRef.tparams).alias) } - case (x: TsDeclTypeAlias, _) => - forType(scope)(FillInTParams(x, typeRef.tparams).alias) - } + val ret = res.getOrElse(Problems(IArray(TypeNotFound(scope, typeRef)))) - val ret = res.getOrElse(Problems(IArray(TypeNotFound(scope, typeRef)))) + if (enableCache) { + scope.root.cache.get.typeMappings.put(typeRef, ret) + } - if (enableCache) { - scope.root.cache.get.typeMappings.put(typeRef, ret) + ret } - ret - } } def pointsToConcreteType(scope: TsTreeScope, alias: TsType): Boolean = diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ResolveTypeLookups.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ResolveTypeLookups.scala index 9072223a1d..ba6d563952 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ResolveTypeLookups.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ResolveTypeLookups.scala @@ -21,15 +21,15 @@ object ResolveTypeLookups extends TreeTransformationScopedChanges { else tpe def expandLookupType(scope: TsTreeScope, lookup: TsTypeLookup): Option[TsType] = - ExpandTypeMappings.evaluateKeys(scope)(lookup.key) match { - case ExpandTypeMappings.Ok(strings, _) => + ExpandTypeMappings.evaluateKeys(scope, LoopDetector.initial)(lookup.key) match { + case ExpandTypeMappings.Ok(keys, _) => FollowAliases(scope)(lookup.from) match { case TsTypeRef(_, name, _) if scope isAbstract name => None case fromTypeRef: TsTypeRef => val members = AllMembersFor(scope, LoopDetector.initial)(fromTypeRef) - pick(members, strings) + pick(members, keys) - case TsTypeObject(_, members) => pick(members, strings) + case TsTypeObject(_, members) => pick(members, keys) case _ => None } case _ => None @@ -37,7 +37,7 @@ object ResolveTypeLookups extends TreeTransformationScopedChanges { val NonStatic = false - def pick(members: IArray[TsMember], strings: Set[String]): Option[TsType] = + def pick(members: IArray[TsMember], strings: Set[TsLiteral]): Option[TsType] = if (strings.isEmpty) { members.collectFirst { case TsMemberIndex(_, _, _, _, isOptional, valueType) => @@ -49,12 +49,12 @@ object ResolveTypeLookups extends TreeTransformationScopedChanges { case other => Some(other) } - def pick(members: IArray[TsMember], Wanted: String): TsType = { + def pick(members: IArray[TsMember], wanted: TsLiteral): TsType = { val (functions, fields, _) = members.partitionCollect2( - { case TsMemberFunction(_, _, TsIdent(Wanted), sig, NonStatic, _, false) => sig }, { - case TsMemberProperty(_, _, TsIdent(Wanted), tpeOpt, _, NonStatic, _, isOptional) => + { case TsMemberFunction(_, _, TsIdent(wanted.literal), sig, NonStatic, _, false) => sig }, { + case TsMemberProperty(_, _, TsIdent(wanted.literal), tpeOpt, _, NonStatic, _, isOptional) => optional(tpeOpt getOrElse TsTypeRef.any, isOptional) - case TsMemberFunction(_, _, TsIdent(Wanted), sig, NonStatic, _, _) => TsTypeFunction(sig) + case TsMemberFunction(_, _, TsIdent(wanted.literal), sig, NonStatic, _, _) => TsTypeFunction(sig) }, ) val combinedFunctions: Option[TsType] = functions.distinct match { diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/trees.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/trees.scala index dc9749ca4c..e8cb57fbfb 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/trees.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/trees.scala @@ -307,7 +307,7 @@ object TsTypeParam { sealed trait TsTerm extends TsTree sealed abstract class TsLiteral(repr: String) extends TsTerm { - def literal = repr + val literal = repr } final case class TsLiteralNumber(value: String) extends TsLiteral(value) From a73b362e4241aca9b618d81fc6cdea1dce66ea4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 09/18] Improve react flavours - Recognize components in intersection types - Support intersection and union types for props - Cleanup slinky web code --- .../check-japgolly/r/react-dropzone/build.sbt | 2 +- .../components/ReactDropzone.scala | 77 +++-- .../check-slinky/r/react-bootstrap/build.sbt | 2 +- .../components/ButtonGroup.scala | 292 +----------------- .../components/ToggleButtonGroup.scala | 2 +- .../check-slinky/r/react-dropzone/build.sbt | 2 +- .../components/ReactDropzone.scala | 51 ++- .../s/semantic-ui-react/build.sbt | 2 +- .../semanticUiReact/components/Button.scala | 4 +- .../semanticUiReact/components/Input.scala | 4 +- .../r/react-transition-group/build.sbt | 2 +- .../components/TransitionGroup.scala | 2 +- .../internal/scalajs/flavours/FindProps.scala | 87 ++++-- .../scalajs/flavours/GenCompanions.scala | 4 +- .../flavours/GenJapgollyComponents.scala | 58 ++-- .../flavours/GenSlinkyComponents.scala | 92 +++--- .../flavours/IdentifyReactComponents.scala | 6 +- .../scalajs/flavours/MemberToProp.scala | 7 + .../internal/scalajs/flavours/Prop.scala | 6 +- .../scalajs/flavours/ReactNames.scala | 9 +- .../converter/internal/IArray.scala | 23 ++ 21 files changed, 296 insertions(+), 438 deletions(-) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt index 15ef838871..8a0e75893a 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-2fd88e" +version := "10.1.10-7e59d8" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/components/ReactDropzone.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/components/ReactDropzone.scala index 1704d3a5f1..9348fdd8ce 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/components/ReactDropzone.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/components/ReactDropzone.scala @@ -1,45 +1,82 @@ package typingsJapgolly.reactDropzone.components -import japgolly.scalajs.react.CtorType.ChildArg +import japgolly.scalajs.react.Callback +import japgolly.scalajs.react.CallbackTo import japgolly.scalajs.react.Key -import japgolly.scalajs.react.component.Js.MountedWithRawType -import japgolly.scalajs.react.component.Js.RawMounted -import japgolly.scalajs.react.component.Js.UnmountedSimple +import japgolly.scalajs.react.ReactDragEventFrom +import japgolly.scalajs.react.component.JsForwardRef.UnmountedWithRoot +import japgolly.scalajs.react.raw.React.Ref import org.scalablytyped.runtime.StringDictionary +import org.scalajs.dom.raw.HTMLElement import typingsJapgolly.react.mod.RefAttributes +import typingsJapgolly.react.mod._Global_.JSX.Element +import typingsJapgolly.reactDropzone.mod.DropEvent import typingsJapgolly.reactDropzone.mod.DropzoneProps import typingsJapgolly.reactDropzone.mod.DropzoneRef +import typingsJapgolly.reactDropzone.mod.DropzoneState import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ -/* This component has complicated props, you'll have to assemble `props` yourself using js.Dynamic.literal(...) or similar. */ object ReactDropzone { def apply( - props: DropzoneProps with RefAttributes[DropzoneRef] with js.Object, + accept: String | js.Array[String] = null, + disabled: js.UndefOr[Boolean] = js.undefined, + getFilesFromEvent: /* event */ DropEvent => CallbackTo[js.Any] = null, + maxSize: Int | Double = null, + minSize: Int | Double = null, + multiple: js.UndefOr[Boolean] = js.undefined, + noClick: js.UndefOr[Boolean] = js.undefined, + noDrag: js.UndefOr[Boolean] = js.undefined, + noDragEventsBubbling: js.UndefOr[Boolean] = js.undefined, + noKeyboard: js.UndefOr[Boolean] = js.undefined, + onDragEnter: ReactDragEventFrom[HTMLElement] => Callback = null, + onDragLeave: ReactDragEventFrom[HTMLElement] => Callback = null, + onDragOver: ReactDragEventFrom[HTMLElement] => Callback = null, + onDrop: (/* acceptedFiles */ js.Array[js.Any], /* rejectedFiles */ js.Array[js.Any], /* event */ DropEvent) => Callback = null, + onDropAccepted: (/* files */ js.Array[js.Any], /* event */ DropEvent) => Callback = null, + onDropRejected: (/* files */ js.Array[js.Any], /* event */ DropEvent) => Callback = null, + onFileDialogCancel: js.UndefOr[Callback] = js.undefined, + preventDropOnDocument: js.UndefOr[Boolean] = js.undefined, key: js.UndefOr[Key] = js.undefined, _overrides: StringDictionary[js.Any] = null )( - children: ChildArg* - ): UnmountedSimple[ - DropzoneProps with RefAttributes[DropzoneRef] with js.Object, - MountedWithRawType[ - DropzoneProps with RefAttributes[DropzoneRef] with js.Object, - js.Object, - RawMounted[DropzoneProps with RefAttributes[DropzoneRef] with js.Object, js.Object] - ] + children: /* state */ DropzoneState => CallbackTo[Element] = null + ): UnmountedWithRoot[ + DropzoneProps with RefAttributes[DropzoneRef], + Ref, + Unit, + DropzoneProps with RefAttributes[DropzoneRef] ] = { val __obj = js.Dynamic.literal() - js.Dynamic.global.Object.assign(__obj, props) + if (children != null) __obj.updateDynamic("children")(js.Any.fromFunction1((t0: /* state */ typingsJapgolly.reactDropzone.mod.DropzoneState) => children(t0).runNow())) + if (accept != null) __obj.updateDynamic("accept")(accept.asInstanceOf[js.Any]) + if (!js.isUndefined(disabled)) __obj.updateDynamic("disabled")(disabled.asInstanceOf[js.Any]) + if (getFilesFromEvent != null) __obj.updateDynamic("getFilesFromEvent")(js.Any.fromFunction1((t0: /* event */ typingsJapgolly.reactDropzone.mod.DropEvent) => getFilesFromEvent(t0).runNow())) + if (maxSize != null) __obj.updateDynamic("maxSize")(maxSize.asInstanceOf[js.Any]) + if (minSize != null) __obj.updateDynamic("minSize")(minSize.asInstanceOf[js.Any]) + if (!js.isUndefined(multiple)) __obj.updateDynamic("multiple")(multiple.asInstanceOf[js.Any]) + if (!js.isUndefined(noClick)) __obj.updateDynamic("noClick")(noClick.asInstanceOf[js.Any]) + if (!js.isUndefined(noDrag)) __obj.updateDynamic("noDrag")(noDrag.asInstanceOf[js.Any]) + if (!js.isUndefined(noDragEventsBubbling)) __obj.updateDynamic("noDragEventsBubbling")(noDragEventsBubbling.asInstanceOf[js.Any]) + if (!js.isUndefined(noKeyboard)) __obj.updateDynamic("noKeyboard")(noKeyboard.asInstanceOf[js.Any]) + if (onDragEnter != null) __obj.updateDynamic("onDragEnter")(js.Any.fromFunction1((t0: japgolly.scalajs.react.ReactDragEventFrom[org.scalajs.dom.raw.HTMLElement]) => onDragEnter(t0).runNow())) + if (onDragLeave != null) __obj.updateDynamic("onDragLeave")(js.Any.fromFunction1((t0: japgolly.scalajs.react.ReactDragEventFrom[org.scalajs.dom.raw.HTMLElement]) => onDragLeave(t0).runNow())) + if (onDragOver != null) __obj.updateDynamic("onDragOver")(js.Any.fromFunction1((t0: japgolly.scalajs.react.ReactDragEventFrom[org.scalajs.dom.raw.HTMLElement]) => onDragOver(t0).runNow())) + if (onDrop != null) __obj.updateDynamic("onDrop")(js.Any.fromFunction3((t0: /* acceptedFiles */ js.Array[js.Any], t1: /* rejectedFiles */ js.Array[js.Any], t2: /* event */ typingsJapgolly.reactDropzone.mod.DropEvent) => onDrop(t0, t1, t2).runNow())) + if (onDropAccepted != null) __obj.updateDynamic("onDropAccepted")(js.Any.fromFunction2((t0: /* files */ js.Array[js.Any], t1: /* event */ typingsJapgolly.reactDropzone.mod.DropEvent) => onDropAccepted(t0, t1).runNow())) + if (onDropRejected != null) __obj.updateDynamic("onDropRejected")(js.Any.fromFunction2((t0: /* files */ js.Array[js.Any], t1: /* event */ typingsJapgolly.reactDropzone.mod.DropEvent) => onDropRejected(t0, t1).runNow())) + onFileDialogCancel.foreach(p => __obj.updateDynamic("onFileDialogCancel")(p.toJsFn)) + if (!js.isUndefined(preventDropOnDocument)) __obj.updateDynamic("preventDropOnDocument")(preventDropOnDocument.asInstanceOf[js.Any]) key.foreach(k => __obj.updateDynamic("key")(k.asInstanceOf[js.Any])) if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) - val f = japgolly.scalajs.react.JsComponent[ - typingsJapgolly.reactDropzone.mod.DropzoneProps with typingsJapgolly.react.mod.RefAttributes[typingsJapgolly.reactDropzone.mod.DropzoneRef] with js.Object, - japgolly.scalajs.react.Children.Varargs, - js.Object](this.componentImport) - f(__obj.asInstanceOf[typingsJapgolly.reactDropzone.mod.DropzoneProps with typingsJapgolly.react.mod.RefAttributes[typingsJapgolly.reactDropzone.mod.DropzoneRef] with js.Object])(children: _*) + val f = japgolly.scalajs.react.JsForwardRefComponent.force[ + typingsJapgolly.reactDropzone.mod.DropzoneProps with typingsJapgolly.react.mod.RefAttributes[typingsJapgolly.reactDropzone.mod.DropzoneRef], + japgolly.scalajs.react.Children.None, + japgolly.scalajs.react.raw.React.Ref](this.componentImport) + f(__obj.asInstanceOf[typingsJapgolly.reactDropzone.mod.DropzoneProps with typingsJapgolly.react.mod.RefAttributes[typingsJapgolly.reactDropzone.mod.DropzoneRef]]) } @JSImport("react-dropzone", JSImport.Default) @js.native diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt index 999d5f650d..1394b367d9 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react-bootstrap" -version := "0.32-afbf48" +version := "0.32-a80847" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/src/main/scala/typingsSlinky/reactBootstrap/components/ButtonGroup.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/src/main/scala/typingsSlinky/reactBootstrap/components/ButtonGroup.scala index dfd9168a56..98258e9c96 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/src/main/scala/typingsSlinky/reactBootstrap/components/ButtonGroup.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/src/main/scala/typingsSlinky/reactBootstrap/components/ButtonGroup.scala @@ -1,51 +1,12 @@ package typingsSlinky.reactBootstrap.components import org.scalablytyped.runtime.StringDictionary -import org.scalajs.dom.raw.Event -import org.scalajs.dom.raw.EventTarget import slinky.core.BuildingComponent import slinky.core.ExternalComponentWithAttributesWithRefType -import slinky.core.SyntheticEvent import slinky.core.TagMod -import slinky.web.SyntheticMouseEvent import slinky.web.html.`*`.tag -import typingsSlinky.react.mod.CSSProperties -import typingsSlinky.react.reactStrings.`additions text` -import typingsSlinky.react.reactStrings.`inline` -import typingsSlinky.react.reactStrings.additions -import typingsSlinky.react.reactStrings.all -import typingsSlinky.react.reactStrings.ascending -import typingsSlinky.react.reactStrings.assertive -import typingsSlinky.react.reactStrings.both -import typingsSlinky.react.reactStrings.copy -import typingsSlinky.react.reactStrings.date -import typingsSlinky.react.reactStrings.descending -import typingsSlinky.react.reactStrings.dialog -import typingsSlinky.react.reactStrings.execute -import typingsSlinky.react.reactStrings.grammar -import typingsSlinky.react.reactStrings.grid -import typingsSlinky.react.reactStrings.horizontal -import typingsSlinky.react.reactStrings.link -import typingsSlinky.react.reactStrings.list -import typingsSlinky.react.reactStrings.listbox -import typingsSlinky.react.reactStrings.location -import typingsSlinky.react.reactStrings.menu -import typingsSlinky.react.reactStrings.mixed -import typingsSlinky.react.reactStrings.move -import typingsSlinky.react.reactStrings.none -import typingsSlinky.react.reactStrings.off -import typingsSlinky.react.reactStrings.on -import typingsSlinky.react.reactStrings.other -import typingsSlinky.react.reactStrings.page -import typingsSlinky.react.reactStrings.polite -import typingsSlinky.react.reactStrings.popup -import typingsSlinky.react.reactStrings.removals -import typingsSlinky.react.reactStrings.spelling -import typingsSlinky.react.reactStrings.step -import typingsSlinky.react.reactStrings.text -import typingsSlinky.react.reactStrings.time -import typingsSlinky.react.reactStrings.tree -import typingsSlinky.react.reactStrings.vertical +import typingsSlinky.react.mod.AllHTMLAttributes +import typingsSlinky.react.mod.ClassAttributes import typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroupProps import typingsSlinky.reactBootstrap.mod.Sizes import scala.scalajs.js @@ -59,265 +20,24 @@ object ButtonGroup object componentImport extends js.Object override val component: String | js.Object = this.componentImport - /* The following DOM/SVG props were specified: accept, action, alt, async, autoComplete, autoFocus, capture, challenge, checked, className, colSpan, cols, content, contentEditable, controls, coords, dangerouslySetInnerHTML, default, defaultChecked, defaultValue, defer, dir, disabled, download, draggable, headers, height, hidden, high, href, htmlFor, id, integrity, kind, lang, list, loop, low, manifest, max, media, method, min, multiple, muted, name, nonce, onAbort, onAnimationEnd, onAnimationIteration, onAnimationStart, onBlur, onCanPlay, onCanPlayThrough, onChange, onClick, onCompositionEnd, onCompositionStart, onCompositionUpdate, onContextMenu, onCopy, onCut, onDoubleClick, onDrag, onDragEnd, onDragEnter, onDragExit, onDragLeave, onDragOver, onDragStart, onDrop, onDurationChange, onEmptied, onEncrypted, onEnded, onError, onFocus, onInput, onInvalid, onKeyDown, onKeyPress, onKeyUp, onLoad, onLoadStart, onLoadedData, onLoadedMetadata, onMouseDown, onMouseEnter, onMouseLeave, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onPaste, onPause, onPlay, onPlaying, onPointerCancel, onPointerDown, onPointerEnter, onPointerLeave, onPointerMove, onPointerOut, onPointerOver, onPointerUp, onProgress, onRateChange, onScroll, onSeeked, onSeeking, onSelect, onStalled, onSubmit, onSuspend, onTimeUpdate, onTouchCancel, onTouchEnd, onTouchMove, onTouchStart, onTransitionEnd, onVolumeChange, onWaiting, onWheel, open, optimum, pattern, placeholder, poster, preload, readOnly, rel, required, reversed, rowSpan, rows, sandbox, scope, scoped, scrolling, selected, shape, size, sizes, spellCheck, src, start, step, suppressContentEditableWarning, tabIndex, target, type, value, width, wrap */ def apply( - about: String = null, - acceptCharset: String = null, - accessKey: String = null, - allowFullScreen: js.UndefOr[Boolean] = js.undefined, - allowTransparency: js.UndefOr[Boolean] = js.undefined, - `aria-activedescendant`: String = null, - `aria-atomic`: js.UndefOr[Boolean] = js.undefined, - `aria-autocomplete`: none | `inline` | list | both = null, - `aria-busy`: js.UndefOr[Boolean] = js.undefined, - `aria-checked`: Boolean | mixed = null, - `aria-colcount`: Int | Double = null, - `aria-colindex`: Int | Double = null, - `aria-colspan`: Int | Double = null, - `aria-controls`: String = null, - `aria-current`: Boolean | page | step | location | date | time = null, - `aria-describedby`: String = null, - `aria-details`: String = null, - `aria-disabled`: js.UndefOr[Boolean] = js.undefined, - `aria-dropeffect`: none | copy | execute | link | move | popup = null, - `aria-errormessage`: String = null, - `aria-expanded`: js.UndefOr[Boolean] = js.undefined, - `aria-flowto`: String = null, - `aria-grabbed`: js.UndefOr[Boolean] = js.undefined, - `aria-haspopup`: Boolean | menu | listbox | tree | grid | dialog = null, - `aria-hidden`: js.UndefOr[Boolean] = js.undefined, - `aria-invalid`: Boolean | grammar | spelling = null, - `aria-keyshortcuts`: String = null, - `aria-label`: String = null, - `aria-labelledby`: String = null, - `aria-level`: Int | Double = null, - `aria-live`: off | assertive | polite = null, - `aria-modal`: js.UndefOr[Boolean] = js.undefined, - `aria-multiline`: js.UndefOr[Boolean] = js.undefined, - `aria-multiselectable`: js.UndefOr[Boolean] = js.undefined, - `aria-orientation`: horizontal | vertical = null, - `aria-owns`: String = null, - `aria-placeholder`: String = null, - `aria-posinset`: Int | Double = null, - `aria-pressed`: Boolean | mixed = null, - `aria-readonly`: js.UndefOr[Boolean] = js.undefined, - `aria-relevant`: additions | (`additions text`) | all | removals | text = null, - `aria-required`: js.UndefOr[Boolean] = js.undefined, - `aria-roledescription`: String = null, - `aria-rowcount`: Int | Double = null, - `aria-rowindex`: Int | Double = null, - `aria-rowspan`: Int | Double = null, - `aria-selected`: js.UndefOr[Boolean] = js.undefined, - `aria-setsize`: Int | Double = null, - `aria-sort`: none | ascending | descending | other = null, - `aria-valuemax`: Int | Double = null, - `aria-valuemin`: Int | Double = null, - `aria-valuenow`: Int | Double = null, - `aria-valuetext`: String = null, - as: String = null, - autoCapitalize: String = null, - autoCorrect: String = null, - autoPlay: js.UndefOr[Boolean] = js.undefined, - autoSave: String = null, + AllHTMLAttributes: AllHTMLAttributes[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] = null, + ClassAttributes: ClassAttributes[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] = null, block: js.UndefOr[Boolean] = js.undefined, bsSize: Sizes = null, bsStyle: String = null, - cellPadding: Double | String = null, - cellSpacing: Double | String = null, - charSet: String = null, - cite: String = null, - classID: String = null, - color: String = null, - contextMenu: String = null, - crossOrigin: String = null, - data: String = null, - datatype: String = null, - dateTime: String = null, - encType: String = null, - form: String = null, - formAction: String = null, - formEncType: String = null, - formMethod: String = null, - formNoValidate: js.UndefOr[Boolean] = js.undefined, - formTarget: String = null, - frameBorder: Double | String = null, - hrefLang: String = null, - httpEquiv: String = null, - inlist: js.Any = null, - inputMode: String = null, - is: String = null, - itemID: String = null, - itemProp: String = null, - itemRef: String = null, - itemScope: js.UndefOr[Boolean] = js.undefined, - itemType: String = null, justified: js.UndefOr[Boolean] = js.undefined, - keyParams: String = null, - keyType: String = null, - label: String = null, - marginHeight: Int | Double = null, - marginWidth: Int | Double = null, - maxLength: Int | Double = null, - mediaGroup: String = null, - minLength: Int | Double = null, - noValidate: js.UndefOr[Boolean] = js.undefined, - onAuxClick: SyntheticMouseEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, - onBeforeInput: SyntheticEvent[EventTarget with typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup, Event] => Unit = null, - onReset: SyntheticEvent[EventTarget with typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup, Event] => Unit = null, - playsInline: js.UndefOr[Boolean] = js.undefined, - prefix: String = null, - property: String = null, - radioGroup: String = null, - resource: String = null, - results: Int | Double = null, - role: String = null, - seamless: js.UndefOr[Boolean] = js.undefined, - security: String = null, - slot: String = null, - span: Int | Double = null, - srcDoc: String = null, - srcLang: String = null, - srcSet: String = null, - style: CSSProperties = null, - summary: String = null, - suppressHydrationWarning: js.UndefOr[Boolean] = js.undefined, - title: String = null, - typeof: String = null, - unselectable: on | off = null, - useMap: String = null, vertical: js.UndefOr[Boolean] = js.undefined, - vocab: String = null, - wmode: String = null, _overrides: StringDictionary[js.Any] = null ): BuildingComponent[tag.type, typingsSlinky.reactBootstrap.mod.ButtonGroup] = { val __obj = js.Dynamic.literal() - if (about != null) __obj.updateDynamic("about")(about.asInstanceOf[js.Any]) - if (acceptCharset != null) __obj.updateDynamic("acceptCharset")(acceptCharset.asInstanceOf[js.Any]) - if (accessKey != null) __obj.updateDynamic("accessKey")(accessKey.asInstanceOf[js.Any]) - if (!js.isUndefined(allowFullScreen)) __obj.updateDynamic("allowFullScreen")(allowFullScreen.asInstanceOf[js.Any]) - if (!js.isUndefined(allowTransparency)) __obj.updateDynamic("allowTransparency")(allowTransparency.asInstanceOf[js.Any]) - if (`aria-activedescendant` != null) __obj.updateDynamic("aria-activedescendant")(`aria-activedescendant`.asInstanceOf[js.Any]) - if (!js.isUndefined(`aria-atomic`)) __obj.updateDynamic("aria-atomic")(`aria-atomic`.asInstanceOf[js.Any]) - if (`aria-autocomplete` != null) __obj.updateDynamic("aria-autocomplete")(`aria-autocomplete`.asInstanceOf[js.Any]) - if (!js.isUndefined(`aria-busy`)) __obj.updateDynamic("aria-busy")(`aria-busy`.asInstanceOf[js.Any]) - if (`aria-checked` != null) __obj.updateDynamic("aria-checked")(`aria-checked`.asInstanceOf[js.Any]) - if (`aria-colcount` != null) __obj.updateDynamic("aria-colcount")(`aria-colcount`.asInstanceOf[js.Any]) - if (`aria-colindex` != null) __obj.updateDynamic("aria-colindex")(`aria-colindex`.asInstanceOf[js.Any]) - if (`aria-colspan` != null) __obj.updateDynamic("aria-colspan")(`aria-colspan`.asInstanceOf[js.Any]) - if (`aria-controls` != null) __obj.updateDynamic("aria-controls")(`aria-controls`.asInstanceOf[js.Any]) - if (`aria-current` != null) __obj.updateDynamic("aria-current")(`aria-current`.asInstanceOf[js.Any]) - if (`aria-describedby` != null) __obj.updateDynamic("aria-describedby")(`aria-describedby`.asInstanceOf[js.Any]) - if (`aria-details` != null) __obj.updateDynamic("aria-details")(`aria-details`.asInstanceOf[js.Any]) - if (!js.isUndefined(`aria-disabled`)) __obj.updateDynamic("aria-disabled")(`aria-disabled`.asInstanceOf[js.Any]) - if (`aria-dropeffect` != null) __obj.updateDynamic("aria-dropeffect")(`aria-dropeffect`.asInstanceOf[js.Any]) - if (`aria-errormessage` != null) __obj.updateDynamic("aria-errormessage")(`aria-errormessage`.asInstanceOf[js.Any]) - if (!js.isUndefined(`aria-expanded`)) __obj.updateDynamic("aria-expanded")(`aria-expanded`.asInstanceOf[js.Any]) - if (`aria-flowto` != null) __obj.updateDynamic("aria-flowto")(`aria-flowto`.asInstanceOf[js.Any]) - if (!js.isUndefined(`aria-grabbed`)) __obj.updateDynamic("aria-grabbed")(`aria-grabbed`.asInstanceOf[js.Any]) - if (`aria-haspopup` != null) __obj.updateDynamic("aria-haspopup")(`aria-haspopup`.asInstanceOf[js.Any]) - if (!js.isUndefined(`aria-hidden`)) __obj.updateDynamic("aria-hidden")(`aria-hidden`.asInstanceOf[js.Any]) - if (`aria-invalid` != null) __obj.updateDynamic("aria-invalid")(`aria-invalid`.asInstanceOf[js.Any]) - if (`aria-keyshortcuts` != null) __obj.updateDynamic("aria-keyshortcuts")(`aria-keyshortcuts`.asInstanceOf[js.Any]) - if (`aria-label` != null) __obj.updateDynamic("aria-label")(`aria-label`.asInstanceOf[js.Any]) - if (`aria-labelledby` != null) __obj.updateDynamic("aria-labelledby")(`aria-labelledby`.asInstanceOf[js.Any]) - if (`aria-level` != null) __obj.updateDynamic("aria-level")(`aria-level`.asInstanceOf[js.Any]) - if (`aria-live` != null) __obj.updateDynamic("aria-live")(`aria-live`.asInstanceOf[js.Any]) - if (!js.isUndefined(`aria-modal`)) __obj.updateDynamic("aria-modal")(`aria-modal`.asInstanceOf[js.Any]) - if (!js.isUndefined(`aria-multiline`)) __obj.updateDynamic("aria-multiline")(`aria-multiline`.asInstanceOf[js.Any]) - if (!js.isUndefined(`aria-multiselectable`)) __obj.updateDynamic("aria-multiselectable")(`aria-multiselectable`.asInstanceOf[js.Any]) - if (`aria-orientation` != null) __obj.updateDynamic("aria-orientation")(`aria-orientation`.asInstanceOf[js.Any]) - if (`aria-owns` != null) __obj.updateDynamic("aria-owns")(`aria-owns`.asInstanceOf[js.Any]) - if (`aria-placeholder` != null) __obj.updateDynamic("aria-placeholder")(`aria-placeholder`.asInstanceOf[js.Any]) - if (`aria-posinset` != null) __obj.updateDynamic("aria-posinset")(`aria-posinset`.asInstanceOf[js.Any]) - if (`aria-pressed` != null) __obj.updateDynamic("aria-pressed")(`aria-pressed`.asInstanceOf[js.Any]) - if (!js.isUndefined(`aria-readonly`)) __obj.updateDynamic("aria-readonly")(`aria-readonly`.asInstanceOf[js.Any]) - if (`aria-relevant` != null) __obj.updateDynamic("aria-relevant")(`aria-relevant`.asInstanceOf[js.Any]) - if (!js.isUndefined(`aria-required`)) __obj.updateDynamic("aria-required")(`aria-required`.asInstanceOf[js.Any]) - if (`aria-roledescription` != null) __obj.updateDynamic("aria-roledescription")(`aria-roledescription`.asInstanceOf[js.Any]) - if (`aria-rowcount` != null) __obj.updateDynamic("aria-rowcount")(`aria-rowcount`.asInstanceOf[js.Any]) - if (`aria-rowindex` != null) __obj.updateDynamic("aria-rowindex")(`aria-rowindex`.asInstanceOf[js.Any]) - if (`aria-rowspan` != null) __obj.updateDynamic("aria-rowspan")(`aria-rowspan`.asInstanceOf[js.Any]) - if (!js.isUndefined(`aria-selected`)) __obj.updateDynamic("aria-selected")(`aria-selected`.asInstanceOf[js.Any]) - if (`aria-setsize` != null) __obj.updateDynamic("aria-setsize")(`aria-setsize`.asInstanceOf[js.Any]) - if (`aria-sort` != null) __obj.updateDynamic("aria-sort")(`aria-sort`.asInstanceOf[js.Any]) - if (`aria-valuemax` != null) __obj.updateDynamic("aria-valuemax")(`aria-valuemax`.asInstanceOf[js.Any]) - if (`aria-valuemin` != null) __obj.updateDynamic("aria-valuemin")(`aria-valuemin`.asInstanceOf[js.Any]) - if (`aria-valuenow` != null) __obj.updateDynamic("aria-valuenow")(`aria-valuenow`.asInstanceOf[js.Any]) - if (`aria-valuetext` != null) __obj.updateDynamic("aria-valuetext")(`aria-valuetext`.asInstanceOf[js.Any]) - if (as != null) __obj.updateDynamic("as")(as.asInstanceOf[js.Any]) - if (autoCapitalize != null) __obj.updateDynamic("autoCapitalize")(autoCapitalize.asInstanceOf[js.Any]) - if (autoCorrect != null) __obj.updateDynamic("autoCorrect")(autoCorrect.asInstanceOf[js.Any]) - if (!js.isUndefined(autoPlay)) __obj.updateDynamic("autoPlay")(autoPlay.asInstanceOf[js.Any]) - if (autoSave != null) __obj.updateDynamic("autoSave")(autoSave.asInstanceOf[js.Any]) + if (AllHTMLAttributes != null) js.Dynamic.global.Object.assign(__obj, AllHTMLAttributes) + if (ClassAttributes != null) js.Dynamic.global.Object.assign(__obj, ClassAttributes) if (!js.isUndefined(block)) __obj.updateDynamic("block")(block.asInstanceOf[js.Any]) if (bsSize != null) __obj.updateDynamic("bsSize")(bsSize.asInstanceOf[js.Any]) if (bsStyle != null) __obj.updateDynamic("bsStyle")(bsStyle.asInstanceOf[js.Any]) - if (cellPadding != null) __obj.updateDynamic("cellPadding")(cellPadding.asInstanceOf[js.Any]) - if (cellSpacing != null) __obj.updateDynamic("cellSpacing")(cellSpacing.asInstanceOf[js.Any]) - if (charSet != null) __obj.updateDynamic("charSet")(charSet.asInstanceOf[js.Any]) - if (cite != null) __obj.updateDynamic("cite")(cite.asInstanceOf[js.Any]) - if (classID != null) __obj.updateDynamic("classID")(classID.asInstanceOf[js.Any]) - if (color != null) __obj.updateDynamic("color")(color.asInstanceOf[js.Any]) - if (contextMenu != null) __obj.updateDynamic("contextMenu")(contextMenu.asInstanceOf[js.Any]) - if (crossOrigin != null) __obj.updateDynamic("crossOrigin")(crossOrigin.asInstanceOf[js.Any]) - if (data != null) __obj.updateDynamic("data")(data.asInstanceOf[js.Any]) - if (datatype != null) __obj.updateDynamic("datatype")(datatype.asInstanceOf[js.Any]) - if (dateTime != null) __obj.updateDynamic("dateTime")(dateTime.asInstanceOf[js.Any]) - if (encType != null) __obj.updateDynamic("encType")(encType.asInstanceOf[js.Any]) - if (form != null) __obj.updateDynamic("form")(form.asInstanceOf[js.Any]) - if (formAction != null) __obj.updateDynamic("formAction")(formAction.asInstanceOf[js.Any]) - if (formEncType != null) __obj.updateDynamic("formEncType")(formEncType.asInstanceOf[js.Any]) - if (formMethod != null) __obj.updateDynamic("formMethod")(formMethod.asInstanceOf[js.Any]) - if (!js.isUndefined(formNoValidate)) __obj.updateDynamic("formNoValidate")(formNoValidate.asInstanceOf[js.Any]) - if (formTarget != null) __obj.updateDynamic("formTarget")(formTarget.asInstanceOf[js.Any]) - if (frameBorder != null) __obj.updateDynamic("frameBorder")(frameBorder.asInstanceOf[js.Any]) - if (hrefLang != null) __obj.updateDynamic("hrefLang")(hrefLang.asInstanceOf[js.Any]) - if (httpEquiv != null) __obj.updateDynamic("httpEquiv")(httpEquiv.asInstanceOf[js.Any]) - if (inlist != null) __obj.updateDynamic("inlist")(inlist.asInstanceOf[js.Any]) - if (inputMode != null) __obj.updateDynamic("inputMode")(inputMode.asInstanceOf[js.Any]) - if (is != null) __obj.updateDynamic("is")(is.asInstanceOf[js.Any]) - if (itemID != null) __obj.updateDynamic("itemID")(itemID.asInstanceOf[js.Any]) - if (itemProp != null) __obj.updateDynamic("itemProp")(itemProp.asInstanceOf[js.Any]) - if (itemRef != null) __obj.updateDynamic("itemRef")(itemRef.asInstanceOf[js.Any]) - if (!js.isUndefined(itemScope)) __obj.updateDynamic("itemScope")(itemScope.asInstanceOf[js.Any]) - if (itemType != null) __obj.updateDynamic("itemType")(itemType.asInstanceOf[js.Any]) if (!js.isUndefined(justified)) __obj.updateDynamic("justified")(justified.asInstanceOf[js.Any]) - if (keyParams != null) __obj.updateDynamic("keyParams")(keyParams.asInstanceOf[js.Any]) - if (keyType != null) __obj.updateDynamic("keyType")(keyType.asInstanceOf[js.Any]) - if (label != null) __obj.updateDynamic("label")(label.asInstanceOf[js.Any]) - if (marginHeight != null) __obj.updateDynamic("marginHeight")(marginHeight.asInstanceOf[js.Any]) - if (marginWidth != null) __obj.updateDynamic("marginWidth")(marginWidth.asInstanceOf[js.Any]) - if (maxLength != null) __obj.updateDynamic("maxLength")(maxLength.asInstanceOf[js.Any]) - if (mediaGroup != null) __obj.updateDynamic("mediaGroup")(mediaGroup.asInstanceOf[js.Any]) - if (minLength != null) __obj.updateDynamic("minLength")(minLength.asInstanceOf[js.Any]) - if (!js.isUndefined(noValidate)) __obj.updateDynamic("noValidate")(noValidate.asInstanceOf[js.Any]) - if (onAuxClick != null) __obj.updateDynamic("onAuxClick")(js.Any.fromFunction1(onAuxClick)) - if (onBeforeInput != null) __obj.updateDynamic("onBeforeInput")(js.Any.fromFunction1(onBeforeInput)) - if (onReset != null) __obj.updateDynamic("onReset")(js.Any.fromFunction1(onReset)) - if (!js.isUndefined(playsInline)) __obj.updateDynamic("playsInline")(playsInline.asInstanceOf[js.Any]) - if (prefix != null) __obj.updateDynamic("prefix")(prefix.asInstanceOf[js.Any]) - if (property != null) __obj.updateDynamic("property")(property.asInstanceOf[js.Any]) - if (radioGroup != null) __obj.updateDynamic("radioGroup")(radioGroup.asInstanceOf[js.Any]) - if (resource != null) __obj.updateDynamic("resource")(resource.asInstanceOf[js.Any]) - if (results != null) __obj.updateDynamic("results")(results.asInstanceOf[js.Any]) - if (role != null) __obj.updateDynamic("role")(role.asInstanceOf[js.Any]) - if (!js.isUndefined(seamless)) __obj.updateDynamic("seamless")(seamless.asInstanceOf[js.Any]) - if (security != null) __obj.updateDynamic("security")(security.asInstanceOf[js.Any]) - if (slot != null) __obj.updateDynamic("slot")(slot.asInstanceOf[js.Any]) - if (span != null) __obj.updateDynamic("span")(span.asInstanceOf[js.Any]) - if (srcDoc != null) __obj.updateDynamic("srcDoc")(srcDoc.asInstanceOf[js.Any]) - if (srcLang != null) __obj.updateDynamic("srcLang")(srcLang.asInstanceOf[js.Any]) - if (srcSet != null) __obj.updateDynamic("srcSet")(srcSet.asInstanceOf[js.Any]) - if (style != null) __obj.updateDynamic("style")(style.asInstanceOf[js.Any]) - if (summary != null) __obj.updateDynamic("summary")(summary.asInstanceOf[js.Any]) - if (!js.isUndefined(suppressHydrationWarning)) __obj.updateDynamic("suppressHydrationWarning")(suppressHydrationWarning.asInstanceOf[js.Any]) - if (title != null) __obj.updateDynamic("title")(title.asInstanceOf[js.Any]) - if (typeof != null) __obj.updateDynamic("typeof")(typeof.asInstanceOf[js.Any]) - if (unselectable != null) __obj.updateDynamic("unselectable")(unselectable.asInstanceOf[js.Any]) - if (useMap != null) __obj.updateDynamic("useMap")(useMap.asInstanceOf[js.Any]) if (!js.isUndefined(vertical)) __obj.updateDynamic("vertical")(vertical.asInstanceOf[js.Any]) - if (vocab != null) __obj.updateDynamic("vocab")(vocab.asInstanceOf[js.Any]) - if (wmode != null) __obj.updateDynamic("wmode")(wmode.asInstanceOf[js.Any]) if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) super.apply(__obj.asInstanceOf[Props]) } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/src/main/scala/typingsSlinky/reactBootstrap/components/ToggleButtonGroup.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/src/main/scala/typingsSlinky/reactBootstrap/components/ToggleButtonGroup.scala index e80f9ad608..a8d21e1042 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/src/main/scala/typingsSlinky/reactBootstrap/components/ToggleButtonGroup.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/src/main/scala/typingsSlinky/reactBootstrap/components/ToggleButtonGroup.scala @@ -7,7 +7,7 @@ import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ -/* This component has complicated props, you'll have to assemble `props` yourself using js.Dynamic.literal(...) or similar. QualifiedName(IArray(Name(typingsSlinky), Name(reactBootstrap), Name(toggleButtonGroupMod), Name(ToggleButtonGroupProps))) was not a @ScalaJSDefined trait */ +/* This component has complicated props, you'll have to assemble `props` yourself using js.Dynamic.literal(...) or similar. Support for combinations of intersection and union types not implemented */ object ToggleButtonGroup extends ExternalComponentWithAttributesWithRefType[tag.type, typingsSlinky.reactBootstrap.mod.ToggleButtonGroup] { @JSImport("react-bootstrap", "ToggleButtonGroup") diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt index adaa0929f8..f82b79f888 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-0c490e" +version := "10.1.10-71ad9b" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/components/ReactDropzone.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/components/ReactDropzone.scala index 676d1aab28..ca3aaa5629 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/components/ReactDropzone.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/components/ReactDropzone.scala @@ -1,22 +1,69 @@ package typingsSlinky.reactDropzone.components +import org.scalablytyped.runtime.StringDictionary +import slinky.core.BuildingComponent import slinky.core.ExternalComponentWithAttributesWithRefType +import slinky.core.TagMod import slinky.web.html.`*`.tag +import typingsSlinky.react.mod.Ref import typingsSlinky.react.mod.RefAttributes +import typingsSlinky.reactDropzone.mod.DropEvent import typingsSlinky.reactDropzone.mod.DropzoneProps import typingsSlinky.reactDropzone.mod.DropzoneRef import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ -/* This component has complicated props, you'll have to assemble `props` yourself using js.Dynamic.literal(...) or similar. QualifiedName(IArray(Name())) was not a @ScalaJSDefined trait */ object ReactDropzone - extends ExternalComponentWithAttributesWithRefType[tag.type, js.Object] { + extends ExternalComponentWithAttributesWithRefType[tag.type, Ref[js.Any] with js.Object] { @JSImport("react-dropzone", JSImport.Default) @js.native object componentImport extends js.Object override val component: String | js.Object = this.componentImport + /* The following DOM/SVG props were specified: disabled, multiple, onDragEnter, onDragLeave, onDragOver */ + def apply( + accept: String | js.Array[String] = null, + getFilesFromEvent: /* event */ DropEvent => /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify Promise> */ _ = null, + maxSize: Int | Double = null, + minSize: Int | Double = null, + noClick: js.UndefOr[Boolean] = js.undefined, + noDrag: js.UndefOr[Boolean] = js.undefined, + noDragEventsBubbling: js.UndefOr[Boolean] = js.undefined, + noKeyboard: js.UndefOr[Boolean] = js.undefined, + onDrop: (/* acceptedFiles */ js.Array[ + /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ + ], /* rejectedFiles */ js.Array[ + /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ + ], /* event */ DropEvent) => Unit = null, + onDropAccepted: (/* files */ js.Array[ + /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ + ], /* event */ DropEvent) => Unit = null, + onDropRejected: (/* files */ js.Array[ + /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ + ], /* event */ DropEvent) => Unit = null, + onFileDialogCancel: () => Unit = null, + preventDropOnDocument: js.UndefOr[Boolean] = js.undefined, + _overrides: StringDictionary[js.Any] = null + ): BuildingComponent[tag.type, Ref[js.Any] with js.Object] = { + val __obj = js.Dynamic.literal() + if (accept != null) __obj.updateDynamic("accept")(accept.asInstanceOf[js.Any]) + if (getFilesFromEvent != null) __obj.updateDynamic("getFilesFromEvent")(js.Any.fromFunction1(getFilesFromEvent)) + if (maxSize != null) __obj.updateDynamic("maxSize")(maxSize.asInstanceOf[js.Any]) + if (minSize != null) __obj.updateDynamic("minSize")(minSize.asInstanceOf[js.Any]) + if (!js.isUndefined(noClick)) __obj.updateDynamic("noClick")(noClick.asInstanceOf[js.Any]) + if (!js.isUndefined(noDrag)) __obj.updateDynamic("noDrag")(noDrag.asInstanceOf[js.Any]) + if (!js.isUndefined(noDragEventsBubbling)) __obj.updateDynamic("noDragEventsBubbling")(noDragEventsBubbling.asInstanceOf[js.Any]) + if (!js.isUndefined(noKeyboard)) __obj.updateDynamic("noKeyboard")(noKeyboard.asInstanceOf[js.Any]) + if (onDrop != null) __obj.updateDynamic("onDrop")(js.Any.fromFunction3(onDrop)) + if (onDropAccepted != null) __obj.updateDynamic("onDropAccepted")(js.Any.fromFunction2(onDropAccepted)) + if (onDropRejected != null) __obj.updateDynamic("onDropRejected")(js.Any.fromFunction2(onDropRejected)) + if (onFileDialogCancel != null) __obj.updateDynamic("onFileDialogCancel")(js.Any.fromFunction0(onFileDialogCancel)) + if (!js.isUndefined(preventDropOnDocument)) __obj.updateDynamic("preventDropOnDocument")(preventDropOnDocument.asInstanceOf[js.Any]) + if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) + super.apply(__obj.asInstanceOf[Props]) + } + def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, Ref[js.Any] with js.Object] = new slinky.core.BuildingComponent[slinky.web.html.`*`.tag.type, typingsSlinky.react.mod.Ref[js.Any] with js.Object](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) type Props = DropzoneProps with RefAttributes[DropzoneRef] } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt index 5bbd3f1492..f5d4cf1a34 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "semantic-ui-react" -version := "0.0-unknown-9764a5" +version := "0.0-unknown-2c4cb5" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Button.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Button.scala index da00ea7f0f..34cda93547 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Button.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Button.scala @@ -9,7 +9,7 @@ import slinky.core.ExternalComponentWithAttributesWithRefType import slinky.core.SyntheticEvent import slinky.core.TagMod import slinky.web.SyntheticMouseEvent -import slinky.web.html.button.tag +import slinky.web.html.`*`.tag import typingsSlinky.react.mod.CSSProperties import typingsSlinky.react.reactStrings.`additions text` import typingsSlinky.react.reactStrings.`inline` @@ -314,7 +314,7 @@ object Button if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) super.apply(__obj.asInstanceOf[Props]) } - def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, default] = new slinky.core.BuildingComponent[slinky.web.html.button.tag.type, typingsSlinky.semanticUiReact.mod.default](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) + def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, default] = new slinky.core.BuildingComponent[slinky.web.html.`*`.tag.type, typingsSlinky.semanticUiReact.mod.default](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) type Props = ButtonProps } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Input.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Input.scala index 65b4e2fc09..acefc4625f 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Input.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Input.scala @@ -9,7 +9,7 @@ import slinky.core.ExternalComponentWithAttributesWithRefType import slinky.core.SyntheticEvent import slinky.core.TagMod import slinky.web.SyntheticMouseEvent -import slinky.web.html.input.tag +import slinky.web.html.`*`.tag import typingsSlinky.react.mod.CSSProperties import typingsSlinky.react.mod.ChangeEvent import typingsSlinky.react.reactStrings.`additions text` @@ -298,7 +298,7 @@ object Input if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) super.apply(__obj.asInstanceOf[Props]) } - def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, default] = new slinky.core.BuildingComponent[slinky.web.html.input.tag.type, typingsSlinky.semanticUiReact.inputMod.default](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) + def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, default] = new slinky.core.BuildingComponent[slinky.web.html.`*`.tag.type, typingsSlinky.semanticUiReact.inputMod.default](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) type Props = InputProps } diff --git a/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/build.sbt b/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/build.sbt index 47a1b7c00f..094d622c3e 100644 --- a/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/build.sbt +++ b/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react-transition-group" -version := "2.0-62f032" +version := "2.0-443848" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/src/main/scala/typingsSlinky/reactTransitionGroup/components/TransitionGroup.scala b/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/src/main/scala/typingsSlinky/reactTransitionGroup/components/TransitionGroup.scala index 1a11d74786..29b4960e34 100644 --- a/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/src/main/scala/typingsSlinky/reactTransitionGroup/components/TransitionGroup.scala +++ b/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/src/main/scala/typingsSlinky/reactTransitionGroup/components/TransitionGroup.scala @@ -8,7 +8,7 @@ import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ -/* This component has complicated props, you'll have to assemble `props` yourself using js.Dynamic.literal(...) or similar. QualifiedName(IArray(Name(typingsSlinky), Name(reactTransitionGroup), Name(transitionGroupMod), Name(TransitionGroupProps))) was not a @ScalaJSDefined trait */ +/* This component has complicated props, you'll have to assemble `props` yourself using js.Dynamic.literal(...) or similar. Couldn't find props for TypeRef(QualifiedName(IArray(Name())),IArray(TypeRef(QualifiedName(IArray(Name(typingsSlinky), Name(reactTransitionGroup), Name(transitionGroupMod), Name(IntrinsicTransitionGroupProps))),IArray(TypeRef(QualifiedName(IArray(Name(typingsSlinky), Name(reactTransitionGroup), Name(reactTransitionGroupStrings), Name(abbr))),IArray(),Comments(0))),NoComments), TypeRef(QualifiedName(IArray(Name(scala), Name(scalajs), Name(js), Name(Any))),IArray(),Comments(1))),NoComments) because: Could't extract props from TypeRef(QualifiedName(IArray(Name(scala), Name(scalajs), Name(js), Name(Any))),IArray(),Comments(1)) because couldn't resolve ClassTree. */ object TransitionGroup extends ExternalComponentWithAttributesWithRefType[tag.type, typingsSlinky.reactTransitionGroup.mod.TransitionGroup] { @JSImport("react-transition-group", "TransitionGroup") diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/FindProps.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/FindProps.scala index 6d2318cfde..37719266f9 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/FindProps.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/FindProps.scala @@ -64,35 +64,62 @@ object FindProps { if (!isRequired) s"if (${name.value} != null) js.Dynamic.global.Object.assign($obj, ${name.value})" else s"js.Dynamic.global.Object.assign($obj, ${name.value})", ), + Left(ref), ), ) } final class FindProps(cleanIllegalNames: CleanIllegalNames) { - def forClassTree( - cls: ClassTree, + def forType( + typeRef: TypeRef, + tparams: IArray[TypeParamTree], scope: TreeScope, memberToProp: MemberToProp, maxNum: Int, acceptNativeTraits: Boolean, ): Res[IArray[Prop]] = - forClassTree(cls, scope, maxNum, acceptNativeTraits).map { eithers => - eithers.mapNotNone { - case Left(prop) => Some(prop) - case Right(member) => memberToProp(scope, member) - }.sorted + FollowAliases(scope)(typeRef) match { + case TypeRef.Intersection(types) => + val results: IArray[Res[IArray[Prop]]] = + types.map(tpe => forType(tpe, tparams, scope, memberToProp, maxNum, acceptNativeTraits)) + + results.partitionCollect3({ case x @ Res.Error(_) => x }, { case x @ Res.Many(_) => x }, { + case x @ Res.One(_, _) => x + }) match { + case (Empty, Empty, ones, _) => + Res.One(typeRef.name, ones.map(_.value).flatten.sorted.distinctBy(_.parameter.name)) + case (Empty, _, _, _) => + Res.Error("Support for combinations of intersection and union types not implemented") + case (errors, _, _, _) => + Res.Error(s"Couldn't find props for $typeRef because: ${errors.map(_.msg).mkString(", ")}") + } + case TypeRef.Union(types) => + Res.combine(types.map(tpe => forType(tpe, tparams, scope, memberToProp, maxNum, acceptNativeTraits))) + + case other => + val retOpt = scope lookup other.typeName collectFirst { + case (_cls: ClassTree, newScope) => + val cls = FillInTParams(_cls, newScope, other.targs, tparams) + forClassTree( + cls, + scope / cls, + memberToProp, + maxNum = maxNum, + acceptNativeTraits = acceptNativeTraits, + ) + } + + retOpt.getOrElse(Res.Error(s"Could't extract props from $other because couldn't resolve ClassTree.")) } - /** - * this is only exported separately from the other `forClassTree` overload because the slinky integration does weird things - */ def forClassTree( cls: ClassTree, scope: TreeScope, + memberToProp: MemberToProp, maxNum: Int, acceptNativeTraits: Boolean, - ): Res[IArray[Either[Prop, MemberTree]]] = + ): Res[IArray[Prop]] = cls.comments.extract { case UnionToInheritance.WasUnion(subclassRefs) => subclassRefs } match { case Some((subclassRefs, _)) => Res.combine(subclassRefs.map { subClsRef => @@ -103,6 +130,7 @@ final class FindProps(cleanIllegalNames: CleanIllegalNames) { forClassTree( FillInTParams(subCls, scope, subClsRef.targs, cls.tparams), scope, + memberToProp, maxNum, acceptNativeTraits, ) @@ -137,8 +165,9 @@ final class FindProps(cleanIllegalNames: CleanIllegalNames) { .members .collect { case (x: MemberTree) => x } .groupBy(x => realNameFrom(x.annotations, x.name)) - .map { - case (name, ms) => name -> Right(combine(ms).renamed(name)) + .collect { + case (name, ms) if name =/= Name.APPLY && name =/= Name.namespaced => + name -> Right(combine(ms).renamed(name)) } def go(p: ParentsResolver.Parent): Map[Name, Either[Prop, MemberTree]] = @@ -153,20 +182,26 @@ final class FindProps(cleanIllegalNames: CleanIllegalNames) { Res.One( cls.name, - IArray.fromTraversable( - builder - .skipParentInlineIfMoreMembersThan(maxNum) { parent => - val isRequired = parent.classTree.members.exists { - case _: MethodTree => true - case FieldTree(_, _, Optional(_), _, _, _, _, _) => false - case _: FieldTree => true - case _ => false + IArray + .fromTraversable( + builder + .skipParentInlineIfMoreMembersThan(maxNum) { parent => + val isRequired = parent.classTree.members.exists { + case _: MethodTree => true + case FieldTree(_, _, Optional(_), _, _, _, _, _) => false + case _: FieldTree => true + case _ => false + } + FindProps.parentParameter(parent.refs.head.name, parent.refs.head, isRequired) } - FindProps.parentParameter(parent.refs.head.name, parent.refs.head, isRequired) - } - .allParamsUnique - .values, - ), + .allParamsUnique + .values, + ) + .mapNotNone { + case Left(prop) => Some(prop) + case Right(member) => memberToProp(scope, member) + } + .sorted, ) } } diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenCompanions.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenCompanions.scala index f9d68b74b7..1d1d16556b 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenCompanions.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenCompanions.scala @@ -91,8 +91,8 @@ final class GenCompanions(memberToProp: MemberToProp, findProps: FindProps) exte case Empty => None case props => val (optionals, inLiterals, Empty) = props.partitionCollect2( - { case Prop(_, Right(f)) => f }, - { case Prop(_, Left(str)) => str }, + { case Prop(_, Right(f), _) => f }, + { case Prop(_, Left(str), _) => str }, ) val typeName = typeCp.parts.last diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenJapgollyComponents.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenJapgollyComponents.scala index b62dbd1f18..6b2a75c9b1 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenJapgollyComponents.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenJapgollyComponents.scala @@ -160,7 +160,11 @@ final class GenJapgollyComponents(reactNames: ReactNames, scalaJsDomNames: Scala .map(p => p.copy(parameter = ToJapgollyTypes.visitParamTree(scope)(p.parameter))) .map { /* rewrite functions returning a Callback so that javascript land can call them */ - case p @ Prop(pt @ ParamTree(name, _, TypeRef.ScalaFunction(Empty, StripWildcards(retType)), Some(_), _), _) => + case p @ Prop( + pt @ ParamTree(name, _, TypeRef.ScalaFunction(Empty, StripWildcards(retType)), Some(_), _), + _, + _, + ) => /* wrap optional `Callback` in `js.UndefOr` because it's an `AnyVal` */ p.copy( parameter = pt.copy(tpe = TypeRef.UndefOr(CallbackTo(retType)), default = Some(TypeRef.undefined)), @@ -169,7 +173,7 @@ final class GenJapgollyComponents(reactNames: ReactNames, scalaJsDomNames: Scala }, ) - case p @ Prop(pt @ ParamTree(name, _, TypeRef.ScalaFunction(Empty, StripWildcards(retType)), None, _), _) => + case p @ Prop(pt @ ParamTree(name, _, TypeRef.ScalaFunction(Empty, StripWildcards(retType)), None, _), _, _) => p.copy( parameter = pt.copy(tpe = CallbackTo(retType)), asString = Right(obj => s"""$obj.updateDynamic("${name.unescaped}")(${name.value}.toJsFn)"""), @@ -184,6 +188,7 @@ final class GenJapgollyComponents(reactNames: ReactNames, scalaJsDomNames: Scala _, ), _, + _, ) => def fn(obj: String) = { val params = @@ -207,7 +212,7 @@ final class GenJapgollyComponents(reactNames: ReactNames, scalaJsDomNames: Scala asString = Right(fn), ) - case p @ Prop(pt @ ParamTree(name, _, TypeRef(japgolly.rawReactElement, _, _), _, _), _) => + case p @ Prop(pt @ ParamTree(name, _, TypeRef(japgolly.rawReactElement, _, _), _, _), _, _) => def fn(obj: String) = s"""if (${name.value} != null) $obj.updateDynamic("${name.unescaped}")(${name.value}.rawElement.asInstanceOf[js.Any])""" p.copy( @@ -215,7 +220,7 @@ final class GenJapgollyComponents(reactNames: ReactNames, scalaJsDomNames: Scala asString = Right(fn), ) - case p @ Prop(pt @ ParamTree(name, _, TypeRef(japgolly.rawReactNode, _, _), _, _), _) => + case p @ Prop(pt @ ParamTree(name, _, TypeRef(japgolly.rawReactNode, _, _), _, _), _, _) => def fn(obj: String) = s"""if (${name.value} != null) $obj.updateDynamic("${name.unescaped}")(${name.value}.rawNode.asInstanceOf[js.Any])""" p.copy( @@ -241,23 +246,18 @@ final class GenJapgollyComponents(reactNames: ReactNames, scalaJsDomNames: Scala case ((propsRefOpt, hasKnownRef, tparams), components) => val (propsRef, resProps): (TypeRef, Res[IArray[Prop]]) = propsRefOpt match { - case Some(props) => - val dealiased = FollowAliases(scope)(props) - - val propsOpt: Option[Res[IArray[Prop]]] = - scope lookup dealiased.typeName collectFirst { - case (_cls: ClassTree, newScope) => - val cls = FillInTParams(_cls, newScope, dealiased.targs, tparams) - findProps.forClassTree( - cls, - scope / cls, - memberToProp, - maxNum = FindProps.MaxParamsForMethod - additionalOptionalProps.length - /* children*/ 1, - acceptNativeTraits = true, - ) - } - - props -> propsOpt.getOrElse(Res.Error(s"Could't extract props from ${props.typeName}.")) + case Some(propsRef) => + val resProps: Res[IArray[Prop]] = + findProps.forType( + propsRef, + tparams, + scope, + memberToProp, + maxNum = FindProps.MaxParamsForMethod - additionalOptionalProps.length - /* children*/ 1, + acceptNativeTraits = true, + ) + + propsRef -> resProps case None => TypeRef.Object -> Res.One(TypeRef.Object.name, Empty) @@ -430,12 +430,12 @@ final class GenJapgollyComponents(reactNames: ReactNames, scalaJsDomNames: Scala val (refTypes, declaredChildren, _, _optionals, requireds, Empty) = { props.partitionCollect5( - { case Prop(ParamTree(names.ref, _, tpe, _, _), _) => tpe }, //refTypes + { case Prop(ParamTree(names.ref, _, tpe, _, _), _, _) => tpe }, //refTypes // take note of declared children, but saying `ReactNode` should be a noop - { case p @ Prop(ParamTree(names.children, _, tpe, _, _), _) if !isVdomNode(tpe) => p }, //declaredChildren - { case Prop(paramTree, _) if shouldIgnore(paramTree) => null }, - { case Prop(p, Right(f)) => p -> f }, //optionals - { case Prop(p, Left(str)) => p -> str }, //requireds + { case p @ Prop(ParamTree(names.children, _, tpe, _, _), _, _) if !isVdomNode(tpe) => p }, //declaredChildren + { case Prop(paramTree, _, _) if shouldIgnore(paramTree) => null }, + { case Prop(p, Right(f), _) => p -> f }, //optionals + { case Prop(p, Left(str), _) => p -> str }, //requireds ) } @@ -501,9 +501,9 @@ final class GenJapgollyComponents(reactNames: ReactNames, scalaJsDomNames: Scala /* The children value can go in one of three places, depending... */ val (requireds2, optionals2, formattedVarargsChildren) = declaredChildren.headOption match { - case Some(Prop(p, Left(str))) => ((p -> str) +: requireds, optionals, "") - case Some(Prop(p, Right(f))) => (requireds, (p -> f) +: optionals, "") - case None => (requireds, optionals, "(children: _*)") + case Some(Prop(p, Left(str), _)) => ((p -> str) +: requireds, optionals, "") + case Some(Prop(p, Right(f), _)) => (requireds, (p -> f) +: optionals, "") + case None => (requireds, optionals, "(children: _*)") } MemberImpl.Custom( diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenSlinkyComponents.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenSlinkyComponents.scala index 2b72abcd4c..73c429c15a 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenSlinkyComponents.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenSlinkyComponents.scala @@ -26,10 +26,10 @@ object GenSlinkyComponents { case class SplitProps(props: IArray[Prop]) { val (refTypes, _, _optionals, requireds, Empty) = props.partitionCollect4( - { case Prop(ParamTree(Name("ref"), _, tpe, _, _), _) => tpe }, - { case Prop(pt, _) if GenSlinkyComponents.shouldIgnore(pt) => null }, - { case Prop(p, Right(f)) => p -> f }, - { case Prop(p, Left(str)) => p -> str }, + { case Prop(ParamTree(Name("ref"), _, tpe, _, _), _, _) => tpe }, + { case Prop(pt, _, _) if GenSlinkyComponents.shouldIgnore(pt) => null }, + { case Prop(p, Right(f), _) => p -> f }, + { case Prop(p, Left(str), _) => p -> str }, ) val optionals = _optionals ++ AdditionalOptionalParams @@ -210,7 +210,7 @@ class GenSlinkyComponents( ) val components: IArray[CastConversion] = - IArray.fromTraversable(reactNames.isComponent.map(from => CastConversion(from, ReactComponentClass, _1))) + IArray.fromTraversable(reactNames.ComponentQNames.map(from => CastConversion(from, ReactComponentClass, _1))) val shared = scalaJsDomNames.AllExceptDeprecated ++ base ++ components mode match { @@ -262,28 +262,20 @@ class GenSlinkyComponents( val (propsRef, resProps, domInfo): (TypeRef, Res[SplitProps], Mode[Unit, DomInfo]) = propsRefOpt match { case Some(propsRef) => - val propsTraitOpt: Option[ClassTree] = { - val dealiased = FollowAliases(scope)(propsRef) - - scope lookup dealiased.typeName collectFirst { - case (cls: ClassTree, newScope) if cls.classType === ClassType.Trait => - FillInTParams(cls, newScope, dealiased.targs, tparams) - } - } - - (propsTraitOpt, withDomProps) match { - case (None, _) => - ( - propsRef, - Res.Error(s"${propsRef.typeName} was not a @ScalaJSDefined trait"), - mode.forWeb(slinkyWeb => DomInfo(IArray.Empty, slinkyWeb.AnyHtmlElement)), - ) - - case (Some(propsTrait), Native(())) => - (propsRef, nativeProps(scope, propsTrait), Native(())) + val resProps = findProps.forType( + propsRef, + tparams, + scope, + memberToProp, + maxNum = FindProps.MaxParamsForMethod - AdditionalOptionalParams.length, + acceptNativeTraits = true, + ) - case (Some(propsTrait), Web((slinkyWeb, domFields))) => - val (props, domInfo) = webProps(scope, propsTrait, slinkyWeb, domFields) + withDomProps match { + case Native(()) => + (propsRef, resProps.map(SplitProps), Native(())) + case Web((slinkyWeb, domFields)) => + val (props, domInfo) = webProps(scope, resProps, slinkyWeb, domFields) (propsRef, props, Web(domInfo)) } @@ -320,37 +312,22 @@ class GenSlinkyComponents( } } - def nativeProps(scope: TreeScope, propsTrait: ClassTree): Res[SplitProps] = - findProps - .forClassTree( - propsTrait, - scope / propsTrait, - memberToProp, - maxNum = FindProps.MaxParamsForMethod - AdditionalOptionalParams.length, - acceptNativeTraits = true, - ) - .map(SplitProps) - def webProps( scope: TreeScope, - propsTrait: ClassTree, + resPropsIn: Res[IArray[Prop]], slinkyWeb: SlinkyWeb, domFields: Map[Name, TypeRef], ): (Res[SplitProps], DomInfo) = { val domPropsBuilder = IArray.Builder.empty[FieldTree] - val resProps: Res[SplitProps] = - findProps - .forClassTree(propsTrait, scope / propsTrait, Int.MaxValue, acceptNativeTraits = true) - .map( - _.flatMap { - case Left(param) if param.parameter.tpe.typeName === QualifiedName.StringDictionary => Empty - case Left(param) => IArray(param) - case Right(fieldTree: FieldTree) => - val param = memberToProp(scope, fieldTree) - + val resPropsOut: Res[SplitProps] = + resPropsIn.map { props => + val rewrittenProps = props + .filter { + case Prop(param, _, _) if param.tpe.typeName === QualifiedName.StringDictionary => false + case prop @ Prop(_, _, Right(fieldTree: FieldTree)) => val isOptionalDom: Boolean = - if (param.exists(!_.isOptional)) false + if (!prop.isOptional) false else domFields.get(fieldTree.name) match { case Some(tpe) => @@ -364,14 +341,15 @@ class GenSlinkyComponents( if (isOptionalDom) { domPropsBuilder += fieldTree - Empty - } else IArray.fromOption(param) + false + } else true - case Right(methodTree: MethodTree) => IArray.fromOption(memberToProp(scope, methodTree)) - }.sorted - .take(FindProps.MaxParamsForMethod), - ) - .map(params => SplitProps(params)) + case _ => true + } + .take(FindProps.MaxParamsForMethod) + + SplitProps(rewrittenProps) + } val domProps = domPropsBuilder.result().distinct @@ -386,7 +364,7 @@ class GenSlinkyComponents( referencedElements.firstDefined(slinkyWeb.ElementMapping.get) } - (resProps, DomInfo(domProps, inferredDomType getOrElse slinkyWeb.AnyHtmlElement)) + (resPropsOut, DomInfo(domProps, inferredDomType getOrElse slinkyWeb.AnyHtmlElement)) } def genSharedPropsClass( diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/IdentifyReactComponents.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/IdentifyReactComponents.scala index 9da5d1a2d4..5db952c67f 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/IdentifyReactComponents.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/IdentifyReactComponents.scala @@ -57,7 +57,7 @@ class IdentifyReactComponents(reactNames: ReactNames) { } go(tree, scope) - .filterNot(c => reactNames.isComponent(c.scalaRef.typeName)) + .filterNot(c => reactNames.isComponent(c.scalaRef)) .map(_.rewritten(scope, Wildcards.Remove)) } @@ -139,7 +139,7 @@ class IdentifyReactComponents(reactNames: ReactNames) { def maybeFieldComponent(field: FieldTree, owner: ContainerTree, scope: TreeScope): Option[Component] = { def pointsAtComponentType(scope: TreeScope, current: TypeRef): Option[TypeRef] = - if (reactNames.isComponent(current.typeName)) { + if (reactNames.isComponent(current)) { Some(current) } else { scope @@ -201,7 +201,7 @@ class IdentifyReactComponents(reactNames: ReactNames) { if (cls.classType =/= ClassType.Class) None else ParentsResolver(scope, cls).transitiveParents.collectFirst { - case (TypeRef(qname, IArray.first(props), _), _) if reactNames isComponent qname => + case (tr @ TypeRef(_, IArray.first(props), _), _) if reactNames isComponent tr => Component( location = locationFrom(scope), scalaRef = TypeRef(cls.codePath, TypeParamTree.asTypeArgs(cls.tparams), NoComments), diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/MemberToProp.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/MemberToProp.scala index 5633c4343c..52a2f1aa7c 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/MemberToProp.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/MemberToProp.scala @@ -27,6 +27,7 @@ object MemberToProp { Right(obj => s"""if (${name.value} != null) $obj.updateDynamic(${escapeIntoString(f.originalName)})(${name.value}$Cast)""", ), + Right(f), ), ) case Optional(tpe) if TypeRef.Primitive(TypeRef(Erasure.simplify(scope / x, tpe))) => @@ -36,6 +37,7 @@ object MemberToProp { Right(obj => s"""if (!js.isUndefined(${name.value})) $obj.updateDynamic(${escapeIntoString(f.originalName)})(${name.value}$Cast)""", ), + Right(f), ), ) case Optional(TypeRef.Function(paramTypes, retType)) => @@ -54,6 +56,7 @@ object MemberToProp { Right(obj => s"""if (${name.value} != null) $obj.updateDynamic(${escapeIntoString(f.originalName)})($convertedTarget)""", ), + Right(f), ), ) case Optional(_) => @@ -69,6 +72,7 @@ object MemberToProp { Right(obj => s"""if (${name.value} != null) $obj.updateDynamic(${escapeIntoString(f.originalName)})(${name.value}$Cast)""", ), + Right(f), ), ) case TypeRef.Function(paramTypes, retType) => @@ -89,6 +93,7 @@ object MemberToProp { Left(s"""${name.value} = $convertedTarget""") else Right(obj => s"""$obj.updateDynamic(${escapeIntoString(f.originalName)})($convertedTarget)"""), + Right(f), ), ) case _ => @@ -99,6 +104,7 @@ object MemberToProp { Left(s"""${name.value} = ${name.value}$Cast""") else Right(obj => s"""$obj.updateDynamic(${escapeIntoString(f.originalName)})(${name.value}$Cast)"""), + Right(f), ), ) } @@ -123,6 +129,7 @@ object MemberToProp { Left(s"""${m.name.value} = $convertedTarget""") else Right(obj => s"""$obj.updateDynamic(${escapeIntoString(m.originalName)})($convertedTarget)"""), + Right(m), ), ) } diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/Prop.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/Prop.scala index 460928cb43..4b0ea742ab 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/Prop.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/Prop.scala @@ -2,7 +2,11 @@ package org.scalablytyped.converter.internal package scalajs package flavours -final case class Prop(parameter: ParamTree, asString: Either[String, String => String]) { +final case class Prop( + parameter: ParamTree, + asString: Either[String, String => String], + original: Either[TypeRef, MemberTree], +) { def isOptional = parameter.default.isDefined } diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/ReactNames.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/ReactNames.scala index fe14fc944d..28c7b6d6ed 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/ReactNames.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/ReactNames.scala @@ -41,7 +41,14 @@ class ReactNames(val outputPkg: Name) { "StatelessComponent", ) - val isComponent: Set[QualifiedName] = ComponentNames.map(mod + Name(_)) + val ComponentQNames: Set[QualifiedName] = + ComponentNames.map(mod + Name(_)) + + def isComponent(tr: TypeRef): Boolean = + tr match { + case TypeRef.Intersection(types) => types.exists(isComponent) + case other => ComponentQNames(other.typeName) + } // events val BaseSyntheticEvent = mod + Name("BaseSyntheticEvent") diff --git a/utils/src/main/scala/org/scalablytyped/converter/internal/IArray.scala b/utils/src/main/scala/org/scalablytyped/converter/internal/IArray.scala index 12228c8444..3b2641ed3c 100644 --- a/utils/src/main/scala/org/scalablytyped/converter/internal/IArray.scala +++ b/utils/src/main/scala/org/scalablytyped/converter/internal/IArray.scala @@ -955,4 +955,27 @@ final class IArray[+A <: AnyRef](private val array: Array[AnyRef], val length: I def nonEmptyOpt: Option[IArray[A]] = if (isEmpty) None else Some(this) + + @inline def distinctBy[B](f: A => B): IArray[A] = { + if (isEmpty) { + return this + } + + val set = mutable.Set.empty[B] + val ret = array.clone() + var i = 0 + var o = 0 + while (i < length) { + val a = apply(i) + val b = f(a) + if (!set(b)) { + set.add(b) + ret(o) = a + o += 1 + } + i += 1 + } + + fromArrayAndSize[A](ret, o) + } } From 6098b1ba60519cd797d0171a472d678fd69533c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 10/18] Revamp naming of anonymous interfaces (necessary after type expansion updates) --- .../chart.js/check/c/chart_dot_js/build.sbt | 2 +- ...onGlobal.scala => AnonDictkeyGlobal.scala} | 8 +- ...> TypeofClassChartInstantiableChart.scala} | 4 +- .../main/scala/typings/chartJs/mod/^.scala | 8 +- .../check/a/angular-agility/build.sbt | 4 +- .../check/a/angular/build.sbt | 2 +- .../angular/{AnonArgs.scala => Anon0.scala} | 2 +- .../main/scala/typings/angular/mod/auto.scala | 6 +- .../check-japgolly/c/componentstest/build.sbt | 4 +- .../r/react-bootstrap/build.sbt | 4 +- .../r/react-contextmenu/build.sbt | 4 +- .../check-japgolly/r/react-dropzone/build.sbt | 4 +- .../check-japgolly/r/react-select/build.sbt | 4 +- .../check-japgolly/r/react/build.sbt | 2 +- .../{AnonDefaultPropsD.scala => Anon0.scala} | 8 +- .../s/semantic-ui-react/build.sbt | 4 +- .../build.sbt | 4 +- ...ptureListener.scala => AnonListener.scala} | 8 +- .../eventListenerMod.scala | 2 +- .../mod.scala | 2 +- .../build.sbt | 4 +- ...ldrenInnerRef.scala => AnonInnerRef.scala} | 8 +- .../stardustUiReactComponentRef/mod.scala | 4 +- .../refFindNodeMod.scala | 2 +- .../refForwardMod.scala | 2 +- .../check-slinky/c/componentstest/build.sbt | 4 +- .../check-slinky/r/react-bootstrap/build.sbt | 4 +- .../r/react-contextmenu/build.sbt | 4 +- .../check-slinky/r/react-dropzone/build.sbt | 4 +- .../check-slinky/r/react-select/build.sbt | 4 +- .../check-slinky/r/react/build.sbt | 2 +- .../{AnonDefaultPropsD.scala => Anon0.scala} | 8 +- .../s/semantic-ui-react/build.sbt | 4 +- .../build.sbt | 4 +- ...ptureListener.scala => AnonListener.scala} | 8 +- .../eventListenerMod.scala | 2 +- .../mod.scala | 2 +- .../build.sbt | 4 +- ...ldrenInnerRef.scala => AnonInnerRef.scala} | 8 +- .../stardustUiReactComponentRef/mod.scala | 4 +- .../refFindNodeMod.scala | 2 +- .../refForwardMod.scala | 2 +- .../check/c/componentstest/build.sbt | 4 +- .../check/r/react-bootstrap/build.sbt | 4 +- .../check/r/react-contextmenu/build.sbt | 4 +- .../check/r/react-dropzone/build.sbt | 4 +- .../check/r/react-select/build.sbt | 4 +- .../check/r/react/build.sbt | 2 +- .../{AnonDefaultPropsD.scala => Anon0.scala} | 8 +- .../check/s/semantic-ui-react/build.sbt | 4 +- .../build.sbt | 4 +- ...ptureListener.scala => AnonListener.scala} | 8 +- .../eventListenerMod.scala | 2 +- .../mod.scala | 2 +- .../build.sbt | 4 +- ...ldrenInnerRef.scala => AnonInnerRef.scala} | 8 +- .../stardustUiReactComponentRef/mod.scala | 4 +- .../refFindNodeMod.scala | 2 +- .../refForwardMod.scala | 2 +- .../r/react-transition-group/build.sbt | 2 +- ...AnonChild.scala => AnonChildFactory.scala} | 8 +- .../transitionGroupMod/package.scala | 2 +- .../r/react-transition-group/build.sbt | 2 +- ...AnonChild.scala => AnonChildFactory.scala} | 8 +- .../transitionGroupMod/package.scala | 2 +- .../check/r/react-transition-group/build.sbt | 2 +- ...AnonChild.scala => AnonChildFactory.scala} | 8 +- .../transitionGroupMod/package.scala | 2 +- .../check/t/type-mappings/build.sbt | 2 +- .../{AnonGetSet.scala => AnonSet.scala} | 8 +- .../typings/typeMappings/IProxiedPerson.scala | 4 +- .../typings/typeMappings/ProxiedPerson.scala | 4 +- .../vue/check/s/storybook__vue/build.sbt | 4 +- .../vue/check/v/vue-resource/build.sbt | 2 +- ...AnonDelete.scala => AnonCall1Delete.scala} | 2 +- ...Headers.scala => AnonDictkeyHeaders.scala} | 8 +- .../vueResource/vuejs/ComponentOption.scala | 6 +- .../scala/typings/vueResource/vuejs/Vue.scala | 4 +- .../vue/check/v/vue-scrollto/build.sbt | 4 +- .../test/resources/vue/check/v/vue/build.sbt | 2 +- .../vue/{AnonArgs.scala => Anon0.scala} | 2 +- ...lement.scala => AnonStaticRenderFns.scala} | 8 +- .../typings/vue/{FnArray.scala => Fn0.scala} | 2 +- .../vue/{FnArrayKey.scala => Fn1.scala} | 2 +- .../typings/vue/optionsMod/package.scala | 2 +- .../main/scala/typings/vue/vueMod/Vue.scala | 8 +- .../typings/vue/vueMod/VueConstructor.scala | 4 +- .../ts/DeriveNonConflictingName.scala | 135 ++++++++++++------ .../ts/transforms/ExtractInterfaces.scala | 2 +- 89 files changed, 275 insertions(+), 222 deletions(-) rename importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/{AnonGlobal.scala => AnonDictkeyGlobal.scala} (85%) rename importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/{TypeofClassChart.scala => TypeofClassChartInstantiableChart.scala} (88%) rename importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/{AnonArgs.scala => Anon0.scala} (92%) rename importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/{AnonDefaultPropsD.scala => Anon0.scala} (77%) rename importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/src/main/scala/typingsJapgolly/stardustUiReactComponentEventListener/{AnonCaptureListener.scala => AnonListener.scala} (87%) rename importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/{AnonChildrenInnerRef.scala => AnonInnerRef.scala} (80%) rename importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/{AnonDefaultPropsD.scala => Anon0.scala} (77%) rename importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/src/main/scala/typingsSlinky/stardustUiReactComponentEventListener/{AnonCaptureListener.scala => AnonListener.scala} (87%) rename importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/{AnonChildrenInnerRef.scala => AnonInnerRef.scala} (80%) rename importer/src/test/resources/react-integration-test/check/r/react/src/main/scala/typings/react/{AnonDefaultPropsD.scala => Anon0.scala} (77%) rename importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/src/main/scala/typings/stardustUiReactComponentEventListener/{AnonCaptureListener.scala => AnonListener.scala} (87%) rename importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/{AnonChildrenInnerRef.scala => AnonInnerRef.scala} (80%) rename importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/src/main/scala/typingsJapgolly/reactTransitionGroup/{AnonChild.scala => AnonChildFactory.scala} (81%) rename importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/src/main/scala/typingsSlinky/reactTransitionGroup/{AnonChild.scala => AnonChildFactory.scala} (78%) rename importer/src/test/resources/react-transition-group/check/r/react-transition-group/src/main/scala/typings/reactTransitionGroup/{AnonChild.scala => AnonChildFactory.scala} (77%) rename importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/{AnonGetSet.scala => AnonSet.scala} (67%) rename importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/{AnonDelete.scala => AnonCall1Delete.scala} (98%) rename importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/{AnonHeaders.scala => AnonDictkeyHeaders.scala} (79%) rename importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/{AnonArgs.scala => Anon0.scala} (93%) rename importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/{AnonCreateElement.scala => AnonStaticRenderFns.scala} (76%) rename importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/{FnArray.scala => Fn0.scala} (88%) rename importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/{FnArrayKey.scala => Fn1.scala} (87%) diff --git a/importer/src/test/resources/chart.js/check/c/chart_dot_js/build.sbt b/importer/src/test/resources/chart.js/check/c/chart_dot_js/build.sbt index 4d5292f1c2..d2b3df4b5b 100644 --- a/importer/src/test/resources/chart.js/check/c/chart_dot_js/build.sbt +++ b/importer/src/test/resources/chart.js/check/c/chart_dot_js/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "chart_dot_js" -version := "0.0-unknown-5366ae" +version := "0.0-unknown-350f17" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/AnonGlobal.scala b/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/AnonDictkeyGlobal.scala similarity index 85% rename from importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/AnonGlobal.scala rename to importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/AnonDictkeyGlobal.scala index 72e2285172..a71e76322a 100644 --- a/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/AnonGlobal.scala +++ b/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/AnonDictkeyGlobal.scala @@ -8,20 +8,20 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonGlobal +trait AnonDictkeyGlobal extends /* key */ StringDictionary[js.Any] { var global: ChartOptions with ChartFontOptions = js.native } -object AnonGlobal { +object AnonDictkeyGlobal { @scala.inline def apply( global: ChartOptions with ChartFontOptions, StringDictionary: /* key */ StringDictionary[js.Any] = null - ): AnonGlobal = { + ): AnonDictkeyGlobal = { val __obj = js.Dynamic.literal(global = global.asInstanceOf[js.Any]) if (StringDictionary != null) js.Dynamic.global.Object.assign(__obj, StringDictionary) - __obj.asInstanceOf[AnonGlobal] + __obj.asInstanceOf[AnonDictkeyGlobal] } } diff --git a/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/TypeofClassChart.scala b/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/TypeofClassChartInstantiableChart.scala similarity index 88% rename from importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/TypeofClassChart.scala rename to importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/TypeofClassChartInstantiableChart.scala index 858ed41f2f..c846ed477b 100644 --- a/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/TypeofClassChart.scala +++ b/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/TypeofClassChartInstantiableChart.scala @@ -11,13 +11,13 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait TypeofClassChart +trait TypeofClassChartInstantiableChart extends Instantiable2[ (/* context */ ArrayLike[CanvasRenderingContext2D | HTMLCanvasElement]) | (/* context */ CanvasRenderingContext2D) | (/* context */ HTMLCanvasElement) | (/* context */ String), /* options */ js.Any, Chart ] { var controllers: StringDictionary[js.Any] = js.native - var defaults: AnonGlobal = js.native + var defaults: AnonDictkeyGlobal = js.native } diff --git a/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/mod/^.scala b/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/mod/^.scala index 9bbffc1a96..4c41cf6353 100644 --- a/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/mod/^.scala +++ b/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/mod/^.scala @@ -1,8 +1,8 @@ package typings.chartJs.mod import org.scalablytyped.runtime.StringDictionary -import typings.chartJs.AnonGlobal -import typings.chartJs.TypeofClassChart +import typings.chartJs.AnonDictkeyGlobal +import typings.chartJs.TypeofClassChartInstantiableChart import typings.std.ArrayLike import typings.std.CanvasRenderingContext2D import typings.std.HTMLCanvasElement @@ -22,8 +22,8 @@ class ^ protected () extends Chart { @JSImport("chart.js", JSImport.Namespace) @js.native object ^ extends js.Object { - val Chart: TypeofClassChart = js.native + val Chart: TypeofClassChartInstantiableChart = js.native var controllers: StringDictionary[js.Any] = js.native - var defaults: AnonGlobal = js.native + var defaults: AnonDictkeyGlobal = js.native } diff --git a/importer/src/test/resources/export-as-namespace/check/a/angular-agility/build.sbt b/importer/src/test/resources/export-as-namespace/check/a/angular-agility/build.sbt index 1ff9d9f5f9..ab0f302944 100644 --- a/importer/src/test/resources/export-as-namespace/check/a/angular-agility/build.sbt +++ b/importer/src/test/resources/export-as-namespace/check/a/angular-agility/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "angular-agility" -version := "0.0-unknown-ad90c7" +version := "0.0-unknown-3a904b" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "angular" % "1.6-a834ce", + "org.scalablytyped" %%% "angular" % "1.6-20d317", "org.scalablytyped" %%% "std" % "0.0-unknown-eec27d") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/export-as-namespace/check/a/angular/build.sbt b/importer/src/test/resources/export-as-namespace/check/a/angular/build.sbt index ec29721e58..305bf4d663 100644 --- a/importer/src/test/resources/export-as-namespace/check/a/angular/build.sbt +++ b/importer/src/test/resources/export-as-namespace/check/a/angular/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "angular" -version := "1.6-a834ce" +version := "1.6-20d317" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/AnonArgs.scala b/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/Anon0.scala similarity index 92% rename from importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/AnonArgs.scala rename to importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/Anon0.scala index 42cf55e039..f68876eb8d 100644 --- a/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/AnonArgs.scala +++ b/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/Anon0.scala @@ -6,6 +6,6 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonArgs[T] +trait Anon0[T] extends Instantiable1[/* args (repeated) */ js.Any, T] diff --git a/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/mod/auto.scala b/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/mod/auto.scala index 807c7ff0a8..4cdfb47be2 100644 --- a/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/mod/auto.scala +++ b/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/mod/auto.scala @@ -1,6 +1,6 @@ package typings.angular.mod -import typings.angular.AnonArgs +import typings.angular.Anon0 import typings.angular.mod._Global_.Function import scala.scalajs.js import scala.scalajs.js.`|` @@ -22,8 +22,8 @@ object auto extends js.Object { def get[T](name: String): T = js.native def get[T](name: String, caller: String): T = js.native def has(name: String): Boolean = js.native - def instantiate[T](typeConstructor: AnonArgs[T]): T = js.native - def instantiate[T](typeConstructor: AnonArgs[T], locals: js.Any): T = js.native + def instantiate[T](typeConstructor: Anon0[T]): T = js.native + def instantiate[T](typeConstructor: Anon0[T], locals: js.Any): T = js.native def invoke[T](func: Injectable[Function | (js.Function1[/* repeated */ _, T])]): T = js.native def invoke[T](func: Injectable[Function | (js.Function1[/* repeated */ _, T])], context: js.Any): T = js.native def invoke[T](func: Injectable[Function | (js.Function1[/* repeated */ _, T])], context: js.Any, locals: js.Any): T = js.native diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt index 15aac42e37..cb63b9bc56 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "componentstest" -version := "0.0-unknown-450911" +version := "0.0-unknown-3a2169" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "react" % "16.9.2-424c14", "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-bootstrap/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-bootstrap/build.sbt index 0878af164f..b1c0707e20 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-bootstrap/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-bootstrap/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-bootstrap" -version := "0.32-679545" +version := "0.32-5c459b" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "react" % "16.9.2-424c14", "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-contextmenu/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-contextmenu/build.sbt index fc531fec32..be6e01192a 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-contextmenu/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-contextmenu/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-contextmenu" -version := "2.13.0-40b38c" +version := "2.13.0-9f7bb6" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "react" % "16.9.2-424c14", "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt index 8a0e75893a..48df0c3097 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-7e59d8" +version := "10.1.10-198c3a" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "react" % "16.9.2-424c14", "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-select/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-select/build.sbt index fa84fd2681..33f7234456 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-select/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-select/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-select" -version := "0.0-unknown-30f6e8" +version := "0.0-unknown-9aaab6" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "react" % "16.9.2-424c14", "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/build.sbt index dd98fbd950..7176dad318 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react" -version := "16.9.2-578572" +version := "16.9.2-424c14" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/AnonDefaultPropsD.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/Anon0.scala similarity index 77% rename from importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/AnonDefaultPropsD.scala rename to importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/Anon0.scala index c176422370..8ebf38dd9e 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/AnonDefaultPropsD.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/Anon0.scala @@ -5,18 +5,18 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonDefaultPropsD extends js.Object { +trait Anon0 extends js.Object { var defaultProps: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any = js.native } -object AnonDefaultPropsD { +object Anon0 { @scala.inline def apply( defaultProps: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any - ): AnonDefaultPropsD = { + ): Anon0 = { val __obj = js.Dynamic.literal(defaultProps = defaultProps.asInstanceOf[js.Any]) - __obj.asInstanceOf[AnonDefaultPropsD] + __obj.asInstanceOf[Anon0] } } diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt index 57ba91eef4..5de16cb96f 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "semantic-ui-react" -version := "0.0-unknown-de4fd1" +version := "0.0-unknown-d58e2d" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "react" % "16.9.2-424c14", "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/build.sbt index ec755db054..197b1200b1 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-event-listener" -version := "0.38.0-bbd7a6" +version := "0.38.0-e69496" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "react" % "16.9.2-424c14", "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/src/main/scala/typingsJapgolly/stardustUiReactComponentEventListener/AnonCaptureListener.scala b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/src/main/scala/typingsJapgolly/stardustUiReactComponentEventListener/AnonListener.scala similarity index 87% rename from importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/src/main/scala/typingsJapgolly/stardustUiReactComponentEventListener/AnonCaptureListener.scala rename to importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/src/main/scala/typingsJapgolly/stardustUiReactComponentEventListener/AnonListener.scala index 9bea6ee613..9b9203cfb0 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/src/main/scala/typingsJapgolly/stardustUiReactComponentEventListener/AnonCaptureListener.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/src/main/scala/typingsJapgolly/stardustUiReactComponentEventListener/AnonListener.scala @@ -5,27 +5,27 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonCaptureListener extends js.Object { +trait AnonListener extends js.Object { var capture: js.UndefOr[scala.Nothing] = js.native var listener: js.UndefOr[scala.Nothing] = js.native var targetRef: js.UndefOr[scala.Nothing] = js.native var `type`: js.UndefOr[scala.Nothing] = js.native } -object AnonCaptureListener { +object AnonListener { @scala.inline def apply( capture: js.UndefOr[scala.Nothing] = js.undefined, listener: js.UndefOr[scala.Nothing] = js.undefined, targetRef: js.UndefOr[scala.Nothing] = js.undefined, `type`: js.UndefOr[scala.Nothing] = js.undefined - ): AnonCaptureListener = { + ): AnonListener = { val __obj = js.Dynamic.literal() if (!js.isUndefined(capture)) __obj.updateDynamic("capture")(capture.asInstanceOf[js.Any]) if (!js.isUndefined(listener)) __obj.updateDynamic("listener")(listener.asInstanceOf[js.Any]) if (!js.isUndefined(targetRef)) __obj.updateDynamic("targetRef")(targetRef.asInstanceOf[js.Any]) if (!js.isUndefined(`type`)) __obj.updateDynamic("type")(`type`.asInstanceOf[js.Any]) - __obj.asInstanceOf[AnonCaptureListener] + __obj.asInstanceOf[AnonListener] } } diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/src/main/scala/typingsJapgolly/stardustUiReactComponentEventListener/eventListenerMod.scala b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/src/main/scala/typingsJapgolly/stardustUiReactComponentEventListener/eventListenerMod.scala index 8364d7065c..cbd766bc13 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/src/main/scala/typingsJapgolly/stardustUiReactComponentEventListener/eventListenerMod.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/src/main/scala/typingsJapgolly/stardustUiReactComponentEventListener/eventListenerMod.scala @@ -12,7 +12,7 @@ object eventListenerMod extends js.Object { @js.native object default extends js.Object { var displayName: String = js.native - var propTypes: AnonCapture | AnonCaptureListener = js.native + var propTypes: AnonCapture | AnonListener = js.native def apply[T /* <: EventTypes */](props: EventListenerOptions[T]): js.Any = js.native @js.native object defaultProps extends js.Object { diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/src/main/scala/typingsJapgolly/stardustUiReactComponentEventListener/mod.scala b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/src/main/scala/typingsJapgolly/stardustUiReactComponentEventListener/mod.scala index ce34703f2d..843717425b 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/src/main/scala/typingsJapgolly/stardustUiReactComponentEventListener/mod.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/src/main/scala/typingsJapgolly/stardustUiReactComponentEventListener/mod.scala @@ -20,7 +20,7 @@ object mod extends js.Object { @js.native object EventListener extends js.Object { var displayName: String = js.native - var propTypes: AnonCapture | AnonCaptureListener = js.native + var propTypes: AnonCapture | AnonListener = js.native def apply[T /* <: EventTypes */](props: EventListenerOptions[T]): js.Any = js.native @js.native object defaultProps extends js.Object { diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/build.sbt index 952055b5ba..6e784542ba 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-ref" -version := "0.38.0-524ec6" +version := "0.38.0-6cfd79" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-578572", + "org.scalablytyped" %%% "react" % "16.9.2-424c14", "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/AnonChildrenInnerRef.scala b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/AnonInnerRef.scala similarity index 80% rename from importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/AnonChildrenInnerRef.scala rename to importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/AnonInnerRef.scala index 2b6cd41f28..0715a342ea 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/AnonChildrenInnerRef.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/AnonInnerRef.scala @@ -5,21 +5,21 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonChildrenInnerRef extends js.Object { +trait AnonInnerRef extends js.Object { var children: js.UndefOr[scala.Nothing] = js.native var innerRef: js.UndefOr[scala.Nothing] = js.native } -object AnonChildrenInnerRef { +object AnonInnerRef { @scala.inline def apply( children: js.UndefOr[scala.Nothing] = js.undefined, innerRef: js.UndefOr[scala.Nothing] = js.undefined - ): AnonChildrenInnerRef = { + ): AnonInnerRef = { val __obj = js.Dynamic.literal() if (!js.isUndefined(children)) __obj.updateDynamic("children")(children.asInstanceOf[js.Any]) if (!js.isUndefined(innerRef)) __obj.updateDynamic("innerRef")(innerRef.asInstanceOf[js.Any]) - __obj.asInstanceOf[AnonChildrenInnerRef] + __obj.asInstanceOf[AnonInnerRef] } } diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/mod.scala b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/mod.scala index 52a3776788..427d4ee82a 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/mod.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/mod.scala @@ -35,14 +35,14 @@ object mod extends js.Object { @js.native object RefFindNode extends js.Object { var displayName: String = js.native - var propTypes: AnonChildren | AnonChildrenInnerRef = js.native + var propTypes: AnonChildren | AnonInnerRef = js.native } /* static members */ @js.native object RefForward extends js.Object { var displayName: String = js.native - var propTypes: AnonChildren | AnonChildrenInnerRef = js.native + var propTypes: AnonChildren | AnonInnerRef = js.native } } diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/refFindNodeMod.scala b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/refFindNodeMod.scala index 4febea2efe..ef15358d06 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/refFindNodeMod.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/refFindNodeMod.scala @@ -28,7 +28,7 @@ object refFindNodeMod extends js.Object { @js.native object default extends js.Object { var displayName: String = js.native - var propTypes: AnonChildren | AnonChildrenInnerRef = js.native + var propTypes: AnonChildren | AnonInnerRef = js.native } } diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/refForwardMod.scala b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/refForwardMod.scala index ceff3458ff..e427145995 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/refForwardMod.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/src/main/scala/typingsJapgolly/stardustUiReactComponentRef/refForwardMod.scala @@ -23,7 +23,7 @@ object refForwardMod extends js.Object { @js.native object default extends js.Object { var displayName: String = js.native - var propTypes: AnonChildren | AnonChildrenInnerRef = js.native + var propTypes: AnonChildren | AnonInnerRef = js.native } } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/c/componentstest/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/c/componentstest/build.sbt index 5914cc65a5..a419c6af03 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/c/componentstest/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/c/componentstest/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "componentstest" -version := "0.0-unknown-0b39d4" +version := "0.0-unknown-35a067" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "react" % "16.9.2-b2066d", "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt index 1394b367d9..97e3eaa02b 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-bootstrap" -version := "0.32-a80847" +version := "0.32-2312c5" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "react" % "16.9.2-b2066d", "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/build.sbt index dccebc4d24..cd371ac57f 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-contextmenu" -version := "2.13.0-30779b" +version := "2.13.0-8127e9" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "react" % "16.9.2-b2066d", "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt index f82b79f888..993c9c9695 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-71ad9b" +version := "10.1.10-54e38b" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "react" % "16.9.2-b2066d", "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-select/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-select/build.sbt index 1e61fe781c..408eacadb7 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-select/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-select/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-select" -version := "0.0-unknown-82d633" +version := "0.0-unknown-ab65ab" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "react" % "16.9.2-b2066d", "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react/build.sbt index 2c28cd5986..6a1f891d50 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react" -version := "16.9.2-3ccb0b" +version := "16.9.2-b2066d" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/AnonDefaultPropsD.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/Anon0.scala similarity index 77% rename from importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/AnonDefaultPropsD.scala rename to importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/Anon0.scala index a38c8aeb51..05bdadb8b9 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/AnonDefaultPropsD.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/Anon0.scala @@ -5,18 +5,18 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonDefaultPropsD extends js.Object { +trait Anon0 extends js.Object { var defaultProps: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any = js.native } -object AnonDefaultPropsD { +object Anon0 { @scala.inline def apply( defaultProps: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any - ): AnonDefaultPropsD = { + ): Anon0 = { val __obj = js.Dynamic.literal(defaultProps = defaultProps.asInstanceOf[js.Any]) - __obj.asInstanceOf[AnonDefaultPropsD] + __obj.asInstanceOf[Anon0] } } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt index f5d4cf1a34..30a6129bd6 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "semantic-ui-react" -version := "0.0-unknown-2c4cb5" +version := "0.0-unknown-8ecbc1" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "react" % "16.9.2-b2066d", "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/build.sbt index 764b9420dc..af17c243c5 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-event-listener" -version := "0.38.0-b3b6b4" +version := "0.38.0-65ba95" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "react" % "16.9.2-b2066d", "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/src/main/scala/typingsSlinky/stardustUiReactComponentEventListener/AnonCaptureListener.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/src/main/scala/typingsSlinky/stardustUiReactComponentEventListener/AnonListener.scala similarity index 87% rename from importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/src/main/scala/typingsSlinky/stardustUiReactComponentEventListener/AnonCaptureListener.scala rename to importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/src/main/scala/typingsSlinky/stardustUiReactComponentEventListener/AnonListener.scala index 5805f95207..e42ce713c1 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/src/main/scala/typingsSlinky/stardustUiReactComponentEventListener/AnonCaptureListener.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/src/main/scala/typingsSlinky/stardustUiReactComponentEventListener/AnonListener.scala @@ -5,27 +5,27 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonCaptureListener extends js.Object { +trait AnonListener extends js.Object { var capture: js.UndefOr[scala.Nothing] = js.native var listener: js.UndefOr[scala.Nothing] = js.native var targetRef: js.UndefOr[scala.Nothing] = js.native var `type`: js.UndefOr[scala.Nothing] = js.native } -object AnonCaptureListener { +object AnonListener { @scala.inline def apply( capture: js.UndefOr[scala.Nothing] = js.undefined, listener: js.UndefOr[scala.Nothing] = js.undefined, targetRef: js.UndefOr[scala.Nothing] = js.undefined, `type`: js.UndefOr[scala.Nothing] = js.undefined - ): AnonCaptureListener = { + ): AnonListener = { val __obj = js.Dynamic.literal() if (!js.isUndefined(capture)) __obj.updateDynamic("capture")(capture.asInstanceOf[js.Any]) if (!js.isUndefined(listener)) __obj.updateDynamic("listener")(listener.asInstanceOf[js.Any]) if (!js.isUndefined(targetRef)) __obj.updateDynamic("targetRef")(targetRef.asInstanceOf[js.Any]) if (!js.isUndefined(`type`)) __obj.updateDynamic("type")(`type`.asInstanceOf[js.Any]) - __obj.asInstanceOf[AnonCaptureListener] + __obj.asInstanceOf[AnonListener] } } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/src/main/scala/typingsSlinky/stardustUiReactComponentEventListener/eventListenerMod.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/src/main/scala/typingsSlinky/stardustUiReactComponentEventListener/eventListenerMod.scala index c552a0a6ad..ce6c0d979c 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/src/main/scala/typingsSlinky/stardustUiReactComponentEventListener/eventListenerMod.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/src/main/scala/typingsSlinky/stardustUiReactComponentEventListener/eventListenerMod.scala @@ -12,7 +12,7 @@ object eventListenerMod extends js.Object { @js.native object default extends js.Object { var displayName: String = js.native - var propTypes: AnonCapture | AnonCaptureListener = js.native + var propTypes: AnonCapture | AnonListener = js.native def apply[T /* <: EventTypes */](props: EventListenerOptions[T]): js.Any = js.native @js.native object defaultProps extends js.Object { diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/src/main/scala/typingsSlinky/stardustUiReactComponentEventListener/mod.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/src/main/scala/typingsSlinky/stardustUiReactComponentEventListener/mod.scala index 8be36550e5..36317ca082 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/src/main/scala/typingsSlinky/stardustUiReactComponentEventListener/mod.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/src/main/scala/typingsSlinky/stardustUiReactComponentEventListener/mod.scala @@ -20,7 +20,7 @@ object mod extends js.Object { @js.native object EventListener extends js.Object { var displayName: String = js.native - var propTypes: AnonCapture | AnonCaptureListener = js.native + var propTypes: AnonCapture | AnonListener = js.native def apply[T /* <: EventTypes */](props: EventListenerOptions[T]): js.Any = js.native @js.native object defaultProps extends js.Object { diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/build.sbt index 5e5ebde33f..f173a0528b 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-ref" -version := "0.38.0-dc4ac6" +version := "0.38.0-e7b67d" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-3ccb0b", + "org.scalablytyped" %%% "react" % "16.9.2-b2066d", "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/AnonChildrenInnerRef.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/AnonInnerRef.scala similarity index 80% rename from importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/AnonChildrenInnerRef.scala rename to importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/AnonInnerRef.scala index 343bc7b69f..0e8d104230 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/AnonChildrenInnerRef.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/AnonInnerRef.scala @@ -5,21 +5,21 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonChildrenInnerRef extends js.Object { +trait AnonInnerRef extends js.Object { var children: js.UndefOr[scala.Nothing] = js.native var innerRef: js.UndefOr[scala.Nothing] = js.native } -object AnonChildrenInnerRef { +object AnonInnerRef { @scala.inline def apply( children: js.UndefOr[scala.Nothing] = js.undefined, innerRef: js.UndefOr[scala.Nothing] = js.undefined - ): AnonChildrenInnerRef = { + ): AnonInnerRef = { val __obj = js.Dynamic.literal() if (!js.isUndefined(children)) __obj.updateDynamic("children")(children.asInstanceOf[js.Any]) if (!js.isUndefined(innerRef)) __obj.updateDynamic("innerRef")(innerRef.asInstanceOf[js.Any]) - __obj.asInstanceOf[AnonChildrenInnerRef] + __obj.asInstanceOf[AnonInnerRef] } } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/mod.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/mod.scala index 2feb6224f6..d27da1ac5d 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/mod.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/mod.scala @@ -35,14 +35,14 @@ object mod extends js.Object { @js.native object RefFindNode extends js.Object { var displayName: String = js.native - var propTypes: AnonChildren | AnonChildrenInnerRef = js.native + var propTypes: AnonChildren | AnonInnerRef = js.native } /* static members */ @js.native object RefForward extends js.Object { var displayName: String = js.native - var propTypes: AnonChildren | AnonChildrenInnerRef = js.native + var propTypes: AnonChildren | AnonInnerRef = js.native } } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/refFindNodeMod.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/refFindNodeMod.scala index 69612af308..f2c5b96bde 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/refFindNodeMod.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/refFindNodeMod.scala @@ -28,7 +28,7 @@ object refFindNodeMod extends js.Object { @js.native object default extends js.Object { var displayName: String = js.native - var propTypes: AnonChildren | AnonChildrenInnerRef = js.native + var propTypes: AnonChildren | AnonInnerRef = js.native } } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/refForwardMod.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/refForwardMod.scala index 5555f13e81..d43a20a8cf 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/refForwardMod.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/src/main/scala/typingsSlinky/stardustUiReactComponentRef/refForwardMod.scala @@ -23,7 +23,7 @@ object refForwardMod extends js.Object { @js.native object default extends js.Object { var displayName: String = js.native - var propTypes: AnonChildren | AnonChildrenInnerRef = js.native + var propTypes: AnonChildren | AnonInnerRef = js.native } } diff --git a/importer/src/test/resources/react-integration-test/check/c/componentstest/build.sbt b/importer/src/test/resources/react-integration-test/check/c/componentstest/build.sbt index 305db2e397..051a59cf59 100644 --- a/importer/src/test/resources/react-integration-test/check/c/componentstest/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/c/componentstest/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "componentstest" -version := "0.0-unknown-b2ed2c" +version := "0.0-unknown-6e420e" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check/r/react-bootstrap/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react-bootstrap/build.sbt index 61102c0be2..12ec9ebc36 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-bootstrap/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react-bootstrap/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "react-bootstrap" -version := "0.32-2b6ea3" +version := "0.32-003a4a" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check/r/react-contextmenu/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react-contextmenu/build.sbt index 9ff7978088..7e0ddd1078 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-contextmenu/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react-contextmenu/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "react-contextmenu" -version := "2.13.0-0a906a" +version := "2.13.0-81c302" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt index 3e9ae22a63..0ba2893cd6 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-26f1d4" +version := "10.1.10-d8360d" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check/r/react-select/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react-select/build.sbt index 8800b86914..1c74ff1708 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-select/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react-select/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "react-select" -version := "0.0-unknown-4324c3" +version := "0.0-unknown-2421e4" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check/r/react/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react/build.sbt index 7d8e845f1a..7c7bf8091c 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react" -version := "16.9.2-8547e4" +version := "16.9.2-6e4c5b" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check/r/react/src/main/scala/typings/react/AnonDefaultPropsD.scala b/importer/src/test/resources/react-integration-test/check/r/react/src/main/scala/typings/react/Anon0.scala similarity index 77% rename from importer/src/test/resources/react-integration-test/check/r/react/src/main/scala/typings/react/AnonDefaultPropsD.scala rename to importer/src/test/resources/react-integration-test/check/r/react/src/main/scala/typings/react/Anon0.scala index f1ec1993e8..73d3a9a135 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react/src/main/scala/typings/react/AnonDefaultPropsD.scala +++ b/importer/src/test/resources/react-integration-test/check/r/react/src/main/scala/typings/react/Anon0.scala @@ -5,18 +5,18 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonDefaultPropsD extends js.Object { +trait Anon0 extends js.Object { var defaultProps: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any = js.native } -object AnonDefaultPropsD { +object Anon0 { @scala.inline def apply( defaultProps: /* import warning: importer.ImportType#apply Failed type conversion: infer D */ js.Any - ): AnonDefaultPropsD = { + ): Anon0 = { val __obj = js.Dynamic.literal(defaultProps = defaultProps.asInstanceOf[js.Any]) - __obj.asInstanceOf[AnonDefaultPropsD] + __obj.asInstanceOf[Anon0] } } diff --git a/importer/src/test/resources/react-integration-test/check/s/semantic-ui-react/build.sbt b/importer/src/test/resources/react-integration-test/check/s/semantic-ui-react/build.sbt index 50ff61f3ee..ca31e4742c 100644 --- a/importer/src/test/resources/react-integration-test/check/s/semantic-ui-react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/s/semantic-ui-react/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "semantic-ui-react" -version := "0.0-unknown-55d14e" +version := "0.0-unknown-eaaa62" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/build.sbt b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/build.sbt index 5ae6304552..2f429fb6b7 100644 --- a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-event-listener" -version := "0.38.0-c742c1" +version := "0.38.0-73ff32" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/src/main/scala/typings/stardustUiReactComponentEventListener/AnonCaptureListener.scala b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/src/main/scala/typings/stardustUiReactComponentEventListener/AnonListener.scala similarity index 87% rename from importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/src/main/scala/typings/stardustUiReactComponentEventListener/AnonCaptureListener.scala rename to importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/src/main/scala/typings/stardustUiReactComponentEventListener/AnonListener.scala index a536e429c0..44919293f1 100644 --- a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/src/main/scala/typings/stardustUiReactComponentEventListener/AnonCaptureListener.scala +++ b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/src/main/scala/typings/stardustUiReactComponentEventListener/AnonListener.scala @@ -5,27 +5,27 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonCaptureListener extends js.Object { +trait AnonListener extends js.Object { var capture: js.UndefOr[scala.Nothing] = js.native var listener: js.UndefOr[scala.Nothing] = js.native var targetRef: js.UndefOr[scala.Nothing] = js.native var `type`: js.UndefOr[scala.Nothing] = js.native } -object AnonCaptureListener { +object AnonListener { @scala.inline def apply( capture: js.UndefOr[scala.Nothing] = js.undefined, listener: js.UndefOr[scala.Nothing] = js.undefined, targetRef: js.UndefOr[scala.Nothing] = js.undefined, `type`: js.UndefOr[scala.Nothing] = js.undefined - ): AnonCaptureListener = { + ): AnonListener = { val __obj = js.Dynamic.literal() if (!js.isUndefined(capture)) __obj.updateDynamic("capture")(capture.asInstanceOf[js.Any]) if (!js.isUndefined(listener)) __obj.updateDynamic("listener")(listener.asInstanceOf[js.Any]) if (!js.isUndefined(targetRef)) __obj.updateDynamic("targetRef")(targetRef.asInstanceOf[js.Any]) if (!js.isUndefined(`type`)) __obj.updateDynamic("type")(`type`.asInstanceOf[js.Any]) - __obj.asInstanceOf[AnonCaptureListener] + __obj.asInstanceOf[AnonListener] } } diff --git a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/src/main/scala/typings/stardustUiReactComponentEventListener/eventListenerMod.scala b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/src/main/scala/typings/stardustUiReactComponentEventListener/eventListenerMod.scala index ecffeb9900..aa3fef7615 100644 --- a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/src/main/scala/typings/stardustUiReactComponentEventListener/eventListenerMod.scala +++ b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/src/main/scala/typings/stardustUiReactComponentEventListener/eventListenerMod.scala @@ -12,7 +12,7 @@ object eventListenerMod extends js.Object { @js.native object default extends js.Object { var displayName: String = js.native - var propTypes: AnonCapture | AnonCaptureListener = js.native + var propTypes: AnonCapture | AnonListener = js.native def apply[T /* <: EventTypes */](props: EventListenerOptions[T]): js.Any = js.native @js.native object defaultProps extends js.Object { diff --git a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/src/main/scala/typings/stardustUiReactComponentEventListener/mod.scala b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/src/main/scala/typings/stardustUiReactComponentEventListener/mod.scala index dcd606cd2c..4e54f17c83 100644 --- a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/src/main/scala/typings/stardustUiReactComponentEventListener/mod.scala +++ b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/src/main/scala/typings/stardustUiReactComponentEventListener/mod.scala @@ -16,7 +16,7 @@ object mod extends js.Object { @js.native object EventListener extends js.Object { var displayName: String = js.native - var propTypes: AnonCapture | AnonCaptureListener = js.native + var propTypes: AnonCapture | AnonListener = js.native def apply[T /* <: EventTypes */](props: EventListenerOptions[T]): js.Any = js.native @js.native object defaultProps extends js.Object { diff --git a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/build.sbt b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/build.sbt index 19360a8bf6..aa7a7aa21d 100644 --- a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-ref" -version := "0.38.0-bc663c" +version := "0.38.0-d4fc7a" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-8547e4", + "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/AnonChildrenInnerRef.scala b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/AnonInnerRef.scala similarity index 80% rename from importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/AnonChildrenInnerRef.scala rename to importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/AnonInnerRef.scala index fb21681205..3b4a515c86 100644 --- a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/AnonChildrenInnerRef.scala +++ b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/AnonInnerRef.scala @@ -5,21 +5,21 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonChildrenInnerRef extends js.Object { +trait AnonInnerRef extends js.Object { var children: js.UndefOr[scala.Nothing] = js.native var innerRef: js.UndefOr[scala.Nothing] = js.native } -object AnonChildrenInnerRef { +object AnonInnerRef { @scala.inline def apply( children: js.UndefOr[scala.Nothing] = js.undefined, innerRef: js.UndefOr[scala.Nothing] = js.undefined - ): AnonChildrenInnerRef = { + ): AnonInnerRef = { val __obj = js.Dynamic.literal() if (!js.isUndefined(children)) __obj.updateDynamic("children")(children.asInstanceOf[js.Any]) if (!js.isUndefined(innerRef)) __obj.updateDynamic("innerRef")(innerRef.asInstanceOf[js.Any]) - __obj.asInstanceOf[AnonChildrenInnerRef] + __obj.asInstanceOf[AnonInnerRef] } } diff --git a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/mod.scala b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/mod.scala index 1783d1c1dc..be74368d27 100644 --- a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/mod.scala +++ b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/mod.scala @@ -35,14 +35,14 @@ object mod extends js.Object { @js.native object RefFindNode extends js.Object { var displayName: String = js.native - var propTypes: AnonChildren | AnonChildrenInnerRef = js.native + var propTypes: AnonChildren | AnonInnerRef = js.native } /* static members */ @js.native object RefForward extends js.Object { var displayName: String = js.native - var propTypes: AnonChildren | AnonChildrenInnerRef = js.native + var propTypes: AnonChildren | AnonInnerRef = js.native } } diff --git a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/refFindNodeMod.scala b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/refFindNodeMod.scala index 67db616131..b75f73482a 100644 --- a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/refFindNodeMod.scala +++ b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/refFindNodeMod.scala @@ -28,7 +28,7 @@ object refFindNodeMod extends js.Object { @js.native object default extends js.Object { var displayName: String = js.native - var propTypes: AnonChildren | AnonChildrenInnerRef = js.native + var propTypes: AnonChildren | AnonInnerRef = js.native } } diff --git a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/refForwardMod.scala b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/refForwardMod.scala index 1e6221230a..c101e7c948 100644 --- a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/refForwardMod.scala +++ b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/src/main/scala/typings/stardustUiReactComponentRef/refForwardMod.scala @@ -23,7 +23,7 @@ object refForwardMod extends js.Object { @js.native object default extends js.Object { var displayName: String = js.native - var propTypes: AnonChildren | AnonChildrenInnerRef = js.native + var propTypes: AnonChildren | AnonInnerRef = js.native } } diff --git a/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/build.sbt b/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/build.sbt index 2c7182536c..bc6229f042 100644 --- a/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/build.sbt +++ b/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react-transition-group" -version := "2.0-92f1f6" +version := "2.0-791c6b" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/src/main/scala/typingsJapgolly/reactTransitionGroup/AnonChild.scala b/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/src/main/scala/typingsJapgolly/reactTransitionGroup/AnonChildFactory.scala similarity index 81% rename from importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/src/main/scala/typingsJapgolly/reactTransitionGroup/AnonChild.scala rename to importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/src/main/scala/typingsJapgolly/reactTransitionGroup/AnonChildFactory.scala index 089db34797..7b4d35e181 100644 --- a/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/src/main/scala/typingsJapgolly/reactTransitionGroup/AnonChild.scala +++ b/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/src/main/scala/typingsJapgolly/reactTransitionGroup/AnonChildFactory.scala @@ -7,16 +7,16 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonChild extends js.Object { +trait AnonChildFactory extends js.Object { var childFactory: js.UndefOr[js.Function1[/* child */ Element, Element]] = js.native } -object AnonChild { +object AnonChildFactory { @scala.inline - def apply(childFactory: /* child */ Element => CallbackTo[Element] = null): AnonChild = { + def apply(childFactory: /* child */ Element => CallbackTo[Element] = null): AnonChildFactory = { val __obj = js.Dynamic.literal() if (childFactory != null) __obj.updateDynamic("childFactory")(js.Any.fromFunction1((t0: /* child */ japgolly.scalajs.react.raw.React.Element) => childFactory(t0).runNow())) - __obj.asInstanceOf[AnonChild] + __obj.asInstanceOf[AnonChildFactory] } } diff --git a/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/src/main/scala/typingsJapgolly/reactTransitionGroup/transitionGroupMod/package.scala b/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/src/main/scala/typingsJapgolly/reactTransitionGroup/transitionGroupMod/package.scala index 82e2f04a51..26bdf52b5c 100644 --- a/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/src/main/scala/typingsJapgolly/reactTransitionGroup/transitionGroupMod/package.scala +++ b/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/src/main/scala/typingsJapgolly/reactTransitionGroup/transitionGroupMod/package.scala @@ -9,5 +9,5 @@ package object transitionGroupMod { (typingsJapgolly.reactTransitionGroup.transitionGroupMod.TransitionGroupProps[typingsJapgolly.reactTransitionGroup.reactTransitionGroupStrings.abbr, js.Any]) with js.Object, js.Object ] - type TransitionGroupProps[T /* <: typingsJapgolly.reactTransitionGroup.reactTransitionGroupStrings.abbr | typingsJapgolly.reactTransitionGroup.reactTransitionGroupStrings.animate */, V /* <: typingsJapgolly.react.mod.ReactType[_] */] = (typingsJapgolly.reactTransitionGroup.transitionGroupMod.IntrinsicTransitionGroupProps[T] with (/* import warning: importer.ImportType#apply Failed type conversion: react.react._Global_.JSX.IntrinsicElements[T] */ js.Any)) | (typingsJapgolly.reactTransitionGroup.transitionGroupMod.ComponentTransitionGroupProps[V] with typingsJapgolly.reactTransitionGroup.AnonChild) + type TransitionGroupProps[T /* <: typingsJapgolly.reactTransitionGroup.reactTransitionGroupStrings.abbr | typingsJapgolly.reactTransitionGroup.reactTransitionGroupStrings.animate */, V /* <: typingsJapgolly.react.mod.ReactType[_] */] = (typingsJapgolly.reactTransitionGroup.transitionGroupMod.IntrinsicTransitionGroupProps[T] with (/* import warning: importer.ImportType#apply Failed type conversion: react.react._Global_.JSX.IntrinsicElements[T] */ js.Any)) | (typingsJapgolly.reactTransitionGroup.transitionGroupMod.ComponentTransitionGroupProps[V] with typingsJapgolly.reactTransitionGroup.AnonChildFactory) } diff --git a/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/build.sbt b/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/build.sbt index 094d622c3e..f0c11485d6 100644 --- a/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/build.sbt +++ b/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react-transition-group" -version := "2.0-443848" +version := "2.0-f9a7d1" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/src/main/scala/typingsSlinky/reactTransitionGroup/AnonChild.scala b/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/src/main/scala/typingsSlinky/reactTransitionGroup/AnonChildFactory.scala similarity index 78% rename from importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/src/main/scala/typingsSlinky/reactTransitionGroup/AnonChild.scala rename to importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/src/main/scala/typingsSlinky/reactTransitionGroup/AnonChildFactory.scala index dc3c458132..bc2003bcc2 100644 --- a/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/src/main/scala/typingsSlinky/reactTransitionGroup/AnonChild.scala +++ b/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/src/main/scala/typingsSlinky/reactTransitionGroup/AnonChildFactory.scala @@ -6,16 +6,16 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonChild extends js.Object { +trait AnonChildFactory extends js.Object { var childFactory: js.UndefOr[js.Function1[/* child */ ReactElement, ReactElement]] = js.native } -object AnonChild { +object AnonChildFactory { @scala.inline - def apply(childFactory: /* child */ ReactElement => ReactElement = null): AnonChild = { + def apply(childFactory: /* child */ ReactElement => ReactElement = null): AnonChildFactory = { val __obj = js.Dynamic.literal() if (childFactory != null) __obj.updateDynamic("childFactory")(js.Any.fromFunction1(childFactory)) - __obj.asInstanceOf[AnonChild] + __obj.asInstanceOf[AnonChildFactory] } } diff --git a/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/src/main/scala/typingsSlinky/reactTransitionGroup/transitionGroupMod/package.scala b/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/src/main/scala/typingsSlinky/reactTransitionGroup/transitionGroupMod/package.scala index 463f85783c..c09426a617 100644 --- a/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/src/main/scala/typingsSlinky/reactTransitionGroup/transitionGroupMod/package.scala +++ b/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/src/main/scala/typingsSlinky/reactTransitionGroup/transitionGroupMod/package.scala @@ -8,5 +8,5 @@ package object transitionGroupMod { type TransitionGroup = slinky.core.ReactComponentClass[ typingsSlinky.reactTransitionGroup.transitionGroupMod.TransitionGroupProps[typingsSlinky.reactTransitionGroup.reactTransitionGroupStrings.abbr, js.Any] ] - type TransitionGroupProps[T /* <: typingsSlinky.reactTransitionGroup.reactTransitionGroupStrings.abbr | typingsSlinky.reactTransitionGroup.reactTransitionGroupStrings.animate */, V /* <: slinky.core.ReactComponentClass[_] */] = (typingsSlinky.reactTransitionGroup.transitionGroupMod.IntrinsicTransitionGroupProps[T] with (/* import warning: importer.ImportType#apply Failed type conversion: react.react._Global_.JSX.IntrinsicElements[T] */ js.Any)) | (typingsSlinky.reactTransitionGroup.transitionGroupMod.ComponentTransitionGroupProps[V] with typingsSlinky.reactTransitionGroup.AnonChild) + type TransitionGroupProps[T /* <: typingsSlinky.reactTransitionGroup.reactTransitionGroupStrings.abbr | typingsSlinky.reactTransitionGroup.reactTransitionGroupStrings.animate */, V /* <: slinky.core.ReactComponentClass[_] */] = (typingsSlinky.reactTransitionGroup.transitionGroupMod.IntrinsicTransitionGroupProps[T] with (/* import warning: importer.ImportType#apply Failed type conversion: react.react._Global_.JSX.IntrinsicElements[T] */ js.Any)) | (typingsSlinky.reactTransitionGroup.transitionGroupMod.ComponentTransitionGroupProps[V] with typingsSlinky.reactTransitionGroup.AnonChildFactory) } diff --git a/importer/src/test/resources/react-transition-group/check/r/react-transition-group/build.sbt b/importer/src/test/resources/react-transition-group/check/r/react-transition-group/build.sbt index 23af328f1d..2560b3f142 100644 --- a/importer/src/test/resources/react-transition-group/check/r/react-transition-group/build.sbt +++ b/importer/src/test/resources/react-transition-group/check/r/react-transition-group/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react-transition-group" -version := "2.0-c3069e" +version := "2.0-2bef44" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-transition-group/check/r/react-transition-group/src/main/scala/typings/reactTransitionGroup/AnonChild.scala b/importer/src/test/resources/react-transition-group/check/r/react-transition-group/src/main/scala/typings/reactTransitionGroup/AnonChildFactory.scala similarity index 77% rename from importer/src/test/resources/react-transition-group/check/r/react-transition-group/src/main/scala/typings/reactTransitionGroup/AnonChild.scala rename to importer/src/test/resources/react-transition-group/check/r/react-transition-group/src/main/scala/typings/reactTransitionGroup/AnonChildFactory.scala index e1ce29c56c..7b06e4f613 100644 --- a/importer/src/test/resources/react-transition-group/check/r/react-transition-group/src/main/scala/typings/reactTransitionGroup/AnonChild.scala +++ b/importer/src/test/resources/react-transition-group/check/r/react-transition-group/src/main/scala/typings/reactTransitionGroup/AnonChildFactory.scala @@ -6,16 +6,16 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonChild extends js.Object { +trait AnonChildFactory extends js.Object { var childFactory: js.UndefOr[js.Function1[/* child */ ReactElement, ReactElement]] = js.native } -object AnonChild { +object AnonChildFactory { @scala.inline - def apply(childFactory: /* child */ ReactElement => ReactElement = null): AnonChild = { + def apply(childFactory: /* child */ ReactElement => ReactElement = null): AnonChildFactory = { val __obj = js.Dynamic.literal() if (childFactory != null) __obj.updateDynamic("childFactory")(js.Any.fromFunction1(childFactory)) - __obj.asInstanceOf[AnonChild] + __obj.asInstanceOf[AnonChildFactory] } } diff --git a/importer/src/test/resources/react-transition-group/check/r/react-transition-group/src/main/scala/typings/reactTransitionGroup/transitionGroupMod/package.scala b/importer/src/test/resources/react-transition-group/check/r/react-transition-group/src/main/scala/typings/reactTransitionGroup/transitionGroupMod/package.scala index 70add6f1cb..2037786a6d 100644 --- a/importer/src/test/resources/react-transition-group/check/r/react-transition-group/src/main/scala/typings/reactTransitionGroup/transitionGroupMod/package.scala +++ b/importer/src/test/resources/react-transition-group/check/r/react-transition-group/src/main/scala/typings/reactTransitionGroup/transitionGroupMod/package.scala @@ -9,5 +9,5 @@ package object transitionGroupMod { typings.reactTransitionGroup.transitionGroupMod.TransitionGroupProps[typings.reactTransitionGroup.reactTransitionGroupStrings.abbr, js.Any], js.Object ] - type TransitionGroupProps[T /* <: typings.reactTransitionGroup.reactTransitionGroupStrings.abbr | typings.reactTransitionGroup.reactTransitionGroupStrings.animate */, V /* <: typings.react.mod.ReactType[_] */] = (typings.reactTransitionGroup.transitionGroupMod.IntrinsicTransitionGroupProps[T] with (/* import warning: importer.ImportType#apply Failed type conversion: react.react._Global_.JSX.IntrinsicElements[T] */ js.Any)) | (typings.reactTransitionGroup.transitionGroupMod.ComponentTransitionGroupProps[V] with typings.reactTransitionGroup.AnonChild) + type TransitionGroupProps[T /* <: typings.reactTransitionGroup.reactTransitionGroupStrings.abbr | typings.reactTransitionGroup.reactTransitionGroupStrings.animate */, V /* <: typings.react.mod.ReactType[_] */] = (typings.reactTransitionGroup.transitionGroupMod.IntrinsicTransitionGroupProps[T] with (/* import warning: importer.ImportType#apply Failed type conversion: react.react._Global_.JSX.IntrinsicElements[T] */ js.Any)) | (typings.reactTransitionGroup.transitionGroupMod.ComponentTransitionGroupProps[V] with typings.reactTransitionGroup.AnonChildFactory) } diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/build.sbt b/importer/src/test/resources/type-mappings/check/t/type-mappings/build.sbt index 95f73e4893..c45f2a5978 100644 --- a/importer/src/test/resources/type-mappings/check/t/type-mappings/build.sbt +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "type-mappings" -version := "0.0-unknown-b657a8" +version := "0.0-unknown-7717b8" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonGetSet.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonSet.scala similarity index 67% rename from importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonGetSet.scala rename to importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonSet.scala index 57a853b96e..03e7964776 100644 --- a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonGetSet.scala +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/AnonSet.scala @@ -5,17 +5,17 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonGetSet extends js.Object { +trait AnonSet extends js.Object { def get(): String = js.native def set(v: String): Unit = js.native } -object AnonGetSet { +object AnonSet { @scala.inline - def apply(get: () => String, set: String => Unit): AnonGetSet = { + def apply(get: () => String, set: String => Unit): AnonSet = { val __obj = js.Dynamic.literal(get = js.Any.fromFunction0(get), set = js.Any.fromFunction1(set)) - __obj.asInstanceOf[AnonGetSet] + __obj.asInstanceOf[AnonSet] } } diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/IProxiedPerson.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/IProxiedPerson.scala index 01459c2f28..7eadd9038d 100644 --- a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/IProxiedPerson.scala +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/IProxiedPerson.scala @@ -8,12 +8,12 @@ import scala.scalajs.js.annotation._ @js.native trait IProxiedPerson extends js.Object { var age: AnonGet = js.native - var name: AnonGetSet = js.native + var name: AnonSet = js.native } object IProxiedPerson { @scala.inline - def apply(age: AnonGet, name: AnonGetSet): IProxiedPerson = { + def apply(age: AnonGet, name: AnonSet): IProxiedPerson = { val __obj = js.Dynamic.literal(age = age.asInstanceOf[js.Any], name = name.asInstanceOf[js.Any]) __obj.asInstanceOf[IProxiedPerson] diff --git a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/ProxiedPerson.scala b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/ProxiedPerson.scala index de1f0b9e08..7f4c510b51 100644 --- a/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/ProxiedPerson.scala +++ b/importer/src/test/resources/type-mappings/check/t/type-mappings/src/main/scala/typings/typeMappings/ProxiedPerson.scala @@ -8,12 +8,12 @@ import scala.scalajs.js.annotation._ @js.native trait ProxiedPerson extends js.Object { var age: AnonGet = js.native - var name: AnonGetSet = js.native + var name: AnonSet = js.native } object ProxiedPerson { @scala.inline - def apply(age: AnonGet, name: AnonGetSet): ProxiedPerson = { + def apply(age: AnonGet, name: AnonSet): ProxiedPerson = { val __obj = js.Dynamic.literal(age = age.asInstanceOf[js.Any], name = name.asInstanceOf[js.Any]) __obj.asInstanceOf[ProxiedPerson] diff --git a/importer/src/test/resources/vue/check/s/storybook__vue/build.sbt b/importer/src/test/resources/vue/check/s/storybook__vue/build.sbt index 090ab888b2..24a53ef249 100644 --- a/importer/src/test/resources/vue/check/s/storybook__vue/build.sbt +++ b/importer/src/test/resources/vue/check/s/storybook__vue/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "storybook__vue" -version := "3.3-5a6db2" +version := "3.3-2c9279" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "org.scalablytyped" %%% "std" % "0.0-unknown-a660db", - "org.scalablytyped" %%% "vue" % "2.5.13-38a981", + "org.scalablytyped" %%% "vue" % "2.5.13-761a36", "org.scalablytyped" %%% "webpack-env" % "1.13-63a4e2") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/vue/check/v/vue-resource/build.sbt b/importer/src/test/resources/vue/check/v/vue-resource/build.sbt index ce5f8dd510..0a7bfd4593 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/build.sbt +++ b/importer/src/test/resources/vue/check/v/vue-resource/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "vue-resource" -version := "0.9.3-aad490" +version := "0.9.3-531650" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonDelete.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonCall1Delete.scala similarity index 98% rename from importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonDelete.scala rename to importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonCall1Delete.scala index a57225dcf6..ae415449e3 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonDelete.scala +++ b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonCall1Delete.scala @@ -8,7 +8,7 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonDelete extends js.Object { +trait AnonCall1Delete extends js.Object { @JSName("delete") var delete_Original: http = js.native @JSName("get") diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonHeaders.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonDictkeyHeaders.scala similarity index 79% rename from importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonHeaders.scala rename to importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonDictkeyHeaders.scala index b7b2e211b7..cdb5347981 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonHeaders.scala +++ b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonDictkeyHeaders.scala @@ -7,18 +7,18 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonHeaders +trait AnonDictkeyHeaders extends /* key */ StringDictionary[js.Any] { var headers: js.UndefOr[HttpHeaders] = js.native } -object AnonHeaders { +object AnonDictkeyHeaders { @scala.inline - def apply(StringDictionary: /* key */ StringDictionary[js.Any] = null, headers: HttpHeaders = null): AnonHeaders = { + def apply(StringDictionary: /* key */ StringDictionary[js.Any] = null, headers: HttpHeaders = null): AnonDictkeyHeaders = { val __obj = js.Dynamic.literal() if (StringDictionary != null) js.Dynamic.global.Object.assign(__obj, StringDictionary) if (headers != null) __obj.updateDynamic("headers")(headers.asInstanceOf[js.Any]) - __obj.asInstanceOf[AnonHeaders] + __obj.asInstanceOf[AnonDictkeyHeaders] } } diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/ComponentOption.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/ComponentOption.scala index 9c1a138eaf..9e10f86940 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/ComponentOption.scala +++ b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/ComponentOption.scala @@ -1,18 +1,18 @@ package typings.vueResource.vuejs -import typings.vueResource.AnonHeaders +import typings.vueResource.AnonDictkeyHeaders import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native trait ComponentOption extends js.Object { - var http: js.UndefOr[AnonHeaders with HttpOptions] = js.native + var http: js.UndefOr[AnonDictkeyHeaders with HttpOptions] = js.native } object ComponentOption { @scala.inline - def apply(http: AnonHeaders with HttpOptions = null): ComponentOption = { + def apply(http: AnonDictkeyHeaders with HttpOptions = null): ComponentOption = { val __obj = js.Dynamic.literal() if (http != null) __obj.updateDynamic("http")(http.asInstanceOf[js.Any]) __obj.asInstanceOf[ComponentOption] diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Vue.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Vue.scala index 2eeb77f882..96d80e56c5 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Vue.scala +++ b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Vue.scala @@ -1,6 +1,6 @@ package typings.vueResource.vuejs -import typings.vueResource.AnonDelete +import typings.vueResource.AnonCall1Delete import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @@ -8,7 +8,7 @@ import scala.scalajs.js.annotation._ @js.native trait Vue extends js.Object { @JSName("$http") - var $http_Original: AnonDelete = js.native + var $http_Original: AnonCall1Delete = js.native @JSName("$resource") var $resource_Original: resource = js.native @JSName("$http") diff --git a/importer/src/test/resources/vue/check/v/vue-scrollto/build.sbt b/importer/src/test/resources/vue/check/v/vue-scrollto/build.sbt index be0564c531..29b9f2f9fd 100644 --- a/importer/src/test/resources/vue/check/v/vue-scrollto/build.sbt +++ b/importer/src/test/resources/vue/check/v/vue-scrollto/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "vue-scrollto" -version := "2.7-023155" +version := "2.7-a35618" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "org.scalablytyped" %%% "std" % "0.0-unknown-a660db", - "org.scalablytyped" %%% "vue" % "2.5.13-38a981") + "org.scalablytyped" %%% "vue" % "2.5.13-761a36") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/vue/check/v/vue/build.sbt b/importer/src/test/resources/vue/check/v/vue/build.sbt index 9f37c212ca..87e83e995e 100644 --- a/importer/src/test/resources/vue/check/v/vue/build.sbt +++ b/importer/src/test/resources/vue/check/v/vue/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "vue" -version := "2.5.13-38a981" +version := "2.5.13-761a36" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/AnonArgs.scala b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Anon0.scala similarity index 93% rename from importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/AnonArgs.scala rename to importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Anon0.scala index 9de0c4caeb..95f7cc90ac 100644 --- a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/AnonArgs.scala +++ b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Anon0.scala @@ -6,6 +6,6 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonArgs[T] +trait Anon0[T] extends Instantiable1[/* args (repeated) */ js.Any, T with js.Object] diff --git a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/AnonCreateElement.scala b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/AnonStaticRenderFns.scala similarity index 76% rename from importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/AnonCreateElement.scala rename to importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/AnonStaticRenderFns.scala index 7f7512e4ce..5453032ac9 100644 --- a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/AnonCreateElement.scala +++ b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/AnonStaticRenderFns.scala @@ -7,17 +7,17 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonCreateElement extends js.Object { +trait AnonStaticRenderFns extends js.Object { var staticRenderFns: js.Array[js.Function0[VNode]] = js.native def render(createElement: CreateElement): VNode = js.native } -object AnonCreateElement { +object AnonStaticRenderFns { @scala.inline - def apply(render: CreateElement => VNode, staticRenderFns: js.Array[js.Function0[VNode]]): AnonCreateElement = { + def apply(render: CreateElement => VNode, staticRenderFns: js.Array[js.Function0[VNode]]): AnonStaticRenderFns = { val __obj = js.Dynamic.literal(render = js.Any.fromFunction1(render), staticRenderFns = staticRenderFns.asInstanceOf[js.Any]) - __obj.asInstanceOf[AnonCreateElement] + __obj.asInstanceOf[AnonStaticRenderFns] } } diff --git a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/FnArray.scala b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Fn0.scala similarity index 88% rename from importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/FnArray.scala rename to importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Fn0.scala index 9e7af6200a..882596cb84 100644 --- a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/FnArray.scala +++ b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Fn0.scala @@ -5,7 +5,7 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait FnArray extends js.Object { +trait Fn0 extends js.Object { def apply[T](array: js.Array[T], key: Double, value: T): T = js.native def apply[T](`object`: js.Object, key: String, value: T): T = js.native } diff --git a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/FnArrayKey.scala b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Fn1.scala similarity index 87% rename from importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/FnArrayKey.scala rename to importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Fn1.scala index 8e1bac2521..d6ebdba0fa 100644 --- a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/FnArrayKey.scala +++ b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Fn1.scala @@ -5,7 +5,7 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait FnArrayKey extends js.Object { +trait Fn1 extends js.Object { def apply(`object`: js.Object, key: String): Unit = js.native def apply[T](array: js.Array[T], key: Double): Unit = js.native } diff --git a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/optionsMod/package.scala b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/optionsMod/package.scala index c62df9f556..1816683ec9 100644 --- a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/optionsMod/package.scala +++ b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/optionsMod/package.scala @@ -38,7 +38,7 @@ package object optionsMod { ] type InjectKey = java.lang.String | js.Symbol type InjectOptions = (org.scalablytyped.runtime.StringDictionary[typings.vue.optionsMod.InjectKey | typings.vue.AnonDefault]) | js.Array[java.lang.String] - type Prop[T] = js.Function0[T] | typings.vue.AnonArgs[T] + type Prop[T] = js.Function0[T] | typings.vue.Anon0[T] type PropValidator[T] = typings.vue.optionsMod.PropOptions[T] | typings.vue.optionsMod.Prop[T] | js.Array[typings.vue.optionsMod.Prop[T]] type PropsDefinition[T] = typings.vue.optionsMod.ArrayPropsDefinition[T] | typings.vue.optionsMod.RecordPropsDefinition[T] type RecordPropsDefinition[T] = /* import warning: importer.ImportType#apply c Unsupported type mapping: diff --git a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/vueMod/Vue.scala b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/vueMod/Vue.scala index ab38b81565..a52c3d0d27 100644 --- a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/vueMod/Vue.scala +++ b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/vueMod/Vue.scala @@ -5,8 +5,8 @@ import org.scalablytyped.runtime.TopLevel import typings.std.Element import typings.std.HTMLElement import typings.std.Record -import typings.vue.FnArray -import typings.vue.FnArrayKey +import typings.vue.Fn0 +import typings.vue.Fn1 import typings.vue.optionsMod.AsyncComponent import typings.vue.optionsMod.Component import typings.vue.optionsMod.ComponentOptions @@ -35,7 +35,7 @@ trait Vue extends js.Object { @JSName("$data") val $data: Record[String, _] = js.native @JSName("$delete") - var $delete_Original: FnArrayKey = js.native + var $delete_Original: Fn1 = js.native @JSName("$el") val $el: HTMLElement = js.native @JSName("$isServer") @@ -61,7 +61,7 @@ trait Vue extends js.Object { @JSName("$scopedSlots") val $scopedSlots: StringDictionary[ScopedSlot] = js.native @JSName("$set") - var $set_Original: FnArray = js.native + var $set_Original: Fn0 = js.native @JSName("$slots") val $slots: StringDictionary[js.Array[VNode]] = js.native @JSName("$ssrContext") diff --git a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/vueMod/VueConstructor.scala b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/vueMod/VueConstructor.scala index b43b1a7d7e..c53da4935f 100644 --- a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/vueMod/VueConstructor.scala +++ b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/vueMod/VueConstructor.scala @@ -3,7 +3,7 @@ package typings.vue.vueMod import org.scalablytyped.runtime.Instantiable0 import org.scalablytyped.runtime.Instantiable1 import typings.std.Record -import typings.vue.AnonCreateElement +import typings.vue.AnonStaticRenderFns import typings.vue.optionsMod.AsyncComponent import typings.vue.optionsMod.ComponentOptions import typings.vue.optionsMod.DefaultComputed @@ -32,7 +32,7 @@ Instantiable0[CombinedVueInstance[V, js.Object, js.Object, js.Object, Record[Str CombinedVueInstance[V, js.Object, js.Object, js.Object, Record[String, js.Any]] ] { var config: VueConfiguration = js.native - def compile(template: String): AnonCreateElement = js.native + def compile(template: String): AnonStaticRenderFns = js.native def component(id: String): ExtendedVue[V, js.Object, js.Object, js.Object, js.Object] = js.native def component( id: String, diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/DeriveNonConflictingName.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/DeriveNonConflictingName.scala index 2facac0831..10a66a35b8 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/DeriveNonConflictingName.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/DeriveNonConflictingName.scala @@ -1,7 +1,7 @@ package org.scalablytyped.converter.internal package ts -import scala.annotation.tailrec +import seqs._ /** * Sometimes we need to name things in Scala where they were anonymous in Typescript. @@ -16,54 +16,107 @@ import scala.annotation.tailrec * of the members. */ object DeriveNonConflictingName { - def pretty(str: String): String = - str.filter(_.isLetterOrDigit).capitalize - - val ExtractNameParts: PartialFunction[TsTree, String] = { - case x: TsNamedDecl => pretty(x.name.value) - case x: TsMemberProperty => pretty(x.name.value) - case x: TsMemberFunction => pretty(x.name.value) - case x: TsFunParam => pretty(x.name.value) - case x: TsLiteral => pretty(x.literal) - case TsMemberIndex(_, _, _, IndexingDict(name, _), _, _) => pretty(name.value) - case TsMemberIndex(_, _, _, IndexingSingle(name), _, _) => pretty(name.parts.head.value) + + def apply[T](prefix: String, minNumParts: Int, members: IArray[TsMember])( + tryCreate: TsIdentSimple => Option[T], + ): T = { + val fromCalls: Option[Detail] = { + members.collect { case TsMemberCall(_, _, sig) => sig } match { + case Empty => None + case calls => + val longest = calls.maxBy(_.params.length) + Some(Detail(s"Call${longest.params.length}")) + } + } + + /** note, we sort below. This is beneficial from a consistency perspective, and + * negative for the number of names we can generate. Prefer the former for now + */ + val fromMembers: IArray[Detail] = + members.collect { + case x: TsMemberProperty => + val short = Detail.pretty(x.name.value) + Detail(short, IArray.fromOptions(Some(short), Detail.prettyType(x.tpe)).mkString) + case TsMemberIndex(_, _, _, IndexingSingle(qname), _, tpe) => + val short = Detail.pretty(qname.parts.last.value) + Detail(short, IArray.fromOptions(Some(short), Detail.prettyType(tpe)).mkString) + case x: TsMemberFunction => Detail(Detail.pretty(x.name.value)) + } + + val fromInstantiable: Option[Detail] = + members.collectFirst { + case TsMemberCtor(_, _, signature) => + val short = "Instantiable" + Detail( + short, + IArray.fromOptions(Some(short), Detail.prettyType(signature.resultType)).mkString, + ) + } + + val fromDict: Option[Detail] = + members + .collectFirst { + case TsMemberIndex(_, _, _, IndexingDict(name, inType), isOptional, outType) => + val optStr = if (isOptional) Some("Opt") else None + val short = Detail.pretty("Dict" + name.value) + val long = IArray + .fromOptions(Some(short), Some(Detail.prettyType(inType)), optStr, Detail.prettyType(outType)) + .mkString + Detail(short, long) + } + + val details = fromMembers.sorted.distinct + + val nameVariants: Stream[String] = + for { + longVersion <- Stream(false, true) + amount <- Stream(1, details.length + 1) + idx <- Stream.range(0, details.length) + } yield { + val pick = IArray.fromOptions(fromCalls, fromInstantiable, fromDict) ++ details.drop(idx).take(amount) + prefix + pick.map(_.pick(longVersion)).mkString("") + } + + nameVariants + .firstDefined(name => tryCreate(TsIdent(name))) + .getOrElse(fallback(prefix, tryCreate)) } - val ExtractNamePartsSecondary: PartialFunction[TsTree, String] = { - case x: TsTypeParam => pretty(x.name.value) - case x: TsTypeRef => pretty(x.name.parts.last.value) + private def fallback[T](prefix: String, tryCreate: TsIdentSimple => Option[T]): T = { + var idx = 0 + while (true) { + tryCreate(TsIdent(prefix + idx)) match { + case Some(t) => return t + case _ => () + } + idx += 1 + } + sys.error("unreachable") } - val ExtractNamePartsTertiary: PartialFunction[TsTree, String] = { - case x: TsQIdent => pretty(x.parts.last.value) - case x: TsMemberProperty => if (x.isOptional) "Optional" else if (x.isReadOnly) "ReadOnly" else "" - case x: TsMemberFunction => if (x.isOptional) "Optional" else if (x.isReadOnly) "ReadOnly" else "" - case x: TsFunParam => if (x.isOptional) "Optional" else "" + final case class Detail(short: String, long: String) { + def pick(wantLong: Boolean): String = + if (wantLong) long else short } - def apply[T](prefix: String, minNumParts: Int, members: IArray[TsTree])(tryCreate: TsIdentSimple => Option[T]): T = { - /* note, we sort below. This is beneficial from a consistency perspective, and - * negative for the number of names we can generate. Prefer the former for now */ - val names = TsTreeTraverse.collectIArray(members)(ExtractNameParts).sorted - val secondary = TsTreeTraverse.collectIArray(members)(ExtractNamePartsSecondary).sorted - val tertiary = TsTreeTraverse.collectIArray(members)(ExtractNamePartsTertiary).sorted - val base = (prefix +: (names ++ secondary ++ tertiary)).distinct - - @tailrec - def go(num: Int): T = - (num > base.length, base take num mkString "") match { - case (true, baseName) => - tryCreate(TsIdent(baseName + "_" + math.abs(members.hashCode).toString)) getOrElse - sys.error("Could not derive unique name") - - case (false, name) => - tryCreate(TsIdent(name)) match { - case Some(ret) => ret - case None => go(num + 1) - } + object Detail { + def apply(s: String) = new Detail(s, s) + implicit val ordering: Ordering[Detail] = Ordering[String].on[Detail](_.short) + + def pretty(str: String): String = + str.filter(_.isLetterOrDigit).capitalize + + def prettyType(tpeOpt: Option[TsType]): Option[String] = + tpeOpt match { + case Some(tpe) => Some(prettyType(tpe)) + case None => None } - go(minNumParts) + def prettyType(tpe: TsType): String = + tpe match { + case TsTypeRef(_, name, _) => pretty(name.parts.last.value) + case _ => "" + } } } diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExtractInterfaces.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExtractInterfaces.scala index 0def71d4ea..9afd4da936 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExtractInterfaces.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExtractInterfaces.scala @@ -20,7 +20,7 @@ object ExtractInterfaces { def addInterface( scope: TsTreeScope, prefix: String, - members: IArray[TsTree], + members: IArray[TsMember], minNumParts: Int, construct: TsIdentSimple => TsDeclInterface, ): CodePath.HasPath = { From 7b4365adf75b08f584a88cf2b4ffecc60761a20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 11/18] Workaround a hang where a namespace exports itself --- .../converter/internal/ts/modules/ReplaceExports.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/ReplaceExports.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/ReplaceExports.scala index 9b65ae4701..af1c76228d 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/ReplaceExports.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/modules/ReplaceExports.scala @@ -42,7 +42,7 @@ class ReplaceExports(loopDetector: LoopDetector) extends TreeTransformationScope case TsImport(IArray.exactlyOne(TsImportedIdent(to)), TsImporteeLocal(from)) => scope - .lookupInternal(Picker.All, from.parts, loopDetector) + .lookupInternal(Picker.ButNot(Picker.All, x), from.parts, loopDetector) .map { case (d, _) => d.withName(to) } .map(SetCodePath.visitTsNamedDecl(x.codePath.forceHasPath)) From 764fe84072a4dd55aa190b558c81f92c370f9e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 12/18] Tweak when we inline intersections --- .../resources/fp-ts/check/f/fp-ts/build.sbt | 2 +- .../main/scala/typings/fpTs/AnonNever.scala | 21 ------- .../scala/typings/fpTs/hktMod/package.scala | 2 +- .../check-japgolly/r/react-dropzone/build.sbt | 2 +- .../DropzoneState.scala} | 8 +-- .../reactDropzone/mod/package.scala | 1 - .../check-slinky/r/react-dropzone/build.sbt | 2 +- .../DropzoneState.scala} | 8 +-- .../reactDropzone/mod/package.scala | 1 - .../check/r/react-dropzone/build.sbt | 2 +- .../DropzoneState.scala} | 8 +-- .../typings/reactDropzone/mod/package.scala | 1 - .../vue/check/v/vue-resource/build.sbt | 2 +- .../vueResource/AnonDictkeyHeaders.scala | 24 -------- .../scala/typings/vueResource/AnonRoot.scala | 20 ------- .../HttpOptionsrootstringBefore.scala | 52 ++++++++++++++++++ ...keystringanyHttpOptionsDictkeyBefore.scala | 55 +++++++++++++++++++ .../vueResource/vuejs/ComponentOption.scala | 6 +- .../typings/vueResource/vuejs/Http_.scala | 4 +- .../ts/parser/TypeExpansionTest.scala | 17 ++---- .../ts/transforms/ExpandTypeMappings.scala | 5 +- 21 files changed, 138 insertions(+), 105 deletions(-) delete mode 100644 importer/src/test/resources/fp-ts/check/f/fp-ts/src/main/scala/typings/fpTs/AnonNever.scala rename importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/{AnonAcceptedFiles.scala => mod/DropzoneState.scala} (54%) rename importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/{AnonAcceptedFiles.scala => mod/DropzoneState.scala} (53%) rename importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/{AnonAcceptedFiles.scala => mod/DropzoneState.scala} (53%) delete mode 100644 importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonDictkeyHeaders.scala delete mode 100644 importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonRoot.scala create mode 100644 importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/HttpOptionsrootstringBefore.scala create mode 100644 importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore.scala diff --git a/importer/src/test/resources/fp-ts/check/f/fp-ts/build.sbt b/importer/src/test/resources/fp-ts/check/f/fp-ts/build.sbt index 1a818d46a3..16f8064b27 100644 --- a/importer/src/test/resources/fp-ts/check/f/fp-ts/build.sbt +++ b/importer/src/test/resources/fp-ts/check/f/fp-ts/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "fp-ts" -version := "1.2.0-33cefb" +version := "1.2.0-43d10e" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/fp-ts/check/f/fp-ts/src/main/scala/typings/fpTs/AnonNever.scala b/importer/src/test/resources/fp-ts/check/f/fp-ts/src/main/scala/typings/fpTs/AnonNever.scala deleted file mode 100644 index 9a9a6f941d..0000000000 --- a/importer/src/test/resources/fp-ts/check/f/fp-ts/src/main/scala/typings/fpTs/AnonNever.scala +++ /dev/null @@ -1,21 +0,0 @@ -package typings.fpTs - -import typings.fpTs.hktMod.HKT -import scala.scalajs.js -import scala.scalajs.js.`|` -import scala.scalajs.js.annotation._ - -@js.native -trait AnonNever extends js.Object { - var never: HKT[scala.Nothing, scala.Nothing] = js.native -} - -object AnonNever { - @scala.inline - def apply(never: HKT[scala.Nothing, scala.Nothing]): AnonNever = { - val __obj = js.Dynamic.literal(never = never.asInstanceOf[js.Any]) - - __obj.asInstanceOf[AnonNever] - } -} - diff --git a/importer/src/test/resources/fp-ts/check/f/fp-ts/src/main/scala/typings/fpTs/hktMod/package.scala b/importer/src/test/resources/fp-ts/check/f/fp-ts/src/main/scala/typings/fpTs/hktMod/package.scala index d17a091348..c2b05deff4 100644 --- a/importer/src/test/resources/fp-ts/check/f/fp-ts/src/main/scala/typings/fpTs/hktMod/package.scala +++ b/importer/src/test/resources/fp-ts/check/f/fp-ts/src/main/scala/typings/fpTs/hktMod/package.scala @@ -6,5 +6,5 @@ import scala.scalajs.js.annotation._ package object hktMod { type Type[URI /* <: typings.fpTs.hktMod.URIS */, A] = /* import warning: importer.ImportType#apply Failed type conversion: fp-ts.fp-ts/lib/HKT.URI2HKT[URI] */ js.Any - type URIS = /* import warning: importer.ImportType#apply Failed type conversion: fp-ts.fp-ts/lib/HKT.URI2HKT & fp-ts.Anon_Never[keyof fp-ts.fp-ts/lib/HKT.URI2HKT | 'never']['_URI'] */ js.Any + type URIS = /* import warning: importer.ImportType#apply Failed type conversion: fp-ts.fp-ts/lib/HKT.HKT['_URI'] */ js.Any } diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt index 48df0c3097..7dbf877f61 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-198c3a" +version := "10.1.10-962a9b" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/AnonAcceptedFiles.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/DropzoneState.scala similarity index 54% rename from importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/AnonAcceptedFiles.scala rename to importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/DropzoneState.scala index 8cc34e026e..555d58f158 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/AnonAcceptedFiles.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/DropzoneState.scala @@ -1,16 +1,15 @@ -package typingsJapgolly.reactDropzone +package typingsJapgolly.reactDropzone.mod import japgolly.scalajs.react.raw.React.RefHandle import org.scalajs.dom.raw.HTMLElement import org.scalajs.dom.raw.HTMLInputElement -import typingsJapgolly.reactDropzone.mod.DropzoneInputProps -import typingsJapgolly.reactDropzone.mod.DropzoneRootProps import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ +/* Inlined react-dropzone.react-dropzone.DropzoneRef & { isFocused :boolean, isDragActive :boolean, isDragAccept :boolean, isDragReject :boolean, isFileDialogActive :boolean, draggedFiles :std.Array, acceptedFiles :std.Array, rejectedFiles :std.Array, rootRef :react.react.RefObject, inputRef :react.react.RefObject, getRootProps (props ? : react-dropzone.react-dropzone.DropzoneRootProps): react-dropzone.react-dropzone.DropzoneRootProps, getInputProps (props ? : react-dropzone.react-dropzone.DropzoneInputProps): react-dropzone.react-dropzone.DropzoneInputProps} */ @js.native -trait AnonAcceptedFiles extends js.Object { +trait DropzoneState extends js.Object { var acceptedFiles: js.Array[ /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ ] = js.native @@ -31,5 +30,6 @@ trait AnonAcceptedFiles extends js.Object { def getInputProps(props: DropzoneInputProps): DropzoneInputProps = js.native def getRootProps(): DropzoneRootProps = js.native def getRootProps(props: DropzoneRootProps): DropzoneRootProps = js.native + def open(): Unit = js.native } diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/package.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/package.scala index da525d97af..91f72dff56 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/package.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/package.scala @@ -6,5 +6,4 @@ import scala.scalajs.js.annotation._ package object mod { type DropEvent = japgolly.scalajs.react.ReactDragEventFrom[org.scalajs.dom.raw.HTMLElement] | japgolly.scalajs.react.ReactEventFrom[org.scalajs.dom.raw.HTMLInputElement] | org.scalajs.dom.raw.DragEvent | org.scalajs.dom.raw.Event - type DropzoneState = typingsJapgolly.reactDropzone.mod.DropzoneRef with typingsJapgolly.reactDropzone.AnonAcceptedFiles } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt index 993c9c9695..9336046351 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-54e38b" +version := "10.1.10-0d342d" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/AnonAcceptedFiles.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/DropzoneState.scala similarity index 53% rename from importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/AnonAcceptedFiles.scala rename to importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/DropzoneState.scala index a2f5706098..39120ec021 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/AnonAcceptedFiles.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/DropzoneState.scala @@ -1,16 +1,15 @@ -package typingsSlinky.reactDropzone +package typingsSlinky.reactDropzone.mod import org.scalajs.dom.raw.HTMLElement import org.scalajs.dom.raw.HTMLInputElement import slinky.core.facade.ReactRef -import typingsSlinky.reactDropzone.mod.DropzoneInputProps -import typingsSlinky.reactDropzone.mod.DropzoneRootProps import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ +/* Inlined react-dropzone.react-dropzone.DropzoneRef & { isFocused :boolean, isDragActive :boolean, isDragAccept :boolean, isDragReject :boolean, isFileDialogActive :boolean, draggedFiles :std.Array, acceptedFiles :std.Array, rejectedFiles :std.Array, rootRef :react.react.RefObject, inputRef :react.react.RefObject, getRootProps (props ? : react-dropzone.react-dropzone.DropzoneRootProps): react-dropzone.react-dropzone.DropzoneRootProps, getInputProps (props ? : react-dropzone.react-dropzone.DropzoneInputProps): react-dropzone.react-dropzone.DropzoneInputProps} */ @js.native -trait AnonAcceptedFiles extends js.Object { +trait DropzoneState extends js.Object { var acceptedFiles: js.Array[ /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ ] = js.native @@ -31,5 +30,6 @@ trait AnonAcceptedFiles extends js.Object { def getInputProps(props: DropzoneInputProps): DropzoneInputProps = js.native def getRootProps(): DropzoneRootProps = js.native def getRootProps(props: DropzoneRootProps): DropzoneRootProps = js.native + def open(): Unit = js.native } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/package.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/package.scala index fe5636c85f..785cfca5fb 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/package.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/package.scala @@ -6,5 +6,4 @@ import scala.scalajs.js.annotation._ package object mod { type DropEvent = typingsSlinky.react.mod.DragEvent[org.scalajs.dom.raw.HTMLElement] | typingsSlinky.react.mod.ChangeEvent[org.scalajs.dom.raw.HTMLInputElement] | org.scalajs.dom.raw.DragEvent | org.scalajs.dom.raw.Event - type DropzoneState = typingsSlinky.reactDropzone.mod.DropzoneRef with typingsSlinky.reactDropzone.AnonAcceptedFiles } diff --git a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt index 0ba2893cd6..7c8a936c7e 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-d8360d" +version := "10.1.10-b3d691" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/AnonAcceptedFiles.scala b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/DropzoneState.scala similarity index 53% rename from importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/AnonAcceptedFiles.scala rename to importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/DropzoneState.scala index 8ada05edf8..48ec3d5eba 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/AnonAcceptedFiles.scala +++ b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/DropzoneState.scala @@ -1,16 +1,15 @@ -package typings.reactDropzone +package typings.reactDropzone.mod import typings.react.mod.RefObject -import typings.reactDropzone.mod.DropzoneInputProps -import typings.reactDropzone.mod.DropzoneRootProps import typings.std.HTMLElement import typings.std.HTMLInputElement import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ +/* Inlined react-dropzone.react-dropzone.DropzoneRef & { isFocused :boolean, isDragActive :boolean, isDragAccept :boolean, isDragReject :boolean, isFileDialogActive :boolean, draggedFiles :std.Array, acceptedFiles :std.Array, rejectedFiles :std.Array, rootRef :react.react.RefObject, inputRef :react.react.RefObject, getRootProps (props ? : react-dropzone.react-dropzone.DropzoneRootProps): react-dropzone.react-dropzone.DropzoneRootProps, getInputProps (props ? : react-dropzone.react-dropzone.DropzoneInputProps): react-dropzone.react-dropzone.DropzoneInputProps} */ @js.native -trait AnonAcceptedFiles extends js.Object { +trait DropzoneState extends js.Object { var acceptedFiles: js.Array[ /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ ] = js.native @@ -31,5 +30,6 @@ trait AnonAcceptedFiles extends js.Object { def getInputProps(props: DropzoneInputProps): DropzoneInputProps = js.native def getRootProps(): DropzoneRootProps = js.native def getRootProps(props: DropzoneRootProps): DropzoneRootProps = js.native + def open(): Unit = js.native } diff --git a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/package.scala b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/package.scala index 3d00fb0d9b..a4e6723fe7 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/package.scala +++ b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/src/main/scala/typings/reactDropzone/mod/package.scala @@ -6,5 +6,4 @@ import scala.scalajs.js.annotation._ package object mod { type DropEvent = typings.react.mod.DragEvent[typings.std.HTMLElement] | typings.react.mod.ChangeEvent[typings.std.HTMLInputElement] | typings.std.DragEvent | typings.std.Event - type DropzoneState = typings.reactDropzone.mod.DropzoneRef with typings.reactDropzone.AnonAcceptedFiles } diff --git a/importer/src/test/resources/vue/check/v/vue-resource/build.sbt b/importer/src/test/resources/vue/check/v/vue-resource/build.sbt index 0a7bfd4593..4f9e999486 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/build.sbt +++ b/importer/src/test/resources/vue/check/v/vue-resource/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "vue-resource" -version := "0.9.3-531650" +version := "0.9.3-cd4261" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonDictkeyHeaders.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonDictkeyHeaders.scala deleted file mode 100644 index cdb5347981..0000000000 --- a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonDictkeyHeaders.scala +++ /dev/null @@ -1,24 +0,0 @@ -package typings.vueResource - -import org.scalablytyped.runtime.StringDictionary -import typings.vueResource.vuejs.HttpHeaders -import scala.scalajs.js -import scala.scalajs.js.`|` -import scala.scalajs.js.annotation._ - -@js.native -trait AnonDictkeyHeaders - extends /* key */ StringDictionary[js.Any] { - var headers: js.UndefOr[HttpHeaders] = js.native -} - -object AnonDictkeyHeaders { - @scala.inline - def apply(StringDictionary: /* key */ StringDictionary[js.Any] = null, headers: HttpHeaders = null): AnonDictkeyHeaders = { - val __obj = js.Dynamic.literal() - if (StringDictionary != null) js.Dynamic.global.Object.assign(__obj, StringDictionary) - if (headers != null) __obj.updateDynamic("headers")(headers.asInstanceOf[js.Any]) - __obj.asInstanceOf[AnonDictkeyHeaders] - } -} - diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonRoot.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonRoot.scala deleted file mode 100644 index 73ae2ba28c..0000000000 --- a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonRoot.scala +++ /dev/null @@ -1,20 +0,0 @@ -package typings.vueResource - -import scala.scalajs.js -import scala.scalajs.js.`|` -import scala.scalajs.js.annotation._ - -@js.native -trait AnonRoot extends js.Object { - var root: String = js.native -} - -object AnonRoot { - @scala.inline - def apply(root: String): AnonRoot = { - val __obj = js.Dynamic.literal(root = root.asInstanceOf[js.Any]) - - __obj.asInstanceOf[AnonRoot] - } -} - diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/HttpOptionsrootstringBefore.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/HttpOptionsrootstringBefore.scala new file mode 100644 index 0000000000..372d618823 --- /dev/null +++ b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/HttpOptionsrootstringBefore.scala @@ -0,0 +1,52 @@ +package typings.vueResource + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +/* Inlined vue-resource.vuejs.HttpOptions & { root :string} */ +@js.native +trait HttpOptionsrootstringBefore extends js.Object { + var before: js.UndefOr[js.Function1[/* request */ js.Any, _]] = js.native + var body: js.UndefOr[js.Any] = js.native + var credentials: js.UndefOr[Boolean] = js.native + var emulateHTTP: js.UndefOr[Boolean] = js.native + var emulateJSON: js.UndefOr[Boolean] = js.native + var headers: js.UndefOr[js.Any] = js.native + var method: js.UndefOr[String] = js.native + var params: js.UndefOr[js.Any] = js.native + var progress: js.UndefOr[js.Function1[/* event */ js.Any, _]] = js.native + var root: String = js.native + var url: js.UndefOr[String] = js.native +} + +object HttpOptionsrootstringBefore { + @scala.inline + def apply( + root: String, + before: /* request */ js.Any => _ = null, + body: js.Any = null, + credentials: js.UndefOr[Boolean] = js.undefined, + emulateHTTP: js.UndefOr[Boolean] = js.undefined, + emulateJSON: js.UndefOr[Boolean] = js.undefined, + headers: js.Any = null, + method: String = null, + params: js.Any = null, + progress: /* event */ js.Any => _ = null, + url: String = null + ): HttpOptionsrootstringBefore = { + val __obj = js.Dynamic.literal(root = root.asInstanceOf[js.Any]) + if (before != null) __obj.updateDynamic("before")(js.Any.fromFunction1(before)) + if (body != null) __obj.updateDynamic("body")(body.asInstanceOf[js.Any]) + if (!js.isUndefined(credentials)) __obj.updateDynamic("credentials")(credentials.asInstanceOf[js.Any]) + if (!js.isUndefined(emulateHTTP)) __obj.updateDynamic("emulateHTTP")(emulateHTTP.asInstanceOf[js.Any]) + if (!js.isUndefined(emulateJSON)) __obj.updateDynamic("emulateJSON")(emulateJSON.asInstanceOf[js.Any]) + if (headers != null) __obj.updateDynamic("headers")(headers.asInstanceOf[js.Any]) + if (method != null) __obj.updateDynamic("method")(method.asInstanceOf[js.Any]) + if (params != null) __obj.updateDynamic("params")(params.asInstanceOf[js.Any]) + if (progress != null) __obj.updateDynamic("progress")(js.Any.fromFunction1(progress)) + if (url != null) __obj.updateDynamic("url")(url.asInstanceOf[js.Any]) + __obj.asInstanceOf[HttpOptionsrootstringBefore] + } +} + diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore.scala new file mode 100644 index 0000000000..6f202037c5 --- /dev/null +++ b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore.scala @@ -0,0 +1,55 @@ +package typings.vueResource + +import org.scalablytyped.runtime.StringDictionary +import typings.vueResource.vuejs.HttpHeaders +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +/* Inlined { headers ? :vue-resource.vuejs.HttpHeaders, [key: string] : any} & vue-resource.vuejs.HttpOptions */ +@js.native +trait headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore + extends /* key */ StringDictionary[js.Any] { + var before: js.UndefOr[js.Function1[/* request */ js.Any, _]] = js.native + var body: js.UndefOr[js.Any] = js.native + var credentials: js.UndefOr[Boolean] = js.native + var emulateHTTP: js.UndefOr[Boolean] = js.native + var emulateJSON: js.UndefOr[Boolean] = js.native + var headers: js.UndefOr[HttpHeaders with js.Any] = js.native + var method: js.UndefOr[String] = js.native + var params: js.UndefOr[js.Any] = js.native + var progress: js.UndefOr[js.Function1[/* event */ js.Any, _]] = js.native + var url: js.UndefOr[String] = js.native +} + +object headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore { + @scala.inline + def apply( + StringDictionary: /* key */ StringDictionary[js.Any] = null, + before: /* request */ js.Any => _ = null, + body: js.Any = null, + credentials: js.UndefOr[Boolean] = js.undefined, + emulateHTTP: js.UndefOr[Boolean] = js.undefined, + emulateJSON: js.UndefOr[Boolean] = js.undefined, + headers: HttpHeaders with js.Any = null, + method: String = null, + params: js.Any = null, + progress: /* event */ js.Any => _ = null, + url: String = null + ): headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore = { + val __obj = js.Dynamic.literal() + if (StringDictionary != null) js.Dynamic.global.Object.assign(__obj, StringDictionary) + if (before != null) __obj.updateDynamic("before")(js.Any.fromFunction1(before)) + if (body != null) __obj.updateDynamic("body")(body.asInstanceOf[js.Any]) + if (!js.isUndefined(credentials)) __obj.updateDynamic("credentials")(credentials.asInstanceOf[js.Any]) + if (!js.isUndefined(emulateHTTP)) __obj.updateDynamic("emulateHTTP")(emulateHTTP.asInstanceOf[js.Any]) + if (!js.isUndefined(emulateJSON)) __obj.updateDynamic("emulateJSON")(emulateJSON.asInstanceOf[js.Any]) + if (headers != null) __obj.updateDynamic("headers")(headers.asInstanceOf[js.Any]) + if (method != null) __obj.updateDynamic("method")(method.asInstanceOf[js.Any]) + if (params != null) __obj.updateDynamic("params")(params.asInstanceOf[js.Any]) + if (progress != null) __obj.updateDynamic("progress")(js.Any.fromFunction1(progress)) + if (url != null) __obj.updateDynamic("url")(url.asInstanceOf[js.Any]) + __obj.asInstanceOf[headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore] + } +} + diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/ComponentOption.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/ComponentOption.scala index 9e10f86940..e70d59a197 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/ComponentOption.scala +++ b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/ComponentOption.scala @@ -1,18 +1,18 @@ package typings.vueResource.vuejs -import typings.vueResource.AnonDictkeyHeaders +import typings.vueResource.headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native trait ComponentOption extends js.Object { - var http: js.UndefOr[AnonDictkeyHeaders with HttpOptions] = js.native + var http: js.UndefOr[headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore] = js.native } object ComponentOption { @scala.inline - def apply(http: AnonDictkeyHeaders with HttpOptions = null): ComponentOption = { + def apply(http: headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore = null): ComponentOption = { val __obj = js.Dynamic.literal() if (http != null) __obj.updateDynamic("http")(http.asInstanceOf[js.Any]) __obj.asInstanceOf[ComponentOption] diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Http_.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Http_.scala index da25daefbe..261a370939 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Http_.scala +++ b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Http_.scala @@ -1,6 +1,6 @@ package typings.vueResource.vuejs -import typings.vueResource.AnonRoot +import typings.vueResource.HttpOptionsrootstringBefore import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @@ -15,7 +15,7 @@ trait Http_ extends js.Object { var interceptors: js.Array[HttpInterceptor | js.Function0[HttpInterceptor]] = js.native @JSName("jsonp") var jsonp_Original: http = js.native - var options: HttpOptions with AnonRoot = js.native + var options: HttpOptionsrootstringBefore = js.native @JSName("patch") var patch_Original: http = js.native @JSName("post") diff --git a/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansionTest.scala b/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansionTest.scala index c04eca06ff..0d7eec19c2 100644 --- a/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansionTest.scala +++ b/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansionTest.scala @@ -81,19 +81,10 @@ export declare type PickerMode = Exclude; NoComments, TsQIdent(IArray(TsIdentLibrarySimple("testing"), TsIdentSimple("Array"))), IArray( - TsTypeIntersect( - IArray( - TsTypeRef( - NoComments, - TsQIdent(IArray(TsIdentLibrarySimple("testing"), TsIdentSimple("ToJsonOutput"))), - IArray(), - ), - TsTypeRef( - NoComments, - TsQIdent(IArray(TsIdentLibrarySimple("testing"), TsIdentSimple("Anon_Name"))), - IArray(), - ), - ), + TsTypeRef( + NoComments, + TsQIdent(IArray(TsIdentLibrarySimple("testing"), TsIdentSimple("ToJsonOutputnamestringChildrenName"))), + IArray(), ), ), ), diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala index cca86d6d8b..e8c06a3826 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala @@ -276,7 +276,10 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { tpe match { case x: TsTypeRef => apply(scope, ld)(x) case x: TsTypeIntersect => - Res.sequence(x.types.map(forType(scope, ld))).map(_.flatten) + val base = Res.sequence(x.types.map(forType(scope, ld))).map(_.flatten) + + if (x.types.exists(_.isInstanceOf[TsTypeObject])) base.withIsRewritten + else base case IsTypeMapping(TsMemberTypeMapped(_, _, _, _, from: TsTypeRef, _, _)) if scope.isAbstract(from.name) => Problems(IArray(NotStatic(scope, from))) From 4e9784dfb4e6a3b854bedbea81af7afddf0af5f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 13/18] Iterate a bit more on naming anonymous interfaces --- .../chart.js/check/c/chart_dot_js/build.sbt | 2 +- ...nDictkeyGlobal.scala => AnonDictkey.scala} | 8 +-- ...tantiableChart.scala => TypeofChart.scala} | 4 +- .../main/scala/typings/chartJs/mod/^.scala | 8 +-- .../check/a/angular-agility/build.sbt | 4 +- .../check/a/angular/build.sbt | 2 +- .../{Anon0.scala => AnonInstantiable.scala} | 2 +- .../main/scala/typings/angular/mod/auto.scala | 6 +-- .../vue/check/s/storybook__vue/build.sbt | 4 +- .../vue/check/v/vue-resource/build.sbt | 2 +- .../{AnonCall1Delete.scala => AnonCall.scala} | 2 +- ...fore.scala => HttpOptionsrootstring.scala} | 8 +-- ....scala => headersHttpHeaderskeystri.scala} | 8 +-- .../vueResource/vuejs/ComponentOption.scala | 6 +-- .../typings/vueResource/vuejs/Http_.scala | 4 +- .../scala/typings/vueResource/vuejs/Vue.scala | 4 +- .../vue/check/v/vue-scrollto/build.sbt | 4 +- .../test/resources/vue/check/v/vue/build.sbt | 2 +- .../{Anon0.scala => AnonInstantiable.scala} | 2 +- .../typings/vue/{Fn0.scala => FnCall.scala} | 2 +- .../vue/{Fn1.scala => FnCallObjectKey.scala} | 2 +- .../typings/vue/optionsMod/package.scala | 2 +- .../main/scala/typings/vue/vueMod/Vue.scala | 8 +-- .../ts/parser/TypeExpansionTest.scala | 2 +- .../ts/DeriveNonConflictingName.scala | 15 +++--- .../internal/ts/TsTypeFormatter.scala | 11 ++-- .../ts/transforms/ExpandTypeMappings.scala | 2 +- .../ts/transforms/ExtractInterfaces.scala | 53 +++++++++---------- .../ts/transforms/ResolveTypeQueries.scala | 2 +- .../converter/internal/comments.scala | 4 ++ 30 files changed, 97 insertions(+), 88 deletions(-) rename importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/{AnonDictkeyGlobal.scala => AnonDictkey.scala} (85%) rename importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/{TypeofClassChartInstantiableChart.scala => TypeofChart.scala} (88%) rename importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/{Anon0.scala => AnonInstantiable.scala} (89%) rename importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/{AnonCall1Delete.scala => AnonCall.scala} (98%) rename importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/{HttpOptionsrootstringBefore.scala => HttpOptionsrootstring.scala} (92%) rename importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/{headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore.scala => headersHttpHeaderskeystri.scala} (90%) rename importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/{Anon0.scala => AnonInstantiable.scala} (90%) rename importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/{Fn0.scala => FnCall.scala} (89%) rename importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/{Fn1.scala => FnCallObjectKey.scala} (85%) diff --git a/importer/src/test/resources/chart.js/check/c/chart_dot_js/build.sbt b/importer/src/test/resources/chart.js/check/c/chart_dot_js/build.sbt index d2b3df4b5b..dcebbdd63c 100644 --- a/importer/src/test/resources/chart.js/check/c/chart_dot_js/build.sbt +++ b/importer/src/test/resources/chart.js/check/c/chart_dot_js/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "chart_dot_js" -version := "0.0-unknown-350f17" +version := "0.0-unknown-0417af" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/AnonDictkeyGlobal.scala b/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/AnonDictkey.scala similarity index 85% rename from importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/AnonDictkeyGlobal.scala rename to importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/AnonDictkey.scala index a71e76322a..61cbd0fe37 100644 --- a/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/AnonDictkeyGlobal.scala +++ b/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/AnonDictkey.scala @@ -8,20 +8,20 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonDictkeyGlobal +trait AnonDictkey extends /* key */ StringDictionary[js.Any] { var global: ChartOptions with ChartFontOptions = js.native } -object AnonDictkeyGlobal { +object AnonDictkey { @scala.inline def apply( global: ChartOptions with ChartFontOptions, StringDictionary: /* key */ StringDictionary[js.Any] = null - ): AnonDictkeyGlobal = { + ): AnonDictkey = { val __obj = js.Dynamic.literal(global = global.asInstanceOf[js.Any]) if (StringDictionary != null) js.Dynamic.global.Object.assign(__obj, StringDictionary) - __obj.asInstanceOf[AnonDictkeyGlobal] + __obj.asInstanceOf[AnonDictkey] } } diff --git a/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/TypeofClassChartInstantiableChart.scala b/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/TypeofChart.scala similarity index 88% rename from importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/TypeofClassChartInstantiableChart.scala rename to importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/TypeofChart.scala index c846ed477b..d10a685c13 100644 --- a/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/TypeofClassChartInstantiableChart.scala +++ b/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/TypeofChart.scala @@ -11,13 +11,13 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait TypeofClassChartInstantiableChart +trait TypeofChart extends Instantiable2[ (/* context */ ArrayLike[CanvasRenderingContext2D | HTMLCanvasElement]) | (/* context */ CanvasRenderingContext2D) | (/* context */ HTMLCanvasElement) | (/* context */ String), /* options */ js.Any, Chart ] { var controllers: StringDictionary[js.Any] = js.native - var defaults: AnonDictkeyGlobal = js.native + var defaults: AnonDictkey = js.native } diff --git a/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/mod/^.scala b/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/mod/^.scala index 4c41cf6353..4c2b656f4b 100644 --- a/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/mod/^.scala +++ b/importer/src/test/resources/chart.js/check/c/chart_dot_js/src/main/scala/typings/chartJs/mod/^.scala @@ -1,8 +1,8 @@ package typings.chartJs.mod import org.scalablytyped.runtime.StringDictionary -import typings.chartJs.AnonDictkeyGlobal -import typings.chartJs.TypeofClassChartInstantiableChart +import typings.chartJs.AnonDictkey +import typings.chartJs.TypeofChart import typings.std.ArrayLike import typings.std.CanvasRenderingContext2D import typings.std.HTMLCanvasElement @@ -22,8 +22,8 @@ class ^ protected () extends Chart { @JSImport("chart.js", JSImport.Namespace) @js.native object ^ extends js.Object { - val Chart: TypeofClassChartInstantiableChart = js.native + val Chart: TypeofChart = js.native var controllers: StringDictionary[js.Any] = js.native - var defaults: AnonDictkeyGlobal = js.native + var defaults: AnonDictkey = js.native } diff --git a/importer/src/test/resources/export-as-namespace/check/a/angular-agility/build.sbt b/importer/src/test/resources/export-as-namespace/check/a/angular-agility/build.sbt index ab0f302944..28463fd21e 100644 --- a/importer/src/test/resources/export-as-namespace/check/a/angular-agility/build.sbt +++ b/importer/src/test/resources/export-as-namespace/check/a/angular-agility/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "angular-agility" -version := "0.0-unknown-3a904b" +version := "0.0-unknown-b38301" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "angular" % "1.6-20d317", + "org.scalablytyped" %%% "angular" % "1.6-600247", "org.scalablytyped" %%% "std" % "0.0-unknown-eec27d") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/export-as-namespace/check/a/angular/build.sbt b/importer/src/test/resources/export-as-namespace/check/a/angular/build.sbt index 305bf4d663..1409f7820e 100644 --- a/importer/src/test/resources/export-as-namespace/check/a/angular/build.sbt +++ b/importer/src/test/resources/export-as-namespace/check/a/angular/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "angular" -version := "1.6-20d317" +version := "1.6-600247" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/Anon0.scala b/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/AnonInstantiable.scala similarity index 89% rename from importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/Anon0.scala rename to importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/AnonInstantiable.scala index f68876eb8d..7e11cdc0ec 100644 --- a/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/Anon0.scala +++ b/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/AnonInstantiable.scala @@ -6,6 +6,6 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait Anon0[T] +trait AnonInstantiable[T] extends Instantiable1[/* args (repeated) */ js.Any, T] diff --git a/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/mod/auto.scala b/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/mod/auto.scala index 4cdfb47be2..0866c174cf 100644 --- a/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/mod/auto.scala +++ b/importer/src/test/resources/export-as-namespace/check/a/angular/src/main/scala/typings/angular/mod/auto.scala @@ -1,6 +1,6 @@ package typings.angular.mod -import typings.angular.Anon0 +import typings.angular.AnonInstantiable import typings.angular.mod._Global_.Function import scala.scalajs.js import scala.scalajs.js.`|` @@ -22,8 +22,8 @@ object auto extends js.Object { def get[T](name: String): T = js.native def get[T](name: String, caller: String): T = js.native def has(name: String): Boolean = js.native - def instantiate[T](typeConstructor: Anon0[T]): T = js.native - def instantiate[T](typeConstructor: Anon0[T], locals: js.Any): T = js.native + def instantiate[T](typeConstructor: AnonInstantiable[T]): T = js.native + def instantiate[T](typeConstructor: AnonInstantiable[T], locals: js.Any): T = js.native def invoke[T](func: Injectable[Function | (js.Function1[/* repeated */ _, T])]): T = js.native def invoke[T](func: Injectable[Function | (js.Function1[/* repeated */ _, T])], context: js.Any): T = js.native def invoke[T](func: Injectable[Function | (js.Function1[/* repeated */ _, T])], context: js.Any, locals: js.Any): T = js.native diff --git a/importer/src/test/resources/vue/check/s/storybook__vue/build.sbt b/importer/src/test/resources/vue/check/s/storybook__vue/build.sbt index 24a53ef249..195ec3cbb6 100644 --- a/importer/src/test/resources/vue/check/s/storybook__vue/build.sbt +++ b/importer/src/test/resources/vue/check/s/storybook__vue/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "storybook__vue" -version := "3.3-2c9279" +version := "3.3-c3d2eb" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "org.scalablytyped" %%% "std" % "0.0-unknown-a660db", - "org.scalablytyped" %%% "vue" % "2.5.13-761a36", + "org.scalablytyped" %%% "vue" % "2.5.13-c38e2c", "org.scalablytyped" %%% "webpack-env" % "1.13-63a4e2") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") diff --git a/importer/src/test/resources/vue/check/v/vue-resource/build.sbt b/importer/src/test/resources/vue/check/v/vue-resource/build.sbt index 4f9e999486..c5c414361f 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/build.sbt +++ b/importer/src/test/resources/vue/check/v/vue-resource/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "vue-resource" -version := "0.9.3-cd4261" +version := "0.9.3-dc7fd5" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonCall1Delete.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonCall.scala similarity index 98% rename from importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonCall1Delete.scala rename to importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonCall.scala index ae415449e3..0c3104fe6e 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonCall1Delete.scala +++ b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/AnonCall.scala @@ -8,7 +8,7 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait AnonCall1Delete extends js.Object { +trait AnonCall extends js.Object { @JSName("delete") var delete_Original: http = js.native @JSName("get") diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/HttpOptionsrootstringBefore.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/HttpOptionsrootstring.scala similarity index 92% rename from importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/HttpOptionsrootstringBefore.scala rename to importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/HttpOptionsrootstring.scala index 372d618823..a52e22d82d 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/HttpOptionsrootstringBefore.scala +++ b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/HttpOptionsrootstring.scala @@ -6,7 +6,7 @@ import scala.scalajs.js.annotation._ /* Inlined vue-resource.vuejs.HttpOptions & { root :string} */ @js.native -trait HttpOptionsrootstringBefore extends js.Object { +trait HttpOptionsrootstring extends js.Object { var before: js.UndefOr[js.Function1[/* request */ js.Any, _]] = js.native var body: js.UndefOr[js.Any] = js.native var credentials: js.UndefOr[Boolean] = js.native @@ -20,7 +20,7 @@ trait HttpOptionsrootstringBefore extends js.Object { var url: js.UndefOr[String] = js.native } -object HttpOptionsrootstringBefore { +object HttpOptionsrootstring { @scala.inline def apply( root: String, @@ -34,7 +34,7 @@ object HttpOptionsrootstringBefore { params: js.Any = null, progress: /* event */ js.Any => _ = null, url: String = null - ): HttpOptionsrootstringBefore = { + ): HttpOptionsrootstring = { val __obj = js.Dynamic.literal(root = root.asInstanceOf[js.Any]) if (before != null) __obj.updateDynamic("before")(js.Any.fromFunction1(before)) if (body != null) __obj.updateDynamic("body")(body.asInstanceOf[js.Any]) @@ -46,7 +46,7 @@ object HttpOptionsrootstringBefore { if (params != null) __obj.updateDynamic("params")(params.asInstanceOf[js.Any]) if (progress != null) __obj.updateDynamic("progress")(js.Any.fromFunction1(progress)) if (url != null) __obj.updateDynamic("url")(url.asInstanceOf[js.Any]) - __obj.asInstanceOf[HttpOptionsrootstringBefore] + __obj.asInstanceOf[HttpOptionsrootstring] } } diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/headersHttpHeaderskeystri.scala similarity index 90% rename from importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore.scala rename to importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/headersHttpHeaderskeystri.scala index 6f202037c5..445928fa5b 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore.scala +++ b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/headersHttpHeaderskeystri.scala @@ -8,7 +8,7 @@ import scala.scalajs.js.annotation._ /* Inlined { headers ? :vue-resource.vuejs.HttpHeaders, [key: string] : any} & vue-resource.vuejs.HttpOptions */ @js.native -trait headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore +trait headersHttpHeaderskeystri extends /* key */ StringDictionary[js.Any] { var before: js.UndefOr[js.Function1[/* request */ js.Any, _]] = js.native var body: js.UndefOr[js.Any] = js.native @@ -22,7 +22,7 @@ trait headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore var url: js.UndefOr[String] = js.native } -object headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore { +object headersHttpHeaderskeystri { @scala.inline def apply( StringDictionary: /* key */ StringDictionary[js.Any] = null, @@ -36,7 +36,7 @@ object headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore { params: js.Any = null, progress: /* event */ js.Any => _ = null, url: String = null - ): headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore = { + ): headersHttpHeaderskeystri = { val __obj = js.Dynamic.literal() if (StringDictionary != null) js.Dynamic.global.Object.assign(__obj, StringDictionary) if (before != null) __obj.updateDynamic("before")(js.Any.fromFunction1(before)) @@ -49,7 +49,7 @@ object headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore { if (params != null) __obj.updateDynamic("params")(params.asInstanceOf[js.Any]) if (progress != null) __obj.updateDynamic("progress")(js.Any.fromFunction1(progress)) if (url != null) __obj.updateDynamic("url")(url.asInstanceOf[js.Any]) - __obj.asInstanceOf[headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore] + __obj.asInstanceOf[headersHttpHeaderskeystri] } } diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/ComponentOption.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/ComponentOption.scala index e70d59a197..ef5442085c 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/ComponentOption.scala +++ b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/ComponentOption.scala @@ -1,18 +1,18 @@ package typings.vueResource.vuejs -import typings.vueResource.headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore +import typings.vueResource.headersHttpHeaderskeystri import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native trait ComponentOption extends js.Object { - var http: js.UndefOr[headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore] = js.native + var http: js.UndefOr[headersHttpHeaderskeystri] = js.native } object ComponentOption { @scala.inline - def apply(http: headersHttpHeaderskeystringanyHttpOptionsDictkeyBefore = null): ComponentOption = { + def apply(http: headersHttpHeaderskeystri = null): ComponentOption = { val __obj = js.Dynamic.literal() if (http != null) __obj.updateDynamic("http")(http.asInstanceOf[js.Any]) __obj.asInstanceOf[ComponentOption] diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Http_.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Http_.scala index 261a370939..f908b39c93 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Http_.scala +++ b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Http_.scala @@ -1,6 +1,6 @@ package typings.vueResource.vuejs -import typings.vueResource.HttpOptionsrootstringBefore +import typings.vueResource.HttpOptionsrootstring import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @@ -15,7 +15,7 @@ trait Http_ extends js.Object { var interceptors: js.Array[HttpInterceptor | js.Function0[HttpInterceptor]] = js.native @JSName("jsonp") var jsonp_Original: http = js.native - var options: HttpOptionsrootstringBefore = js.native + var options: HttpOptionsrootstring = js.native @JSName("patch") var patch_Original: http = js.native @JSName("post") diff --git a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Vue.scala b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Vue.scala index 96d80e56c5..3ac35d03b5 100644 --- a/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Vue.scala +++ b/importer/src/test/resources/vue/check/v/vue-resource/src/main/scala/typings/vueResource/vuejs/Vue.scala @@ -1,6 +1,6 @@ package typings.vueResource.vuejs -import typings.vueResource.AnonCall1Delete +import typings.vueResource.AnonCall import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @@ -8,7 +8,7 @@ import scala.scalajs.js.annotation._ @js.native trait Vue extends js.Object { @JSName("$http") - var $http_Original: AnonCall1Delete = js.native + var $http_Original: AnonCall = js.native @JSName("$resource") var $resource_Original: resource = js.native @JSName("$http") diff --git a/importer/src/test/resources/vue/check/v/vue-scrollto/build.sbt b/importer/src/test/resources/vue/check/v/vue-scrollto/build.sbt index 29b9f2f9fd..f957c1a13d 100644 --- a/importer/src/test/resources/vue/check/v/vue-scrollto/build.sbt +++ b/importer/src/test/resources/vue/check/v/vue-scrollto/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "vue-scrollto" -version := "2.7-a35618" +version := "2.7-e9145e" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "org.scalablytyped" %%% "std" % "0.0-unknown-a660db", - "org.scalablytyped" %%% "vue" % "2.5.13-761a36") + "org.scalablytyped" %%% "vue" % "2.5.13-c38e2c") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/vue/check/v/vue/build.sbt b/importer/src/test/resources/vue/check/v/vue/build.sbt index 87e83e995e..2914e53260 100644 --- a/importer/src/test/resources/vue/check/v/vue/build.sbt +++ b/importer/src/test/resources/vue/check/v/vue/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "vue" -version := "2.5.13-761a36" +version := "2.5.13-c38e2c" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Anon0.scala b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/AnonInstantiable.scala similarity index 90% rename from importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Anon0.scala rename to importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/AnonInstantiable.scala index 95f7cc90ac..74eb4109a4 100644 --- a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Anon0.scala +++ b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/AnonInstantiable.scala @@ -6,6 +6,6 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait Anon0[T] +trait AnonInstantiable[T] extends Instantiable1[/* args (repeated) */ js.Any, T with js.Object] diff --git a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Fn0.scala b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/FnCall.scala similarity index 89% rename from importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Fn0.scala rename to importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/FnCall.scala index 882596cb84..06b516c23f 100644 --- a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Fn0.scala +++ b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/FnCall.scala @@ -5,7 +5,7 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait Fn0 extends js.Object { +trait FnCall extends js.Object { def apply[T](array: js.Array[T], key: Double, value: T): T = js.native def apply[T](`object`: js.Object, key: String, value: T): T = js.native } diff --git a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Fn1.scala b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/FnCallObjectKey.scala similarity index 85% rename from importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Fn1.scala rename to importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/FnCallObjectKey.scala index d6ebdba0fa..2e7c85efb4 100644 --- a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/Fn1.scala +++ b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/FnCallObjectKey.scala @@ -5,7 +5,7 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native -trait Fn1 extends js.Object { +trait FnCallObjectKey extends js.Object { def apply(`object`: js.Object, key: String): Unit = js.native def apply[T](array: js.Array[T], key: Double): Unit = js.native } diff --git a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/optionsMod/package.scala b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/optionsMod/package.scala index 1816683ec9..45abccd6da 100644 --- a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/optionsMod/package.scala +++ b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/optionsMod/package.scala @@ -38,7 +38,7 @@ package object optionsMod { ] type InjectKey = java.lang.String | js.Symbol type InjectOptions = (org.scalablytyped.runtime.StringDictionary[typings.vue.optionsMod.InjectKey | typings.vue.AnonDefault]) | js.Array[java.lang.String] - type Prop[T] = js.Function0[T] | typings.vue.Anon0[T] + type Prop[T] = js.Function0[T] | typings.vue.AnonInstantiable[T] type PropValidator[T] = typings.vue.optionsMod.PropOptions[T] | typings.vue.optionsMod.Prop[T] | js.Array[typings.vue.optionsMod.Prop[T]] type PropsDefinition[T] = typings.vue.optionsMod.ArrayPropsDefinition[T] | typings.vue.optionsMod.RecordPropsDefinition[T] type RecordPropsDefinition[T] = /* import warning: importer.ImportType#apply c Unsupported type mapping: diff --git a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/vueMod/Vue.scala b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/vueMod/Vue.scala index a52c3d0d27..ff54bb8585 100644 --- a/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/vueMod/Vue.scala +++ b/importer/src/test/resources/vue/check/v/vue/src/main/scala/typings/vue/vueMod/Vue.scala @@ -5,8 +5,8 @@ import org.scalablytyped.runtime.TopLevel import typings.std.Element import typings.std.HTMLElement import typings.std.Record -import typings.vue.Fn0 -import typings.vue.Fn1 +import typings.vue.FnCall +import typings.vue.FnCallObjectKey import typings.vue.optionsMod.AsyncComponent import typings.vue.optionsMod.Component import typings.vue.optionsMod.ComponentOptions @@ -35,7 +35,7 @@ trait Vue extends js.Object { @JSName("$data") val $data: Record[String, _] = js.native @JSName("$delete") - var $delete_Original: Fn1 = js.native + var $delete_Original: FnCallObjectKey = js.native @JSName("$el") val $el: HTMLElement = js.native @JSName("$isServer") @@ -61,7 +61,7 @@ trait Vue extends js.Object { @JSName("$scopedSlots") val $scopedSlots: StringDictionary[ScopedSlot] = js.native @JSName("$set") - var $set_Original: Fn0 = js.native + var $set_Original: FnCall = js.native @JSName("$slots") val $slots: StringDictionary[js.Array[VNode]] = js.native @JSName("$ssrContext") diff --git a/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansionTest.scala b/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansionTest.scala index 0d7eec19c2..a098d1edce 100644 --- a/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansionTest.scala +++ b/importer/src/test/scala/org/scalablytyped/converter/internal/ts/parser/TypeExpansionTest.scala @@ -83,7 +83,7 @@ export declare type PickerMode = Exclude; IArray( TsTypeRef( NoComments, - TsQIdent(IArray(TsIdentLibrarySimple("testing"), TsIdentSimple("ToJsonOutputnamestringChildrenName"))), + TsQIdent(IArray(TsIdentLibrarySimple("testing"), TsIdentSimple("ToJsonOutputnamestringName"))), IArray(), ), ), diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/DeriveNonConflictingName.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/DeriveNonConflictingName.scala index 10a66a35b8..3a8c34fd45 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/DeriveNonConflictingName.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/DeriveNonConflictingName.scala @@ -16,16 +16,17 @@ import seqs._ * of the members. */ object DeriveNonConflictingName { + val Anon = "Anon" + val Fn = "Fn" + val isMeaningless = Set(Anon, Fn) - def apply[T](prefix: String, minNumParts: Int, members: IArray[TsMember])( - tryCreate: TsIdentSimple => Option[T], - ): T = { + def apply[T](prefix: String, members: IArray[TsMember])(tryCreate: TsIdentSimple => Option[T]): T = { val fromCalls: Option[Detail] = { members.collect { case TsMemberCall(_, _, sig) => sig } match { case Empty => None case calls => val longest = calls.maxBy(_.params.length) - Some(Detail(s"Call${longest.params.length}")) + Some(Detail(s"Call", s"Call${longest.params.map(_.name.value.capitalize).mkString}")) } } @@ -65,15 +66,15 @@ object DeriveNonConflictingName { Detail(short, long) } - val details = fromMembers.sorted.distinct + val details = IArray.fromOptions(fromCalls, fromInstantiable, fromDict) ++ fromMembers.sorted.distinct val nameVariants: Stream[String] = for { longVersion <- Stream(false, true) - amount <- Stream(1, details.length + 1) + amount <- Stream.range(if (isMeaningless(prefix)) 1 else 0, details.length + 1) idx <- Stream.range(0, details.length) } yield { - val pick = IArray.fromOptions(fromCalls, fromInstantiable, fromDict) ++ details.drop(idx).take(amount) + val pick = details.drop(idx).take(amount) prefix + pick.map(_.pick(longVersion)).mkString("") } diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/TsTypeFormatter.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/TsTypeFormatter.scala index 599b47237f..6e45b86e86 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/TsTypeFormatter.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/TsTypeFormatter.scala @@ -1,7 +1,11 @@ package org.scalablytyped.converter.internal package ts -object TsTypeFormatter { +object TsTypeFormatter extends TsTypeFormatter(true) + +class TsTypeFormatter(val keepComments: Boolean) { + def dropComments = new TsTypeFormatter(false) + def qident(q: TsQIdent): String = q.parts.map(_.value).mkString(".") @@ -113,9 +117,10 @@ object TsTypeFormatter { def apply(tpe: TsType): String = tpe match { - case TsTypeRef(cs, name, ts) => Comments.format(cs) + qident(name) + tparams(ts)(apply).getOrElse("") + case TsTypeRef(cs, name, ts) => + Comments.format(cs, keepComments) + qident(name) + tparams(ts)(apply).getOrElse("") case TsTypeLiteral(l) => lit(l) - case TsTypeObject(cs, members) => Comments.format(cs) + s"{${members.map(member).mkString(", ")}}" + case TsTypeObject(cs, members) => Comments.format(cs, keepComments) + s"{${members.map(member).mkString(", ")}}" case TsTypeFunction(s) => s"${sig(s)}" case TsTypeConstructor(f) => s"new ${apply(f)}" case TsTypeIs(ident, x) => s"${ident.value} is ${apply(x)}" diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala index e8c06a3826..dafe3de5dd 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala @@ -36,7 +36,7 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { x case Ok(newMembers, true) => - val nameHint = TsTypeFormatter(Unqualify.visitTsType(())(x)).filter(_.isLetterOrDigit).take(50) + val nameHint = TsTypeFormatter.dropComments(Unqualify.visitTsType(())(x)).filter(_.isLetterOrDigit) val notices = Comments( List( diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExtractInterfaces.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExtractInterfaces.scala index 9afd4da936..59ab6997da 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExtractInterfaces.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExtractInterfaces.scala @@ -17,14 +17,10 @@ object ExtractInterfaces { class ConflictHandlingStore(inLibrary: TsIdent) { val interfaces = mutable.Map.empty[TsIdent, TsDeclInterface] - def addInterface( - scope: TsTreeScope, - prefix: String, - members: IArray[TsMember], - minNumParts: Int, - construct: TsIdentSimple => TsDeclInterface, + def addInterface(scope: TsTreeScope, prefix: String, members: IArray[TsMember])( + construct: TsIdentSimple => TsDeclInterface, ): CodePath.HasPath = { - val interface = DeriveNonConflictingName(prefix, minNumParts, members) { name => + val interface = DeriveNonConflictingName(prefix, members) { name => val interface = construct(name) withCodePath CodePath.HasPath(inLibrary, TsQIdent.of(name)) interfaces get name match { @@ -69,28 +65,31 @@ object ExtractInterfaces { val referencedTparams: IArray[TsTypeParam] = TypeParamsReferencedInTree(scope.tparams, obj) - val nameHint = obj.comments.extract { - case Markers.NameHint(hint) => hint + val prefix: String = { + def isFunction = + obj.members.forall { + case _: TsMemberCall => true + case _ => false + } + + obj.comments.extract { case Markers.NameHint(hint) => hint } match { + case Some((nameHint, _)) => nameHint.take(25) + case None if isFunction => DeriveNonConflictingName.Fn + case None => DeriveNonConflictingName.Anon + } } - def isFunction = obj.members.forall { case _: TsMemberCall => true; case _ => false } - - val codePath = store.addInterface( - scope, - nameHint.fold(if (isFunction) "Fn_" else "Anon_")(_._1), - obj.members, - minNumParts = nameHint.fold(2)(_ => 1), - name => - TsDeclInterface( - nameHint.fold(obj.comments)(_._2), - declared = true, - name, - referencedTparams, - Empty, - obj.members, - CodePath.NoPath, - ), - ) + val codePath = store.addInterface(scope, prefix, obj.members) { name => + TsDeclInterface( + obj.comments.extract { case Markers.NameHint(hint) => hint }.fold(obj.comments)(_._2), + declared = true, + name, + referencedTparams, + Empty, + obj.members, + CodePath.NoPath, + ) + } TsTypeRef(NoComments, codePath.codePath, TsTypeParam.asTypeArgs(referencedTparams)) diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ResolveTypeQueries.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ResolveTypeQueries.scala index 8dfbaa9912..a16a145e8f 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ResolveTypeQueries.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ResolveTypeQueries.scala @@ -137,7 +137,7 @@ object ResolveTypeQueries extends TransformLeaveMembers with TransformLeaveClass statics match { case Empty => Some((cls, ctor)) case some => - val nameHint = Comments(CommentData(Markers.NameHint(s"TypeofClass${cls.name.value}"))) + val nameHint = Comments(CommentData(Markers.NameHint(s"Typeof${cls.name.value}"))) Some( ( cls, diff --git a/utils/src/main/scala/org/scalablytyped/converter/internal/comments.scala b/utils/src/main/scala/org/scalablytyped/converter/internal/comments.scala index 5b3d46cda8..4885d03030 100644 --- a/utils/src/main/scala/org/scalablytyped/converter/internal/comments.scala +++ b/utils/src/main/scala/org/scalablytyped/converter/internal/comments.scala @@ -16,6 +16,7 @@ object Comment { Comment(s"/* import warning: ${e.value.split("\\.").takeRight(2).mkString(".")} $s */") } +@SerialVersionUID(8167323919307012581L) // something about this class seems brittle sealed class Comments(val cs: List[Comment]) extends Serializable { def rawCs = cs collect { case CommentRaw(raw) => raw } @@ -108,4 +109,7 @@ object Comments { ) } .mkString("") + + def format(comments: Comments, keepComments: Boolean): String = + if (keepComments) format(comments) else "" } From 5b58ca9657dbf9ac0359ebeaafbdb283e1b163f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 14/18] Stabilize performance of ExpandTypeMappings --- .../importer/Phase1ReadTypescript.scala | 2 +- .../internal/importer/Libraries.scala | 2 +- .../ts/transforms/ExpandTypeMappings.scala | 39 ++++++++++++------- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase1ReadTypescript.scala b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase1ReadTypescript.scala index 66167961b3..6aa2cc127a 100644 --- a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase1ReadTypescript.scala +++ b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase1ReadTypescript.scala @@ -234,7 +234,7 @@ object Phase1ReadTypescript { T.DefaultedTypeArguments.visitTsParsedFile(scope.caching), //after FlattenTrees T.InlineTrivialParents.visitTsParsedFile(scope.caching), //after FlattenTrees and DefaultedTypeArguments if (expandTypeMappings(libName)) T.ExpandTypeMappings.visitTsParsedFile(scope.caching) else identity, // before ExtractInterfaces - if (expandTypeMappings(libName)) T.ExpandTypeMappings.After.visitTsParsedFile(scope) else identity, // before ExtractInterfaces + if (expandTypeMappings(libName)) T.ExpandTypeMappings.After.visitTsParsedFile(scope.caching) else identity, // before ExtractInterfaces ( T.SimplifyConditionals >> // after ExpandTypeMappings T.TypeAliasToConstEnum >> diff --git a/importer/src/main/scala/org/scalablytyped/converter/internal/importer/Libraries.scala b/importer/src/main/scala/org/scalablytyped/converter/internal/importer/Libraries.scala index 703a72eafb..1dd27598e6 100644 --- a/importer/src/main/scala/org/scalablytyped/converter/internal/importer/Libraries.scala +++ b/importer/src/main/scala/org/scalablytyped/converter/internal/importer/Libraries.scala @@ -283,7 +283,7 @@ object Libraries { base ++ circular map TsIdentLibrary.apply } - val Slow = Set("@pulumi/aws", "aws-sdk", "googleapis", "@material-ui/core") map TsIdentLibrary.apply + val Slow = Set("@pulumi/aws", "aws-sdk", "googleapis", "@material-ui/core", "@storybook/components") map TsIdentLibrary.apply /* These are all the libraries used in demos. The set doubles as the extended test set */ val DemoSet: Set[TsIdentLibrary] = expo ++ Set( diff --git a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala index dafe3de5dd..ae75539904 100644 --- a/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala +++ b/ts/src/main/scala/org/scalablytyped/converter/internal/ts/transforms/ExpandTypeMappings.scala @@ -96,19 +96,30 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { val EmptySet = Set.empty[String] sealed trait Res[+T] { - def withIsRewritten: Res[T] = this match { - case Ok(value, _) => Ok(value, wasRewritten = true) - case p: Problems => p - } + def isSuccess: Boolean = + this match { + case Ok(_, _) => true + case Problems(_) => false + } - def validated[U](pred: T => Either[Problem, U]): Res[U] = this match { - case Ok(value, wasRewritten) => - pred(value) match { - case Left(problem) => Problems(IArray(problem)) - case Right(newValue) => Ok(newValue, wasRewritten) - } - case p: Problems => p - } + def withIsRewritten(wasRewritten: Boolean): Res[T] = + this match { + case Ok(value, _) => Ok(value, wasRewritten) + case p: Problems => p + } + + def withIsRewritten: Res[T] = + withIsRewritten(wasRewritten = true) + + def validated[U](pred: T => Either[Problem, U]): Res[U] = + this match { + case Ok(value, wasRewritten) => + pred(value) match { + case Left(problem) => Problems(IArray(problem)) + case Right(newValue) => Ok(newValue, wasRewritten) + } + case p: Problems => p + } def map[U](f: T => U): Res[U] = this match { @@ -174,7 +185,7 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { case `key` => TsTypeLiteral(name) case TsTypeLookup(from, `key`) => val foundType: Option[TsType] = - AllMembersFor.forType(scope, ld)(from) match { + AllMembersFor.forType(scope / from, ld)(from) match { case Ok(members, _) => members collectFirst { case TsMemberProperty(_, _, TsIdent(name.literal), tpeOpt, _, false, _, isOptional) => @@ -388,7 +399,7 @@ object ExpandTypeMappings extends TreeTransformationScopedChanges { case Left(()) => Problems(IArray(Loop(scope))) case Right(ld) => - val enableCache = scope.root.cache.isDefined && typeRef.tparams.forall(_.isInstanceOf[TsTypeRef]) + val enableCache = scope.root.cache.isDefined if (enableCache) { if (scope.root.cache.get.typeMappings.contains(typeRef)) { return scope.root.cache.get.typeMappings(typeRef) From 53d20c3f4900f80d1c57ad337a0b20e3a54b341e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 15/18] Adhere to props type having to be <:< js.Object for japgolly components by using the relevant part of a union type --- .../check-japgolly/c/componentstest/build.sbt | 2 +- .../componentstest/components/Component.scala | 23 +++++++++++++------ .../s/semantic-ui-react/build.sbt | 2 +- .../semanticUiReact/components/Button.scala | 7 +++--- .../semanticUiReact/components/Input.scala | 7 +++--- .../internal/scalajs/flavours/FindProps.scala | 10 ++++---- .../scalajs/flavours/GenCompanions.scala | 2 +- .../flavours/GenJapgollyComponents.scala | 16 ++++++------- .../flavours/GenSlinkyComponents.scala | 5 ++-- 9 files changed, 43 insertions(+), 31 deletions(-) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt index cb63b9bc56..f8515b15d1 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "componentstest" -version := "0.0-unknown-3a2169" +version := "0.0-unknown-45ce70" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/src/main/scala/typingsJapgolly/componentstest/components/Component.scala b/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/src/main/scala/typingsJapgolly/componentstest/components/Component.scala index 08200a98ae..59fd474e9d 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/src/main/scala/typingsJapgolly/componentstest/components/Component.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/src/main/scala/typingsJapgolly/componentstest/components/Component.scala @@ -5,7 +5,6 @@ import japgolly.scalajs.react.CtorType.ChildArg import japgolly.scalajs.react.Key import japgolly.scalajs.react.component.JsForwardRef.UnmountedWithRoot import org.scalablytyped.runtime.StringDictionary -import typingsJapgolly.componentstest.mod.Props import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @@ -18,7 +17,12 @@ object Component { _overrides: StringDictionary[js.Any] = null )( children: ChildArg* - ): UnmountedWithRoot[Props, typingsJapgolly.componentstest.mod.Component, Unit, Props] = { + ): UnmountedWithRoot[ + typingsJapgolly.componentstest.mod.A, + typingsJapgolly.componentstest.mod.Component, + Unit, + typingsJapgolly.componentstest.mod.A + ] = { val __obj = js.Dynamic.literal(aMember = aMember.asInstanceOf[js.Any]) __obj.updateDynamic("aCallback")(aCallback.toJsFn) @@ -26,10 +30,10 @@ object Component { if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) val f = japgolly.scalajs.react.JsForwardRefComponent.force[ - typingsJapgolly.componentstest.mod.Props, + typingsJapgolly.componentstest.mod.A, japgolly.scalajs.react.Children.Varargs, typingsJapgolly.componentstest.mod.Component](this.componentImport) - f(__obj.asInstanceOf[typingsJapgolly.componentstest.mod.Props])(children: _*) + f(__obj.asInstanceOf[typingsJapgolly.componentstest.mod.A])(children: _*) } def B( bMember: String, @@ -38,7 +42,12 @@ object Component { _overrides: StringDictionary[js.Any] = null )( children: ChildArg* - ): UnmountedWithRoot[Props, typingsJapgolly.componentstest.mod.Component, Unit, Props] = { + ): UnmountedWithRoot[ + typingsJapgolly.componentstest.mod.B, + typingsJapgolly.componentstest.mod.Component, + Unit, + typingsJapgolly.componentstest.mod.B + ] = { val __obj = js.Dynamic.literal(bMember = bMember.asInstanceOf[js.Any]) bCallback.foreach(p => __obj.updateDynamic("bCallback")(p.toJsFn)) @@ -46,10 +55,10 @@ object Component { if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) val f = japgolly.scalajs.react.JsForwardRefComponent.force[ - typingsJapgolly.componentstest.mod.Props, + typingsJapgolly.componentstest.mod.B, japgolly.scalajs.react.Children.Varargs, typingsJapgolly.componentstest.mod.Component](this.componentImport) - f(__obj.asInstanceOf[typingsJapgolly.componentstest.mod.Props])(children: _*) + f(__obj.asInstanceOf[typingsJapgolly.componentstest.mod.B])(children: _*) } @JSImport("componentstest", "Component") @js.native diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt index 5de16cb96f..fb087f37c6 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "semantic-ui-react" -version := "0.0-unknown-d58e2d" +version := "0.0-unknown-21fe55" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/src/main/scala/typingsJapgolly/semanticUiReact/components/Button.scala b/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/src/main/scala/typingsJapgolly/semanticUiReact/components/Button.scala index 7e87d13c71..0bf31a6215 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/src/main/scala/typingsJapgolly/semanticUiReact/components/Button.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/src/main/scala/typingsJapgolly/semanticUiReact/components/Button.scala @@ -60,6 +60,7 @@ import typingsJapgolly.react.reactStrings.text import typingsJapgolly.react.reactStrings.time import typingsJapgolly.react.reactStrings.tree import typingsJapgolly.semanticUiReact.buttonMod.ButtonProps +import typingsJapgolly.semanticUiReact.buttonMod.StrictButtonProps import typingsJapgolly.semanticUiReact.genericMod.SemanticCOLORS import typingsJapgolly.semanticUiReact.genericMod.SemanticFLOATS import typingsJapgolly.semanticUiReact.genericMod.SemanticSIZES @@ -296,7 +297,7 @@ object Button { _overrides: StringDictionary[js.Any] = null )( children: ChildArg* - ): UnmountedWithRoot[ButtonProps, default, Unit, ButtonProps] = { + ): UnmountedWithRoot[StrictButtonProps, default, Unit, StrictButtonProps] = { val __obj = js.Dynamic.literal() if (about != null) __obj.updateDynamic("about")(about.asInstanceOf[js.Any]) @@ -506,10 +507,10 @@ object Button { if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) val f = japgolly.scalajs.react.JsForwardRefComponent.force[ - typingsJapgolly.semanticUiReact.buttonMod.ButtonProps, + typingsJapgolly.semanticUiReact.buttonMod.StrictButtonProps, japgolly.scalajs.react.Children.Varargs, typingsJapgolly.semanticUiReact.mod.default](this.componentImport) - f(__obj.asInstanceOf[typingsJapgolly.semanticUiReact.buttonMod.ButtonProps])(children: _*) + f(__obj.asInstanceOf[typingsJapgolly.semanticUiReact.buttonMod.StrictButtonProps])(children: _*) } @JSImport("semantic-ui-react/dist/commonjs/elements/Button", JSImport.Default) @js.native diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/src/main/scala/typingsJapgolly/semanticUiReact/components/Input.scala b/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/src/main/scala/typingsJapgolly/semanticUiReact/components/Input.scala index dc4dcd466e..2eff4a99c9 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/src/main/scala/typingsJapgolly/semanticUiReact/components/Input.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/src/main/scala/typingsJapgolly/semanticUiReact/components/Input.scala @@ -61,6 +61,7 @@ import typingsJapgolly.semanticUiReact.genericMod.HtmlInputrops import typingsJapgolly.semanticUiReact.genericMod.SemanticShorthandItem import typingsJapgolly.semanticUiReact.inputInputMod.InputOnChangeData import typingsJapgolly.semanticUiReact.inputInputMod.InputProps +import typingsJapgolly.semanticUiReact.inputInputMod.StrictInputProps import typingsJapgolly.semanticUiReact.inputMod.default import typingsJapgolly.semanticUiReact.semanticUiReactStrings.`left corner` import typingsJapgolly.semanticUiReact.semanticUiReactStrings.`right corner` @@ -300,7 +301,7 @@ object Input { _overrides: StringDictionary[js.Any] = null )( children: ChildArg* - ): UnmountedWithRoot[InputProps, default, Unit, InputProps] = { + ): UnmountedWithRoot[StrictInputProps, default, Unit, StrictInputProps] = { val __obj = js.Dynamic.literal() if (about != null) __obj.updateDynamic("about")(about.asInstanceOf[js.Any]) @@ -523,10 +524,10 @@ object Input { if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) val f = japgolly.scalajs.react.JsForwardRefComponent.force[ - typingsJapgolly.semanticUiReact.inputInputMod.InputProps, + typingsJapgolly.semanticUiReact.inputInputMod.StrictInputProps, japgolly.scalajs.react.Children.Varargs, typingsJapgolly.semanticUiReact.inputMod.default](this.componentImport) - f(__obj.asInstanceOf[typingsJapgolly.semanticUiReact.inputInputMod.InputProps])(children: _*) + f(__obj.asInstanceOf[typingsJapgolly.semanticUiReact.inputInputMod.StrictInputProps])(children: _*) } @JSImport("semantic-ui-react/dist/commonjs/elements/Input", JSImport.Default) @js.native diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/FindProps.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/FindProps.scala index 37719266f9..73b40a6f6e 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/FindProps.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/FindProps.scala @@ -19,7 +19,7 @@ object FindProps { case Res.Error(_) => None } - def asMap: Map[Name, T] = this match { + def asMap: Map[TypeRef, T] = this match { case Res.One(name, value) => Map(name -> value) case Res.Many(values) => values case Res.Error(_) => Map.empty @@ -41,8 +41,8 @@ object FindProps { } } case class Error[T](msg: String) extends Res[T] - case class One[T](name: Name, value: T) extends Success[T] - case class Many[T](values: Map[Name, T]) extends Success[T] + case class One[T](name: TypeRef, value: T) extends Success[T] + case class Many[T](values: Map[TypeRef, T]) extends Success[T] def combine[T](ress: IArray[Res[T]]): Res[T] = ress.partitionCollect3( @@ -88,7 +88,7 @@ final class FindProps(cleanIllegalNames: CleanIllegalNames) { case x @ Res.One(_, _) => x }) match { case (Empty, Empty, ones, _) => - Res.One(typeRef.name, ones.map(_.value).flatten.sorted.distinctBy(_.parameter.name)) + Res.One(typeRef, ones.map(_.value).flatten.sorted.distinctBy(_.parameter.name)) case (Empty, _, _, _) => Res.Error("Support for combinations of intersection and union types not implemented") case (errors, _, _, _) => @@ -181,7 +181,7 @@ final class FindProps(cleanIllegalNames: CleanIllegalNames) { ) Res.One( - cls.name, + TypeRef(cls.codePath, TypeParamTree.asTypeArgs(cls.tparams), NoComments), IArray .fromTraversable( builder diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenCompanions.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenCompanions.scala index 1d1d16556b..c260a349c0 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenCompanions.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenCompanions.scala @@ -44,7 +44,7 @@ final class GenCompanions(memberToProp: MemberToProp, findProps: FindProps) exte case Res.Many(paramsMap) => val methods: IArray[MethodTree] = IArray.fromTraversable(paramsMap.flatMap { - case (name, params) => generateCreator(name, params, cls.codePath, cls.tparams) + case (propsRef, params) => generateCreator(propsRef.name, params, cls.codePath, cls.tparams) }) val modOpt: Option[ModuleTree] = diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenJapgollyComponents.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenJapgollyComponents.scala index 6b2a75c9b1..b904a32a7b 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenJapgollyComponents.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenJapgollyComponents.scala @@ -260,14 +260,14 @@ final class GenJapgollyComponents(reactNames: ReactNames, scalaJsDomNames: Scala propsRef -> resProps case None => - TypeRef.Object -> Res.One(TypeRef.Object.name, Empty) + TypeRef.Object -> Res.One(TypeRef.Object, Empty) } resProps match { case Res.Success(props) => components match { case IArray.exactlyOne(one) => - IArray(genComponent(pkgCp, propsRef, props, one.knownRef, tparams, one)) + IArray(genComponent(pkgCp, props, one.knownRef, tparams, one)) case many => /** We share `apply` methods for each props type in abstract classes to limit compilation time. * References causes some trouble, so if the component knows it we thread it through a type param. @@ -281,7 +281,7 @@ final class GenJapgollyComponents(reactNames: ReactNames, scalaJsDomNames: Scala val propsWithObject = TypeRef.Intersection(IArray(propsRef, TypeRef.Object)) val (_, Left(param)) = FindProps.parentParameter(Name("props"), propsWithObject, isRequired = true) val mod = - genComponent(pkgCp, propsWithObject, Res.One(propsRef.name, IArray(param)), c.knownRef, tparams, c) + genComponent(pkgCp, Res.One(propsWithObject, IArray(param)), c.knownRef, tparams, c) val comment = Comment( s"/* This component has complicated props, you'll have to assemble `props` yourself using js.Dynamic.literal(...) or similar. */\n", ) @@ -300,7 +300,6 @@ final class GenJapgollyComponents(reactNames: ReactNames, scalaJsDomNames: Scala def genComponent( pkgCodePath: QualifiedName, - propsRef: TypeRef, resProps: Res.Success[IArray[Prop]], knownRefRewritten: Option[TypeRef], tparams: IArray[TypeParamTree], @@ -310,11 +309,12 @@ final class GenJapgollyComponents(reactNames: ReactNames, scalaJsDomNames: Scala val methods: IArray[MemberTree] = resProps match { - case Res.One(_, props) => + case Res.One(propsRef, props) => IArray(genCreator(Name.APPLY, propsRef, props, knownRefRewritten, tparams, componentCp)) case Res.Many(propss) => IArray.fromTraversable(propss.map { - case (name, props) => genCreator(name, propsRef, props, knownRefRewritten, tparams, componentCp) + case (propsRef, props) => + genCreator(propsRef.name, propsRef, props, knownRefRewritten, tparams, componentCp) }) } @@ -366,11 +366,11 @@ final class GenJapgollyComponents(reactNames: ReactNames, scalaJsDomNames: Scala val methods: IArray[MemberTree] = resProps match { - case Res.One(_, props) => + case Res.One(propsRef, props) => IArray(genCreator(Name.APPLY, propsRef, props, knownRefRewritten, tparams, classCp)) case Res.Many(propss) => IArray.fromTraversable(propss.map { - case (name, props) => genCreator(name, propsRef, props, knownRefRewritten, tparams, classCp) + case (propsRef, props) => genCreator(propsRef.name, propsRef, props, knownRefRewritten, tparams, classCp) }) } diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenSlinkyComponents.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenSlinkyComponents.scala index 73c429c15a..f2becbe537 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenSlinkyComponents.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenSlinkyComponents.scala @@ -282,7 +282,7 @@ class GenSlinkyComponents( case None => ( TypeRef.Object, - Res.One(TypeRef.Object.name, SplitProps(Empty)), + Res.One(TypeRef.Object, SplitProps(Empty)), mode.forWeb(slinkyWeb => DomInfo(IArray.Empty, slinkyWeb.AnyHtmlElement)), ) } @@ -558,7 +558,8 @@ class GenSlinkyComponents( resProps match { case Res.Error(_) => Empty // we could generate something, but there is already an `apply` in the parent case Res.One(_, props) => IArray(applyMethod(Name.APPLY, props)) - case Res.Many(values) => IArray.fromTraversable(values.map { case (name, props) => applyMethod(name, props) }) + case Res.Many(values) => + IArray.fromTraversable(values.map { case (propsRef, props) => applyMethod(propsRef.name, props) }) } ( From d923e3a14fca79f379ae2c1666790c0e2a455fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Raddum=20Berg?= Date: Sat, 21 Mar 2020 01:38:35 +0100 Subject: [PATCH 16/18] Rewrite the slinky integration to improve tag detection and props removal - Do this by reusing the slinky json data structures (checked in for now) and match against typescript/react definitions of the same tags. Only elide optional props with exactly the same type as what is specified in react. - Cleanup FindProps --- .../internal/importer/Phase3Compile.scala | 2 +- .../internal/importer/PhaseFlavour.scala | 6 +- .../converter/internal/importer/Source.scala | 2 +- .../internal/importer/flavourImpl.scala | 4 +- .../converter/internal/importer/Ci.scala | 4 +- .../importer/documentation/NpmjsFetcher.scala | 6 +- .../check-japgolly/m/material-ui/build.sbt | 6 +- .../check-japgolly/r/react/build.sbt | 4 +- .../check-japgolly/s/std/build.sbt | 2 +- .../std/HTMLElementTagNameMap.scala | 34 + .../std/SVGElementTagNameMap.scala | 20 + .../scala/typingsJapgolly/std/package.scala | 4 + .../check-slinky/m/material-ui/build.sbt | 6 +- .../check-slinky/r/react/build.sbt | 4 +- .../material-ui/check-slinky/s/std/build.sbt | 2 +- .../std/HTMLElementTagNameMap.scala | 34 + .../std/SVGElementTagNameMap.scala | 20 + .../scala/typingsSlinky/std/package.scala | 4 + .../material-ui/check/m/material-ui/build.sbt | 6 +- .../material-ui/check/r/react/build.sbt | 4 +- .../material-ui/check/s/std/build.sbt | 2 +- .../typings/std/HTMLElementTagNameMap.scala | 34 + .../typings/std/SVGElementTagNameMap.scala | 20 + .../src/main/scala/typings/std/package.scala | 4 + .../test/resources/material-ui/in/stdlib.d.ts | 21 +- .../react-icons/check/r/react-icons/build.sbt | 2 +- .../typings/reactIcons/reactIconsProps.scala | 12 - .../check-japgolly/c/componentstest/build.sbt | 6 +- .../r/react-bootstrap/build.sbt | 6 +- .../r/react-contextmenu/build.sbt | 6 +- .../check-japgolly/r/react-dropzone/build.sbt | 6 +- .../components/ReactDropzone.scala | 2 +- .../reactDropzone/mod/DropzoneProps.scala | 2 +- .../reactDropzone/mod/default.scala | 2 +- .../check-japgolly/r/react-select/build.sbt | 6 +- .../check-japgolly/r/react/build.sbt | 4 +- .../react/mod/AnimationEvent.scala | 3 +- .../react/mod/ClipboardEvent.scala | 3 +- .../react/mod/CompositionEvent.scala | 3 +- .../typingsJapgolly/react/mod/DragEvent.scala | 3 +- .../react/mod/FocusEvent.scala | 3 +- .../react/mod/KeyboardEvent.scala | 3 +- .../react/mod/PointerEvent.scala | 3 +- .../typingsJapgolly/react/mod/ReactDOM.scala | 19 +- .../typingsJapgolly/react/mod/ReactHTML.scala | 31 +- .../react/mod/TouchEvent.scala | 3 +- .../react/mod/TransitionEvent.scala | 3 +- .../typingsJapgolly/react/mod/UIEvent.scala | 3 +- .../react/mod/WheelEvent.scala | 3 +- .../mod/_Global_/JSX/IntrinsicElements.scala | 40 +- .../s/semantic-ui-react/build.sbt | 6 +- .../build.sbt | 6 +- .../build.sbt | 6 +- .../check-japgolly/s/std/build.sbt | 2 +- .../std/HTMLElementTagNameMap.scala | 229 ++ .../std/SVGElementTagNameMap.scala | 26 + .../check-slinky/c/componentstest/build.sbt | 6 +- .../check-slinky/r/react-bootstrap/build.sbt | 6 +- .../components/ButtonGroup.scala | 438 ++- .../r/react-contextmenu/build.sbt | 6 +- .../components/MenuItem.scala | 8 +- .../reactContextmenu/components/SubMenu.scala | 6 +- .../check-slinky/r/react-dropzone/build.sbt | 6 +- .../components/ReactDropzone.scala | 10 +- .../reactDropzone/mod/DropzoneProps.scala | 6 +- .../reactDropzone/mod/default.scala | 4 +- .../check-slinky/r/react-select/build.sbt | 6 +- .../check-slinky/r/react/build.sbt | 4 +- .../react/mod/AnimationEvent.scala | 3 +- .../react/mod/ClipboardEvent.scala | 3 +- .../react/mod/CompositionEvent.scala | 3 +- .../typingsSlinky/react/mod/DragEvent.scala | 3 +- .../typingsSlinky/react/mod/FocusEvent.scala | 3 +- .../react/mod/KeyboardEvent.scala | 3 +- .../react/mod/PointerEvent.scala | 3 +- .../typingsSlinky/react/mod/ReactDOM.scala | 19 +- .../typingsSlinky/react/mod/ReactHTML.scala | 31 +- .../typingsSlinky/react/mod/TouchEvent.scala | 3 +- .../react/mod/TransitionEvent.scala | 3 +- .../typingsSlinky/react/mod/UIEvent.scala | 3 +- .../typingsSlinky/react/mod/WheelEvent.scala | 3 +- .../mod/_Global_/JSX/IntrinsicElements.scala | 40 +- .../s/semantic-ui-react/build.sbt | 6 +- .../components/Accordion.scala | 4 +- .../components/AccordionAccordion.scala | 4 +- .../components/AccordionPanel.scala | 4 +- .../components/AccordionTitle.scala | 4 +- .../semanticUiReact/components/Button.scala | 26 +- .../semanticUiReact/components/Input.scala | 15 +- .../build.sbt | 6 +- .../build.sbt | 6 +- .../check-slinky/s/std/build.sbt | 2 +- .../std/HTMLElementTagNameMap.scala | 229 ++ .../std/SVGElementTagNameMap.scala | 26 + .../check/c/componentstest/build.sbt | 6 +- .../check/r/react-bootstrap/build.sbt | 6 +- .../check/r/react-contextmenu/build.sbt | 6 +- .../check/r/react-dropzone/build.sbt | 6 +- .../check/r/react-select/build.sbt | 6 +- .../check/r/react/build.sbt | 4 +- .../check/s/semantic-ui-react/build.sbt | 6 +- .../build.sbt | 6 +- .../build.sbt | 6 +- .../check/s/std/build.sbt | 2 +- .../typings/std/HTMLElementTagNameMap.scala | 229 ++ .../typings/std/SVGElementTagNameMap.scala | 22 + .../react-integration-test/in/stdlib.d.ts | 114 + .../r/react-transition-group/build.sbt | 6 +- .../check-japgolly/r/react/build.sbt | 4 +- .../check-japgolly/s/std/build.sbt | 2 +- .../std/HTMLElementTagNameMap.scala | 34 + .../std/SVGElementTagNameMap.scala | 20 + .../scala/typingsJapgolly/std/package.scala | 4 + .../r/react-transition-group/build.sbt | 6 +- .../check-slinky/r/react/build.sbt | 4 +- .../check-slinky/s/std/build.sbt | 2 +- .../std/HTMLElementTagNameMap.scala | 34 + .../std/SVGElementTagNameMap.scala | 20 + .../scala/typingsSlinky/std/package.scala | 4 + .../check/r/react-transition-group/build.sbt | 6 +- .../check/r/react/build.sbt | 4 +- .../check/s/std/build.sbt | 2 +- .../typings/std/HTMLElementTagNameMap.scala | 34 + .../typings/std/SVGElementTagNameMap.scala | 20 + .../src/main/scala/typings/std/package.scala | 4 + .../react-transition-group/in/stdlib.d.ts | 23 +- .../internal/importer/ImporterHarness.scala | 4 +- .../internal/importer/ImporterTest.scala | 4 +- ...lablyTypedConverterExternalNpmPlugin.scala | 17 +- .../plugin/ScalablyTypedConverterPlugin.scala | 15 +- scalajs/src/main/resources/html.json | 2801 ++++++++++++++++ scalajs/src/main/resources/svg.json | 2860 +++++++++++++++++ .../internal/scalajs/QualifiedName.scala | 31 +- .../internal/scalajs/flavours/FindProps.scala | 177 +- .../scalajs/flavours/FlavourImpl.scala | 132 +- .../scalajs/flavours/GenCompanions.scala | 6 +- .../flavours/GenJapgollyComponents.scala | 11 +- .../flavours/GenSlinkyComponents.scala | 363 ++- .../flavours/IdentifyReactComponents.scala | 68 +- .../internal/scalajs/flavours/Prop.scala | 3 +- .../scalajs/flavours/ReactNames.scala | 37 +- .../scalajs/flavours/ScalaJsDomNames.scala | 4 +- .../scalajs/flavours/SlinkyFlavour.scala | 48 + .../scalajs/flavours/SlinkyTagsLoader.scala | 180 ++ .../flavours/SlinkyTypeConversions.scala | 58 + .../internal/scalajs/flavours/SlinkyWeb.scala | 382 +-- .../internal/scalajs/flavours/types.scala | 22 +- .../converter/internal}/Json.scala | 32 +- 148 files changed, 8457 insertions(+), 1118 deletions(-) create mode 100644 importer/src/test/resources/material-ui/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/HTMLElementTagNameMap.scala create mode 100644 importer/src/test/resources/material-ui/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/SVGElementTagNameMap.scala create mode 100644 importer/src/test/resources/material-ui/check-slinky/s/std/src/main/scala/typingsSlinky/std/HTMLElementTagNameMap.scala create mode 100644 importer/src/test/resources/material-ui/check-slinky/s/std/src/main/scala/typingsSlinky/std/SVGElementTagNameMap.scala create mode 100644 importer/src/test/resources/material-ui/check/s/std/src/main/scala/typings/std/HTMLElementTagNameMap.scala create mode 100644 importer/src/test/resources/material-ui/check/s/std/src/main/scala/typings/std/SVGElementTagNameMap.scala create mode 100644 importer/src/test/resources/react-integration-test/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/HTMLElementTagNameMap.scala create mode 100644 importer/src/test/resources/react-integration-test/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/SVGElementTagNameMap.scala create mode 100644 importer/src/test/resources/react-integration-test/check-slinky/s/std/src/main/scala/typingsSlinky/std/HTMLElementTagNameMap.scala create mode 100644 importer/src/test/resources/react-integration-test/check-slinky/s/std/src/main/scala/typingsSlinky/std/SVGElementTagNameMap.scala create mode 100644 importer/src/test/resources/react-integration-test/check/s/std/src/main/scala/typings/std/HTMLElementTagNameMap.scala create mode 100644 importer/src/test/resources/react-integration-test/check/s/std/src/main/scala/typings/std/SVGElementTagNameMap.scala create mode 100644 importer/src/test/resources/react-transition-group/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/HTMLElementTagNameMap.scala create mode 100644 importer/src/test/resources/react-transition-group/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/SVGElementTagNameMap.scala create mode 100644 importer/src/test/resources/react-transition-group/check-slinky/s/std/src/main/scala/typingsSlinky/std/HTMLElementTagNameMap.scala create mode 100644 importer/src/test/resources/react-transition-group/check-slinky/s/std/src/main/scala/typingsSlinky/std/SVGElementTagNameMap.scala create mode 100644 importer/src/test/resources/react-transition-group/check/s/std/src/main/scala/typings/std/HTMLElementTagNameMap.scala create mode 100644 importer/src/test/resources/react-transition-group/check/s/std/src/main/scala/typings/std/SVGElementTagNameMap.scala create mode 100644 scalajs/src/main/resources/html.json create mode 100644 scalajs/src/main/resources/svg.json create mode 100644 scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/SlinkyFlavour.scala create mode 100644 scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/SlinkyTagsLoader.scala create mode 100644 scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/SlinkyTypeConversions.scala rename {importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer => utils/src/main/scala/org/scalablytyped/converter/internal}/Json.scala (83%) diff --git a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase3Compile.scala b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase3Compile.scala index bb8598c068..33c3d3b7db 100644 --- a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase3Compile.scala +++ b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Phase3Compile.scala @@ -59,7 +59,7 @@ class Phase3Compile( _lib match { case Facade => - val buildJson = Json[FacadeJson](source.path / "build.json") + val buildJson = Json.force[FacadeJson](source.path / "build.json") val dependencies: PhaseRes[Source, Set[Source]] = PhaseRes.sequenceSet( diff --git a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/PhaseFlavour.scala b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/PhaseFlavour.scala index 88007f7d97..ecba20bcf4 100644 --- a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/PhaseFlavour.scala +++ b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/PhaseFlavour.scala @@ -25,15 +25,15 @@ class PhaseFlavour(flavour: FlavourImpl) extends Phase[Source, Phase2Res, Phase2 case lib: LibScalaJs => getDeps((lib.dependencies.keys: Iterable[Source]).to[SortedSet]).map { case Phase2Res.Unpack(deps, _) => - val scope = new TreeScope.Root( + val originalScope = new TreeScope.Root( libName = lib.scalaName, - _dependencies = deps.map { case (_, lib) => lib.scalaName -> lib.packageTree }, + _dependencies = lib.dependencies.map { case (_, lib) => lib.scalaName -> lib.packageTree }, logger = logger, pedantic = false, outputPkg = flavour.outputPkg, ) - val tree = flavour.rewrittenTree(scope, lib.packageTree) + val tree = flavour.rewrittenTree(originalScope, lib.packageTree) LibScalaJs(lib.source)( lib.libName, diff --git a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Source.scala b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Source.scala index 9d33b13030..2b29db0166 100644 --- a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Source.scala +++ b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/Source.scala @@ -118,7 +118,7 @@ object Source { import jsonCodecs._ val typingsJsonPath = fromFolder.folder.path / os.RelPath(path) - val typingsJson = Json[TypingsJson](typingsJsonPath) + val typingsJson = Json.force[TypingsJson](typingsJsonPath) IArray(InFile(typingsJsonPath / os.up / typingsJson.main)) case _ => Empty } diff --git a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/flavourImpl.scala b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/flavourImpl.scala index 2e90e54865..270b8dcc18 100644 --- a/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/flavourImpl.scala +++ b/importer-portable/src/main/scala/org/scalablytyped/converter/internal/importer/flavourImpl.scala @@ -2,7 +2,7 @@ package org.scalablytyped.converter.internal.importer import org.scalablytyped.converter.Flavour import org.scalablytyped.converter.internal.scalajs.Name -import org.scalablytyped.converter.internal.scalajs.flavours.FlavourImpl +import org.scalablytyped.converter.internal.scalajs.flavours.{FlavourImpl, SlinkyFlavour} object flavourImpl { def apply( @@ -18,7 +18,7 @@ object flavourImpl { outputPkg = outputPackage, ) case Flavour.Slinky => - FlavourImpl.Slinky(outputPkg = outputPackage) + SlinkyFlavour(outputPkg = outputPackage) case Flavour.SlinkyNative => FlavourImpl.SlinkyNative(outputPkg = outputPackage) case Flavour.Japgolly => diff --git a/importer/src/main/scala/org/scalablytyped/converter/internal/importer/Ci.scala b/importer/src/main/scala/org/scalablytyped/converter/internal/importer/Ci.scala index 7e83f22ee6..7f215aa766 100644 --- a/importer/src/main/scala/org/scalablytyped/converter/internal/importer/Ci.scala +++ b/importer/src/main/scala/org/scalablytyped/converter/internal/importer/Ci.scala @@ -259,7 +259,7 @@ class Ci(config: Ci.Config, paths: Ci.Paths) { val externalsFolderF: Future[InFolder] = dtFolderF.map { dtFolder => val external: NotNeededPackages = - Json[NotNeededPackages](dtFolder.path / os.up / "notNeededPackages.json") + Json.force[NotNeededPackages](dtFolder.path / os.up / "notNeededPackages.json") UpToDateExternals( interfaceLogger, @@ -407,7 +407,7 @@ target/ val summaryFile = targetFolder / Summary.path val formattedDiff: String = { - val existingOpt = Try(Json[Summary](summaryFile)).toOption + val existingOpt = Try(Json.force[Summary](summaryFile)).toOption val diff = Summary.diff(BuildInfo.gitSha.take(6), existingOpt, summary) Json.persist(summaryFile)(summary) Summary.formatDiff(diff) diff --git a/importer/src/main/scala/org/scalablytyped/converter/internal/importer/documentation/NpmjsFetcher.scala b/importer/src/main/scala/org/scalablytyped/converter/internal/importer/documentation/NpmjsFetcher.scala index 9858a8e6ca..823848b229 100644 --- a/importer/src/main/scala/org/scalablytyped/converter/internal/importer/documentation/NpmjsFetcher.scala +++ b/importer/src/main/scala/org/scalablytyped/converter/internal/importer/documentation/NpmjsFetcher.scala @@ -1,12 +1,12 @@ -package org.scalablytyped.converter.internal.importer.documentation +package org.scalablytyped.converter.internal +package importer +package documentation import java.nio.file.Path import com.olvind.logging.Logger import gigahorse.HttpClient import gigahorse.support.okhttp.Gigahorse -import org.scalablytyped.converter.internal.files -import org.scalablytyped.converter.internal.importer.{Json, Source} import org.scalablytyped.converter.internal.stringUtils.encodeURIComponent import org.scalablytyped.converter.internal.ts.TsIdentLibrarySimple diff --git a/importer/src/test/resources/material-ui/check-japgolly/m/material-ui/build.sbt b/importer/src/test/resources/material-ui/check-japgolly/m/material-ui/build.sbt index 98b112347e..4995b1de56 100644 --- a/importer/src/test/resources/material-ui/check-japgolly/m/material-ui/build.sbt +++ b/importer/src/test/resources/material-ui/check-japgolly/m/material-ui/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "material-ui" -version := "0.0-unknown-089c9b" +version := "0.0-unknown-2ae586" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "0.0-unknown-129a34", - "org.scalablytyped" %%% "std" % "0.0-unknown-c1e19b") + "org.scalablytyped" %%% "react" % "0.0-unknown-965b10", + "org.scalablytyped" %%% "std" % "0.0-unknown-5a59ff") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/material-ui/check-japgolly/r/react/build.sbt b/importer/src/test/resources/material-ui/check-japgolly/r/react/build.sbt index 5eba89b598..64c6a1a98f 100644 --- a/importer/src/test/resources/material-ui/check-japgolly/r/react/build.sbt +++ b/importer/src/test/resources/material-ui/check-japgolly/r/react/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react" -version := "0.0-unknown-129a34" +version := "0.0-unknown-965b10" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "std" % "0.0-unknown-c1e19b") + "org.scalablytyped" %%% "std" % "0.0-unknown-5a59ff") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/material-ui/check-japgolly/s/std/build.sbt b/importer/src/test/resources/material-ui/check-japgolly/s/std/build.sbt index c833208932..fdb03a3c32 100644 --- a/importer/src/test/resources/material-ui/check-japgolly/s/std/build.sbt +++ b/importer/src/test/resources/material-ui/check-japgolly/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-c1e19b" +version := "0.0-unknown-5a59ff" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/material-ui/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/HTMLElementTagNameMap.scala b/importer/src/test/resources/material-ui/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/HTMLElementTagNameMap.scala new file mode 100644 index 0000000000..154708d327 --- /dev/null +++ b/importer/src/test/resources/material-ui/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/HTMLElementTagNameMap.scala @@ -0,0 +1,34 @@ +package typingsJapgolly.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait HTMLElementTagNameMap extends js.Object { + var a: org.scalajs.dom.raw.HTMLAnchorElement = js.native + var abbr: org.scalajs.dom.raw.HTMLElement = js.native + var address: org.scalajs.dom.raw.HTMLElement = js.native + var area: org.scalajs.dom.raw.HTMLAreaElement = js.native + var article: org.scalajs.dom.raw.HTMLElement = js.native + var aside: org.scalajs.dom.raw.HTMLElement = js.native + var audio: org.scalajs.dom.raw.HTMLAudioElement = js.native +} + +object HTMLElementTagNameMap { + @scala.inline + def apply( + a: org.scalajs.dom.raw.HTMLAnchorElement, + abbr: org.scalajs.dom.raw.HTMLElement, + address: org.scalajs.dom.raw.HTMLElement, + area: org.scalajs.dom.raw.HTMLAreaElement, + article: org.scalajs.dom.raw.HTMLElement, + aside: org.scalajs.dom.raw.HTMLElement, + audio: org.scalajs.dom.raw.HTMLAudioElement + ): HTMLElementTagNameMap = { + val __obj = js.Dynamic.literal(a = a.asInstanceOf[js.Any], abbr = abbr.asInstanceOf[js.Any], address = address.asInstanceOf[js.Any], area = area.asInstanceOf[js.Any], article = article.asInstanceOf[js.Any], aside = aside.asInstanceOf[js.Any], audio = audio.asInstanceOf[js.Any]) + + __obj.asInstanceOf[HTMLElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/material-ui/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/SVGElementTagNameMap.scala b/importer/src/test/resources/material-ui/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/SVGElementTagNameMap.scala new file mode 100644 index 0000000000..a05b5c1a4b --- /dev/null +++ b/importer/src/test/resources/material-ui/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/SVGElementTagNameMap.scala @@ -0,0 +1,20 @@ +package typingsJapgolly.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait SVGElementTagNameMap extends js.Object { + var circle: org.scalajs.dom.raw.SVGCircleElement = js.native +} + +object SVGElementTagNameMap { + @scala.inline + def apply(circle: org.scalajs.dom.raw.SVGCircleElement): SVGElementTagNameMap = { + val __obj = js.Dynamic.literal(circle = circle.asInstanceOf[js.Any]) + + __obj.asInstanceOf[SVGElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/material-ui/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/package.scala b/importer/src/test/resources/material-ui/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/package.scala index 47b5c32966..abe66b498d 100644 --- a/importer/src/test/resources/material-ui/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/package.scala +++ b/importer/src/test/resources/material-ui/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/package.scala @@ -6,6 +6,10 @@ import scala.scalajs.js.annotation._ package object std { type Element = org.scalajs.dom.raw.Node + type HTMLAnchorElement = org.scalajs.dom.raw.Element + type HTMLAreaElement = org.scalajs.dom.raw.Element + type HTMLAudioElement = org.scalajs.dom.raw.Element type HTMLElement = org.scalajs.dom.raw.Element type Partial[T] = T + type SVGCircleElement = org.scalajs.dom.raw.Element } diff --git a/importer/src/test/resources/material-ui/check-slinky/m/material-ui/build.sbt b/importer/src/test/resources/material-ui/check-slinky/m/material-ui/build.sbt index ce2cebdfd1..d0a618e6a9 100644 --- a/importer/src/test/resources/material-ui/check-slinky/m/material-ui/build.sbt +++ b/importer/src/test/resources/material-ui/check-slinky/m/material-ui/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "material-ui" -version := "0.0-unknown-09f9f7" +version := "0.0-unknown-2499f4" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "0.0-unknown-41ab35", - "org.scalablytyped" %%% "std" % "0.0-unknown-dec9c9") + "org.scalablytyped" %%% "react" % "0.0-unknown-44e59c", + "org.scalablytyped" %%% "std" % "0.0-unknown-903f63") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/material-ui/check-slinky/r/react/build.sbt b/importer/src/test/resources/material-ui/check-slinky/r/react/build.sbt index 05df67cd3d..e980b76f55 100644 --- a/importer/src/test/resources/material-ui/check-slinky/r/react/build.sbt +++ b/importer/src/test/resources/material-ui/check-slinky/r/react/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react" -version := "0.0-unknown-41ab35" +version := "0.0-unknown-44e59c" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "std" % "0.0-unknown-dec9c9") + "org.scalablytyped" %%% "std" % "0.0-unknown-903f63") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/material-ui/check-slinky/s/std/build.sbt b/importer/src/test/resources/material-ui/check-slinky/s/std/build.sbt index 473901e234..b3b2de9bcb 100644 --- a/importer/src/test/resources/material-ui/check-slinky/s/std/build.sbt +++ b/importer/src/test/resources/material-ui/check-slinky/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-dec9c9" +version := "0.0-unknown-903f63" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/material-ui/check-slinky/s/std/src/main/scala/typingsSlinky/std/HTMLElementTagNameMap.scala b/importer/src/test/resources/material-ui/check-slinky/s/std/src/main/scala/typingsSlinky/std/HTMLElementTagNameMap.scala new file mode 100644 index 0000000000..1e76b4da18 --- /dev/null +++ b/importer/src/test/resources/material-ui/check-slinky/s/std/src/main/scala/typingsSlinky/std/HTMLElementTagNameMap.scala @@ -0,0 +1,34 @@ +package typingsSlinky.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait HTMLElementTagNameMap extends js.Object { + var a: org.scalajs.dom.raw.HTMLAnchorElement = js.native + var abbr: org.scalajs.dom.raw.HTMLElement = js.native + var address: org.scalajs.dom.raw.HTMLElement = js.native + var area: org.scalajs.dom.raw.HTMLAreaElement = js.native + var article: org.scalajs.dom.raw.HTMLElement = js.native + var aside: org.scalajs.dom.raw.HTMLElement = js.native + var audio: org.scalajs.dom.raw.HTMLAudioElement = js.native +} + +object HTMLElementTagNameMap { + @scala.inline + def apply( + a: org.scalajs.dom.raw.HTMLAnchorElement, + abbr: org.scalajs.dom.raw.HTMLElement, + address: org.scalajs.dom.raw.HTMLElement, + area: org.scalajs.dom.raw.HTMLAreaElement, + article: org.scalajs.dom.raw.HTMLElement, + aside: org.scalajs.dom.raw.HTMLElement, + audio: org.scalajs.dom.raw.HTMLAudioElement + ): HTMLElementTagNameMap = { + val __obj = js.Dynamic.literal(a = a.asInstanceOf[js.Any], abbr = abbr.asInstanceOf[js.Any], address = address.asInstanceOf[js.Any], area = area.asInstanceOf[js.Any], article = article.asInstanceOf[js.Any], aside = aside.asInstanceOf[js.Any], audio = audio.asInstanceOf[js.Any]) + + __obj.asInstanceOf[HTMLElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/material-ui/check-slinky/s/std/src/main/scala/typingsSlinky/std/SVGElementTagNameMap.scala b/importer/src/test/resources/material-ui/check-slinky/s/std/src/main/scala/typingsSlinky/std/SVGElementTagNameMap.scala new file mode 100644 index 0000000000..904ccf916f --- /dev/null +++ b/importer/src/test/resources/material-ui/check-slinky/s/std/src/main/scala/typingsSlinky/std/SVGElementTagNameMap.scala @@ -0,0 +1,20 @@ +package typingsSlinky.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait SVGElementTagNameMap extends js.Object { + var circle: org.scalajs.dom.raw.SVGCircleElement = js.native +} + +object SVGElementTagNameMap { + @scala.inline + def apply(circle: org.scalajs.dom.raw.SVGCircleElement): SVGElementTagNameMap = { + val __obj = js.Dynamic.literal(circle = circle.asInstanceOf[js.Any]) + + __obj.asInstanceOf[SVGElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/material-ui/check-slinky/s/std/src/main/scala/typingsSlinky/std/package.scala b/importer/src/test/resources/material-ui/check-slinky/s/std/src/main/scala/typingsSlinky/std/package.scala index 638451868d..aceb30b2d9 100644 --- a/importer/src/test/resources/material-ui/check-slinky/s/std/src/main/scala/typingsSlinky/std/package.scala +++ b/importer/src/test/resources/material-ui/check-slinky/s/std/src/main/scala/typingsSlinky/std/package.scala @@ -6,6 +6,10 @@ import scala.scalajs.js.annotation._ package object std { type Element = org.scalajs.dom.raw.Node + type HTMLAnchorElement = org.scalajs.dom.raw.Element + type HTMLAreaElement = org.scalajs.dom.raw.Element + type HTMLAudioElement = org.scalajs.dom.raw.Element type HTMLElement = org.scalajs.dom.raw.Element type Partial[T] = T + type SVGCircleElement = org.scalajs.dom.raw.Element } diff --git a/importer/src/test/resources/material-ui/check/m/material-ui/build.sbt b/importer/src/test/resources/material-ui/check/m/material-ui/build.sbt index 6e82ce2547..65cee70e28 100644 --- a/importer/src/test/resources/material-ui/check/m/material-ui/build.sbt +++ b/importer/src/test/resources/material-ui/check/m/material-ui/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "material-ui" -version := "0.0-unknown-81182e" +version := "0.0-unknown-2b6d65" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "0.0-unknown-cf0283", - "org.scalablytyped" %%% "std" % "0.0-unknown-b9ee21") + "org.scalablytyped" %%% "react" % "0.0-unknown-613a91", + "org.scalablytyped" %%% "std" % "0.0-unknown-a7aa54") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/material-ui/check/r/react/build.sbt b/importer/src/test/resources/material-ui/check/r/react/build.sbt index 9bac5fb425..1d61c57562 100644 --- a/importer/src/test/resources/material-ui/check/r/react/build.sbt +++ b/importer/src/test/resources/material-ui/check/r/react/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "react" -version := "0.0-unknown-cf0283" +version := "0.0-unknown-613a91" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "std" % "0.0-unknown-b9ee21") + "org.scalablytyped" %%% "std" % "0.0-unknown-a7aa54") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/material-ui/check/s/std/build.sbt b/importer/src/test/resources/material-ui/check/s/std/build.sbt index dae97a4ffe..f9c433c23c 100644 --- a/importer/src/test/resources/material-ui/check/s/std/build.sbt +++ b/importer/src/test/resources/material-ui/check/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-b9ee21" +version := "0.0-unknown-a7aa54" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/material-ui/check/s/std/src/main/scala/typings/std/HTMLElementTagNameMap.scala b/importer/src/test/resources/material-ui/check/s/std/src/main/scala/typings/std/HTMLElementTagNameMap.scala new file mode 100644 index 0000000000..e88544bdd0 --- /dev/null +++ b/importer/src/test/resources/material-ui/check/s/std/src/main/scala/typings/std/HTMLElementTagNameMap.scala @@ -0,0 +1,34 @@ +package typings.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait HTMLElementTagNameMap extends js.Object { + var a: HTMLAnchorElement = js.native + var abbr: HTMLElement = js.native + var address: HTMLElement = js.native + var area: HTMLAreaElement = js.native + var article: HTMLElement = js.native + var aside: HTMLElement = js.native + var audio: HTMLAudioElement = js.native +} + +object HTMLElementTagNameMap { + @scala.inline + def apply( + a: HTMLAnchorElement, + abbr: HTMLElement, + address: HTMLElement, + area: HTMLAreaElement, + article: HTMLElement, + aside: HTMLElement, + audio: HTMLAudioElement + ): HTMLElementTagNameMap = { + val __obj = js.Dynamic.literal(a = a.asInstanceOf[js.Any], abbr = abbr.asInstanceOf[js.Any], address = address.asInstanceOf[js.Any], area = area.asInstanceOf[js.Any], article = article.asInstanceOf[js.Any], aside = aside.asInstanceOf[js.Any], audio = audio.asInstanceOf[js.Any]) + + __obj.asInstanceOf[HTMLElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/material-ui/check/s/std/src/main/scala/typings/std/SVGElementTagNameMap.scala b/importer/src/test/resources/material-ui/check/s/std/src/main/scala/typings/std/SVGElementTagNameMap.scala new file mode 100644 index 0000000000..6148083e33 --- /dev/null +++ b/importer/src/test/resources/material-ui/check/s/std/src/main/scala/typings/std/SVGElementTagNameMap.scala @@ -0,0 +1,20 @@ +package typings.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait SVGElementTagNameMap extends js.Object { + var circle: SVGCircleElement = js.native +} + +object SVGElementTagNameMap { + @scala.inline + def apply(circle: SVGCircleElement): SVGElementTagNameMap = { + val __obj = js.Dynamic.literal(circle = circle.asInstanceOf[js.Any]) + + __obj.asInstanceOf[SVGElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/material-ui/check/s/std/src/main/scala/typings/std/package.scala b/importer/src/test/resources/material-ui/check/s/std/src/main/scala/typings/std/package.scala index c012eee2f7..644edbc9a4 100644 --- a/importer/src/test/resources/material-ui/check/s/std/src/main/scala/typings/std/package.scala +++ b/importer/src/test/resources/material-ui/check/s/std/src/main/scala/typings/std/package.scala @@ -6,6 +6,10 @@ import scala.scalajs.js.annotation._ package object std { type Element = typings.std.Node + type HTMLAnchorElement = typings.std.Element + type HTMLAreaElement = typings.std.Element + type HTMLAudioElement = typings.std.Element type HTMLElement = typings.std.Element type Partial[T] = T + type SVGCircleElement = typings.std.Element } diff --git a/importer/src/test/resources/material-ui/in/stdlib.d.ts b/importer/src/test/resources/material-ui/in/stdlib.d.ts index a6fe2a1a36..6aee2f417d 100644 --- a/importer/src/test/resources/material-ui/in/stdlib.d.ts +++ b/importer/src/test/resources/material-ui/in/stdlib.d.ts @@ -4,6 +4,25 @@ interface Array {} interface Node{} interface Element extends Node {} interface HTMLElement extends Element {} +interface HTMLAnchorElement extends Element {} +interface HTMLAreaElement extends Element {} +interface HTMLAudioElement extends Element {} +interface SVGCircleElement extends Element {} + declare interface Function {} -declare type Partial = T; \ No newline at end of file +declare type Partial = T; + +interface HTMLElementTagNameMap { + "a": HTMLAnchorElement; + "abbr": HTMLElement; + "address": HTMLElement; + "area": HTMLAreaElement; + "article": HTMLElement; + "aside": HTMLElement; + "audio": HTMLAudioElement; +} + +interface SVGElementTagNameMap { + "circle": SVGCircleElement; +} diff --git a/importer/src/test/resources/react-icons/check/r/react-icons/build.sbt b/importer/src/test/resources/react-icons/check/r/react-icons/build.sbt index fdf975c4b8..58f732e0e1 100644 --- a/importer/src/test/resources/react-icons/check/r/react-icons/build.sbt +++ b/importer/src/test/resources/react-icons/check/r/react-icons/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "react-icons" -version := "2.2-34ec13" +version := "2.2-4f1fe7" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-icons/check/r/react-icons/src/main/scala/typings/reactIcons/reactIconsProps.scala b/importer/src/test/resources/react-icons/check/r/react-icons/src/main/scala/typings/reactIcons/reactIconsProps.scala index 40b0c6b507..f59dd61cd3 100644 --- a/importer/src/test/resources/react-icons/check/r/react-icons/src/main/scala/typings/reactIcons/reactIconsProps.scala +++ b/importer/src/test/resources/react-icons/check/r/react-icons/src/main/scala/typings/reactIcons/reactIconsProps.scala @@ -6,23 +6,11 @@ import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ trait reactIconsProps { - @scala.inline - def `500pxProps`: IconBaseProps.type = typings.reactIconBase.mod.IconBaseProps type `500pxProps` = IconBaseProps - @scala.inline - def AdjustProps: IconBaseProps.type = typings.reactIconBase.mod.IconBaseProps type AdjustProps = IconBaseProps - @scala.inline - def AdnProps: IconBaseProps.type = typings.reactIconBase.mod.IconBaseProps type AdnProps = IconBaseProps - @scala.inline - def Fa500pxProps: IconBaseProps.type = typings.reactIconBase.mod.IconBaseProps type Fa500pxProps = IconBaseProps - @scala.inline - def FaAdjustProps: IconBaseProps.type = typings.reactIconBase.mod.IconBaseProps type FaAdjustProps = IconBaseProps - @scala.inline - def FaAdnProps: IconBaseProps.type = typings.reactIconBase.mod.IconBaseProps type FaAdnProps = IconBaseProps } diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt index f8515b15d1..d65dbfc6e7 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/c/componentstest/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "componentstest" -version := "0.0-unknown-45ce70" +version := "0.0-unknown-3b15c5" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-424c14", - "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") + "org.scalablytyped" %%% "react" % "16.9.2-e4ed36", + "org.scalablytyped" %%% "std" % "0.0-unknown-6e7350") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-bootstrap/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-bootstrap/build.sbt index b1c0707e20..4b65dd3914 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-bootstrap/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-bootstrap/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-bootstrap" -version := "0.32-5c459b" +version := "0.32-ac02a7" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-424c14", - "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") + "org.scalablytyped" %%% "react" % "16.9.2-e4ed36", + "org.scalablytyped" %%% "std" % "0.0-unknown-6e7350") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-contextmenu/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-contextmenu/build.sbt index be6e01192a..15401a4e0b 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-contextmenu/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-contextmenu/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-contextmenu" -version := "2.13.0-9f7bb6" +version := "2.13.0-1ab842" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-424c14", - "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") + "org.scalablytyped" %%% "react" % "16.9.2-e4ed36", + "org.scalablytyped" %%% "std" % "0.0-unknown-6e7350") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt index 7dbf877f61..eae25a28b9 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-962a9b" +version := "10.1.10-72c01b" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-424c14", - "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") + "org.scalablytyped" %%% "react" % "16.9.2-e4ed36", + "org.scalablytyped" %%% "std" % "0.0-unknown-6e7350") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/components/ReactDropzone.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/components/ReactDropzone.scala index 9348fdd8ce..36f17451da 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/components/ReactDropzone.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/components/ReactDropzone.scala @@ -5,11 +5,11 @@ import japgolly.scalajs.react.CallbackTo import japgolly.scalajs.react.Key import japgolly.scalajs.react.ReactDragEventFrom import japgolly.scalajs.react.component.JsForwardRef.UnmountedWithRoot +import japgolly.scalajs.react.raw.React.Element import japgolly.scalajs.react.raw.React.Ref import org.scalablytyped.runtime.StringDictionary import org.scalajs.dom.raw.HTMLElement import typingsJapgolly.react.mod.RefAttributes -import typingsJapgolly.react.mod._Global_.JSX.Element import typingsJapgolly.reactDropzone.mod.DropEvent import typingsJapgolly.reactDropzone.mod.DropzoneProps import typingsJapgolly.reactDropzone.mod.DropzoneRef diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/DropzoneProps.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/DropzoneProps.scala index 2b0235258a..a93d02f3d5 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/DropzoneProps.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/DropzoneProps.scala @@ -3,8 +3,8 @@ package typingsJapgolly.reactDropzone.mod import japgolly.scalajs.react.Callback import japgolly.scalajs.react.CallbackTo import japgolly.scalajs.react.ReactDragEventFrom +import japgolly.scalajs.react.raw.React.Element import org.scalajs.dom.raw.HTMLElement -import typingsJapgolly.react.mod._Global_.JSX.Element import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/default.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/default.scala index 1b203fc744..5b1b2a93dc 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/default.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-dropzone/src/main/scala/typingsJapgolly/reactDropzone/mod/default.scala @@ -1,7 +1,7 @@ package typingsJapgolly.reactDropzone.mod +import japgolly.scalajs.react.raw.React.Element import typingsJapgolly.react.mod.RefAttributes -import typingsJapgolly.react.mod._Global_.JSX.Element import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-select/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-select/build.sbt index 33f7234456..257ddbc0d7 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react-select/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react-select/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-select" -version := "0.0-unknown-9aaab6" +version := "0.0-unknown-4f3b6a" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-424c14", - "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") + "org.scalablytyped" %%% "react" % "16.9.2-e4ed36", + "org.scalablytyped" %%% "std" % "0.0-unknown-6e7350") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/build.sbt index 7176dad318..74af6cd41c 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react" -version := "16.9.2-424c14" +version := "16.9.2-e4ed36" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") + "org.scalablytyped" %%% "std" % "0.0-unknown-6e7350") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/AnimationEvent.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/AnimationEvent.scala index e07374dea0..b13e4a1cb5 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/AnimationEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/AnimationEvent.scala @@ -2,6 +2,7 @@ package typingsJapgolly.react.mod import japgolly.scalajs.react.Callback import japgolly.scalajs.react.CallbackTo +import org.scalajs.dom.raw.Event import typingsJapgolly.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -27,7 +28,7 @@ object AnimationEvent { isDefaultPrevented: CallbackTo[Boolean], isPropagationStopped: CallbackTo[Boolean], isTrusted: Boolean, - nativeEvent: NativeAnimationEvent, + nativeEvent: Event, persist: Callback, preventDefault: Callback, pseudoElement: String, diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/ClipboardEvent.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/ClipboardEvent.scala index 51e00c31ef..b6a6b60445 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/ClipboardEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/ClipboardEvent.scala @@ -3,6 +3,7 @@ package typingsJapgolly.react.mod import japgolly.scalajs.react.Callback import japgolly.scalajs.react.CallbackTo import org.scalajs.dom.raw.DataTransfer +import org.scalajs.dom.raw.Event import typingsJapgolly.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -25,7 +26,7 @@ object ClipboardEvent { isDefaultPrevented: CallbackTo[Boolean], isPropagationStopped: CallbackTo[Boolean], isTrusted: Boolean, - nativeEvent: NativeClipboardEvent, + nativeEvent: Event, persist: Callback, preventDefault: Callback, stopPropagation: Callback, diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/CompositionEvent.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/CompositionEvent.scala index a61e6b64d5..2460a142c6 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/CompositionEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/CompositionEvent.scala @@ -2,6 +2,7 @@ package typingsJapgolly.react.mod import japgolly.scalajs.react.Callback import japgolly.scalajs.react.CallbackTo +import org.scalajs.dom.raw.Event import typingsJapgolly.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -24,7 +25,7 @@ object CompositionEvent { isDefaultPrevented: CallbackTo[Boolean], isPropagationStopped: CallbackTo[Boolean], isTrusted: Boolean, - nativeEvent: NativeCompositionEvent, + nativeEvent: Event, persist: Callback, preventDefault: Callback, stopPropagation: Callback, diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/DragEvent.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/DragEvent.scala index e42868f780..667e1ac37b 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/DragEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/DragEvent.scala @@ -3,6 +3,7 @@ package typingsJapgolly.react.mod import japgolly.scalajs.react.Callback import japgolly.scalajs.react.CallbackTo import org.scalajs.dom.raw.DataTransfer +import org.scalajs.dom.raw.Event import org.scalajs.dom.raw.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -35,7 +36,7 @@ object DragEvent { metaKey: Boolean, movementX: Double, movementY: Double, - nativeEvent: NativeDragEvent, + nativeEvent: Event, pageX: Double, pageY: Double, persist: Callback, diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/FocusEvent.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/FocusEvent.scala index 51c02f3f99..2a37c4974a 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/FocusEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/FocusEvent.scala @@ -2,6 +2,7 @@ package typingsJapgolly.react.mod import japgolly.scalajs.react.Callback import japgolly.scalajs.react.CallbackTo +import org.scalajs.dom.raw.Event import typingsJapgolly.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -25,7 +26,7 @@ object FocusEvent { isDefaultPrevented: CallbackTo[Boolean], isPropagationStopped: CallbackTo[Boolean], isTrusted: Boolean, - nativeEvent: NativeFocusEvent, + nativeEvent: Event, persist: Callback, preventDefault: Callback, relatedTarget: org.scalajs.dom.raw.EventTarget, diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/KeyboardEvent.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/KeyboardEvent.scala index 41f7c42fec..c5e8559b74 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/KeyboardEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/KeyboardEvent.scala @@ -2,6 +2,7 @@ package typingsJapgolly.react.mod import japgolly.scalajs.react.Callback import japgolly.scalajs.react.CallbackTo +import org.scalajs.dom.raw.Event import typingsJapgolly.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -49,7 +50,7 @@ object KeyboardEvent { locale: String, location: Double, metaKey: Boolean, - nativeEvent: NativeKeyboardEvent, + nativeEvent: Event, persist: Callback, preventDefault: Callback, repeat: Boolean, diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/PointerEvent.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/PointerEvent.scala index fd300afd57..edea54c80b 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/PointerEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/PointerEvent.scala @@ -2,6 +2,7 @@ package typingsJapgolly.react.mod import japgolly.scalajs.react.Callback import japgolly.scalajs.react.CallbackTo +import org.scalajs.dom.raw.Event import org.scalajs.dom.raw.EventTarget import typingsJapgolly.react.reactStrings.mouse import typingsJapgolly.react.reactStrings.pen @@ -45,7 +46,7 @@ object PointerEvent { metaKey: Boolean, movementX: Double, movementY: Double, - nativeEvent: NativePointerEvent, + nativeEvent: Event, pageX: Double, pageY: Double, persist: Callback, diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/ReactDOM.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/ReactDOM.scala index 693646c330..9eaa3651e5 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/ReactDOM.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/ReactDOM.scala @@ -1,5 +1,6 @@ package typingsJapgolly.react.mod +import org.scalajs.dom.raw.Element import org.scalajs.dom.raw.HTMLAnchorElement import org.scalajs.dom.raw.HTMLAreaElement import org.scalajs.dom.raw.HTMLAudioElement @@ -52,12 +53,6 @@ import org.scalajs.dom.raw.HTMLTitleElement import org.scalajs.dom.raw.HTMLTrackElement import org.scalajs.dom.raw.HTMLUListElement import org.scalajs.dom.raw.HTMLVideoElement -import typingsJapgolly.std.HTMLDataElement -import typingsJapgolly.std.HTMLDialogElement -import typingsJapgolly.std.HTMLTableDataCellElement -import typingsJapgolly.std.HTMLTableHeaderCellElement -import typingsJapgolly.std.HTMLTemplateElement -import typingsJapgolly.std.HTMLWebViewElement import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @@ -95,7 +90,7 @@ object ReactDOM { code: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], col: DetailedHTMLFactory[ColHTMLAttributes[HTMLTableColElement], HTMLTableColElement], colgroup: DetailedHTMLFactory[ColgroupHTMLAttributes[HTMLTableColElement], HTMLTableColElement], - data: DetailedHTMLFactory[DataHTMLAttributes[HTMLDataElement], HTMLDataElement], + data: DetailedHTMLFactory[DataHTMLAttributes[Element], Element], datalist: DetailedHTMLFactory[HTMLAttributes[HTMLDataListElement], HTMLDataListElement], dd: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], defs: SVGFactory, @@ -103,7 +98,7 @@ object ReactDOM { desc: SVGFactory, details: DetailedHTMLFactory[DetailsHTMLAttributes[HTMLElement], HTMLElement], dfn: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], - dialog: DetailedHTMLFactory[DialogHTMLAttributes[HTMLDialogElement], HTMLDialogElement], + dialog: DetailedHTMLFactory[DialogHTMLAttributes[Element], Element], div: DetailedHTMLFactory[HTMLAttributes[HTMLDivElement], HTMLDivElement], dl: DetailedHTMLFactory[HTMLAttributes[HTMLDListElement], HTMLDListElement], dt: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], @@ -219,13 +214,13 @@ object ReactDOM { symbol: SVGFactory, table: DetailedHTMLFactory[TableHTMLAttributes[HTMLTableElement], HTMLTableElement], tbody: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], - td: DetailedHTMLFactory[TdHTMLAttributes[HTMLTableDataCellElement], HTMLTableDataCellElement], - template: DetailedHTMLFactory[HTMLAttributes[HTMLTemplateElement], HTMLTemplateElement], + td: DetailedHTMLFactory[TdHTMLAttributes[Element], Element], + template: DetailedHTMLFactory[HTMLAttributes[Element], Element], text: SVGFactory, textPath: SVGFactory, textarea: DetailedHTMLFactory[TextareaHTMLAttributes[HTMLTextAreaElement], HTMLTextAreaElement], tfoot: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], - th: DetailedHTMLFactory[ThHTMLAttributes[HTMLTableHeaderCellElement], HTMLTableHeaderCellElement], + th: DetailedHTMLFactory[ThHTMLAttributes[Element], Element], thead: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], time: DetailedHTMLFactory[TimeHTMLAttributes[HTMLElement], HTMLElement], title: DetailedHTMLFactory[HTMLAttributes[HTMLTitleElement], HTMLTitleElement], @@ -239,7 +234,7 @@ object ReactDOM { video: DetailedHTMLFactory[VideoHTMLAttributes[HTMLVideoElement], HTMLVideoElement], view: SVGFactory, wbr: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], - webview: DetailedHTMLFactory[WebViewHTMLAttributes[HTMLWebViewElement], HTMLWebViewElement] + webview: DetailedHTMLFactory[WebViewHTMLAttributes[Element], Element] ): ReactDOM = { val __obj = js.Dynamic.literal(a = a.asInstanceOf[js.Any], abbr = abbr.asInstanceOf[js.Any], address = address.asInstanceOf[js.Any], animate = animate.asInstanceOf[js.Any], area = area.asInstanceOf[js.Any], article = article.asInstanceOf[js.Any], aside = aside.asInstanceOf[js.Any], audio = audio.asInstanceOf[js.Any], b = b.asInstanceOf[js.Any], base = base.asInstanceOf[js.Any], bdi = bdi.asInstanceOf[js.Any], bdo = bdo.asInstanceOf[js.Any], big = big.asInstanceOf[js.Any], blockquote = blockquote.asInstanceOf[js.Any], body = body.asInstanceOf[js.Any], br = br.asInstanceOf[js.Any], button = button.asInstanceOf[js.Any], canvas = canvas.asInstanceOf[js.Any], caption = caption.asInstanceOf[js.Any], circle = circle.asInstanceOf[js.Any], cite = cite.asInstanceOf[js.Any], clipPath = clipPath.asInstanceOf[js.Any], code = code.asInstanceOf[js.Any], col = col.asInstanceOf[js.Any], colgroup = colgroup.asInstanceOf[js.Any], data = data.asInstanceOf[js.Any], datalist = datalist.asInstanceOf[js.Any], dd = dd.asInstanceOf[js.Any], defs = defs.asInstanceOf[js.Any], del = del.asInstanceOf[js.Any], desc = desc.asInstanceOf[js.Any], details = details.asInstanceOf[js.Any], dfn = dfn.asInstanceOf[js.Any], dialog = dialog.asInstanceOf[js.Any], div = div.asInstanceOf[js.Any], dl = dl.asInstanceOf[js.Any], dt = dt.asInstanceOf[js.Any], ellipse = ellipse.asInstanceOf[js.Any], em = em.asInstanceOf[js.Any], embed = embed.asInstanceOf[js.Any], feBlend = feBlend.asInstanceOf[js.Any], feColorMatrix = feColorMatrix.asInstanceOf[js.Any], feComponentTransfer = feComponentTransfer.asInstanceOf[js.Any], feComposite = feComposite.asInstanceOf[js.Any], feConvolveMatrix = feConvolveMatrix.asInstanceOf[js.Any], feDiffuseLighting = feDiffuseLighting.asInstanceOf[js.Any], feDisplacementMap = feDisplacementMap.asInstanceOf[js.Any], feDistantLight = feDistantLight.asInstanceOf[js.Any], feDropShadow = feDropShadow.asInstanceOf[js.Any], feFlood = feFlood.asInstanceOf[js.Any], feFuncA = feFuncA.asInstanceOf[js.Any], feFuncB = feFuncB.asInstanceOf[js.Any], feFuncG = feFuncG.asInstanceOf[js.Any], feFuncR = feFuncR.asInstanceOf[js.Any], feGaussianBlur = feGaussianBlur.asInstanceOf[js.Any], feImage = feImage.asInstanceOf[js.Any], feMerge = feMerge.asInstanceOf[js.Any], feMergeNode = feMergeNode.asInstanceOf[js.Any], feMorphology = feMorphology.asInstanceOf[js.Any], feOffset = feOffset.asInstanceOf[js.Any], fePointLight = fePointLight.asInstanceOf[js.Any], feSpecularLighting = feSpecularLighting.asInstanceOf[js.Any], feSpotLight = feSpotLight.asInstanceOf[js.Any], feTile = feTile.asInstanceOf[js.Any], feTurbulence = feTurbulence.asInstanceOf[js.Any], fieldset = fieldset.asInstanceOf[js.Any], figcaption = figcaption.asInstanceOf[js.Any], figure = figure.asInstanceOf[js.Any], filter = filter.asInstanceOf[js.Any], footer = footer.asInstanceOf[js.Any], foreignObject = foreignObject.asInstanceOf[js.Any], form = form.asInstanceOf[js.Any], g = g.asInstanceOf[js.Any], h1 = h1.asInstanceOf[js.Any], h2 = h2.asInstanceOf[js.Any], h3 = h3.asInstanceOf[js.Any], h4 = h4.asInstanceOf[js.Any], h5 = h5.asInstanceOf[js.Any], h6 = h6.asInstanceOf[js.Any], head = head.asInstanceOf[js.Any], header = header.asInstanceOf[js.Any], hgroup = hgroup.asInstanceOf[js.Any], hr = hr.asInstanceOf[js.Any], html = html.asInstanceOf[js.Any], i = i.asInstanceOf[js.Any], iframe = iframe.asInstanceOf[js.Any], image = image.asInstanceOf[js.Any], img = img.asInstanceOf[js.Any], input = input.asInstanceOf[js.Any], ins = ins.asInstanceOf[js.Any], kbd = kbd.asInstanceOf[js.Any], keygen = keygen.asInstanceOf[js.Any], label = label.asInstanceOf[js.Any], legend = legend.asInstanceOf[js.Any], li = li.asInstanceOf[js.Any], line = line.asInstanceOf[js.Any], linearGradient = linearGradient.asInstanceOf[js.Any], link = link.asInstanceOf[js.Any], main = main.asInstanceOf[js.Any], map = map.asInstanceOf[js.Any], mark = mark.asInstanceOf[js.Any], marker = marker.asInstanceOf[js.Any], mask = mask.asInstanceOf[js.Any], menu = menu.asInstanceOf[js.Any], menuitem = menuitem.asInstanceOf[js.Any], meta = meta.asInstanceOf[js.Any], metadata = metadata.asInstanceOf[js.Any], meter = meter.asInstanceOf[js.Any], nav = nav.asInstanceOf[js.Any], noscript = noscript.asInstanceOf[js.Any], ol = ol.asInstanceOf[js.Any], optgroup = optgroup.asInstanceOf[js.Any], option = option.asInstanceOf[js.Any], output = output.asInstanceOf[js.Any], p = p.asInstanceOf[js.Any], param = param.asInstanceOf[js.Any], path = path.asInstanceOf[js.Any], pattern = pattern.asInstanceOf[js.Any], picture = picture.asInstanceOf[js.Any], polygon = polygon.asInstanceOf[js.Any], polyline = polyline.asInstanceOf[js.Any], pre = pre.asInstanceOf[js.Any], progress = progress.asInstanceOf[js.Any], q = q.asInstanceOf[js.Any], radialGradient = radialGradient.asInstanceOf[js.Any], rect = rect.asInstanceOf[js.Any], rp = rp.asInstanceOf[js.Any], rt = rt.asInstanceOf[js.Any], ruby = ruby.asInstanceOf[js.Any], s = s.asInstanceOf[js.Any], samp = samp.asInstanceOf[js.Any], script = script.asInstanceOf[js.Any], section = section.asInstanceOf[js.Any], select = select.asInstanceOf[js.Any], small = small.asInstanceOf[js.Any], source = source.asInstanceOf[js.Any], span = span.asInstanceOf[js.Any], stop = stop.asInstanceOf[js.Any], strong = strong.asInstanceOf[js.Any], style = style.asInstanceOf[js.Any], sub = sub.asInstanceOf[js.Any], summary = summary.asInstanceOf[js.Any], sup = sup.asInstanceOf[js.Any], svg = svg.asInstanceOf[js.Any], switch = switch.asInstanceOf[js.Any], symbol = symbol.asInstanceOf[js.Any], table = table.asInstanceOf[js.Any], tbody = tbody.asInstanceOf[js.Any], td = td.asInstanceOf[js.Any], template = template.asInstanceOf[js.Any], text = text.asInstanceOf[js.Any], textPath = textPath.asInstanceOf[js.Any], textarea = textarea.asInstanceOf[js.Any], tfoot = tfoot.asInstanceOf[js.Any], th = th.asInstanceOf[js.Any], thead = thead.asInstanceOf[js.Any], time = time.asInstanceOf[js.Any], title = title.asInstanceOf[js.Any], tr = tr.asInstanceOf[js.Any], track = track.asInstanceOf[js.Any], tspan = tspan.asInstanceOf[js.Any], u = u.asInstanceOf[js.Any], ul = ul.asInstanceOf[js.Any], use = use.asInstanceOf[js.Any], video = video.asInstanceOf[js.Any], view = view.asInstanceOf[js.Any], wbr = wbr.asInstanceOf[js.Any], webview = webview.asInstanceOf[js.Any]) __obj.updateDynamic("object")(`object`.asInstanceOf[js.Any]) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/ReactHTML.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/ReactHTML.scala index a0a81f479b..3ad35e36d3 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/ReactHTML.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/ReactHTML.scala @@ -1,5 +1,6 @@ package typingsJapgolly.react.mod +import org.scalajs.dom.raw.Element import org.scalajs.dom.raw.HTMLAnchorElement import org.scalajs.dom.raw.HTMLAreaElement import org.scalajs.dom.raw.HTMLAudioElement @@ -52,12 +53,6 @@ import org.scalajs.dom.raw.HTMLTitleElement import org.scalajs.dom.raw.HTMLTrackElement import org.scalajs.dom.raw.HTMLUListElement import org.scalajs.dom.raw.HTMLVideoElement -import typingsJapgolly.std.HTMLDataElement -import typingsJapgolly.std.HTMLDialogElement -import typingsJapgolly.std.HTMLTableDataCellElement -import typingsJapgolly.std.HTMLTableHeaderCellElement -import typingsJapgolly.std.HTMLTemplateElement -import typingsJapgolly.std.HTMLWebViewElement import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @@ -89,13 +84,13 @@ trait ReactHTML extends js.Object { var code: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement] = js.native var col: DetailedHTMLFactory[ColHTMLAttributes[HTMLTableColElement], HTMLTableColElement] = js.native var colgroup: DetailedHTMLFactory[ColgroupHTMLAttributes[HTMLTableColElement], HTMLTableColElement] = js.native - var data: DetailedHTMLFactory[DataHTMLAttributes[HTMLDataElement], HTMLDataElement] = js.native + var data: DetailedHTMLFactory[DataHTMLAttributes[Element], Element] = js.native var datalist: DetailedHTMLFactory[HTMLAttributes[HTMLDataListElement], HTMLDataListElement] = js.native var dd: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement] = js.native var del: DetailedHTMLFactory[DelHTMLAttributes[HTMLElement], HTMLElement] = js.native var details: DetailedHTMLFactory[DetailsHTMLAttributes[HTMLElement], HTMLElement] = js.native var dfn: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement] = js.native - var dialog: DetailedHTMLFactory[DialogHTMLAttributes[HTMLDialogElement], HTMLDialogElement] = js.native + var dialog: DetailedHTMLFactory[DialogHTMLAttributes[Element], Element] = js.native var div: DetailedHTMLFactory[HTMLAttributes[HTMLDivElement], HTMLDivElement] = js.native var dl: DetailedHTMLFactory[HTMLAttributes[HTMLDListElement], HTMLDListElement] = js.native var dt: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement] = js.native @@ -166,11 +161,11 @@ trait ReactHTML extends js.Object { var sup: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement] = js.native var table: DetailedHTMLFactory[TableHTMLAttributes[HTMLTableElement], HTMLTableElement] = js.native var tbody: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement] = js.native - var td: DetailedHTMLFactory[TdHTMLAttributes[HTMLTableDataCellElement], HTMLTableDataCellElement] = js.native - var template: DetailedHTMLFactory[HTMLAttributes[HTMLTemplateElement], HTMLTemplateElement] = js.native + var td: DetailedHTMLFactory[TdHTMLAttributes[Element], Element] = js.native + var template: DetailedHTMLFactory[HTMLAttributes[Element], Element] = js.native var textarea: DetailedHTMLFactory[TextareaHTMLAttributes[HTMLTextAreaElement], HTMLTextAreaElement] = js.native var tfoot: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement] = js.native - var th: DetailedHTMLFactory[ThHTMLAttributes[HTMLTableHeaderCellElement], HTMLTableHeaderCellElement] = js.native + var th: DetailedHTMLFactory[ThHTMLAttributes[Element], Element] = js.native var thead: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement] = js.native var time: DetailedHTMLFactory[TimeHTMLAttributes[HTMLElement], HTMLElement] = js.native var title: DetailedHTMLFactory[HTMLAttributes[HTMLTitleElement], HTMLTitleElement] = js.native @@ -181,7 +176,7 @@ trait ReactHTML extends js.Object { var `var`: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement] = js.native var video: DetailedHTMLFactory[VideoHTMLAttributes[HTMLVideoElement], HTMLVideoElement] = js.native var wbr: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement] = js.native - var webview: DetailedHTMLFactory[WebViewHTMLAttributes[HTMLWebViewElement], HTMLWebViewElement] = js.native + var webview: DetailedHTMLFactory[WebViewHTMLAttributes[Element], Element] = js.native } object ReactHTML { @@ -209,13 +204,13 @@ object ReactHTML { code: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], col: DetailedHTMLFactory[ColHTMLAttributes[HTMLTableColElement], HTMLTableColElement], colgroup: DetailedHTMLFactory[ColgroupHTMLAttributes[HTMLTableColElement], HTMLTableColElement], - data: DetailedHTMLFactory[DataHTMLAttributes[HTMLDataElement], HTMLDataElement], + data: DetailedHTMLFactory[DataHTMLAttributes[Element], Element], datalist: DetailedHTMLFactory[HTMLAttributes[HTMLDataListElement], HTMLDataListElement], dd: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], del: DetailedHTMLFactory[DelHTMLAttributes[HTMLElement], HTMLElement], details: DetailedHTMLFactory[DetailsHTMLAttributes[HTMLElement], HTMLElement], dfn: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], - dialog: DetailedHTMLFactory[DialogHTMLAttributes[HTMLDialogElement], HTMLDialogElement], + dialog: DetailedHTMLFactory[DialogHTMLAttributes[Element], Element], div: DetailedHTMLFactory[HTMLAttributes[HTMLDivElement], HTMLDivElement], dl: DetailedHTMLFactory[HTMLAttributes[HTMLDListElement], HTMLDListElement], dt: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], @@ -286,11 +281,11 @@ object ReactHTML { sup: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], table: DetailedHTMLFactory[TableHTMLAttributes[HTMLTableElement], HTMLTableElement], tbody: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], - td: DetailedHTMLFactory[TdHTMLAttributes[HTMLTableDataCellElement], HTMLTableDataCellElement], - template: DetailedHTMLFactory[HTMLAttributes[HTMLTemplateElement], HTMLTemplateElement], + td: DetailedHTMLFactory[TdHTMLAttributes[Element], Element], + template: DetailedHTMLFactory[HTMLAttributes[Element], Element], textarea: DetailedHTMLFactory[TextareaHTMLAttributes[HTMLTextAreaElement], HTMLTextAreaElement], tfoot: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], - th: DetailedHTMLFactory[ThHTMLAttributes[HTMLTableHeaderCellElement], HTMLTableHeaderCellElement], + th: DetailedHTMLFactory[ThHTMLAttributes[Element], Element], thead: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], time: DetailedHTMLFactory[TimeHTMLAttributes[HTMLElement], HTMLElement], title: DetailedHTMLFactory[HTMLAttributes[HTMLTitleElement], HTMLTitleElement], @@ -301,7 +296,7 @@ object ReactHTML { `var`: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], video: DetailedHTMLFactory[VideoHTMLAttributes[HTMLVideoElement], HTMLVideoElement], wbr: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], - webview: DetailedHTMLFactory[WebViewHTMLAttributes[HTMLWebViewElement], HTMLWebViewElement] + webview: DetailedHTMLFactory[WebViewHTMLAttributes[Element], Element] ): ReactHTML = { val __obj = js.Dynamic.literal(a = a.asInstanceOf[js.Any], abbr = abbr.asInstanceOf[js.Any], address = address.asInstanceOf[js.Any], area = area.asInstanceOf[js.Any], article = article.asInstanceOf[js.Any], aside = aside.asInstanceOf[js.Any], audio = audio.asInstanceOf[js.Any], b = b.asInstanceOf[js.Any], base = base.asInstanceOf[js.Any], bdi = bdi.asInstanceOf[js.Any], bdo = bdo.asInstanceOf[js.Any], big = big.asInstanceOf[js.Any], blockquote = blockquote.asInstanceOf[js.Any], body = body.asInstanceOf[js.Any], br = br.asInstanceOf[js.Any], button = button.asInstanceOf[js.Any], canvas = canvas.asInstanceOf[js.Any], caption = caption.asInstanceOf[js.Any], cite = cite.asInstanceOf[js.Any], code = code.asInstanceOf[js.Any], col = col.asInstanceOf[js.Any], colgroup = colgroup.asInstanceOf[js.Any], data = data.asInstanceOf[js.Any], datalist = datalist.asInstanceOf[js.Any], dd = dd.asInstanceOf[js.Any], del = del.asInstanceOf[js.Any], details = details.asInstanceOf[js.Any], dfn = dfn.asInstanceOf[js.Any], dialog = dialog.asInstanceOf[js.Any], div = div.asInstanceOf[js.Any], dl = dl.asInstanceOf[js.Any], dt = dt.asInstanceOf[js.Any], em = em.asInstanceOf[js.Any], embed = embed.asInstanceOf[js.Any], fieldset = fieldset.asInstanceOf[js.Any], figcaption = figcaption.asInstanceOf[js.Any], figure = figure.asInstanceOf[js.Any], footer = footer.asInstanceOf[js.Any], form = form.asInstanceOf[js.Any], h1 = h1.asInstanceOf[js.Any], h2 = h2.asInstanceOf[js.Any], h3 = h3.asInstanceOf[js.Any], h4 = h4.asInstanceOf[js.Any], h5 = h5.asInstanceOf[js.Any], h6 = h6.asInstanceOf[js.Any], head = head.asInstanceOf[js.Any], header = header.asInstanceOf[js.Any], hgroup = hgroup.asInstanceOf[js.Any], hr = hr.asInstanceOf[js.Any], html = html.asInstanceOf[js.Any], i = i.asInstanceOf[js.Any], iframe = iframe.asInstanceOf[js.Any], img = img.asInstanceOf[js.Any], input = input.asInstanceOf[js.Any], ins = ins.asInstanceOf[js.Any], kbd = kbd.asInstanceOf[js.Any], keygen = keygen.asInstanceOf[js.Any], label = label.asInstanceOf[js.Any], legend = legend.asInstanceOf[js.Any], li = li.asInstanceOf[js.Any], link = link.asInstanceOf[js.Any], main = main.asInstanceOf[js.Any], map = map.asInstanceOf[js.Any], mark = mark.asInstanceOf[js.Any], menu = menu.asInstanceOf[js.Any], menuitem = menuitem.asInstanceOf[js.Any], meta = meta.asInstanceOf[js.Any], meter = meter.asInstanceOf[js.Any], nav = nav.asInstanceOf[js.Any], noscript = noscript.asInstanceOf[js.Any], ol = ol.asInstanceOf[js.Any], optgroup = optgroup.asInstanceOf[js.Any], option = option.asInstanceOf[js.Any], output = output.asInstanceOf[js.Any], p = p.asInstanceOf[js.Any], param = param.asInstanceOf[js.Any], picture = picture.asInstanceOf[js.Any], pre = pre.asInstanceOf[js.Any], progress = progress.asInstanceOf[js.Any], q = q.asInstanceOf[js.Any], rp = rp.asInstanceOf[js.Any], rt = rt.asInstanceOf[js.Any], ruby = ruby.asInstanceOf[js.Any], s = s.asInstanceOf[js.Any], samp = samp.asInstanceOf[js.Any], script = script.asInstanceOf[js.Any], section = section.asInstanceOf[js.Any], select = select.asInstanceOf[js.Any], small = small.asInstanceOf[js.Any], source = source.asInstanceOf[js.Any], span = span.asInstanceOf[js.Any], strong = strong.asInstanceOf[js.Any], style = style.asInstanceOf[js.Any], sub = sub.asInstanceOf[js.Any], summary = summary.asInstanceOf[js.Any], sup = sup.asInstanceOf[js.Any], table = table.asInstanceOf[js.Any], tbody = tbody.asInstanceOf[js.Any], td = td.asInstanceOf[js.Any], template = template.asInstanceOf[js.Any], textarea = textarea.asInstanceOf[js.Any], tfoot = tfoot.asInstanceOf[js.Any], th = th.asInstanceOf[js.Any], thead = thead.asInstanceOf[js.Any], time = time.asInstanceOf[js.Any], title = title.asInstanceOf[js.Any], tr = tr.asInstanceOf[js.Any], track = track.asInstanceOf[js.Any], u = u.asInstanceOf[js.Any], ul = ul.asInstanceOf[js.Any], video = video.asInstanceOf[js.Any], wbr = wbr.asInstanceOf[js.Any], webview = webview.asInstanceOf[js.Any]) __obj.updateDynamic("object")(`object`.asInstanceOf[js.Any]) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/TouchEvent.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/TouchEvent.scala index 37847a5524..487fd63539 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/TouchEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/TouchEvent.scala @@ -2,6 +2,7 @@ package typingsJapgolly.react.mod import japgolly.scalajs.react.Callback import japgolly.scalajs.react.CallbackTo +import org.scalajs.dom.raw.Event import typingsJapgolly.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -38,7 +39,7 @@ object TouchEvent { isPropagationStopped: CallbackTo[Boolean], isTrusted: Boolean, metaKey: Boolean, - nativeEvent: NativeTouchEvent, + nativeEvent: Event, persist: Callback, preventDefault: Callback, shiftKey: Boolean, diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/TransitionEvent.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/TransitionEvent.scala index 1e643e4c3c..35cfd4187d 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/TransitionEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/TransitionEvent.scala @@ -2,6 +2,7 @@ package typingsJapgolly.react.mod import japgolly.scalajs.react.Callback import japgolly.scalajs.react.CallbackTo +import org.scalajs.dom.raw.Event import typingsJapgolly.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -26,7 +27,7 @@ object TransitionEvent { isDefaultPrevented: CallbackTo[Boolean], isPropagationStopped: CallbackTo[Boolean], isTrusted: Boolean, - nativeEvent: NativeTransitionEvent, + nativeEvent: Event, persist: Callback, preventDefault: Callback, propertyName: String, diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/UIEvent.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/UIEvent.scala index bc96bc4265..cd1b78c85b 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/UIEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/UIEvent.scala @@ -2,6 +2,7 @@ package typingsJapgolly.react.mod import japgolly.scalajs.react.Callback import japgolly.scalajs.react.CallbackTo +import org.scalajs.dom.raw.Event import typingsJapgolly.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -25,7 +26,7 @@ object UIEvent { isDefaultPrevented: CallbackTo[Boolean], isPropagationStopped: CallbackTo[Boolean], isTrusted: Boolean, - nativeEvent: NativeUIEvent, + nativeEvent: Event, persist: Callback, preventDefault: Callback, stopPropagation: Callback, diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/WheelEvent.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/WheelEvent.scala index 87d4f15d74..2f11c36b12 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/WheelEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/WheelEvent.scala @@ -2,6 +2,7 @@ package typingsJapgolly.react.mod import japgolly.scalajs.react.Callback import japgolly.scalajs.react.CallbackTo +import org.scalajs.dom.raw.Event import org.scalajs.dom.raw.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -40,7 +41,7 @@ object WheelEvent { metaKey: Boolean, movementX: Double, movementY: Double, - nativeEvent: NativeWheelEvent, + nativeEvent: Event, pageX: Double, pageY: Double, persist: Callback, diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/_Global_/JSX/IntrinsicElements.scala b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/_Global_/JSX/IntrinsicElements.scala index 712e878f86..d186fa2751 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/_Global_/JSX/IntrinsicElements.scala +++ b/importer/src/test/resources/react-integration-test/check-japgolly/r/react/src/main/scala/typingsJapgolly/react/mod/_Global_/JSX/IntrinsicElements.scala @@ -157,14 +157,6 @@ import typingsJapgolly.react.mod.TimeHTMLAttributes import typingsJapgolly.react.mod.TrackHTMLAttributes import typingsJapgolly.react.mod.VideoHTMLAttributes import typingsJapgolly.react.mod.WebViewHTMLAttributes -import typingsJapgolly.std.HTMLDataElement -import typingsJapgolly.std.HTMLDialogElement -import typingsJapgolly.std.HTMLTableDataCellElement -import typingsJapgolly.std.HTMLTableHeaderCellElement -import typingsJapgolly.std.HTMLTemplateElement -import typingsJapgolly.std.HTMLWebViewElement -import typingsJapgolly.std.SVGFEDropShadowElement -import typingsJapgolly.std.SVGForeignObjectElement import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @@ -201,7 +193,7 @@ trait IntrinsicElements extends js.Object { var code: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement] = js.native var col: DetailedHTMLProps[ColHTMLAttributes[HTMLTableColElement], HTMLTableColElement] = js.native var colgroup: DetailedHTMLProps[ColgroupHTMLAttributes[HTMLTableColElement], HTMLTableColElement] = js.native - var data: DetailedHTMLProps[DataHTMLAttributes[HTMLDataElement], HTMLDataElement] = js.native + var data: DetailedHTMLProps[DataHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element] = js.native var datalist: DetailedHTMLProps[HTMLAttributes[HTMLDataListElement], HTMLDataListElement] = js.native var dd: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement] = js.native var defs: SVGProps[SVGDefsElement] = js.native @@ -209,7 +201,7 @@ trait IntrinsicElements extends js.Object { var desc: SVGProps[SVGDescElement] = js.native var details: DetailedHTMLProps[DetailsHTMLAttributes[HTMLElement], HTMLElement] = js.native var dfn: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement] = js.native - var dialog: DetailedHTMLProps[DialogHTMLAttributes[HTMLDialogElement], HTMLDialogElement] = js.native + var dialog: DetailedHTMLProps[DialogHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element] = js.native var div: DetailedHTMLProps[HTMLAttributes[HTMLDivElement], HTMLDivElement] = js.native var dl: DetailedHTMLProps[HTMLAttributes[HTMLDListElement], HTMLDListElement] = js.native var dt: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement] = js.native @@ -224,7 +216,7 @@ trait IntrinsicElements extends js.Object { var feDiffuseLighting: SVGProps[SVGFEDiffuseLightingElement] = js.native var feDisplacementMap: SVGProps[SVGFEDisplacementMapElement] = js.native var feDistantLight: SVGProps[SVGFEDistantLightElement] = js.native - var feDropShadow: SVGProps[SVGFEDropShadowElement] = js.native + var feDropShadow: SVGProps[org.scalajs.dom.raw.Element] = js.native var feFlood: SVGProps[SVGFEFloodElement] = js.native var feFuncA: SVGProps[SVGFEFuncAElement] = js.native var feFuncB: SVGProps[SVGFEFuncBElement] = js.native @@ -246,7 +238,7 @@ trait IntrinsicElements extends js.Object { var figure: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement] = js.native var filter: SVGProps[SVGFilterElement] = js.native var footer: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement] = js.native - var foreignObject: SVGProps[SVGForeignObjectElement] = js.native + var foreignObject: SVGProps[org.scalajs.dom.raw.Element] = js.native var form: DetailedHTMLProps[FormHTMLAttributes[HTMLFormElement], HTMLFormElement] = js.native var g: SVGProps[SVGGElement] = js.native var h1: DetailedHTMLProps[HTMLAttributes[HTMLHeadingElement], HTMLHeadingElement] = js.native @@ -328,13 +320,13 @@ trait IntrinsicElements extends js.Object { var symbol: SVGProps[SVGSymbolElement] = js.native var table: DetailedHTMLProps[TableHTMLAttributes[HTMLTableElement], HTMLTableElement] = js.native var tbody: DetailedHTMLProps[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement] = js.native - var td: DetailedHTMLProps[TdHTMLAttributes[HTMLTableDataCellElement], HTMLTableDataCellElement] = js.native - var template: DetailedHTMLProps[HTMLAttributes[HTMLTemplateElement], HTMLTemplateElement] = js.native + var td: DetailedHTMLProps[TdHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element] = js.native + var template: DetailedHTMLProps[HTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element] = js.native var text: SVGProps[SVGTextElement] = js.native var textPath: SVGProps[SVGTextPathElement] = js.native var textarea: DetailedHTMLProps[TextareaHTMLAttributes[HTMLTextAreaElement], HTMLTextAreaElement] = js.native var tfoot: DetailedHTMLProps[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement] = js.native - var th: DetailedHTMLProps[ThHTMLAttributes[HTMLTableHeaderCellElement], HTMLTableHeaderCellElement] = js.native + var th: DetailedHTMLProps[ThHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element] = js.native var thead: DetailedHTMLProps[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement] = js.native var time: DetailedHTMLProps[TimeHTMLAttributes[HTMLElement], HTMLElement] = js.native var title: DetailedHTMLProps[HTMLAttributes[HTMLTitleElement], HTMLTitleElement] = js.native @@ -348,7 +340,7 @@ trait IntrinsicElements extends js.Object { var video: DetailedHTMLProps[VideoHTMLAttributes[HTMLVideoElement], HTMLVideoElement] = js.native var view: SVGProps[SVGViewElement] = js.native var wbr: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement] = js.native - var webview: DetailedHTMLProps[WebViewHTMLAttributes[HTMLWebViewElement], HTMLWebViewElement] = js.native + var webview: DetailedHTMLProps[WebViewHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element] = js.native } object IntrinsicElements { @@ -381,7 +373,7 @@ object IntrinsicElements { code: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement], col: DetailedHTMLProps[ColHTMLAttributes[HTMLTableColElement], HTMLTableColElement], colgroup: DetailedHTMLProps[ColgroupHTMLAttributes[HTMLTableColElement], HTMLTableColElement], - data: DetailedHTMLProps[DataHTMLAttributes[HTMLDataElement], HTMLDataElement], + data: DetailedHTMLProps[DataHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element], datalist: DetailedHTMLProps[HTMLAttributes[HTMLDataListElement], HTMLDataListElement], dd: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement], defs: SVGProps[SVGDefsElement], @@ -389,7 +381,7 @@ object IntrinsicElements { desc: SVGProps[SVGDescElement], details: DetailedHTMLProps[DetailsHTMLAttributes[HTMLElement], HTMLElement], dfn: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement], - dialog: DetailedHTMLProps[DialogHTMLAttributes[HTMLDialogElement], HTMLDialogElement], + dialog: DetailedHTMLProps[DialogHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element], div: DetailedHTMLProps[HTMLAttributes[HTMLDivElement], HTMLDivElement], dl: DetailedHTMLProps[HTMLAttributes[HTMLDListElement], HTMLDListElement], dt: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement], @@ -404,7 +396,7 @@ object IntrinsicElements { feDiffuseLighting: SVGProps[SVGFEDiffuseLightingElement], feDisplacementMap: SVGProps[SVGFEDisplacementMapElement], feDistantLight: SVGProps[SVGFEDistantLightElement], - feDropShadow: SVGProps[SVGFEDropShadowElement], + feDropShadow: SVGProps[org.scalajs.dom.raw.Element], feFlood: SVGProps[SVGFEFloodElement], feFuncA: SVGProps[SVGFEFuncAElement], feFuncB: SVGProps[SVGFEFuncBElement], @@ -426,7 +418,7 @@ object IntrinsicElements { figure: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement], filter: SVGProps[SVGFilterElement], footer: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement], - foreignObject: SVGProps[SVGForeignObjectElement], + foreignObject: SVGProps[org.scalajs.dom.raw.Element], form: DetailedHTMLProps[FormHTMLAttributes[HTMLFormElement], HTMLFormElement], g: SVGProps[SVGGElement], h1: DetailedHTMLProps[HTMLAttributes[HTMLHeadingElement], HTMLHeadingElement], @@ -507,13 +499,13 @@ object IntrinsicElements { symbol: SVGProps[SVGSymbolElement], table: DetailedHTMLProps[TableHTMLAttributes[HTMLTableElement], HTMLTableElement], tbody: DetailedHTMLProps[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], - td: DetailedHTMLProps[TdHTMLAttributes[HTMLTableDataCellElement], HTMLTableDataCellElement], - template: DetailedHTMLProps[HTMLAttributes[HTMLTemplateElement], HTMLTemplateElement], + td: DetailedHTMLProps[TdHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element], + template: DetailedHTMLProps[HTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element], text: SVGProps[SVGTextElement], textPath: SVGProps[SVGTextPathElement], textarea: DetailedHTMLProps[TextareaHTMLAttributes[HTMLTextAreaElement], HTMLTextAreaElement], tfoot: DetailedHTMLProps[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], - th: DetailedHTMLProps[ThHTMLAttributes[HTMLTableHeaderCellElement], HTMLTableHeaderCellElement], + th: DetailedHTMLProps[ThHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element], thead: DetailedHTMLProps[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], time: DetailedHTMLProps[TimeHTMLAttributes[HTMLElement], HTMLElement], title: DetailedHTMLProps[HTMLAttributes[HTMLTitleElement], HTMLTitleElement], @@ -527,7 +519,7 @@ object IntrinsicElements { video: DetailedHTMLProps[VideoHTMLAttributes[HTMLVideoElement], HTMLVideoElement], view: SVGProps[SVGViewElement], wbr: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement], - webview: DetailedHTMLProps[WebViewHTMLAttributes[HTMLWebViewElement], HTMLWebViewElement] + webview: DetailedHTMLProps[WebViewHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element] ): IntrinsicElements = { val __obj = js.Dynamic.literal(a = a.asInstanceOf[js.Any], abbr = abbr.asInstanceOf[js.Any], address = address.asInstanceOf[js.Any], animate = animate.asInstanceOf[js.Any], animateMotion = animateMotion.asInstanceOf[js.Any], animateTransform = animateTransform.asInstanceOf[js.Any], area = area.asInstanceOf[js.Any], article = article.asInstanceOf[js.Any], aside = aside.asInstanceOf[js.Any], audio = audio.asInstanceOf[js.Any], b = b.asInstanceOf[js.Any], base = base.asInstanceOf[js.Any], bdi = bdi.asInstanceOf[js.Any], bdo = bdo.asInstanceOf[js.Any], big = big.asInstanceOf[js.Any], blockquote = blockquote.asInstanceOf[js.Any], body = body.asInstanceOf[js.Any], br = br.asInstanceOf[js.Any], button = button.asInstanceOf[js.Any], canvas = canvas.asInstanceOf[js.Any], caption = caption.asInstanceOf[js.Any], circle = circle.asInstanceOf[js.Any], cite = cite.asInstanceOf[js.Any], clipPath = clipPath.asInstanceOf[js.Any], code = code.asInstanceOf[js.Any], col = col.asInstanceOf[js.Any], colgroup = colgroup.asInstanceOf[js.Any], data = data.asInstanceOf[js.Any], datalist = datalist.asInstanceOf[js.Any], dd = dd.asInstanceOf[js.Any], defs = defs.asInstanceOf[js.Any], del = del.asInstanceOf[js.Any], desc = desc.asInstanceOf[js.Any], details = details.asInstanceOf[js.Any], dfn = dfn.asInstanceOf[js.Any], dialog = dialog.asInstanceOf[js.Any], div = div.asInstanceOf[js.Any], dl = dl.asInstanceOf[js.Any], dt = dt.asInstanceOf[js.Any], ellipse = ellipse.asInstanceOf[js.Any], em = em.asInstanceOf[js.Any], embed = embed.asInstanceOf[js.Any], feBlend = feBlend.asInstanceOf[js.Any], feColorMatrix = feColorMatrix.asInstanceOf[js.Any], feComponentTransfer = feComponentTransfer.asInstanceOf[js.Any], feComposite = feComposite.asInstanceOf[js.Any], feConvolveMatrix = feConvolveMatrix.asInstanceOf[js.Any], feDiffuseLighting = feDiffuseLighting.asInstanceOf[js.Any], feDisplacementMap = feDisplacementMap.asInstanceOf[js.Any], feDistantLight = feDistantLight.asInstanceOf[js.Any], feDropShadow = feDropShadow.asInstanceOf[js.Any], feFlood = feFlood.asInstanceOf[js.Any], feFuncA = feFuncA.asInstanceOf[js.Any], feFuncB = feFuncB.asInstanceOf[js.Any], feFuncG = feFuncG.asInstanceOf[js.Any], feFuncR = feFuncR.asInstanceOf[js.Any], feGaussianBlur = feGaussianBlur.asInstanceOf[js.Any], feImage = feImage.asInstanceOf[js.Any], feMerge = feMerge.asInstanceOf[js.Any], feMergeNode = feMergeNode.asInstanceOf[js.Any], feMorphology = feMorphology.asInstanceOf[js.Any], feOffset = feOffset.asInstanceOf[js.Any], fePointLight = fePointLight.asInstanceOf[js.Any], feSpecularLighting = feSpecularLighting.asInstanceOf[js.Any], feSpotLight = feSpotLight.asInstanceOf[js.Any], feTile = feTile.asInstanceOf[js.Any], feTurbulence = feTurbulence.asInstanceOf[js.Any], fieldset = fieldset.asInstanceOf[js.Any], figcaption = figcaption.asInstanceOf[js.Any], figure = figure.asInstanceOf[js.Any], filter = filter.asInstanceOf[js.Any], footer = footer.asInstanceOf[js.Any], foreignObject = foreignObject.asInstanceOf[js.Any], form = form.asInstanceOf[js.Any], g = g.asInstanceOf[js.Any], h1 = h1.asInstanceOf[js.Any], h2 = h2.asInstanceOf[js.Any], h3 = h3.asInstanceOf[js.Any], h4 = h4.asInstanceOf[js.Any], h5 = h5.asInstanceOf[js.Any], h6 = h6.asInstanceOf[js.Any], head = head.asInstanceOf[js.Any], header = header.asInstanceOf[js.Any], hgroup = hgroup.asInstanceOf[js.Any], hr = hr.asInstanceOf[js.Any], html = html.asInstanceOf[js.Any], i = i.asInstanceOf[js.Any], iframe = iframe.asInstanceOf[js.Any], image = image.asInstanceOf[js.Any], img = img.asInstanceOf[js.Any], input = input.asInstanceOf[js.Any], ins = ins.asInstanceOf[js.Any], kbd = kbd.asInstanceOf[js.Any], keygen = keygen.asInstanceOf[js.Any], label = label.asInstanceOf[js.Any], legend = legend.asInstanceOf[js.Any], li = li.asInstanceOf[js.Any], line = line.asInstanceOf[js.Any], linearGradient = linearGradient.asInstanceOf[js.Any], link = link.asInstanceOf[js.Any], main = main.asInstanceOf[js.Any], map = map.asInstanceOf[js.Any], mark = mark.asInstanceOf[js.Any], marker = marker.asInstanceOf[js.Any], mask = mask.asInstanceOf[js.Any], menu = menu.asInstanceOf[js.Any], menuitem = menuitem.asInstanceOf[js.Any], meta = meta.asInstanceOf[js.Any], metadata = metadata.asInstanceOf[js.Any], meter = meter.asInstanceOf[js.Any], mpath = mpath.asInstanceOf[js.Any], nav = nav.asInstanceOf[js.Any], noindex = noindex.asInstanceOf[js.Any], noscript = noscript.asInstanceOf[js.Any], ol = ol.asInstanceOf[js.Any], optgroup = optgroup.asInstanceOf[js.Any], option = option.asInstanceOf[js.Any], output = output.asInstanceOf[js.Any], p = p.asInstanceOf[js.Any], param = param.asInstanceOf[js.Any], path = path.asInstanceOf[js.Any], pattern = pattern.asInstanceOf[js.Any], picture = picture.asInstanceOf[js.Any], polygon = polygon.asInstanceOf[js.Any], polyline = polyline.asInstanceOf[js.Any], pre = pre.asInstanceOf[js.Any], progress = progress.asInstanceOf[js.Any], q = q.asInstanceOf[js.Any], radialGradient = radialGradient.asInstanceOf[js.Any], rect = rect.asInstanceOf[js.Any], rp = rp.asInstanceOf[js.Any], rt = rt.asInstanceOf[js.Any], ruby = ruby.asInstanceOf[js.Any], s = s.asInstanceOf[js.Any], samp = samp.asInstanceOf[js.Any], script = script.asInstanceOf[js.Any], section = section.asInstanceOf[js.Any], select = select.asInstanceOf[js.Any], small = small.asInstanceOf[js.Any], source = source.asInstanceOf[js.Any], span = span.asInstanceOf[js.Any], stop = stop.asInstanceOf[js.Any], strong = strong.asInstanceOf[js.Any], style = style.asInstanceOf[js.Any], sub = sub.asInstanceOf[js.Any], summary = summary.asInstanceOf[js.Any], sup = sup.asInstanceOf[js.Any], svg = svg.asInstanceOf[js.Any], switch = switch.asInstanceOf[js.Any], symbol = symbol.asInstanceOf[js.Any], table = table.asInstanceOf[js.Any], tbody = tbody.asInstanceOf[js.Any], td = td.asInstanceOf[js.Any], template = template.asInstanceOf[js.Any], text = text.asInstanceOf[js.Any], textPath = textPath.asInstanceOf[js.Any], textarea = textarea.asInstanceOf[js.Any], tfoot = tfoot.asInstanceOf[js.Any], th = th.asInstanceOf[js.Any], thead = thead.asInstanceOf[js.Any], time = time.asInstanceOf[js.Any], title = title.asInstanceOf[js.Any], tr = tr.asInstanceOf[js.Any], track = track.asInstanceOf[js.Any], tspan = tspan.asInstanceOf[js.Any], u = u.asInstanceOf[js.Any], ul = ul.asInstanceOf[js.Any], use = use.asInstanceOf[js.Any], video = video.asInstanceOf[js.Any], view = view.asInstanceOf[js.Any], wbr = wbr.asInstanceOf[js.Any], webview = webview.asInstanceOf[js.Any]) __obj.updateDynamic("object")(`object`.asInstanceOf[js.Any]) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt index fb087f37c6..e460bf41cb 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/semantic-ui-react/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "semantic-ui-react" -version := "0.0-unknown-21fe55" +version := "0.0-unknown-81cf91" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-424c14", - "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") + "org.scalablytyped" %%% "react" % "16.9.2-e4ed36", + "org.scalablytyped" %%% "std" % "0.0-unknown-6e7350") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/build.sbt index 197b1200b1..dac4ad1d88 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-event-listener/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-event-listener" -version := "0.38.0-e69496" +version := "0.38.0-bfd788" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-424c14", - "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") + "org.scalablytyped" %%% "react" % "16.9.2-e4ed36", + "org.scalablytyped" %%% "std" % "0.0-unknown-6e7350") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/build.sbt index 6e784542ba..72785b1b4a 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/stardust-ui__react-component-ref/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-ref" -version := "0.38.0-6cfd79" +version := "0.38.0-c4f435" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-424c14", - "org.scalablytyped" %%% "std" % "0.0-unknown-266f11") + "org.scalablytyped" %%% "react" % "16.9.2-e4ed36", + "org.scalablytyped" %%% "std" % "0.0-unknown-6e7350") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/std/build.sbt b/importer/src/test/resources/react-integration-test/check-japgolly/s/std/build.sbt index de5f0ba0df..0ca92f7a4b 100644 --- a/importer/src/test/resources/react-integration-test/check-japgolly/s/std/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-266f11" +version := "0.0-unknown-6e7350" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/HTMLElementTagNameMap.scala b/importer/src/test/resources/react-integration-test/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/HTMLElementTagNameMap.scala new file mode 100644 index 0000000000..bb36aee026 --- /dev/null +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/HTMLElementTagNameMap.scala @@ -0,0 +1,229 @@ +package typingsJapgolly.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait HTMLElementTagNameMap extends js.Object { + var a: org.scalajs.dom.raw.HTMLAnchorElement = js.native + var abbr: org.scalajs.dom.raw.HTMLElement = js.native + var address: org.scalajs.dom.raw.HTMLElement = js.native + var area: org.scalajs.dom.raw.HTMLAreaElement = js.native + var article: org.scalajs.dom.raw.HTMLElement = js.native + var aside: org.scalajs.dom.raw.HTMLElement = js.native + var audio: org.scalajs.dom.raw.HTMLAudioElement = js.native + var b: org.scalajs.dom.raw.HTMLElement = js.native + var base: org.scalajs.dom.raw.HTMLBaseElement = js.native + var bdi: org.scalajs.dom.raw.HTMLElement = js.native + var bdo: org.scalajs.dom.raw.HTMLElement = js.native + var blockquote: org.scalajs.dom.raw.HTMLQuoteElement = js.native + var body: org.scalajs.dom.raw.HTMLBodyElement = js.native + var br: org.scalajs.dom.raw.HTMLBRElement = js.native + var button: org.scalajs.dom.raw.HTMLButtonElement = js.native + var canvas: org.scalajs.dom.raw.HTMLCanvasElement = js.native + var cite: org.scalajs.dom.raw.HTMLElement = js.native + var code: org.scalajs.dom.raw.HTMLElement = js.native + var col: org.scalajs.dom.raw.HTMLTableColElement = js.native + var colgroup: org.scalajs.dom.raw.HTMLTableColElement = js.native + var data: org.scalajs.dom.raw.Element = js.native + var datalist: org.scalajs.dom.raw.HTMLDataListElement = js.native + var dd: org.scalajs.dom.raw.HTMLElement = js.native + var del: org.scalajs.dom.raw.HTMLModElement = js.native + var dfn: org.scalajs.dom.raw.HTMLElement = js.native + var dialog: org.scalajs.dom.raw.Element = js.native + var div: org.scalajs.dom.raw.HTMLDivElement = js.native + var dl: org.scalajs.dom.raw.HTMLDListElement = js.native + var dt: org.scalajs.dom.raw.HTMLElement = js.native + var em: org.scalajs.dom.raw.HTMLElement = js.native + var embed: org.scalajs.dom.raw.HTMLEmbedElement = js.native + var fieldset: org.scalajs.dom.raw.HTMLFieldSetElement = js.native + var figcaption: org.scalajs.dom.raw.HTMLElement = js.native + var figure: org.scalajs.dom.raw.HTMLElement = js.native + var footer: org.scalajs.dom.raw.HTMLElement = js.native + var form: org.scalajs.dom.raw.HTMLFormElement = js.native + var h1: org.scalajs.dom.raw.HTMLHeadingElement = js.native + var h2: org.scalajs.dom.raw.HTMLHeadingElement = js.native + var h3: org.scalajs.dom.raw.HTMLHeadingElement = js.native + var h4: org.scalajs.dom.raw.HTMLHeadingElement = js.native + var h5: org.scalajs.dom.raw.HTMLHeadingElement = js.native + var h6: org.scalajs.dom.raw.HTMLHeadingElement = js.native + var head: org.scalajs.dom.raw.HTMLHeadElement = js.native + var header: org.scalajs.dom.raw.HTMLElement = js.native + var hgroup: org.scalajs.dom.raw.HTMLElement = js.native + var hr: org.scalajs.dom.raw.HTMLHRElement = js.native + var html: org.scalajs.dom.raw.HTMLHtmlElement = js.native + var i: org.scalajs.dom.raw.HTMLElement = js.native + var iframe: org.scalajs.dom.raw.HTMLIFrameElement = js.native + var img: org.scalajs.dom.raw.HTMLImageElement = js.native + var input: org.scalajs.dom.raw.HTMLInputElement = js.native + var ins: org.scalajs.dom.raw.HTMLModElement = js.native + var kbd: org.scalajs.dom.raw.HTMLElement = js.native + var label: org.scalajs.dom.raw.HTMLLabelElement = js.native + var legend: org.scalajs.dom.raw.HTMLLegendElement = js.native + var li: org.scalajs.dom.raw.HTMLLIElement = js.native + var link: org.scalajs.dom.raw.HTMLLinkElement = js.native + var main: org.scalajs.dom.raw.HTMLElement = js.native + var map: org.scalajs.dom.raw.HTMLMapElement = js.native + var mark: org.scalajs.dom.raw.HTMLElement = js.native + var meta: org.scalajs.dom.raw.HTMLMetaElement = js.native + var nav: org.scalajs.dom.raw.HTMLElement = js.native + var noscript: org.scalajs.dom.raw.HTMLElement = js.native + var `object`: org.scalajs.dom.raw.HTMLObjectElement = js.native + var ol: org.scalajs.dom.raw.HTMLOListElement = js.native + var optgroup: org.scalajs.dom.raw.HTMLOptGroupElement = js.native + var option: org.scalajs.dom.raw.HTMLOptionElement = js.native + var p: org.scalajs.dom.raw.HTMLParagraphElement = js.native + var param: org.scalajs.dom.raw.HTMLParamElement = js.native + var pre: org.scalajs.dom.raw.HTMLPreElement = js.native + var progress: org.scalajs.dom.raw.HTMLProgressElement = js.native + var q: org.scalajs.dom.raw.HTMLQuoteElement = js.native + var rp: org.scalajs.dom.raw.HTMLElement = js.native + var rt: org.scalajs.dom.raw.HTMLElement = js.native + var ruby: org.scalajs.dom.raw.HTMLElement = js.native + var s: org.scalajs.dom.raw.HTMLElement = js.native + var samp: org.scalajs.dom.raw.HTMLElement = js.native + var script: org.scalajs.dom.raw.HTMLScriptElement = js.native + var section: org.scalajs.dom.raw.HTMLElement = js.native + var select: org.scalajs.dom.raw.HTMLSelectElement = js.native + var small: org.scalajs.dom.raw.HTMLElement = js.native + var source: org.scalajs.dom.raw.HTMLSourceElement = js.native + var span: org.scalajs.dom.raw.HTMLSpanElement = js.native + var strong: org.scalajs.dom.raw.HTMLElement = js.native + var style: org.scalajs.dom.raw.HTMLStyleElement = js.native + var sub: org.scalajs.dom.raw.HTMLElement = js.native + var summary: org.scalajs.dom.raw.HTMLElement = js.native + var sup: org.scalajs.dom.raw.HTMLElement = js.native + var table: org.scalajs.dom.raw.HTMLTableElement = js.native + var tbody: org.scalajs.dom.raw.HTMLTableSectionElement = js.native + var td: org.scalajs.dom.raw.Element = js.native + var template: org.scalajs.dom.raw.Element = js.native + var textarea: org.scalajs.dom.raw.HTMLTextAreaElement = js.native + var tfoot: org.scalajs.dom.raw.HTMLTableSectionElement = js.native + var th: org.scalajs.dom.raw.Element = js.native + var thead: org.scalajs.dom.raw.HTMLTableSectionElement = js.native + var title: org.scalajs.dom.raw.HTMLTitleElement = js.native + var tr: org.scalajs.dom.raw.HTMLTableRowElement = js.native + var track: org.scalajs.dom.raw.HTMLTrackElement = js.native + var u: org.scalajs.dom.raw.HTMLElement = js.native + var ul: org.scalajs.dom.raw.HTMLUListElement = js.native + var `var`: org.scalajs.dom.raw.HTMLElement = js.native + var video: org.scalajs.dom.raw.HTMLVideoElement = js.native + var wbr: org.scalajs.dom.raw.HTMLElement = js.native +} + +object HTMLElementTagNameMap { + @scala.inline + def apply( + a: org.scalajs.dom.raw.HTMLAnchorElement, + abbr: org.scalajs.dom.raw.HTMLElement, + address: org.scalajs.dom.raw.HTMLElement, + area: org.scalajs.dom.raw.HTMLAreaElement, + article: org.scalajs.dom.raw.HTMLElement, + aside: org.scalajs.dom.raw.HTMLElement, + audio: org.scalajs.dom.raw.HTMLAudioElement, + b: org.scalajs.dom.raw.HTMLElement, + base: org.scalajs.dom.raw.HTMLBaseElement, + bdi: org.scalajs.dom.raw.HTMLElement, + bdo: org.scalajs.dom.raw.HTMLElement, + blockquote: org.scalajs.dom.raw.HTMLQuoteElement, + body: org.scalajs.dom.raw.HTMLBodyElement, + br: org.scalajs.dom.raw.HTMLBRElement, + button: org.scalajs.dom.raw.HTMLButtonElement, + canvas: org.scalajs.dom.raw.HTMLCanvasElement, + cite: org.scalajs.dom.raw.HTMLElement, + code: org.scalajs.dom.raw.HTMLElement, + col: org.scalajs.dom.raw.HTMLTableColElement, + colgroup: org.scalajs.dom.raw.HTMLTableColElement, + data: org.scalajs.dom.raw.Element, + datalist: org.scalajs.dom.raw.HTMLDataListElement, + dd: org.scalajs.dom.raw.HTMLElement, + del: org.scalajs.dom.raw.HTMLModElement, + dfn: org.scalajs.dom.raw.HTMLElement, + dialog: org.scalajs.dom.raw.Element, + div: org.scalajs.dom.raw.HTMLDivElement, + dl: org.scalajs.dom.raw.HTMLDListElement, + dt: org.scalajs.dom.raw.HTMLElement, + em: org.scalajs.dom.raw.HTMLElement, + embed: org.scalajs.dom.raw.HTMLEmbedElement, + fieldset: org.scalajs.dom.raw.HTMLFieldSetElement, + figcaption: org.scalajs.dom.raw.HTMLElement, + figure: org.scalajs.dom.raw.HTMLElement, + footer: org.scalajs.dom.raw.HTMLElement, + form: org.scalajs.dom.raw.HTMLFormElement, + h1: org.scalajs.dom.raw.HTMLHeadingElement, + h2: org.scalajs.dom.raw.HTMLHeadingElement, + h3: org.scalajs.dom.raw.HTMLHeadingElement, + h4: org.scalajs.dom.raw.HTMLHeadingElement, + h5: org.scalajs.dom.raw.HTMLHeadingElement, + h6: org.scalajs.dom.raw.HTMLHeadingElement, + head: org.scalajs.dom.raw.HTMLHeadElement, + header: org.scalajs.dom.raw.HTMLElement, + hgroup: org.scalajs.dom.raw.HTMLElement, + hr: org.scalajs.dom.raw.HTMLHRElement, + html: org.scalajs.dom.raw.HTMLHtmlElement, + i: org.scalajs.dom.raw.HTMLElement, + iframe: org.scalajs.dom.raw.HTMLIFrameElement, + img: org.scalajs.dom.raw.HTMLImageElement, + input: org.scalajs.dom.raw.HTMLInputElement, + ins: org.scalajs.dom.raw.HTMLModElement, + kbd: org.scalajs.dom.raw.HTMLElement, + label: org.scalajs.dom.raw.HTMLLabelElement, + legend: org.scalajs.dom.raw.HTMLLegendElement, + li: org.scalajs.dom.raw.HTMLLIElement, + link: org.scalajs.dom.raw.HTMLLinkElement, + main: org.scalajs.dom.raw.HTMLElement, + map: org.scalajs.dom.raw.HTMLMapElement, + mark: org.scalajs.dom.raw.HTMLElement, + meta: org.scalajs.dom.raw.HTMLMetaElement, + nav: org.scalajs.dom.raw.HTMLElement, + noscript: org.scalajs.dom.raw.HTMLElement, + `object`: org.scalajs.dom.raw.HTMLObjectElement, + ol: org.scalajs.dom.raw.HTMLOListElement, + optgroup: org.scalajs.dom.raw.HTMLOptGroupElement, + option: org.scalajs.dom.raw.HTMLOptionElement, + p: org.scalajs.dom.raw.HTMLParagraphElement, + param: org.scalajs.dom.raw.HTMLParamElement, + pre: org.scalajs.dom.raw.HTMLPreElement, + progress: org.scalajs.dom.raw.HTMLProgressElement, + q: org.scalajs.dom.raw.HTMLQuoteElement, + rp: org.scalajs.dom.raw.HTMLElement, + rt: org.scalajs.dom.raw.HTMLElement, + ruby: org.scalajs.dom.raw.HTMLElement, + s: org.scalajs.dom.raw.HTMLElement, + samp: org.scalajs.dom.raw.HTMLElement, + script: org.scalajs.dom.raw.HTMLScriptElement, + section: org.scalajs.dom.raw.HTMLElement, + select: org.scalajs.dom.raw.HTMLSelectElement, + small: org.scalajs.dom.raw.HTMLElement, + source: org.scalajs.dom.raw.HTMLSourceElement, + span: org.scalajs.dom.raw.HTMLSpanElement, + strong: org.scalajs.dom.raw.HTMLElement, + style: org.scalajs.dom.raw.HTMLStyleElement, + sub: org.scalajs.dom.raw.HTMLElement, + summary: org.scalajs.dom.raw.HTMLElement, + sup: org.scalajs.dom.raw.HTMLElement, + table: org.scalajs.dom.raw.HTMLTableElement, + tbody: org.scalajs.dom.raw.HTMLTableSectionElement, + td: org.scalajs.dom.raw.Element, + template: org.scalajs.dom.raw.Element, + textarea: org.scalajs.dom.raw.HTMLTextAreaElement, + tfoot: org.scalajs.dom.raw.HTMLTableSectionElement, + th: org.scalajs.dom.raw.Element, + thead: org.scalajs.dom.raw.HTMLTableSectionElement, + title: org.scalajs.dom.raw.HTMLTitleElement, + tr: org.scalajs.dom.raw.HTMLTableRowElement, + track: org.scalajs.dom.raw.HTMLTrackElement, + u: org.scalajs.dom.raw.HTMLElement, + ul: org.scalajs.dom.raw.HTMLUListElement, + `var`: org.scalajs.dom.raw.HTMLElement, + video: org.scalajs.dom.raw.HTMLVideoElement, + wbr: org.scalajs.dom.raw.HTMLElement + ): HTMLElementTagNameMap = { + val __obj = js.Dynamic.literal(a = a.asInstanceOf[js.Any], abbr = abbr.asInstanceOf[js.Any], address = address.asInstanceOf[js.Any], area = area.asInstanceOf[js.Any], article = article.asInstanceOf[js.Any], aside = aside.asInstanceOf[js.Any], audio = audio.asInstanceOf[js.Any], b = b.asInstanceOf[js.Any], base = base.asInstanceOf[js.Any], bdi = bdi.asInstanceOf[js.Any], bdo = bdo.asInstanceOf[js.Any], blockquote = blockquote.asInstanceOf[js.Any], body = body.asInstanceOf[js.Any], br = br.asInstanceOf[js.Any], button = button.asInstanceOf[js.Any], canvas = canvas.asInstanceOf[js.Any], cite = cite.asInstanceOf[js.Any], code = code.asInstanceOf[js.Any], col = col.asInstanceOf[js.Any], colgroup = colgroup.asInstanceOf[js.Any], data = data.asInstanceOf[js.Any], datalist = datalist.asInstanceOf[js.Any], dd = dd.asInstanceOf[js.Any], del = del.asInstanceOf[js.Any], dfn = dfn.asInstanceOf[js.Any], dialog = dialog.asInstanceOf[js.Any], div = div.asInstanceOf[js.Any], dl = dl.asInstanceOf[js.Any], dt = dt.asInstanceOf[js.Any], em = em.asInstanceOf[js.Any], embed = embed.asInstanceOf[js.Any], fieldset = fieldset.asInstanceOf[js.Any], figcaption = figcaption.asInstanceOf[js.Any], figure = figure.asInstanceOf[js.Any], footer = footer.asInstanceOf[js.Any], form = form.asInstanceOf[js.Any], h1 = h1.asInstanceOf[js.Any], h2 = h2.asInstanceOf[js.Any], h3 = h3.asInstanceOf[js.Any], h4 = h4.asInstanceOf[js.Any], h5 = h5.asInstanceOf[js.Any], h6 = h6.asInstanceOf[js.Any], head = head.asInstanceOf[js.Any], header = header.asInstanceOf[js.Any], hgroup = hgroup.asInstanceOf[js.Any], hr = hr.asInstanceOf[js.Any], html = html.asInstanceOf[js.Any], i = i.asInstanceOf[js.Any], iframe = iframe.asInstanceOf[js.Any], img = img.asInstanceOf[js.Any], input = input.asInstanceOf[js.Any], ins = ins.asInstanceOf[js.Any], kbd = kbd.asInstanceOf[js.Any], label = label.asInstanceOf[js.Any], legend = legend.asInstanceOf[js.Any], li = li.asInstanceOf[js.Any], link = link.asInstanceOf[js.Any], main = main.asInstanceOf[js.Any], map = map.asInstanceOf[js.Any], mark = mark.asInstanceOf[js.Any], meta = meta.asInstanceOf[js.Any], nav = nav.asInstanceOf[js.Any], noscript = noscript.asInstanceOf[js.Any], ol = ol.asInstanceOf[js.Any], optgroup = optgroup.asInstanceOf[js.Any], option = option.asInstanceOf[js.Any], p = p.asInstanceOf[js.Any], param = param.asInstanceOf[js.Any], pre = pre.asInstanceOf[js.Any], progress = progress.asInstanceOf[js.Any], q = q.asInstanceOf[js.Any], rp = rp.asInstanceOf[js.Any], rt = rt.asInstanceOf[js.Any], ruby = ruby.asInstanceOf[js.Any], s = s.asInstanceOf[js.Any], samp = samp.asInstanceOf[js.Any], script = script.asInstanceOf[js.Any], section = section.asInstanceOf[js.Any], select = select.asInstanceOf[js.Any], small = small.asInstanceOf[js.Any], source = source.asInstanceOf[js.Any], span = span.asInstanceOf[js.Any], strong = strong.asInstanceOf[js.Any], style = style.asInstanceOf[js.Any], sub = sub.asInstanceOf[js.Any], summary = summary.asInstanceOf[js.Any], sup = sup.asInstanceOf[js.Any], table = table.asInstanceOf[js.Any], tbody = tbody.asInstanceOf[js.Any], td = td.asInstanceOf[js.Any], template = template.asInstanceOf[js.Any], textarea = textarea.asInstanceOf[js.Any], tfoot = tfoot.asInstanceOf[js.Any], th = th.asInstanceOf[js.Any], thead = thead.asInstanceOf[js.Any], title = title.asInstanceOf[js.Any], tr = tr.asInstanceOf[js.Any], track = track.asInstanceOf[js.Any], u = u.asInstanceOf[js.Any], ul = ul.asInstanceOf[js.Any], video = video.asInstanceOf[js.Any], wbr = wbr.asInstanceOf[js.Any]) + __obj.updateDynamic("object")(`object`.asInstanceOf[js.Any]) + __obj.updateDynamic("var")(`var`.asInstanceOf[js.Any]) + __obj.asInstanceOf[HTMLElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/react-integration-test/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/SVGElementTagNameMap.scala b/importer/src/test/resources/react-integration-test/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/SVGElementTagNameMap.scala new file mode 100644 index 0000000000..013011148c --- /dev/null +++ b/importer/src/test/resources/react-integration-test/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/SVGElementTagNameMap.scala @@ -0,0 +1,26 @@ +package typingsJapgolly.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait SVGElementTagNameMap extends js.Object { + var circle: org.scalajs.dom.raw.SVGCircleElement = js.native + var clipPath: org.scalajs.dom.raw.SVGClipPathElement = js.native + var defs: org.scalajs.dom.raw.SVGDefsElement = js.native +} + +object SVGElementTagNameMap { + @scala.inline + def apply( + circle: org.scalajs.dom.raw.SVGCircleElement, + clipPath: org.scalajs.dom.raw.SVGClipPathElement, + defs: org.scalajs.dom.raw.SVGDefsElement + ): SVGElementTagNameMap = { + val __obj = js.Dynamic.literal(circle = circle.asInstanceOf[js.Any], clipPath = clipPath.asInstanceOf[js.Any], defs = defs.asInstanceOf[js.Any]) + + __obj.asInstanceOf[SVGElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/react-integration-test/check-slinky/c/componentstest/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/c/componentstest/build.sbt index a419c6af03..f0c4b5fef6 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/c/componentstest/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/c/componentstest/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "componentstest" -version := "0.0-unknown-35a067" +version := "0.0-unknown-e4de6c" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-b2066d", - "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") + "org.scalablytyped" %%% "react" % "16.9.2-33376e", + "org.scalablytyped" %%% "std" % "0.0-unknown-da34c0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt index 97e3eaa02b..1a36324049 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-bootstrap" -version := "0.32-2312c5" +version := "0.32-f6ce97" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-b2066d", - "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") + "org.scalablytyped" %%% "react" % "16.9.2-33376e", + "org.scalablytyped" %%% "std" % "0.0-unknown-da34c0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/src/main/scala/typingsSlinky/reactBootstrap/components/ButtonGroup.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/src/main/scala/typingsSlinky/reactBootstrap/components/ButtonGroup.scala index 98258e9c96..d6ae3abf36 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/src/main/scala/typingsSlinky/reactBootstrap/components/ButtonGroup.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-bootstrap/src/main/scala/typingsSlinky/reactBootstrap/components/ButtonGroup.scala @@ -1,12 +1,61 @@ package typingsSlinky.reactBootstrap.components import org.scalablytyped.runtime.StringDictionary +import org.scalajs.dom.raw.Event +import org.scalajs.dom.raw.EventTarget import slinky.core.BuildingComponent import slinky.core.ExternalComponentWithAttributesWithRefType +import slinky.core.SyntheticEvent import slinky.core.TagMod +import slinky.web.SyntheticAnimationEvent +import slinky.web.SyntheticClipboardEvent +import slinky.web.SyntheticCompositionEvent +import slinky.web.SyntheticFocusEvent +import slinky.web.SyntheticKeyboardEvent +import slinky.web.SyntheticMouseEvent +import slinky.web.SyntheticPointerEvent +import slinky.web.SyntheticTouchEvent +import slinky.web.SyntheticTransitionEvent +import slinky.web.SyntheticUIEvent +import slinky.web.SyntheticWheelEvent import slinky.web.html.`*`.tag -import typingsSlinky.react.mod.AllHTMLAttributes -import typingsSlinky.react.mod.ClassAttributes +import typingsSlinky.react.mod.DragEvent +import typingsSlinky.react.reactStrings.`additions text` +import typingsSlinky.react.reactStrings.`inline` +import typingsSlinky.react.reactStrings.additions +import typingsSlinky.react.reactStrings.all +import typingsSlinky.react.reactStrings.ascending +import typingsSlinky.react.reactStrings.assertive +import typingsSlinky.react.reactStrings.both +import typingsSlinky.react.reactStrings.copy +import typingsSlinky.react.reactStrings.date +import typingsSlinky.react.reactStrings.descending +import typingsSlinky.react.reactStrings.dialog +import typingsSlinky.react.reactStrings.execute +import typingsSlinky.react.reactStrings.grammar +import typingsSlinky.react.reactStrings.grid +import typingsSlinky.react.reactStrings.horizontal +import typingsSlinky.react.reactStrings.link +import typingsSlinky.react.reactStrings.list +import typingsSlinky.react.reactStrings.listbox +import typingsSlinky.react.reactStrings.location +import typingsSlinky.react.reactStrings.menu +import typingsSlinky.react.reactStrings.mixed +import typingsSlinky.react.reactStrings.move +import typingsSlinky.react.reactStrings.none +import typingsSlinky.react.reactStrings.off +import typingsSlinky.react.reactStrings.on +import typingsSlinky.react.reactStrings.other +import typingsSlinky.react.reactStrings.page +import typingsSlinky.react.reactStrings.polite +import typingsSlinky.react.reactStrings.popup +import typingsSlinky.react.reactStrings.removals +import typingsSlinky.react.reactStrings.spelling +import typingsSlinky.react.reactStrings.step +import typingsSlinky.react.reactStrings.text +import typingsSlinky.react.reactStrings.time +import typingsSlinky.react.reactStrings.tree +import typingsSlinky.react.reactStrings.vertical import typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroupProps import typingsSlinky.reactBootstrap.mod.Sizes import scala.scalajs.js @@ -20,24 +69,401 @@ object ButtonGroup object componentImport extends js.Object override val component: String | js.Object = this.componentImport + /* The following DOM/SVG props were specified: accept, action, alt, async, autoComplete, autoFocus, capture, challenge, checked, cite, className, colSpan, cols, content, contentEditable, controls, coords, dangerouslySetInnerHTML, data, default, defaultChecked, defaultValue, defer, dir, disabled, download, draggable, form, headers, height, hidden, high, href, htmlFor, id, integrity, kind, label, lang, list, loop, low, manifest, max, media, method, min, multiple, muted, name, nonce, open, optimum, pattern, placeholder, poster, preload, readOnly, rel, required, reversed, rowSpan, rows, sandbox, scope, scoped, scrolling, selected, shape, size, sizes, span, spellCheck, src, start, step, style, summary, suppressContentEditableWarning, tabIndex, target, title, type, value, width, wrap */ def apply( - AllHTMLAttributes: AllHTMLAttributes[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] = null, - ClassAttributes: ClassAttributes[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] = null, + about: String = null, + acceptCharset: String = null, + accessKey: String = null, + allowFullScreen: js.UndefOr[Boolean] = js.undefined, + allowTransparency: js.UndefOr[Boolean] = js.undefined, + `aria-activedescendant`: String = null, + `aria-atomic`: js.UndefOr[Boolean] = js.undefined, + `aria-autocomplete`: none | `inline` | list | both = null, + `aria-busy`: js.UndefOr[Boolean] = js.undefined, + `aria-checked`: Boolean | mixed = null, + `aria-colcount`: Int | Double = null, + `aria-colindex`: Int | Double = null, + `aria-colspan`: Int | Double = null, + `aria-controls`: String = null, + `aria-current`: Boolean | page | step | location | date | time = null, + `aria-describedby`: String = null, + `aria-details`: String = null, + `aria-disabled`: js.UndefOr[Boolean] = js.undefined, + `aria-dropeffect`: none | copy | execute | link | move | popup = null, + `aria-errormessage`: String = null, + `aria-expanded`: js.UndefOr[Boolean] = js.undefined, + `aria-flowto`: String = null, + `aria-grabbed`: js.UndefOr[Boolean] = js.undefined, + `aria-haspopup`: Boolean | menu | listbox | tree | grid | dialog = null, + `aria-hidden`: js.UndefOr[Boolean] = js.undefined, + `aria-invalid`: Boolean | grammar | spelling = null, + `aria-keyshortcuts`: String = null, + `aria-label`: String = null, + `aria-labelledby`: String = null, + `aria-level`: Int | Double = null, + `aria-live`: off | assertive | polite = null, + `aria-modal`: js.UndefOr[Boolean] = js.undefined, + `aria-multiline`: js.UndefOr[Boolean] = js.undefined, + `aria-multiselectable`: js.UndefOr[Boolean] = js.undefined, + `aria-orientation`: horizontal | vertical = null, + `aria-owns`: String = null, + `aria-placeholder`: String = null, + `aria-posinset`: Int | Double = null, + `aria-pressed`: Boolean | mixed = null, + `aria-readonly`: js.UndefOr[Boolean] = js.undefined, + `aria-relevant`: additions | (`additions text`) | all | removals | text = null, + `aria-required`: js.UndefOr[Boolean] = js.undefined, + `aria-roledescription`: String = null, + `aria-rowcount`: Int | Double = null, + `aria-rowindex`: Int | Double = null, + `aria-rowspan`: Int | Double = null, + `aria-selected`: js.UndefOr[Boolean] = js.undefined, + `aria-setsize`: Int | Double = null, + `aria-sort`: none | ascending | descending | other = null, + `aria-valuemax`: Int | Double = null, + `aria-valuemin`: Int | Double = null, + `aria-valuenow`: Int | Double = null, + `aria-valuetext`: String = null, + as: String = null, + autoCapitalize: String = null, + autoCorrect: String = null, + autoPlay: js.UndefOr[Boolean] = js.undefined, + autoSave: String = null, block: js.UndefOr[Boolean] = js.undefined, bsSize: Sizes = null, bsStyle: String = null, + cellPadding: Double | String = null, + cellSpacing: Double | String = null, + charSet: String = null, + classID: String = null, + color: String = null, + contextMenu: String = null, + crossOrigin: String = null, + datatype: String = null, + dateTime: String = null, + encType: String = null, + formAction: String = null, + formEncType: String = null, + formMethod: String = null, + formNoValidate: js.UndefOr[Boolean] = js.undefined, + formTarget: String = null, + frameBorder: Double | String = null, + hrefLang: String = null, + httpEquiv: String = null, + inlist: js.Any = null, + inputMode: String = null, + is: String = null, + itemID: String = null, + itemProp: String = null, + itemRef: String = null, + itemScope: js.UndefOr[Boolean] = js.undefined, + itemType: String = null, justified: js.UndefOr[Boolean] = js.undefined, + keyParams: String = null, + keyType: String = null, + marginHeight: Int | Double = null, + marginWidth: Int | Double = null, + maxLength: Int | Double = null, + mediaGroup: String = null, + minLength: Int | Double = null, + noValidate: js.UndefOr[Boolean] = js.undefined, + onAbort: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onAnimationEnd: SyntheticAnimationEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onAnimationIteration: SyntheticAnimationEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onAnimationStart: SyntheticAnimationEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onAuxClick: SyntheticMouseEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onBeforeInput: SyntheticEvent[EventTarget with typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup, Event] => Unit = null, + onBlur: SyntheticFocusEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onCanPlay: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onCanPlayThrough: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onChange: SyntheticEvent[EventTarget with typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup, Event] => Unit = null, + onClick: SyntheticMouseEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onCompositionEnd: SyntheticCompositionEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onCompositionStart: SyntheticCompositionEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onCompositionUpdate: SyntheticCompositionEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onContextMenu: SyntheticMouseEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onCopy: SyntheticClipboardEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onCut: SyntheticClipboardEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onDoubleClick: SyntheticMouseEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onDrag: DragEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onDragEnd: DragEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onDragEnter: DragEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onDragExit: DragEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onDragLeave: DragEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onDragOver: DragEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onDragStart: DragEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onDrop: DragEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onDurationChange: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onEmptied: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onEncrypted: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onEnded: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onError: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onFocus: SyntheticFocusEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onInput: SyntheticEvent[EventTarget with typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup, Event] => Unit = null, + onInvalid: SyntheticEvent[EventTarget with typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup, Event] => Unit = null, + onKeyDown: SyntheticKeyboardEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onKeyPress: SyntheticKeyboardEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onKeyUp: SyntheticKeyboardEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onLoad: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onLoadStart: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onLoadedData: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onLoadedMetadata: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onMouseDown: SyntheticMouseEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onMouseEnter: SyntheticMouseEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onMouseLeave: SyntheticMouseEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onMouseMove: SyntheticMouseEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onMouseOut: SyntheticMouseEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onMouseOver: SyntheticMouseEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onMouseUp: SyntheticMouseEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onPaste: SyntheticClipboardEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onPause: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onPlay: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onPlaying: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onPointerCancel: SyntheticPointerEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onPointerDown: SyntheticPointerEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onPointerEnter: SyntheticPointerEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onPointerLeave: SyntheticPointerEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onPointerMove: SyntheticPointerEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onPointerOut: SyntheticPointerEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onPointerOver: SyntheticPointerEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onPointerUp: SyntheticPointerEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onProgress: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onRateChange: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onReset: SyntheticEvent[EventTarget with typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup, Event] => Unit = null, + onScroll: SyntheticUIEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onSeeked: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onSeeking: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onSelect: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onStalled: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onSubmit: SyntheticEvent[EventTarget with typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup, Event] => Unit = null, + onSuspend: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onTimeUpdate: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onTouchCancel: SyntheticTouchEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onTouchEnd: SyntheticTouchEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onTouchMove: SyntheticTouchEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onTouchStart: SyntheticTouchEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onTransitionEnd: SyntheticTransitionEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onVolumeChange: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onWaiting: SyntheticEvent[Event, typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + onWheel: SyntheticWheelEvent[typingsSlinky.reactBootstrap.buttonGroupMod.ButtonGroup] => Unit = null, + playsInline: js.UndefOr[Boolean] = js.undefined, + prefix: String = null, + property: String = null, + radioGroup: String = null, + resource: String = null, + results: Int | Double = null, + role: String = null, + seamless: js.UndefOr[Boolean] = js.undefined, + security: String = null, + slot: String = null, + srcDoc: String = null, + srcLang: String = null, + srcSet: String = null, + suppressHydrationWarning: js.UndefOr[Boolean] = js.undefined, + typeof: String = null, + unselectable: on | off = null, + useMap: String = null, vertical: js.UndefOr[Boolean] = js.undefined, + vocab: String = null, + wmode: String = null, _overrides: StringDictionary[js.Any] = null ): BuildingComponent[tag.type, typingsSlinky.reactBootstrap.mod.ButtonGroup] = { val __obj = js.Dynamic.literal() - if (AllHTMLAttributes != null) js.Dynamic.global.Object.assign(__obj, AllHTMLAttributes) - if (ClassAttributes != null) js.Dynamic.global.Object.assign(__obj, ClassAttributes) + if (about != null) __obj.updateDynamic("about")(about.asInstanceOf[js.Any]) + if (acceptCharset != null) __obj.updateDynamic("acceptCharset")(acceptCharset.asInstanceOf[js.Any]) + if (accessKey != null) __obj.updateDynamic("accessKey")(accessKey.asInstanceOf[js.Any]) + if (!js.isUndefined(allowFullScreen)) __obj.updateDynamic("allowFullScreen")(allowFullScreen.asInstanceOf[js.Any]) + if (!js.isUndefined(allowTransparency)) __obj.updateDynamic("allowTransparency")(allowTransparency.asInstanceOf[js.Any]) + if (`aria-activedescendant` != null) __obj.updateDynamic("aria-activedescendant")(`aria-activedescendant`.asInstanceOf[js.Any]) + if (!js.isUndefined(`aria-atomic`)) __obj.updateDynamic("aria-atomic")(`aria-atomic`.asInstanceOf[js.Any]) + if (`aria-autocomplete` != null) __obj.updateDynamic("aria-autocomplete")(`aria-autocomplete`.asInstanceOf[js.Any]) + if (!js.isUndefined(`aria-busy`)) __obj.updateDynamic("aria-busy")(`aria-busy`.asInstanceOf[js.Any]) + if (`aria-checked` != null) __obj.updateDynamic("aria-checked")(`aria-checked`.asInstanceOf[js.Any]) + if (`aria-colcount` != null) __obj.updateDynamic("aria-colcount")(`aria-colcount`.asInstanceOf[js.Any]) + if (`aria-colindex` != null) __obj.updateDynamic("aria-colindex")(`aria-colindex`.asInstanceOf[js.Any]) + if (`aria-colspan` != null) __obj.updateDynamic("aria-colspan")(`aria-colspan`.asInstanceOf[js.Any]) + if (`aria-controls` != null) __obj.updateDynamic("aria-controls")(`aria-controls`.asInstanceOf[js.Any]) + if (`aria-current` != null) __obj.updateDynamic("aria-current")(`aria-current`.asInstanceOf[js.Any]) + if (`aria-describedby` != null) __obj.updateDynamic("aria-describedby")(`aria-describedby`.asInstanceOf[js.Any]) + if (`aria-details` != null) __obj.updateDynamic("aria-details")(`aria-details`.asInstanceOf[js.Any]) + if (!js.isUndefined(`aria-disabled`)) __obj.updateDynamic("aria-disabled")(`aria-disabled`.asInstanceOf[js.Any]) + if (`aria-dropeffect` != null) __obj.updateDynamic("aria-dropeffect")(`aria-dropeffect`.asInstanceOf[js.Any]) + if (`aria-errormessage` != null) __obj.updateDynamic("aria-errormessage")(`aria-errormessage`.asInstanceOf[js.Any]) + if (!js.isUndefined(`aria-expanded`)) __obj.updateDynamic("aria-expanded")(`aria-expanded`.asInstanceOf[js.Any]) + if (`aria-flowto` != null) __obj.updateDynamic("aria-flowto")(`aria-flowto`.asInstanceOf[js.Any]) + if (!js.isUndefined(`aria-grabbed`)) __obj.updateDynamic("aria-grabbed")(`aria-grabbed`.asInstanceOf[js.Any]) + if (`aria-haspopup` != null) __obj.updateDynamic("aria-haspopup")(`aria-haspopup`.asInstanceOf[js.Any]) + if (!js.isUndefined(`aria-hidden`)) __obj.updateDynamic("aria-hidden")(`aria-hidden`.asInstanceOf[js.Any]) + if (`aria-invalid` != null) __obj.updateDynamic("aria-invalid")(`aria-invalid`.asInstanceOf[js.Any]) + if (`aria-keyshortcuts` != null) __obj.updateDynamic("aria-keyshortcuts")(`aria-keyshortcuts`.asInstanceOf[js.Any]) + if (`aria-label` != null) __obj.updateDynamic("aria-label")(`aria-label`.asInstanceOf[js.Any]) + if (`aria-labelledby` != null) __obj.updateDynamic("aria-labelledby")(`aria-labelledby`.asInstanceOf[js.Any]) + if (`aria-level` != null) __obj.updateDynamic("aria-level")(`aria-level`.asInstanceOf[js.Any]) + if (`aria-live` != null) __obj.updateDynamic("aria-live")(`aria-live`.asInstanceOf[js.Any]) + if (!js.isUndefined(`aria-modal`)) __obj.updateDynamic("aria-modal")(`aria-modal`.asInstanceOf[js.Any]) + if (!js.isUndefined(`aria-multiline`)) __obj.updateDynamic("aria-multiline")(`aria-multiline`.asInstanceOf[js.Any]) + if (!js.isUndefined(`aria-multiselectable`)) __obj.updateDynamic("aria-multiselectable")(`aria-multiselectable`.asInstanceOf[js.Any]) + if (`aria-orientation` != null) __obj.updateDynamic("aria-orientation")(`aria-orientation`.asInstanceOf[js.Any]) + if (`aria-owns` != null) __obj.updateDynamic("aria-owns")(`aria-owns`.asInstanceOf[js.Any]) + if (`aria-placeholder` != null) __obj.updateDynamic("aria-placeholder")(`aria-placeholder`.asInstanceOf[js.Any]) + if (`aria-posinset` != null) __obj.updateDynamic("aria-posinset")(`aria-posinset`.asInstanceOf[js.Any]) + if (`aria-pressed` != null) __obj.updateDynamic("aria-pressed")(`aria-pressed`.asInstanceOf[js.Any]) + if (!js.isUndefined(`aria-readonly`)) __obj.updateDynamic("aria-readonly")(`aria-readonly`.asInstanceOf[js.Any]) + if (`aria-relevant` != null) __obj.updateDynamic("aria-relevant")(`aria-relevant`.asInstanceOf[js.Any]) + if (!js.isUndefined(`aria-required`)) __obj.updateDynamic("aria-required")(`aria-required`.asInstanceOf[js.Any]) + if (`aria-roledescription` != null) __obj.updateDynamic("aria-roledescription")(`aria-roledescription`.asInstanceOf[js.Any]) + if (`aria-rowcount` != null) __obj.updateDynamic("aria-rowcount")(`aria-rowcount`.asInstanceOf[js.Any]) + if (`aria-rowindex` != null) __obj.updateDynamic("aria-rowindex")(`aria-rowindex`.asInstanceOf[js.Any]) + if (`aria-rowspan` != null) __obj.updateDynamic("aria-rowspan")(`aria-rowspan`.asInstanceOf[js.Any]) + if (!js.isUndefined(`aria-selected`)) __obj.updateDynamic("aria-selected")(`aria-selected`.asInstanceOf[js.Any]) + if (`aria-setsize` != null) __obj.updateDynamic("aria-setsize")(`aria-setsize`.asInstanceOf[js.Any]) + if (`aria-sort` != null) __obj.updateDynamic("aria-sort")(`aria-sort`.asInstanceOf[js.Any]) + if (`aria-valuemax` != null) __obj.updateDynamic("aria-valuemax")(`aria-valuemax`.asInstanceOf[js.Any]) + if (`aria-valuemin` != null) __obj.updateDynamic("aria-valuemin")(`aria-valuemin`.asInstanceOf[js.Any]) + if (`aria-valuenow` != null) __obj.updateDynamic("aria-valuenow")(`aria-valuenow`.asInstanceOf[js.Any]) + if (`aria-valuetext` != null) __obj.updateDynamic("aria-valuetext")(`aria-valuetext`.asInstanceOf[js.Any]) + if (as != null) __obj.updateDynamic("as")(as.asInstanceOf[js.Any]) + if (autoCapitalize != null) __obj.updateDynamic("autoCapitalize")(autoCapitalize.asInstanceOf[js.Any]) + if (autoCorrect != null) __obj.updateDynamic("autoCorrect")(autoCorrect.asInstanceOf[js.Any]) + if (!js.isUndefined(autoPlay)) __obj.updateDynamic("autoPlay")(autoPlay.asInstanceOf[js.Any]) + if (autoSave != null) __obj.updateDynamic("autoSave")(autoSave.asInstanceOf[js.Any]) if (!js.isUndefined(block)) __obj.updateDynamic("block")(block.asInstanceOf[js.Any]) if (bsSize != null) __obj.updateDynamic("bsSize")(bsSize.asInstanceOf[js.Any]) if (bsStyle != null) __obj.updateDynamic("bsStyle")(bsStyle.asInstanceOf[js.Any]) + if (cellPadding != null) __obj.updateDynamic("cellPadding")(cellPadding.asInstanceOf[js.Any]) + if (cellSpacing != null) __obj.updateDynamic("cellSpacing")(cellSpacing.asInstanceOf[js.Any]) + if (charSet != null) __obj.updateDynamic("charSet")(charSet.asInstanceOf[js.Any]) + if (classID != null) __obj.updateDynamic("classID")(classID.asInstanceOf[js.Any]) + if (color != null) __obj.updateDynamic("color")(color.asInstanceOf[js.Any]) + if (contextMenu != null) __obj.updateDynamic("contextMenu")(contextMenu.asInstanceOf[js.Any]) + if (crossOrigin != null) __obj.updateDynamic("crossOrigin")(crossOrigin.asInstanceOf[js.Any]) + if (datatype != null) __obj.updateDynamic("datatype")(datatype.asInstanceOf[js.Any]) + if (dateTime != null) __obj.updateDynamic("dateTime")(dateTime.asInstanceOf[js.Any]) + if (encType != null) __obj.updateDynamic("encType")(encType.asInstanceOf[js.Any]) + if (formAction != null) __obj.updateDynamic("formAction")(formAction.asInstanceOf[js.Any]) + if (formEncType != null) __obj.updateDynamic("formEncType")(formEncType.asInstanceOf[js.Any]) + if (formMethod != null) __obj.updateDynamic("formMethod")(formMethod.asInstanceOf[js.Any]) + if (!js.isUndefined(formNoValidate)) __obj.updateDynamic("formNoValidate")(formNoValidate.asInstanceOf[js.Any]) + if (formTarget != null) __obj.updateDynamic("formTarget")(formTarget.asInstanceOf[js.Any]) + if (frameBorder != null) __obj.updateDynamic("frameBorder")(frameBorder.asInstanceOf[js.Any]) + if (hrefLang != null) __obj.updateDynamic("hrefLang")(hrefLang.asInstanceOf[js.Any]) + if (httpEquiv != null) __obj.updateDynamic("httpEquiv")(httpEquiv.asInstanceOf[js.Any]) + if (inlist != null) __obj.updateDynamic("inlist")(inlist.asInstanceOf[js.Any]) + if (inputMode != null) __obj.updateDynamic("inputMode")(inputMode.asInstanceOf[js.Any]) + if (is != null) __obj.updateDynamic("is")(is.asInstanceOf[js.Any]) + if (itemID != null) __obj.updateDynamic("itemID")(itemID.asInstanceOf[js.Any]) + if (itemProp != null) __obj.updateDynamic("itemProp")(itemProp.asInstanceOf[js.Any]) + if (itemRef != null) __obj.updateDynamic("itemRef")(itemRef.asInstanceOf[js.Any]) + if (!js.isUndefined(itemScope)) __obj.updateDynamic("itemScope")(itemScope.asInstanceOf[js.Any]) + if (itemType != null) __obj.updateDynamic("itemType")(itemType.asInstanceOf[js.Any]) if (!js.isUndefined(justified)) __obj.updateDynamic("justified")(justified.asInstanceOf[js.Any]) + if (keyParams != null) __obj.updateDynamic("keyParams")(keyParams.asInstanceOf[js.Any]) + if (keyType != null) __obj.updateDynamic("keyType")(keyType.asInstanceOf[js.Any]) + if (marginHeight != null) __obj.updateDynamic("marginHeight")(marginHeight.asInstanceOf[js.Any]) + if (marginWidth != null) __obj.updateDynamic("marginWidth")(marginWidth.asInstanceOf[js.Any]) + if (maxLength != null) __obj.updateDynamic("maxLength")(maxLength.asInstanceOf[js.Any]) + if (mediaGroup != null) __obj.updateDynamic("mediaGroup")(mediaGroup.asInstanceOf[js.Any]) + if (minLength != null) __obj.updateDynamic("minLength")(minLength.asInstanceOf[js.Any]) + if (!js.isUndefined(noValidate)) __obj.updateDynamic("noValidate")(noValidate.asInstanceOf[js.Any]) + if (onAbort != null) __obj.updateDynamic("onAbort")(js.Any.fromFunction1(onAbort)) + if (onAnimationEnd != null) __obj.updateDynamic("onAnimationEnd")(js.Any.fromFunction1(onAnimationEnd)) + if (onAnimationIteration != null) __obj.updateDynamic("onAnimationIteration")(js.Any.fromFunction1(onAnimationIteration)) + if (onAnimationStart != null) __obj.updateDynamic("onAnimationStart")(js.Any.fromFunction1(onAnimationStart)) + if (onAuxClick != null) __obj.updateDynamic("onAuxClick")(js.Any.fromFunction1(onAuxClick)) + if (onBeforeInput != null) __obj.updateDynamic("onBeforeInput")(js.Any.fromFunction1(onBeforeInput)) + if (onBlur != null) __obj.updateDynamic("onBlur")(js.Any.fromFunction1(onBlur)) + if (onCanPlay != null) __obj.updateDynamic("onCanPlay")(js.Any.fromFunction1(onCanPlay)) + if (onCanPlayThrough != null) __obj.updateDynamic("onCanPlayThrough")(js.Any.fromFunction1(onCanPlayThrough)) + if (onChange != null) __obj.updateDynamic("onChange")(js.Any.fromFunction1(onChange)) + if (onClick != null) __obj.updateDynamic("onClick")(js.Any.fromFunction1(onClick)) + if (onCompositionEnd != null) __obj.updateDynamic("onCompositionEnd")(js.Any.fromFunction1(onCompositionEnd)) + if (onCompositionStart != null) __obj.updateDynamic("onCompositionStart")(js.Any.fromFunction1(onCompositionStart)) + if (onCompositionUpdate != null) __obj.updateDynamic("onCompositionUpdate")(js.Any.fromFunction1(onCompositionUpdate)) + if (onContextMenu != null) __obj.updateDynamic("onContextMenu")(js.Any.fromFunction1(onContextMenu)) + if (onCopy != null) __obj.updateDynamic("onCopy")(js.Any.fromFunction1(onCopy)) + if (onCut != null) __obj.updateDynamic("onCut")(js.Any.fromFunction1(onCut)) + if (onDoubleClick != null) __obj.updateDynamic("onDoubleClick")(js.Any.fromFunction1(onDoubleClick)) + if (onDrag != null) __obj.updateDynamic("onDrag")(js.Any.fromFunction1(onDrag)) + if (onDragEnd != null) __obj.updateDynamic("onDragEnd")(js.Any.fromFunction1(onDragEnd)) + if (onDragEnter != null) __obj.updateDynamic("onDragEnter")(js.Any.fromFunction1(onDragEnter)) + if (onDragExit != null) __obj.updateDynamic("onDragExit")(js.Any.fromFunction1(onDragExit)) + if (onDragLeave != null) __obj.updateDynamic("onDragLeave")(js.Any.fromFunction1(onDragLeave)) + if (onDragOver != null) __obj.updateDynamic("onDragOver")(js.Any.fromFunction1(onDragOver)) + if (onDragStart != null) __obj.updateDynamic("onDragStart")(js.Any.fromFunction1(onDragStart)) + if (onDrop != null) __obj.updateDynamic("onDrop")(js.Any.fromFunction1(onDrop)) + if (onDurationChange != null) __obj.updateDynamic("onDurationChange")(js.Any.fromFunction1(onDurationChange)) + if (onEmptied != null) __obj.updateDynamic("onEmptied")(js.Any.fromFunction1(onEmptied)) + if (onEncrypted != null) __obj.updateDynamic("onEncrypted")(js.Any.fromFunction1(onEncrypted)) + if (onEnded != null) __obj.updateDynamic("onEnded")(js.Any.fromFunction1(onEnded)) + if (onError != null) __obj.updateDynamic("onError")(js.Any.fromFunction1(onError)) + if (onFocus != null) __obj.updateDynamic("onFocus")(js.Any.fromFunction1(onFocus)) + if (onInput != null) __obj.updateDynamic("onInput")(js.Any.fromFunction1(onInput)) + if (onInvalid != null) __obj.updateDynamic("onInvalid")(js.Any.fromFunction1(onInvalid)) + if (onKeyDown != null) __obj.updateDynamic("onKeyDown")(js.Any.fromFunction1(onKeyDown)) + if (onKeyPress != null) __obj.updateDynamic("onKeyPress")(js.Any.fromFunction1(onKeyPress)) + if (onKeyUp != null) __obj.updateDynamic("onKeyUp")(js.Any.fromFunction1(onKeyUp)) + if (onLoad != null) __obj.updateDynamic("onLoad")(js.Any.fromFunction1(onLoad)) + if (onLoadStart != null) __obj.updateDynamic("onLoadStart")(js.Any.fromFunction1(onLoadStart)) + if (onLoadedData != null) __obj.updateDynamic("onLoadedData")(js.Any.fromFunction1(onLoadedData)) + if (onLoadedMetadata != null) __obj.updateDynamic("onLoadedMetadata")(js.Any.fromFunction1(onLoadedMetadata)) + if (onMouseDown != null) __obj.updateDynamic("onMouseDown")(js.Any.fromFunction1(onMouseDown)) + if (onMouseEnter != null) __obj.updateDynamic("onMouseEnter")(js.Any.fromFunction1(onMouseEnter)) + if (onMouseLeave != null) __obj.updateDynamic("onMouseLeave")(js.Any.fromFunction1(onMouseLeave)) + if (onMouseMove != null) __obj.updateDynamic("onMouseMove")(js.Any.fromFunction1(onMouseMove)) + if (onMouseOut != null) __obj.updateDynamic("onMouseOut")(js.Any.fromFunction1(onMouseOut)) + if (onMouseOver != null) __obj.updateDynamic("onMouseOver")(js.Any.fromFunction1(onMouseOver)) + if (onMouseUp != null) __obj.updateDynamic("onMouseUp")(js.Any.fromFunction1(onMouseUp)) + if (onPaste != null) __obj.updateDynamic("onPaste")(js.Any.fromFunction1(onPaste)) + if (onPause != null) __obj.updateDynamic("onPause")(js.Any.fromFunction1(onPause)) + if (onPlay != null) __obj.updateDynamic("onPlay")(js.Any.fromFunction1(onPlay)) + if (onPlaying != null) __obj.updateDynamic("onPlaying")(js.Any.fromFunction1(onPlaying)) + if (onPointerCancel != null) __obj.updateDynamic("onPointerCancel")(js.Any.fromFunction1(onPointerCancel)) + if (onPointerDown != null) __obj.updateDynamic("onPointerDown")(js.Any.fromFunction1(onPointerDown)) + if (onPointerEnter != null) __obj.updateDynamic("onPointerEnter")(js.Any.fromFunction1(onPointerEnter)) + if (onPointerLeave != null) __obj.updateDynamic("onPointerLeave")(js.Any.fromFunction1(onPointerLeave)) + if (onPointerMove != null) __obj.updateDynamic("onPointerMove")(js.Any.fromFunction1(onPointerMove)) + if (onPointerOut != null) __obj.updateDynamic("onPointerOut")(js.Any.fromFunction1(onPointerOut)) + if (onPointerOver != null) __obj.updateDynamic("onPointerOver")(js.Any.fromFunction1(onPointerOver)) + if (onPointerUp != null) __obj.updateDynamic("onPointerUp")(js.Any.fromFunction1(onPointerUp)) + if (onProgress != null) __obj.updateDynamic("onProgress")(js.Any.fromFunction1(onProgress)) + if (onRateChange != null) __obj.updateDynamic("onRateChange")(js.Any.fromFunction1(onRateChange)) + if (onReset != null) __obj.updateDynamic("onReset")(js.Any.fromFunction1(onReset)) + if (onScroll != null) __obj.updateDynamic("onScroll")(js.Any.fromFunction1(onScroll)) + if (onSeeked != null) __obj.updateDynamic("onSeeked")(js.Any.fromFunction1(onSeeked)) + if (onSeeking != null) __obj.updateDynamic("onSeeking")(js.Any.fromFunction1(onSeeking)) + if (onSelect != null) __obj.updateDynamic("onSelect")(js.Any.fromFunction1(onSelect)) + if (onStalled != null) __obj.updateDynamic("onStalled")(js.Any.fromFunction1(onStalled)) + if (onSubmit != null) __obj.updateDynamic("onSubmit")(js.Any.fromFunction1(onSubmit)) + if (onSuspend != null) __obj.updateDynamic("onSuspend")(js.Any.fromFunction1(onSuspend)) + if (onTimeUpdate != null) __obj.updateDynamic("onTimeUpdate")(js.Any.fromFunction1(onTimeUpdate)) + if (onTouchCancel != null) __obj.updateDynamic("onTouchCancel")(js.Any.fromFunction1(onTouchCancel)) + if (onTouchEnd != null) __obj.updateDynamic("onTouchEnd")(js.Any.fromFunction1(onTouchEnd)) + if (onTouchMove != null) __obj.updateDynamic("onTouchMove")(js.Any.fromFunction1(onTouchMove)) + if (onTouchStart != null) __obj.updateDynamic("onTouchStart")(js.Any.fromFunction1(onTouchStart)) + if (onTransitionEnd != null) __obj.updateDynamic("onTransitionEnd")(js.Any.fromFunction1(onTransitionEnd)) + if (onVolumeChange != null) __obj.updateDynamic("onVolumeChange")(js.Any.fromFunction1(onVolumeChange)) + if (onWaiting != null) __obj.updateDynamic("onWaiting")(js.Any.fromFunction1(onWaiting)) + if (onWheel != null) __obj.updateDynamic("onWheel")(js.Any.fromFunction1(onWheel)) + if (!js.isUndefined(playsInline)) __obj.updateDynamic("playsInline")(playsInline.asInstanceOf[js.Any]) + if (prefix != null) __obj.updateDynamic("prefix")(prefix.asInstanceOf[js.Any]) + if (property != null) __obj.updateDynamic("property")(property.asInstanceOf[js.Any]) + if (radioGroup != null) __obj.updateDynamic("radioGroup")(radioGroup.asInstanceOf[js.Any]) + if (resource != null) __obj.updateDynamic("resource")(resource.asInstanceOf[js.Any]) + if (results != null) __obj.updateDynamic("results")(results.asInstanceOf[js.Any]) + if (role != null) __obj.updateDynamic("role")(role.asInstanceOf[js.Any]) + if (!js.isUndefined(seamless)) __obj.updateDynamic("seamless")(seamless.asInstanceOf[js.Any]) + if (security != null) __obj.updateDynamic("security")(security.asInstanceOf[js.Any]) + if (slot != null) __obj.updateDynamic("slot")(slot.asInstanceOf[js.Any]) + if (srcDoc != null) __obj.updateDynamic("srcDoc")(srcDoc.asInstanceOf[js.Any]) + if (srcLang != null) __obj.updateDynamic("srcLang")(srcLang.asInstanceOf[js.Any]) + if (srcSet != null) __obj.updateDynamic("srcSet")(srcSet.asInstanceOf[js.Any]) + if (!js.isUndefined(suppressHydrationWarning)) __obj.updateDynamic("suppressHydrationWarning")(suppressHydrationWarning.asInstanceOf[js.Any]) + if (typeof != null) __obj.updateDynamic("typeof")(typeof.asInstanceOf[js.Any]) + if (unselectable != null) __obj.updateDynamic("unselectable")(unselectable.asInstanceOf[js.Any]) + if (useMap != null) __obj.updateDynamic("useMap")(useMap.asInstanceOf[js.Any]) if (!js.isUndefined(vertical)) __obj.updateDynamic("vertical")(vertical.asInstanceOf[js.Any]) + if (vocab != null) __obj.updateDynamic("vocab")(vocab.asInstanceOf[js.Any]) + if (wmode != null) __obj.updateDynamic("wmode")(wmode.asInstanceOf[js.Any]) if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) super.apply(__obj.asInstanceOf[Props]) } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/build.sbt index cd371ac57f..a6fd19aedd 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-contextmenu" -version := "2.13.0-8127e9" +version := "2.13.0-6861c3" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-b2066d", - "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") + "org.scalablytyped" %%% "react" % "16.9.2-33376e", + "org.scalablytyped" %%% "std" % "0.0-unknown-da34c0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/src/main/scala/typingsSlinky/reactContextmenu/components/MenuItem.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/src/main/scala/typingsSlinky/reactContextmenu/components/MenuItem.scala index ce24eff1ce..1390dc17ba 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/src/main/scala/typingsSlinky/reactContextmenu/components/MenuItem.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/src/main/scala/typingsSlinky/reactContextmenu/components/MenuItem.scala @@ -8,7 +8,7 @@ import slinky.core.ExternalComponentWithAttributesWithRefType import slinky.core.TagMod import slinky.web.SyntheticMouseEvent import slinky.web.SyntheticTouchEvent -import slinky.web.html.`*`.tag +import slinky.web.html.div.tag import typingsSlinky.react.mod.HTMLAttributes import typingsSlinky.reactContextmenu.mod.MenuItemProps import scala.scalajs.js @@ -22,10 +22,11 @@ object MenuItem object componentImport extends js.Object override val component: String | js.Object = this.componentImport - /* The following DOM/SVG props were specified: className, disabled */ + /* The following DOM/SVG props were specified: className */ def apply( attributes: HTMLAttributes[HTMLDivElement] = null, data: /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify Object */ js.Any = null, + disabled: js.UndefOr[Boolean] = js.undefined, divider: js.UndefOr[Boolean] = js.undefined, onClick: (js.Function3[ /* event */ SyntheticTouchEvent[HTMLDivElement] | SyntheticMouseEvent[HTMLDivElement], @@ -39,13 +40,14 @@ object MenuItem val __obj = js.Dynamic.literal() if (attributes != null) __obj.updateDynamic("attributes")(attributes.asInstanceOf[js.Any]) if (data != null) __obj.updateDynamic("data")(data.asInstanceOf[js.Any]) + if (!js.isUndefined(disabled)) __obj.updateDynamic("disabled")(disabled.asInstanceOf[js.Any]) if (!js.isUndefined(divider)) __obj.updateDynamic("divider")(divider.asInstanceOf[js.Any]) if (onClick != null) __obj.updateDynamic("onClick")(onClick.asInstanceOf[js.Any]) if (!js.isUndefined(preventClose)) __obj.updateDynamic("preventClose")(preventClose.asInstanceOf[js.Any]) if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) super.apply(__obj.asInstanceOf[Props]) } - def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, typingsSlinky.reactContextmenu.mod.MenuItem] = new slinky.core.BuildingComponent[slinky.web.html.`*`.tag.type, typingsSlinky.reactContextmenu.mod.MenuItem](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) + def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, typingsSlinky.reactContextmenu.mod.MenuItem] = new slinky.core.BuildingComponent[slinky.web.html.div.tag.type, typingsSlinky.reactContextmenu.mod.MenuItem](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) type Props = MenuItemProps } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/src/main/scala/typingsSlinky/reactContextmenu/components/SubMenu.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/src/main/scala/typingsSlinky/reactContextmenu/components/SubMenu.scala index 37810d0137..0427e65370 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/src/main/scala/typingsSlinky/reactContextmenu/components/SubMenu.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-contextmenu/src/main/scala/typingsSlinky/reactContextmenu/components/SubMenu.scala @@ -8,7 +8,7 @@ import slinky.core.ExternalComponentWithAttributesWithRefType import slinky.core.facade.ReactElement import slinky.web.SyntheticMouseEvent import slinky.web.SyntheticTouchEvent -import slinky.web.html.`*`.tag +import slinky.web.html.div.tag import typingsSlinky.react.mod.ReactText import typingsSlinky.reactContextmenu.mod.SubMenuProps import scala.scalajs.js @@ -22,9 +22,10 @@ object SubMenu object componentImport extends js.Object override val component: String | js.Object = this.componentImport - /* The following DOM/SVG props were specified: className, disabled */ + /* The following DOM/SVG props were specified: className */ def apply( title: ReactElement | ReactText, + disabled: js.UndefOr[Boolean] = js.undefined, hoverDelay: Int | Double = null, onClick: (js.Function3[ /* event */ SyntheticTouchEvent[HTMLDivElement] | SyntheticMouseEvent[HTMLDivElement], @@ -37,6 +38,7 @@ object SubMenu _overrides: StringDictionary[js.Any] = null ): BuildingComponent[tag.type, typingsSlinky.reactContextmenu.mod.SubMenu] = { val __obj = js.Dynamic.literal(title = title.asInstanceOf[js.Any]) + if (!js.isUndefined(disabled)) __obj.updateDynamic("disabled")(disabled.asInstanceOf[js.Any]) if (hoverDelay != null) __obj.updateDynamic("hoverDelay")(hoverDelay.asInstanceOf[js.Any]) if (onClick != null) __obj.updateDynamic("onClick")(onClick.asInstanceOf[js.Any]) if (!js.isUndefined(preventCloseOnClick)) __obj.updateDynamic("preventCloseOnClick")(preventCloseOnClick.asInstanceOf[js.Any]) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt index 9336046351..7147d197a8 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-0d342d" +version := "10.1.10-328b51" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-b2066d", - "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") + "org.scalablytyped" %%% "react" % "16.9.2-33376e", + "org.scalablytyped" %%% "std" % "0.0-unknown-da34c0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/components/ReactDropzone.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/components/ReactDropzone.scala index ca3aaa5629..adecf8308b 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/components/ReactDropzone.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/components/ReactDropzone.scala @@ -1,10 +1,12 @@ package typingsSlinky.reactDropzone.components import org.scalablytyped.runtime.StringDictionary +import org.scalajs.dom.raw.HTMLElement import slinky.core.BuildingComponent import slinky.core.ExternalComponentWithAttributesWithRefType import slinky.core.TagMod import slinky.web.html.`*`.tag +import typingsSlinky.react.mod.DragEvent import typingsSlinky.react.mod.Ref import typingsSlinky.react.mod.RefAttributes import typingsSlinky.reactDropzone.mod.DropEvent @@ -21,7 +23,7 @@ object ReactDropzone object componentImport extends js.Object override val component: String | js.Object = this.componentImport - /* The following DOM/SVG props were specified: disabled, multiple, onDragEnter, onDragLeave, onDragOver */ + /* The following DOM/SVG props were specified: disabled, multiple */ def apply( accept: String | js.Array[String] = null, getFilesFromEvent: /* event */ DropEvent => /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify Promise> */ _ = null, @@ -31,6 +33,9 @@ object ReactDropzone noDrag: js.UndefOr[Boolean] = js.undefined, noDragEventsBubbling: js.UndefOr[Boolean] = js.undefined, noKeyboard: js.UndefOr[Boolean] = js.undefined, + onDragEnter: DragEvent[HTMLElement] => Unit = null, + onDragLeave: DragEvent[HTMLElement] => Unit = null, + onDragOver: DragEvent[HTMLElement] => Unit = null, onDrop: (/* acceptedFiles */ js.Array[ /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify File */ _ ], /* rejectedFiles */ js.Array[ @@ -55,6 +60,9 @@ object ReactDropzone if (!js.isUndefined(noDrag)) __obj.updateDynamic("noDrag")(noDrag.asInstanceOf[js.Any]) if (!js.isUndefined(noDragEventsBubbling)) __obj.updateDynamic("noDragEventsBubbling")(noDragEventsBubbling.asInstanceOf[js.Any]) if (!js.isUndefined(noKeyboard)) __obj.updateDynamic("noKeyboard")(noKeyboard.asInstanceOf[js.Any]) + if (onDragEnter != null) __obj.updateDynamic("onDragEnter")(js.Any.fromFunction1(onDragEnter)) + if (onDragLeave != null) __obj.updateDynamic("onDragLeave")(js.Any.fromFunction1(onDragLeave)) + if (onDragOver != null) __obj.updateDynamic("onDragOver")(js.Any.fromFunction1(onDragOver)) if (onDrop != null) __obj.updateDynamic("onDrop")(js.Any.fromFunction3(onDrop)) if (onDropAccepted != null) __obj.updateDynamic("onDropAccepted")(js.Any.fromFunction2(onDropAccepted)) if (onDropRejected != null) __obj.updateDynamic("onDropRejected")(js.Any.fromFunction2(onDropRejected)) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/DropzoneProps.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/DropzoneProps.scala index 450a2633a1..d9f0d6fe50 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/DropzoneProps.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/DropzoneProps.scala @@ -1,22 +1,22 @@ package typingsSlinky.reactDropzone.mod import org.scalajs.dom.raw.HTMLElement +import slinky.core.facade.ReactElement import typingsSlinky.react.mod.DragEvent -import typingsSlinky.react.mod._Global_.JSX.Element import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @js.native trait DropzoneProps extends DropzoneOptions { - var children: js.UndefOr[js.Function1[/* state */ DropzoneState, Element]] = js.native + var children: js.UndefOr[js.Function1[/* state */ DropzoneState, ReactElement]] = js.native } object DropzoneProps { @scala.inline def apply( accept: String | js.Array[String] = null, - children: /* state */ DropzoneState => Element = null, + children: /* state */ DropzoneState => ReactElement = null, disabled: js.UndefOr[Boolean] = js.undefined, getFilesFromEvent: /* event */ DropEvent => /* import warning: transforms.QualifyReferences#resolveTypeRef many Couldn't qualify Promise> */ _ = null, maxSize: Int | Double = null, diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/default.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/default.scala index c0ffa34f3f..09bd5949b9 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/default.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-dropzone/src/main/scala/typingsSlinky/reactDropzone/mod/default.scala @@ -1,7 +1,7 @@ package typingsSlinky.reactDropzone.mod +import slinky.core.facade.ReactElement import typingsSlinky.react.mod.RefAttributes -import typingsSlinky.react.mod._Global_.JSX.Element import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @@ -9,6 +9,6 @@ import scala.scalajs.js.annotation._ @JSImport("react-dropzone", JSImport.Default) @js.native object default extends js.Object { - def apply(props: DropzoneProps with RefAttributes[DropzoneRef]): Element = js.native + def apply(props: DropzoneProps with RefAttributes[DropzoneRef]): ReactElement = js.native } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react-select/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react-select/build.sbt index 408eacadb7..1ed2d23b75 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react-select/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react-select/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-select" -version := "0.0-unknown-ab65ab" +version := "0.0-unknown-5958ff" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-b2066d", - "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") + "org.scalablytyped" %%% "react" % "16.9.2-33376e", + "org.scalablytyped" %%% "std" % "0.0-unknown-da34c0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/r/react/build.sbt index 6a1f891d50..6d832ff880 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react" -version := "16.9.2-b2066d" +version := "16.9.2-33376e" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") + "org.scalablytyped" %%% "std" % "0.0-unknown-da34c0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/AnimationEvent.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/AnimationEvent.scala index ef759bb5ca..a8ed8fb04a 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/AnimationEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/AnimationEvent.scala @@ -1,5 +1,6 @@ package typingsSlinky.react.mod +import org.scalajs.dom.raw.Event import typingsSlinky.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -25,7 +26,7 @@ object AnimationEvent { isDefaultPrevented: () => Boolean, isPropagationStopped: () => Boolean, isTrusted: Boolean, - nativeEvent: NativeAnimationEvent, + nativeEvent: Event, persist: () => Unit, preventDefault: () => Unit, pseudoElement: String, diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/ClipboardEvent.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/ClipboardEvent.scala index 8089219d34..bdaf3e233a 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/ClipboardEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/ClipboardEvent.scala @@ -1,6 +1,7 @@ package typingsSlinky.react.mod import org.scalajs.dom.raw.DataTransfer +import org.scalajs.dom.raw.Event import typingsSlinky.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -23,7 +24,7 @@ object ClipboardEvent { isDefaultPrevented: () => Boolean, isPropagationStopped: () => Boolean, isTrusted: Boolean, - nativeEvent: NativeClipboardEvent, + nativeEvent: Event, persist: () => Unit, preventDefault: () => Unit, stopPropagation: () => Unit, diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/CompositionEvent.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/CompositionEvent.scala index e90733363a..e584b2dee9 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/CompositionEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/CompositionEvent.scala @@ -1,5 +1,6 @@ package typingsSlinky.react.mod +import org.scalajs.dom.raw.Event import typingsSlinky.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -22,7 +23,7 @@ object CompositionEvent { isDefaultPrevented: () => Boolean, isPropagationStopped: () => Boolean, isTrusted: Boolean, - nativeEvent: NativeCompositionEvent, + nativeEvent: Event, persist: () => Unit, preventDefault: () => Unit, stopPropagation: () => Unit, diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/DragEvent.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/DragEvent.scala index 8c7d2e27cb..a414adeb81 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/DragEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/DragEvent.scala @@ -1,6 +1,7 @@ package typingsSlinky.react.mod import org.scalajs.dom.raw.DataTransfer +import org.scalajs.dom.raw.Event import org.scalajs.dom.raw.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -33,7 +34,7 @@ object DragEvent { metaKey: Boolean, movementX: Double, movementY: Double, - nativeEvent: NativeDragEvent, + nativeEvent: Event, pageX: Double, pageY: Double, persist: () => Unit, diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/FocusEvent.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/FocusEvent.scala index bbaf0f0c6d..0a1fed8d08 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/FocusEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/FocusEvent.scala @@ -1,5 +1,6 @@ package typingsSlinky.react.mod +import org.scalajs.dom.raw.Event import typingsSlinky.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -23,7 +24,7 @@ object FocusEvent { isDefaultPrevented: () => Boolean, isPropagationStopped: () => Boolean, isTrusted: Boolean, - nativeEvent: NativeFocusEvent, + nativeEvent: Event, persist: () => Unit, preventDefault: () => Unit, relatedTarget: org.scalajs.dom.raw.EventTarget, diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/KeyboardEvent.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/KeyboardEvent.scala index d75f55b699..d4e3d0321b 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/KeyboardEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/KeyboardEvent.scala @@ -1,5 +1,6 @@ package typingsSlinky.react.mod +import org.scalajs.dom.raw.Event import typingsSlinky.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -47,7 +48,7 @@ object KeyboardEvent { locale: String, location: Double, metaKey: Boolean, - nativeEvent: NativeKeyboardEvent, + nativeEvent: Event, persist: () => Unit, preventDefault: () => Unit, repeat: Boolean, diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/PointerEvent.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/PointerEvent.scala index fb2387eb5b..eea1ae3b0c 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/PointerEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/PointerEvent.scala @@ -1,5 +1,6 @@ package typingsSlinky.react.mod +import org.scalajs.dom.raw.Event import org.scalajs.dom.raw.EventTarget import typingsSlinky.react.reactStrings.mouse import typingsSlinky.react.reactStrings.pen @@ -43,7 +44,7 @@ object PointerEvent { metaKey: Boolean, movementX: Double, movementY: Double, - nativeEvent: NativePointerEvent, + nativeEvent: Event, pageX: Double, pageY: Double, persist: () => Unit, diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/ReactDOM.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/ReactDOM.scala index 0c83b9c164..ea6e396ac9 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/ReactDOM.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/ReactDOM.scala @@ -1,5 +1,6 @@ package typingsSlinky.react.mod +import org.scalajs.dom.raw.Element import org.scalajs.dom.raw.HTMLAnchorElement import org.scalajs.dom.raw.HTMLAreaElement import org.scalajs.dom.raw.HTMLAudioElement @@ -52,12 +53,6 @@ import org.scalajs.dom.raw.HTMLTitleElement import org.scalajs.dom.raw.HTMLTrackElement import org.scalajs.dom.raw.HTMLUListElement import org.scalajs.dom.raw.HTMLVideoElement -import typingsSlinky.std.HTMLDataElement -import typingsSlinky.std.HTMLDialogElement -import typingsSlinky.std.HTMLTableDataCellElement -import typingsSlinky.std.HTMLTableHeaderCellElement -import typingsSlinky.std.HTMLTemplateElement -import typingsSlinky.std.HTMLWebViewElement import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @@ -95,7 +90,7 @@ object ReactDOM { code: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], col: DetailedHTMLFactory[ColHTMLAttributes[HTMLTableColElement], HTMLTableColElement], colgroup: DetailedHTMLFactory[ColgroupHTMLAttributes[HTMLTableColElement], HTMLTableColElement], - data: DetailedHTMLFactory[DataHTMLAttributes[HTMLDataElement], HTMLDataElement], + data: DetailedHTMLFactory[DataHTMLAttributes[Element], Element], datalist: DetailedHTMLFactory[HTMLAttributes[HTMLDataListElement], HTMLDataListElement], dd: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], defs: SVGFactory, @@ -103,7 +98,7 @@ object ReactDOM { desc: SVGFactory, details: DetailedHTMLFactory[DetailsHTMLAttributes[HTMLElement], HTMLElement], dfn: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], - dialog: DetailedHTMLFactory[DialogHTMLAttributes[HTMLDialogElement], HTMLDialogElement], + dialog: DetailedHTMLFactory[DialogHTMLAttributes[Element], Element], div: DetailedHTMLFactory[HTMLAttributes[HTMLDivElement], HTMLDivElement], dl: DetailedHTMLFactory[HTMLAttributes[HTMLDListElement], HTMLDListElement], dt: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], @@ -219,13 +214,13 @@ object ReactDOM { symbol: SVGFactory, table: DetailedHTMLFactory[TableHTMLAttributes[HTMLTableElement], HTMLTableElement], tbody: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], - td: DetailedHTMLFactory[TdHTMLAttributes[HTMLTableDataCellElement], HTMLTableDataCellElement], - template: DetailedHTMLFactory[HTMLAttributes[HTMLTemplateElement], HTMLTemplateElement], + td: DetailedHTMLFactory[TdHTMLAttributes[Element], Element], + template: DetailedHTMLFactory[HTMLAttributes[Element], Element], text: SVGFactory, textPath: SVGFactory, textarea: DetailedHTMLFactory[TextareaHTMLAttributes[HTMLTextAreaElement], HTMLTextAreaElement], tfoot: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], - th: DetailedHTMLFactory[ThHTMLAttributes[HTMLTableHeaderCellElement], HTMLTableHeaderCellElement], + th: DetailedHTMLFactory[ThHTMLAttributes[Element], Element], thead: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], time: DetailedHTMLFactory[TimeHTMLAttributes[HTMLElement], HTMLElement], title: DetailedHTMLFactory[HTMLAttributes[HTMLTitleElement], HTMLTitleElement], @@ -239,7 +234,7 @@ object ReactDOM { video: DetailedHTMLFactory[VideoHTMLAttributes[HTMLVideoElement], HTMLVideoElement], view: SVGFactory, wbr: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], - webview: DetailedHTMLFactory[WebViewHTMLAttributes[HTMLWebViewElement], HTMLWebViewElement] + webview: DetailedHTMLFactory[WebViewHTMLAttributes[Element], Element] ): ReactDOM = { val __obj = js.Dynamic.literal(a = a.asInstanceOf[js.Any], abbr = abbr.asInstanceOf[js.Any], address = address.asInstanceOf[js.Any], animate = animate.asInstanceOf[js.Any], area = area.asInstanceOf[js.Any], article = article.asInstanceOf[js.Any], aside = aside.asInstanceOf[js.Any], audio = audio.asInstanceOf[js.Any], b = b.asInstanceOf[js.Any], base = base.asInstanceOf[js.Any], bdi = bdi.asInstanceOf[js.Any], bdo = bdo.asInstanceOf[js.Any], big = big.asInstanceOf[js.Any], blockquote = blockquote.asInstanceOf[js.Any], body = body.asInstanceOf[js.Any], br = br.asInstanceOf[js.Any], button = button.asInstanceOf[js.Any], canvas = canvas.asInstanceOf[js.Any], caption = caption.asInstanceOf[js.Any], circle = circle.asInstanceOf[js.Any], cite = cite.asInstanceOf[js.Any], clipPath = clipPath.asInstanceOf[js.Any], code = code.asInstanceOf[js.Any], col = col.asInstanceOf[js.Any], colgroup = colgroup.asInstanceOf[js.Any], data = data.asInstanceOf[js.Any], datalist = datalist.asInstanceOf[js.Any], dd = dd.asInstanceOf[js.Any], defs = defs.asInstanceOf[js.Any], del = del.asInstanceOf[js.Any], desc = desc.asInstanceOf[js.Any], details = details.asInstanceOf[js.Any], dfn = dfn.asInstanceOf[js.Any], dialog = dialog.asInstanceOf[js.Any], div = div.asInstanceOf[js.Any], dl = dl.asInstanceOf[js.Any], dt = dt.asInstanceOf[js.Any], ellipse = ellipse.asInstanceOf[js.Any], em = em.asInstanceOf[js.Any], embed = embed.asInstanceOf[js.Any], feBlend = feBlend.asInstanceOf[js.Any], feColorMatrix = feColorMatrix.asInstanceOf[js.Any], feComponentTransfer = feComponentTransfer.asInstanceOf[js.Any], feComposite = feComposite.asInstanceOf[js.Any], feConvolveMatrix = feConvolveMatrix.asInstanceOf[js.Any], feDiffuseLighting = feDiffuseLighting.asInstanceOf[js.Any], feDisplacementMap = feDisplacementMap.asInstanceOf[js.Any], feDistantLight = feDistantLight.asInstanceOf[js.Any], feDropShadow = feDropShadow.asInstanceOf[js.Any], feFlood = feFlood.asInstanceOf[js.Any], feFuncA = feFuncA.asInstanceOf[js.Any], feFuncB = feFuncB.asInstanceOf[js.Any], feFuncG = feFuncG.asInstanceOf[js.Any], feFuncR = feFuncR.asInstanceOf[js.Any], feGaussianBlur = feGaussianBlur.asInstanceOf[js.Any], feImage = feImage.asInstanceOf[js.Any], feMerge = feMerge.asInstanceOf[js.Any], feMergeNode = feMergeNode.asInstanceOf[js.Any], feMorphology = feMorphology.asInstanceOf[js.Any], feOffset = feOffset.asInstanceOf[js.Any], fePointLight = fePointLight.asInstanceOf[js.Any], feSpecularLighting = feSpecularLighting.asInstanceOf[js.Any], feSpotLight = feSpotLight.asInstanceOf[js.Any], feTile = feTile.asInstanceOf[js.Any], feTurbulence = feTurbulence.asInstanceOf[js.Any], fieldset = fieldset.asInstanceOf[js.Any], figcaption = figcaption.asInstanceOf[js.Any], figure = figure.asInstanceOf[js.Any], filter = filter.asInstanceOf[js.Any], footer = footer.asInstanceOf[js.Any], foreignObject = foreignObject.asInstanceOf[js.Any], form = form.asInstanceOf[js.Any], g = g.asInstanceOf[js.Any], h1 = h1.asInstanceOf[js.Any], h2 = h2.asInstanceOf[js.Any], h3 = h3.asInstanceOf[js.Any], h4 = h4.asInstanceOf[js.Any], h5 = h5.asInstanceOf[js.Any], h6 = h6.asInstanceOf[js.Any], head = head.asInstanceOf[js.Any], header = header.asInstanceOf[js.Any], hgroup = hgroup.asInstanceOf[js.Any], hr = hr.asInstanceOf[js.Any], html = html.asInstanceOf[js.Any], i = i.asInstanceOf[js.Any], iframe = iframe.asInstanceOf[js.Any], image = image.asInstanceOf[js.Any], img = img.asInstanceOf[js.Any], input = input.asInstanceOf[js.Any], ins = ins.asInstanceOf[js.Any], kbd = kbd.asInstanceOf[js.Any], keygen = keygen.asInstanceOf[js.Any], label = label.asInstanceOf[js.Any], legend = legend.asInstanceOf[js.Any], li = li.asInstanceOf[js.Any], line = line.asInstanceOf[js.Any], linearGradient = linearGradient.asInstanceOf[js.Any], link = link.asInstanceOf[js.Any], main = main.asInstanceOf[js.Any], map = map.asInstanceOf[js.Any], mark = mark.asInstanceOf[js.Any], marker = marker.asInstanceOf[js.Any], mask = mask.asInstanceOf[js.Any], menu = menu.asInstanceOf[js.Any], menuitem = menuitem.asInstanceOf[js.Any], meta = meta.asInstanceOf[js.Any], metadata = metadata.asInstanceOf[js.Any], meter = meter.asInstanceOf[js.Any], nav = nav.asInstanceOf[js.Any], noscript = noscript.asInstanceOf[js.Any], ol = ol.asInstanceOf[js.Any], optgroup = optgroup.asInstanceOf[js.Any], option = option.asInstanceOf[js.Any], output = output.asInstanceOf[js.Any], p = p.asInstanceOf[js.Any], param = param.asInstanceOf[js.Any], path = path.asInstanceOf[js.Any], pattern = pattern.asInstanceOf[js.Any], picture = picture.asInstanceOf[js.Any], polygon = polygon.asInstanceOf[js.Any], polyline = polyline.asInstanceOf[js.Any], pre = pre.asInstanceOf[js.Any], progress = progress.asInstanceOf[js.Any], q = q.asInstanceOf[js.Any], radialGradient = radialGradient.asInstanceOf[js.Any], rect = rect.asInstanceOf[js.Any], rp = rp.asInstanceOf[js.Any], rt = rt.asInstanceOf[js.Any], ruby = ruby.asInstanceOf[js.Any], s = s.asInstanceOf[js.Any], samp = samp.asInstanceOf[js.Any], script = script.asInstanceOf[js.Any], section = section.asInstanceOf[js.Any], select = select.asInstanceOf[js.Any], small = small.asInstanceOf[js.Any], source = source.asInstanceOf[js.Any], span = span.asInstanceOf[js.Any], stop = stop.asInstanceOf[js.Any], strong = strong.asInstanceOf[js.Any], style = style.asInstanceOf[js.Any], sub = sub.asInstanceOf[js.Any], summary = summary.asInstanceOf[js.Any], sup = sup.asInstanceOf[js.Any], svg = svg.asInstanceOf[js.Any], switch = switch.asInstanceOf[js.Any], symbol = symbol.asInstanceOf[js.Any], table = table.asInstanceOf[js.Any], tbody = tbody.asInstanceOf[js.Any], td = td.asInstanceOf[js.Any], template = template.asInstanceOf[js.Any], text = text.asInstanceOf[js.Any], textPath = textPath.asInstanceOf[js.Any], textarea = textarea.asInstanceOf[js.Any], tfoot = tfoot.asInstanceOf[js.Any], th = th.asInstanceOf[js.Any], thead = thead.asInstanceOf[js.Any], time = time.asInstanceOf[js.Any], title = title.asInstanceOf[js.Any], tr = tr.asInstanceOf[js.Any], track = track.asInstanceOf[js.Any], tspan = tspan.asInstanceOf[js.Any], u = u.asInstanceOf[js.Any], ul = ul.asInstanceOf[js.Any], use = use.asInstanceOf[js.Any], video = video.asInstanceOf[js.Any], view = view.asInstanceOf[js.Any], wbr = wbr.asInstanceOf[js.Any], webview = webview.asInstanceOf[js.Any]) __obj.updateDynamic("object")(`object`.asInstanceOf[js.Any]) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/ReactHTML.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/ReactHTML.scala index 1d5dbf1075..ebd511dfdb 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/ReactHTML.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/ReactHTML.scala @@ -1,5 +1,6 @@ package typingsSlinky.react.mod +import org.scalajs.dom.raw.Element import org.scalajs.dom.raw.HTMLAnchorElement import org.scalajs.dom.raw.HTMLAreaElement import org.scalajs.dom.raw.HTMLAudioElement @@ -52,12 +53,6 @@ import org.scalajs.dom.raw.HTMLTitleElement import org.scalajs.dom.raw.HTMLTrackElement import org.scalajs.dom.raw.HTMLUListElement import org.scalajs.dom.raw.HTMLVideoElement -import typingsSlinky.std.HTMLDataElement -import typingsSlinky.std.HTMLDialogElement -import typingsSlinky.std.HTMLTableDataCellElement -import typingsSlinky.std.HTMLTableHeaderCellElement -import typingsSlinky.std.HTMLTemplateElement -import typingsSlinky.std.HTMLWebViewElement import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @@ -89,13 +84,13 @@ trait ReactHTML extends js.Object { var code: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement] = js.native var col: DetailedHTMLFactory[ColHTMLAttributes[HTMLTableColElement], HTMLTableColElement] = js.native var colgroup: DetailedHTMLFactory[ColgroupHTMLAttributes[HTMLTableColElement], HTMLTableColElement] = js.native - var data: DetailedHTMLFactory[DataHTMLAttributes[HTMLDataElement], HTMLDataElement] = js.native + var data: DetailedHTMLFactory[DataHTMLAttributes[Element], Element] = js.native var datalist: DetailedHTMLFactory[HTMLAttributes[HTMLDataListElement], HTMLDataListElement] = js.native var dd: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement] = js.native var del: DetailedHTMLFactory[DelHTMLAttributes[HTMLElement], HTMLElement] = js.native var details: DetailedHTMLFactory[DetailsHTMLAttributes[HTMLElement], HTMLElement] = js.native var dfn: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement] = js.native - var dialog: DetailedHTMLFactory[DialogHTMLAttributes[HTMLDialogElement], HTMLDialogElement] = js.native + var dialog: DetailedHTMLFactory[DialogHTMLAttributes[Element], Element] = js.native var div: DetailedHTMLFactory[HTMLAttributes[HTMLDivElement], HTMLDivElement] = js.native var dl: DetailedHTMLFactory[HTMLAttributes[HTMLDListElement], HTMLDListElement] = js.native var dt: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement] = js.native @@ -166,11 +161,11 @@ trait ReactHTML extends js.Object { var sup: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement] = js.native var table: DetailedHTMLFactory[TableHTMLAttributes[HTMLTableElement], HTMLTableElement] = js.native var tbody: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement] = js.native - var td: DetailedHTMLFactory[TdHTMLAttributes[HTMLTableDataCellElement], HTMLTableDataCellElement] = js.native - var template: DetailedHTMLFactory[HTMLAttributes[HTMLTemplateElement], HTMLTemplateElement] = js.native + var td: DetailedHTMLFactory[TdHTMLAttributes[Element], Element] = js.native + var template: DetailedHTMLFactory[HTMLAttributes[Element], Element] = js.native var textarea: DetailedHTMLFactory[TextareaHTMLAttributes[HTMLTextAreaElement], HTMLTextAreaElement] = js.native var tfoot: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement] = js.native - var th: DetailedHTMLFactory[ThHTMLAttributes[HTMLTableHeaderCellElement], HTMLTableHeaderCellElement] = js.native + var th: DetailedHTMLFactory[ThHTMLAttributes[Element], Element] = js.native var thead: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement] = js.native var time: DetailedHTMLFactory[TimeHTMLAttributes[HTMLElement], HTMLElement] = js.native var title: DetailedHTMLFactory[HTMLAttributes[HTMLTitleElement], HTMLTitleElement] = js.native @@ -181,7 +176,7 @@ trait ReactHTML extends js.Object { var `var`: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement] = js.native var video: DetailedHTMLFactory[VideoHTMLAttributes[HTMLVideoElement], HTMLVideoElement] = js.native var wbr: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement] = js.native - var webview: DetailedHTMLFactory[WebViewHTMLAttributes[HTMLWebViewElement], HTMLWebViewElement] = js.native + var webview: DetailedHTMLFactory[WebViewHTMLAttributes[Element], Element] = js.native } object ReactHTML { @@ -209,13 +204,13 @@ object ReactHTML { code: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], col: DetailedHTMLFactory[ColHTMLAttributes[HTMLTableColElement], HTMLTableColElement], colgroup: DetailedHTMLFactory[ColgroupHTMLAttributes[HTMLTableColElement], HTMLTableColElement], - data: DetailedHTMLFactory[DataHTMLAttributes[HTMLDataElement], HTMLDataElement], + data: DetailedHTMLFactory[DataHTMLAttributes[Element], Element], datalist: DetailedHTMLFactory[HTMLAttributes[HTMLDataListElement], HTMLDataListElement], dd: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], del: DetailedHTMLFactory[DelHTMLAttributes[HTMLElement], HTMLElement], details: DetailedHTMLFactory[DetailsHTMLAttributes[HTMLElement], HTMLElement], dfn: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], - dialog: DetailedHTMLFactory[DialogHTMLAttributes[HTMLDialogElement], HTMLDialogElement], + dialog: DetailedHTMLFactory[DialogHTMLAttributes[Element], Element], div: DetailedHTMLFactory[HTMLAttributes[HTMLDivElement], HTMLDivElement], dl: DetailedHTMLFactory[HTMLAttributes[HTMLDListElement], HTMLDListElement], dt: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], @@ -286,11 +281,11 @@ object ReactHTML { sup: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], table: DetailedHTMLFactory[TableHTMLAttributes[HTMLTableElement], HTMLTableElement], tbody: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], - td: DetailedHTMLFactory[TdHTMLAttributes[HTMLTableDataCellElement], HTMLTableDataCellElement], - template: DetailedHTMLFactory[HTMLAttributes[HTMLTemplateElement], HTMLTemplateElement], + td: DetailedHTMLFactory[TdHTMLAttributes[Element], Element], + template: DetailedHTMLFactory[HTMLAttributes[Element], Element], textarea: DetailedHTMLFactory[TextareaHTMLAttributes[HTMLTextAreaElement], HTMLTextAreaElement], tfoot: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], - th: DetailedHTMLFactory[ThHTMLAttributes[HTMLTableHeaderCellElement], HTMLTableHeaderCellElement], + th: DetailedHTMLFactory[ThHTMLAttributes[Element], Element], thead: DetailedHTMLFactory[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], time: DetailedHTMLFactory[TimeHTMLAttributes[HTMLElement], HTMLElement], title: DetailedHTMLFactory[HTMLAttributes[HTMLTitleElement], HTMLTitleElement], @@ -301,7 +296,7 @@ object ReactHTML { `var`: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], video: DetailedHTMLFactory[VideoHTMLAttributes[HTMLVideoElement], HTMLVideoElement], wbr: DetailedHTMLFactory[HTMLAttributes[HTMLElement], HTMLElement], - webview: DetailedHTMLFactory[WebViewHTMLAttributes[HTMLWebViewElement], HTMLWebViewElement] + webview: DetailedHTMLFactory[WebViewHTMLAttributes[Element], Element] ): ReactHTML = { val __obj = js.Dynamic.literal(a = a.asInstanceOf[js.Any], abbr = abbr.asInstanceOf[js.Any], address = address.asInstanceOf[js.Any], area = area.asInstanceOf[js.Any], article = article.asInstanceOf[js.Any], aside = aside.asInstanceOf[js.Any], audio = audio.asInstanceOf[js.Any], b = b.asInstanceOf[js.Any], base = base.asInstanceOf[js.Any], bdi = bdi.asInstanceOf[js.Any], bdo = bdo.asInstanceOf[js.Any], big = big.asInstanceOf[js.Any], blockquote = blockquote.asInstanceOf[js.Any], body = body.asInstanceOf[js.Any], br = br.asInstanceOf[js.Any], button = button.asInstanceOf[js.Any], canvas = canvas.asInstanceOf[js.Any], caption = caption.asInstanceOf[js.Any], cite = cite.asInstanceOf[js.Any], code = code.asInstanceOf[js.Any], col = col.asInstanceOf[js.Any], colgroup = colgroup.asInstanceOf[js.Any], data = data.asInstanceOf[js.Any], datalist = datalist.asInstanceOf[js.Any], dd = dd.asInstanceOf[js.Any], del = del.asInstanceOf[js.Any], details = details.asInstanceOf[js.Any], dfn = dfn.asInstanceOf[js.Any], dialog = dialog.asInstanceOf[js.Any], div = div.asInstanceOf[js.Any], dl = dl.asInstanceOf[js.Any], dt = dt.asInstanceOf[js.Any], em = em.asInstanceOf[js.Any], embed = embed.asInstanceOf[js.Any], fieldset = fieldset.asInstanceOf[js.Any], figcaption = figcaption.asInstanceOf[js.Any], figure = figure.asInstanceOf[js.Any], footer = footer.asInstanceOf[js.Any], form = form.asInstanceOf[js.Any], h1 = h1.asInstanceOf[js.Any], h2 = h2.asInstanceOf[js.Any], h3 = h3.asInstanceOf[js.Any], h4 = h4.asInstanceOf[js.Any], h5 = h5.asInstanceOf[js.Any], h6 = h6.asInstanceOf[js.Any], head = head.asInstanceOf[js.Any], header = header.asInstanceOf[js.Any], hgroup = hgroup.asInstanceOf[js.Any], hr = hr.asInstanceOf[js.Any], html = html.asInstanceOf[js.Any], i = i.asInstanceOf[js.Any], iframe = iframe.asInstanceOf[js.Any], img = img.asInstanceOf[js.Any], input = input.asInstanceOf[js.Any], ins = ins.asInstanceOf[js.Any], kbd = kbd.asInstanceOf[js.Any], keygen = keygen.asInstanceOf[js.Any], label = label.asInstanceOf[js.Any], legend = legend.asInstanceOf[js.Any], li = li.asInstanceOf[js.Any], link = link.asInstanceOf[js.Any], main = main.asInstanceOf[js.Any], map = map.asInstanceOf[js.Any], mark = mark.asInstanceOf[js.Any], menu = menu.asInstanceOf[js.Any], menuitem = menuitem.asInstanceOf[js.Any], meta = meta.asInstanceOf[js.Any], meter = meter.asInstanceOf[js.Any], nav = nav.asInstanceOf[js.Any], noscript = noscript.asInstanceOf[js.Any], ol = ol.asInstanceOf[js.Any], optgroup = optgroup.asInstanceOf[js.Any], option = option.asInstanceOf[js.Any], output = output.asInstanceOf[js.Any], p = p.asInstanceOf[js.Any], param = param.asInstanceOf[js.Any], picture = picture.asInstanceOf[js.Any], pre = pre.asInstanceOf[js.Any], progress = progress.asInstanceOf[js.Any], q = q.asInstanceOf[js.Any], rp = rp.asInstanceOf[js.Any], rt = rt.asInstanceOf[js.Any], ruby = ruby.asInstanceOf[js.Any], s = s.asInstanceOf[js.Any], samp = samp.asInstanceOf[js.Any], script = script.asInstanceOf[js.Any], section = section.asInstanceOf[js.Any], select = select.asInstanceOf[js.Any], small = small.asInstanceOf[js.Any], source = source.asInstanceOf[js.Any], span = span.asInstanceOf[js.Any], strong = strong.asInstanceOf[js.Any], style = style.asInstanceOf[js.Any], sub = sub.asInstanceOf[js.Any], summary = summary.asInstanceOf[js.Any], sup = sup.asInstanceOf[js.Any], table = table.asInstanceOf[js.Any], tbody = tbody.asInstanceOf[js.Any], td = td.asInstanceOf[js.Any], template = template.asInstanceOf[js.Any], textarea = textarea.asInstanceOf[js.Any], tfoot = tfoot.asInstanceOf[js.Any], th = th.asInstanceOf[js.Any], thead = thead.asInstanceOf[js.Any], time = time.asInstanceOf[js.Any], title = title.asInstanceOf[js.Any], tr = tr.asInstanceOf[js.Any], track = track.asInstanceOf[js.Any], u = u.asInstanceOf[js.Any], ul = ul.asInstanceOf[js.Any], video = video.asInstanceOf[js.Any], wbr = wbr.asInstanceOf[js.Any], webview = webview.asInstanceOf[js.Any]) __obj.updateDynamic("object")(`object`.asInstanceOf[js.Any]) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/TouchEvent.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/TouchEvent.scala index 77a8a43496..bc2fcbbd54 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/TouchEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/TouchEvent.scala @@ -1,5 +1,6 @@ package typingsSlinky.react.mod +import org.scalajs.dom.raw.Event import typingsSlinky.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -36,7 +37,7 @@ object TouchEvent { isPropagationStopped: () => Boolean, isTrusted: Boolean, metaKey: Boolean, - nativeEvent: NativeTouchEvent, + nativeEvent: Event, persist: () => Unit, preventDefault: () => Unit, shiftKey: Boolean, diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/TransitionEvent.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/TransitionEvent.scala index b533ce6082..ae9deb3f7f 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/TransitionEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/TransitionEvent.scala @@ -1,5 +1,6 @@ package typingsSlinky.react.mod +import org.scalajs.dom.raw.Event import typingsSlinky.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -24,7 +25,7 @@ object TransitionEvent { isDefaultPrevented: () => Boolean, isPropagationStopped: () => Boolean, isTrusted: Boolean, - nativeEvent: NativeTransitionEvent, + nativeEvent: Event, persist: () => Unit, preventDefault: () => Unit, propertyName: String, diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/UIEvent.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/UIEvent.scala index d604f254d8..ad8f6fbe49 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/UIEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/UIEvent.scala @@ -1,5 +1,6 @@ package typingsSlinky.react.mod +import org.scalajs.dom.raw.Event import typingsSlinky.std.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -23,7 +24,7 @@ object UIEvent { isDefaultPrevented: () => Boolean, isPropagationStopped: () => Boolean, isTrusted: Boolean, - nativeEvent: NativeUIEvent, + nativeEvent: Event, persist: () => Unit, preventDefault: () => Unit, stopPropagation: () => Unit, diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/WheelEvent.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/WheelEvent.scala index d75accafbe..0d9f9b1d9b 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/WheelEvent.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/WheelEvent.scala @@ -1,5 +1,6 @@ package typingsSlinky.react.mod +import org.scalajs.dom.raw.Event import org.scalajs.dom.raw.EventTarget import scala.scalajs.js import scala.scalajs.js.`|` @@ -38,7 +39,7 @@ object WheelEvent { metaKey: Boolean, movementX: Double, movementY: Double, - nativeEvent: NativeWheelEvent, + nativeEvent: Event, pageX: Double, pageY: Double, persist: () => Unit, diff --git a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/_Global_/JSX/IntrinsicElements.scala b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/_Global_/JSX/IntrinsicElements.scala index 369280e537..5831ffa5ec 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/_Global_/JSX/IntrinsicElements.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/r/react/src/main/scala/typingsSlinky/react/mod/_Global_/JSX/IntrinsicElements.scala @@ -157,14 +157,6 @@ import typingsSlinky.react.mod.TimeHTMLAttributes import typingsSlinky.react.mod.TrackHTMLAttributes import typingsSlinky.react.mod.VideoHTMLAttributes import typingsSlinky.react.mod.WebViewHTMLAttributes -import typingsSlinky.std.HTMLDataElement -import typingsSlinky.std.HTMLDialogElement -import typingsSlinky.std.HTMLTableDataCellElement -import typingsSlinky.std.HTMLTableHeaderCellElement -import typingsSlinky.std.HTMLTemplateElement -import typingsSlinky.std.HTMLWebViewElement -import typingsSlinky.std.SVGFEDropShadowElement -import typingsSlinky.std.SVGForeignObjectElement import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation._ @@ -201,7 +193,7 @@ trait IntrinsicElements extends js.Object { var code: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement] = js.native var col: DetailedHTMLProps[ColHTMLAttributes[HTMLTableColElement], HTMLTableColElement] = js.native var colgroup: DetailedHTMLProps[ColgroupHTMLAttributes[HTMLTableColElement], HTMLTableColElement] = js.native - var data: DetailedHTMLProps[DataHTMLAttributes[HTMLDataElement], HTMLDataElement] = js.native + var data: DetailedHTMLProps[DataHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element] = js.native var datalist: DetailedHTMLProps[HTMLAttributes[HTMLDataListElement], HTMLDataListElement] = js.native var dd: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement] = js.native var defs: SVGProps[SVGDefsElement] = js.native @@ -209,7 +201,7 @@ trait IntrinsicElements extends js.Object { var desc: SVGProps[SVGDescElement] = js.native var details: DetailedHTMLProps[DetailsHTMLAttributes[HTMLElement], HTMLElement] = js.native var dfn: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement] = js.native - var dialog: DetailedHTMLProps[DialogHTMLAttributes[HTMLDialogElement], HTMLDialogElement] = js.native + var dialog: DetailedHTMLProps[DialogHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element] = js.native var div: DetailedHTMLProps[HTMLAttributes[HTMLDivElement], HTMLDivElement] = js.native var dl: DetailedHTMLProps[HTMLAttributes[HTMLDListElement], HTMLDListElement] = js.native var dt: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement] = js.native @@ -224,7 +216,7 @@ trait IntrinsicElements extends js.Object { var feDiffuseLighting: SVGProps[SVGFEDiffuseLightingElement] = js.native var feDisplacementMap: SVGProps[SVGFEDisplacementMapElement] = js.native var feDistantLight: SVGProps[SVGFEDistantLightElement] = js.native - var feDropShadow: SVGProps[SVGFEDropShadowElement] = js.native + var feDropShadow: SVGProps[org.scalajs.dom.raw.Element] = js.native var feFlood: SVGProps[SVGFEFloodElement] = js.native var feFuncA: SVGProps[SVGFEFuncAElement] = js.native var feFuncB: SVGProps[SVGFEFuncBElement] = js.native @@ -246,7 +238,7 @@ trait IntrinsicElements extends js.Object { var figure: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement] = js.native var filter: SVGProps[SVGFilterElement] = js.native var footer: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement] = js.native - var foreignObject: SVGProps[SVGForeignObjectElement] = js.native + var foreignObject: SVGProps[org.scalajs.dom.raw.Element] = js.native var form: DetailedHTMLProps[FormHTMLAttributes[HTMLFormElement], HTMLFormElement] = js.native var g: SVGProps[SVGGElement] = js.native var h1: DetailedHTMLProps[HTMLAttributes[HTMLHeadingElement], HTMLHeadingElement] = js.native @@ -328,13 +320,13 @@ trait IntrinsicElements extends js.Object { var symbol: SVGProps[SVGSymbolElement] = js.native var table: DetailedHTMLProps[TableHTMLAttributes[HTMLTableElement], HTMLTableElement] = js.native var tbody: DetailedHTMLProps[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement] = js.native - var td: DetailedHTMLProps[TdHTMLAttributes[HTMLTableDataCellElement], HTMLTableDataCellElement] = js.native - var template: DetailedHTMLProps[HTMLAttributes[HTMLTemplateElement], HTMLTemplateElement] = js.native + var td: DetailedHTMLProps[TdHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element] = js.native + var template: DetailedHTMLProps[HTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element] = js.native var text: SVGProps[SVGTextElement] = js.native var textPath: SVGProps[SVGTextPathElement] = js.native var textarea: DetailedHTMLProps[TextareaHTMLAttributes[HTMLTextAreaElement], HTMLTextAreaElement] = js.native var tfoot: DetailedHTMLProps[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement] = js.native - var th: DetailedHTMLProps[ThHTMLAttributes[HTMLTableHeaderCellElement], HTMLTableHeaderCellElement] = js.native + var th: DetailedHTMLProps[ThHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element] = js.native var thead: DetailedHTMLProps[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement] = js.native var time: DetailedHTMLProps[TimeHTMLAttributes[HTMLElement], HTMLElement] = js.native var title: DetailedHTMLProps[HTMLAttributes[HTMLTitleElement], HTMLTitleElement] = js.native @@ -348,7 +340,7 @@ trait IntrinsicElements extends js.Object { var video: DetailedHTMLProps[VideoHTMLAttributes[HTMLVideoElement], HTMLVideoElement] = js.native var view: SVGProps[SVGViewElement] = js.native var wbr: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement] = js.native - var webview: DetailedHTMLProps[WebViewHTMLAttributes[HTMLWebViewElement], HTMLWebViewElement] = js.native + var webview: DetailedHTMLProps[WebViewHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element] = js.native } object IntrinsicElements { @@ -381,7 +373,7 @@ object IntrinsicElements { code: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement], col: DetailedHTMLProps[ColHTMLAttributes[HTMLTableColElement], HTMLTableColElement], colgroup: DetailedHTMLProps[ColgroupHTMLAttributes[HTMLTableColElement], HTMLTableColElement], - data: DetailedHTMLProps[DataHTMLAttributes[HTMLDataElement], HTMLDataElement], + data: DetailedHTMLProps[DataHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element], datalist: DetailedHTMLProps[HTMLAttributes[HTMLDataListElement], HTMLDataListElement], dd: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement], defs: SVGProps[SVGDefsElement], @@ -389,7 +381,7 @@ object IntrinsicElements { desc: SVGProps[SVGDescElement], details: DetailedHTMLProps[DetailsHTMLAttributes[HTMLElement], HTMLElement], dfn: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement], - dialog: DetailedHTMLProps[DialogHTMLAttributes[HTMLDialogElement], HTMLDialogElement], + dialog: DetailedHTMLProps[DialogHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element], div: DetailedHTMLProps[HTMLAttributes[HTMLDivElement], HTMLDivElement], dl: DetailedHTMLProps[HTMLAttributes[HTMLDListElement], HTMLDListElement], dt: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement], @@ -404,7 +396,7 @@ object IntrinsicElements { feDiffuseLighting: SVGProps[SVGFEDiffuseLightingElement], feDisplacementMap: SVGProps[SVGFEDisplacementMapElement], feDistantLight: SVGProps[SVGFEDistantLightElement], - feDropShadow: SVGProps[SVGFEDropShadowElement], + feDropShadow: SVGProps[org.scalajs.dom.raw.Element], feFlood: SVGProps[SVGFEFloodElement], feFuncA: SVGProps[SVGFEFuncAElement], feFuncB: SVGProps[SVGFEFuncBElement], @@ -426,7 +418,7 @@ object IntrinsicElements { figure: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement], filter: SVGProps[SVGFilterElement], footer: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement], - foreignObject: SVGProps[SVGForeignObjectElement], + foreignObject: SVGProps[org.scalajs.dom.raw.Element], form: DetailedHTMLProps[FormHTMLAttributes[HTMLFormElement], HTMLFormElement], g: SVGProps[SVGGElement], h1: DetailedHTMLProps[HTMLAttributes[HTMLHeadingElement], HTMLHeadingElement], @@ -507,13 +499,13 @@ object IntrinsicElements { symbol: SVGProps[SVGSymbolElement], table: DetailedHTMLProps[TableHTMLAttributes[HTMLTableElement], HTMLTableElement], tbody: DetailedHTMLProps[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], - td: DetailedHTMLProps[TdHTMLAttributes[HTMLTableDataCellElement], HTMLTableDataCellElement], - template: DetailedHTMLProps[HTMLAttributes[HTMLTemplateElement], HTMLTemplateElement], + td: DetailedHTMLProps[TdHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element], + template: DetailedHTMLProps[HTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element], text: SVGProps[SVGTextElement], textPath: SVGProps[SVGTextPathElement], textarea: DetailedHTMLProps[TextareaHTMLAttributes[HTMLTextAreaElement], HTMLTextAreaElement], tfoot: DetailedHTMLProps[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], - th: DetailedHTMLProps[ThHTMLAttributes[HTMLTableHeaderCellElement], HTMLTableHeaderCellElement], + th: DetailedHTMLProps[ThHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element], thead: DetailedHTMLProps[HTMLAttributes[HTMLTableSectionElement], HTMLTableSectionElement], time: DetailedHTMLProps[TimeHTMLAttributes[HTMLElement], HTMLElement], title: DetailedHTMLProps[HTMLAttributes[HTMLTitleElement], HTMLTitleElement], @@ -527,7 +519,7 @@ object IntrinsicElements { video: DetailedHTMLProps[VideoHTMLAttributes[HTMLVideoElement], HTMLVideoElement], view: SVGProps[SVGViewElement], wbr: DetailedHTMLProps[HTMLAttributes[HTMLElement], HTMLElement], - webview: DetailedHTMLProps[WebViewHTMLAttributes[HTMLWebViewElement], HTMLWebViewElement] + webview: DetailedHTMLProps[WebViewHTMLAttributes[org.scalajs.dom.raw.Element], org.scalajs.dom.raw.Element] ): IntrinsicElements = { val __obj = js.Dynamic.literal(a = a.asInstanceOf[js.Any], abbr = abbr.asInstanceOf[js.Any], address = address.asInstanceOf[js.Any], animate = animate.asInstanceOf[js.Any], animateMotion = animateMotion.asInstanceOf[js.Any], animateTransform = animateTransform.asInstanceOf[js.Any], area = area.asInstanceOf[js.Any], article = article.asInstanceOf[js.Any], aside = aside.asInstanceOf[js.Any], audio = audio.asInstanceOf[js.Any], b = b.asInstanceOf[js.Any], base = base.asInstanceOf[js.Any], bdi = bdi.asInstanceOf[js.Any], bdo = bdo.asInstanceOf[js.Any], big = big.asInstanceOf[js.Any], blockquote = blockquote.asInstanceOf[js.Any], body = body.asInstanceOf[js.Any], br = br.asInstanceOf[js.Any], button = button.asInstanceOf[js.Any], canvas = canvas.asInstanceOf[js.Any], caption = caption.asInstanceOf[js.Any], circle = circle.asInstanceOf[js.Any], cite = cite.asInstanceOf[js.Any], clipPath = clipPath.asInstanceOf[js.Any], code = code.asInstanceOf[js.Any], col = col.asInstanceOf[js.Any], colgroup = colgroup.asInstanceOf[js.Any], data = data.asInstanceOf[js.Any], datalist = datalist.asInstanceOf[js.Any], dd = dd.asInstanceOf[js.Any], defs = defs.asInstanceOf[js.Any], del = del.asInstanceOf[js.Any], desc = desc.asInstanceOf[js.Any], details = details.asInstanceOf[js.Any], dfn = dfn.asInstanceOf[js.Any], dialog = dialog.asInstanceOf[js.Any], div = div.asInstanceOf[js.Any], dl = dl.asInstanceOf[js.Any], dt = dt.asInstanceOf[js.Any], ellipse = ellipse.asInstanceOf[js.Any], em = em.asInstanceOf[js.Any], embed = embed.asInstanceOf[js.Any], feBlend = feBlend.asInstanceOf[js.Any], feColorMatrix = feColorMatrix.asInstanceOf[js.Any], feComponentTransfer = feComponentTransfer.asInstanceOf[js.Any], feComposite = feComposite.asInstanceOf[js.Any], feConvolveMatrix = feConvolveMatrix.asInstanceOf[js.Any], feDiffuseLighting = feDiffuseLighting.asInstanceOf[js.Any], feDisplacementMap = feDisplacementMap.asInstanceOf[js.Any], feDistantLight = feDistantLight.asInstanceOf[js.Any], feDropShadow = feDropShadow.asInstanceOf[js.Any], feFlood = feFlood.asInstanceOf[js.Any], feFuncA = feFuncA.asInstanceOf[js.Any], feFuncB = feFuncB.asInstanceOf[js.Any], feFuncG = feFuncG.asInstanceOf[js.Any], feFuncR = feFuncR.asInstanceOf[js.Any], feGaussianBlur = feGaussianBlur.asInstanceOf[js.Any], feImage = feImage.asInstanceOf[js.Any], feMerge = feMerge.asInstanceOf[js.Any], feMergeNode = feMergeNode.asInstanceOf[js.Any], feMorphology = feMorphology.asInstanceOf[js.Any], feOffset = feOffset.asInstanceOf[js.Any], fePointLight = fePointLight.asInstanceOf[js.Any], feSpecularLighting = feSpecularLighting.asInstanceOf[js.Any], feSpotLight = feSpotLight.asInstanceOf[js.Any], feTile = feTile.asInstanceOf[js.Any], feTurbulence = feTurbulence.asInstanceOf[js.Any], fieldset = fieldset.asInstanceOf[js.Any], figcaption = figcaption.asInstanceOf[js.Any], figure = figure.asInstanceOf[js.Any], filter = filter.asInstanceOf[js.Any], footer = footer.asInstanceOf[js.Any], foreignObject = foreignObject.asInstanceOf[js.Any], form = form.asInstanceOf[js.Any], g = g.asInstanceOf[js.Any], h1 = h1.asInstanceOf[js.Any], h2 = h2.asInstanceOf[js.Any], h3 = h3.asInstanceOf[js.Any], h4 = h4.asInstanceOf[js.Any], h5 = h5.asInstanceOf[js.Any], h6 = h6.asInstanceOf[js.Any], head = head.asInstanceOf[js.Any], header = header.asInstanceOf[js.Any], hgroup = hgroup.asInstanceOf[js.Any], hr = hr.asInstanceOf[js.Any], html = html.asInstanceOf[js.Any], i = i.asInstanceOf[js.Any], iframe = iframe.asInstanceOf[js.Any], image = image.asInstanceOf[js.Any], img = img.asInstanceOf[js.Any], input = input.asInstanceOf[js.Any], ins = ins.asInstanceOf[js.Any], kbd = kbd.asInstanceOf[js.Any], keygen = keygen.asInstanceOf[js.Any], label = label.asInstanceOf[js.Any], legend = legend.asInstanceOf[js.Any], li = li.asInstanceOf[js.Any], line = line.asInstanceOf[js.Any], linearGradient = linearGradient.asInstanceOf[js.Any], link = link.asInstanceOf[js.Any], main = main.asInstanceOf[js.Any], map = map.asInstanceOf[js.Any], mark = mark.asInstanceOf[js.Any], marker = marker.asInstanceOf[js.Any], mask = mask.asInstanceOf[js.Any], menu = menu.asInstanceOf[js.Any], menuitem = menuitem.asInstanceOf[js.Any], meta = meta.asInstanceOf[js.Any], metadata = metadata.asInstanceOf[js.Any], meter = meter.asInstanceOf[js.Any], mpath = mpath.asInstanceOf[js.Any], nav = nav.asInstanceOf[js.Any], noindex = noindex.asInstanceOf[js.Any], noscript = noscript.asInstanceOf[js.Any], ol = ol.asInstanceOf[js.Any], optgroup = optgroup.asInstanceOf[js.Any], option = option.asInstanceOf[js.Any], output = output.asInstanceOf[js.Any], p = p.asInstanceOf[js.Any], param = param.asInstanceOf[js.Any], path = path.asInstanceOf[js.Any], pattern = pattern.asInstanceOf[js.Any], picture = picture.asInstanceOf[js.Any], polygon = polygon.asInstanceOf[js.Any], polyline = polyline.asInstanceOf[js.Any], pre = pre.asInstanceOf[js.Any], progress = progress.asInstanceOf[js.Any], q = q.asInstanceOf[js.Any], radialGradient = radialGradient.asInstanceOf[js.Any], rect = rect.asInstanceOf[js.Any], rp = rp.asInstanceOf[js.Any], rt = rt.asInstanceOf[js.Any], ruby = ruby.asInstanceOf[js.Any], s = s.asInstanceOf[js.Any], samp = samp.asInstanceOf[js.Any], script = script.asInstanceOf[js.Any], section = section.asInstanceOf[js.Any], select = select.asInstanceOf[js.Any], small = small.asInstanceOf[js.Any], source = source.asInstanceOf[js.Any], span = span.asInstanceOf[js.Any], stop = stop.asInstanceOf[js.Any], strong = strong.asInstanceOf[js.Any], style = style.asInstanceOf[js.Any], sub = sub.asInstanceOf[js.Any], summary = summary.asInstanceOf[js.Any], sup = sup.asInstanceOf[js.Any], svg = svg.asInstanceOf[js.Any], switch = switch.asInstanceOf[js.Any], symbol = symbol.asInstanceOf[js.Any], table = table.asInstanceOf[js.Any], tbody = tbody.asInstanceOf[js.Any], td = td.asInstanceOf[js.Any], template = template.asInstanceOf[js.Any], text = text.asInstanceOf[js.Any], textPath = textPath.asInstanceOf[js.Any], textarea = textarea.asInstanceOf[js.Any], tfoot = tfoot.asInstanceOf[js.Any], th = th.asInstanceOf[js.Any], thead = thead.asInstanceOf[js.Any], time = time.asInstanceOf[js.Any], title = title.asInstanceOf[js.Any], tr = tr.asInstanceOf[js.Any], track = track.asInstanceOf[js.Any], tspan = tspan.asInstanceOf[js.Any], u = u.asInstanceOf[js.Any], ul = ul.asInstanceOf[js.Any], use = use.asInstanceOf[js.Any], video = video.asInstanceOf[js.Any], view = view.asInstanceOf[js.Any], wbr = wbr.asInstanceOf[js.Any], webview = webview.asInstanceOf[js.Any]) __obj.updateDynamic("object")(`object`.asInstanceOf[js.Any]) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt index 30a6129bd6..bbef86074d 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "semantic-ui-react" -version := "0.0-unknown-8ecbc1" +version := "0.0-unknown-a862fb" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-b2066d", - "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") + "org.scalablytyped" %%% "react" % "16.9.2-33376e", + "org.scalablytyped" %%% "std" % "0.0-unknown-da34c0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Accordion.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Accordion.scala index 10053d354d..aca8c75b7d 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Accordion.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Accordion.scala @@ -6,7 +6,7 @@ import slinky.core.BuildingComponent import slinky.core.ExternalComponentWithAttributesWithRefType import slinky.core.TagMod import slinky.web.SyntheticMouseEvent -import slinky.web.html.`*`.tag +import slinky.web.html.div.tag import typingsSlinky.semanticUiReact.accordionAccordionMod.AccordionProps import typingsSlinky.semanticUiReact.accordionMod.default import typingsSlinky.semanticUiReact.accordionPanelMod.AccordionPanelProps @@ -49,7 +49,7 @@ object Accordion if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) super.apply(__obj.asInstanceOf[Props]) } - def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, default] = new slinky.core.BuildingComponent[slinky.web.html.`*`.tag.type, typingsSlinky.semanticUiReact.accordionMod.default](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) + def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, default] = new slinky.core.BuildingComponent[slinky.web.html.div.tag.type, typingsSlinky.semanticUiReact.accordionMod.default](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) type Props = AccordionProps } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/AccordionAccordion.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/AccordionAccordion.scala index 3913d7875d..420e416ac9 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/AccordionAccordion.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/AccordionAccordion.scala @@ -6,7 +6,7 @@ import slinky.core.BuildingComponent import slinky.core.ExternalComponentWithAttributesWithRefType import slinky.core.TagMod import slinky.web.SyntheticMouseEvent -import slinky.web.html.`*`.tag +import slinky.web.html.div.tag import typingsSlinky.semanticUiReact.accordionAccordionAccordionMod.AccordionAccordionProps import typingsSlinky.semanticUiReact.accordionAccordionAccordionMod.default import typingsSlinky.semanticUiReact.accordionPanelMod.AccordionPanelProps @@ -44,7 +44,7 @@ object AccordionAccordion super.apply(__obj.asInstanceOf[Props]) } def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, default] = new slinky.core.BuildingComponent[ - slinky.web.html.`*`.tag.type, + slinky.web.html.div.tag.type, typingsSlinky.semanticUiReact.accordionAccordionAccordionMod.default](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) type Props = AccordionAccordionProps } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/AccordionPanel.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/AccordionPanel.scala index 7b89ad62b2..99301511f4 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/AccordionPanel.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/AccordionPanel.scala @@ -6,7 +6,7 @@ import slinky.core.BuildingComponent import slinky.core.ExternalComponentWithAttributesWithRefType import slinky.core.TagMod import slinky.web.SyntheticMouseEvent -import slinky.web.html.`*`.tag +import slinky.web.html.div.tag import typingsSlinky.semanticUiReact.accordionContentMod.AccordionContentProps import typingsSlinky.semanticUiReact.accordionPanelMod.AccordionPanelProps import typingsSlinky.semanticUiReact.accordionPanelMod.default @@ -41,7 +41,7 @@ object AccordionPanel super.apply(__obj.asInstanceOf[Props]) } def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, default] = new slinky.core.BuildingComponent[ - slinky.web.html.`*`.tag.type, + slinky.web.html.div.tag.type, typingsSlinky.semanticUiReact.accordionPanelMod.default](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) type Props = AccordionPanelProps } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/AccordionTitle.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/AccordionTitle.scala index bcc40353b0..e0c16ce892 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/AccordionTitle.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/AccordionTitle.scala @@ -6,7 +6,7 @@ import slinky.core.BuildingComponent import slinky.core.ExternalComponentWithAttributesWithRefType import slinky.core.TagMod import slinky.web.SyntheticMouseEvent -import slinky.web.html.`*`.tag +import slinky.web.html.div.tag import typingsSlinky.semanticUiReact.accordionTitleMod.AccordionTitleProps import typingsSlinky.semanticUiReact.accordionTitleMod.default import typingsSlinky.semanticUiReact.genericMod.SemanticShorthandContent @@ -45,7 +45,7 @@ object AccordionTitle super.apply(__obj.asInstanceOf[Props]) } def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, default] = new slinky.core.BuildingComponent[ - slinky.web.html.`*`.tag.type, + slinky.web.html.div.tag.type, typingsSlinky.semanticUiReact.accordionTitleMod.default](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) type Props = AccordionTitleProps } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Button.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Button.scala index 34cda93547..9ed2f7a26b 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Button.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Button.scala @@ -9,8 +9,7 @@ import slinky.core.ExternalComponentWithAttributesWithRefType import slinky.core.SyntheticEvent import slinky.core.TagMod import slinky.web.SyntheticMouseEvent -import slinky.web.html.`*`.tag -import typingsSlinky.react.mod.CSSProperties +import slinky.web.html.button.tag import typingsSlinky.react.reactStrings.`additions text` import typingsSlinky.react.reactStrings.`inline` import typingsSlinky.react.reactStrings.additions @@ -18,7 +17,6 @@ import typingsSlinky.react.reactStrings.all import typingsSlinky.react.reactStrings.ascending import typingsSlinky.react.reactStrings.assertive import typingsSlinky.react.reactStrings.both -import typingsSlinky.react.reactStrings.button import typingsSlinky.react.reactStrings.copy import typingsSlinky.react.reactStrings.date import typingsSlinky.react.reactStrings.descending @@ -42,10 +40,8 @@ import typingsSlinky.react.reactStrings.page import typingsSlinky.react.reactStrings.polite import typingsSlinky.react.reactStrings.popup import typingsSlinky.react.reactStrings.removals -import typingsSlinky.react.reactStrings.reset import typingsSlinky.react.reactStrings.spelling import typingsSlinky.react.reactStrings.step -import typingsSlinky.react.reactStrings.submit import typingsSlinky.react.reactStrings.text import typingsSlinky.react.reactStrings.time import typingsSlinky.react.reactStrings.tree @@ -80,7 +76,7 @@ object Button object componentImport extends js.Object override val component: String | js.Object = this.componentImport - /* The following DOM/SVG props were specified: autoFocus, className, contentEditable, dangerouslySetInnerHTML, defaultChecked, defaultValue, dir, disabled, draggable, hidden, id, lang, name, onAbort, onAnimationEnd, onAnimationIteration, onAnimationStart, onBlur, onCanPlay, onCanPlayThrough, onChange, onCompositionEnd, onCompositionStart, onCompositionUpdate, onContextMenu, onCopy, onCut, onDoubleClick, onDrag, onDragEnd, onDragEnter, onDragExit, onDragLeave, onDragOver, onDragStart, onDrop, onDurationChange, onEmptied, onEncrypted, onEnded, onError, onFocus, onInput, onInvalid, onKeyDown, onKeyPress, onKeyUp, onLoad, onLoadStart, onLoadedData, onLoadedMetadata, onMouseDown, onMouseEnter, onMouseLeave, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onPaste, onPause, onPlay, onPlaying, onPointerCancel, onPointerDown, onPointerEnter, onPointerLeave, onPointerMove, onPointerOut, onPointerOver, onPointerUp, onProgress, onRateChange, onScroll, onSeeked, onSeeking, onSelect, onStalled, onSubmit, onSuspend, onTimeUpdate, onTouchCancel, onTouchEnd, onTouchMove, onTouchStart, onTransitionEnd, onVolumeChange, onWaiting, onWheel, placeholder, spellCheck, suppressContentEditableWarning, value */ + /* The following DOM/SVG props were specified: className, contentEditable, dangerouslySetInnerHTML, dir, disabled, draggable, form, hidden, id, lang, name, onAbort, onAnimationEnd, onAnimationIteration, onAnimationStart, onBlur, onCanPlay, onCanPlayThrough, onChange, onCompositionEnd, onCompositionStart, onCompositionUpdate, onContextMenu, onCopy, onCut, onDoubleClick, onDrag, onDragEnd, onDragEnter, onDragExit, onDragLeave, onDragOver, onDragStart, onDrop, onDurationChange, onEmptied, onEncrypted, onEnded, onError, onFocus, onInput, onInvalid, onKeyDown, onKeyPress, onKeyUp, onLoad, onLoadStart, onLoadedData, onLoadedMetadata, onMouseDown, onMouseEnter, onMouseLeave, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onPaste, onPause, onPlay, onPlaying, onPointerCancel, onPointerDown, onPointerEnter, onPointerLeave, onPointerMove, onPointerOut, onPointerOver, onPointerUp, onProgress, onRateChange, onScroll, onSeeked, onSeeking, onSelect, onStalled, onSubmit, onSuspend, onTimeUpdate, onTouchCancel, onTouchEnd, onTouchMove, onTouchStart, onTransitionEnd, onVolumeChange, onWaiting, onWheel, spellCheck, style, suppressContentEditableWarning, title, type, value */ def apply( about: String = null, accessKey: String = null, @@ -138,6 +134,7 @@ object Button attached: Boolean | left | right | top | bottom = null, autoCapitalize: String = null, autoCorrect: String = null, + autoFocus: js.UndefOr[Boolean] = js.undefined, autoSave: String = null, basic: js.UndefOr[Boolean] = js.undefined, circular: js.UndefOr[Boolean] = js.undefined, @@ -146,9 +143,10 @@ object Button content: SemanticShorthandContent = null, contextMenu: String = null, datatype: String = null, + defaultChecked: js.UndefOr[Boolean] = js.undefined, + defaultValue: String | js.Array[String] = null, floated: SemanticFLOATS = null, fluid: js.UndefOr[Boolean] = js.undefined, - form: String = null, formAction: String = null, formEncType: String = null, formMethod: String = null, @@ -176,6 +174,7 @@ object Button onBeforeInput: SyntheticEvent[EventTarget with HTMLButtonElement, Event] => Unit = null, onClick: (/* event */ SyntheticMouseEvent[HTMLButtonElement], /* data */ ButtonProps) => Unit = null, onReset: SyntheticEvent[EventTarget with HTMLButtonElement, Event] => Unit = null, + placeholder: String = null, positive: js.UndefOr[Boolean] = js.undefined, prefix: String = null, primary: js.UndefOr[Boolean] = js.undefined, @@ -188,12 +187,9 @@ object Button security: String = null, size: SemanticSIZES = null, slot: String = null, - style: CSSProperties = null, suppressHydrationWarning: js.UndefOr[Boolean] = js.undefined, tabIndex: Double | String = null, - title: String = null, toggle: js.UndefOr[Boolean] = js.undefined, - `type`: submit | reset | button = null, typeof: String = null, unselectable: on | off = null, vocab: String = null, @@ -256,6 +252,7 @@ object Button if (attached != null) __obj.updateDynamic("attached")(attached.asInstanceOf[js.Any]) if (autoCapitalize != null) __obj.updateDynamic("autoCapitalize")(autoCapitalize.asInstanceOf[js.Any]) if (autoCorrect != null) __obj.updateDynamic("autoCorrect")(autoCorrect.asInstanceOf[js.Any]) + if (!js.isUndefined(autoFocus)) __obj.updateDynamic("autoFocus")(autoFocus.asInstanceOf[js.Any]) if (autoSave != null) __obj.updateDynamic("autoSave")(autoSave.asInstanceOf[js.Any]) if (!js.isUndefined(basic)) __obj.updateDynamic("basic")(basic.asInstanceOf[js.Any]) if (!js.isUndefined(circular)) __obj.updateDynamic("circular")(circular.asInstanceOf[js.Any]) @@ -264,9 +261,10 @@ object Button if (content != null) __obj.updateDynamic("content")(content.asInstanceOf[js.Any]) if (contextMenu != null) __obj.updateDynamic("contextMenu")(contextMenu.asInstanceOf[js.Any]) if (datatype != null) __obj.updateDynamic("datatype")(datatype.asInstanceOf[js.Any]) + if (!js.isUndefined(defaultChecked)) __obj.updateDynamic("defaultChecked")(defaultChecked.asInstanceOf[js.Any]) + if (defaultValue != null) __obj.updateDynamic("defaultValue")(defaultValue.asInstanceOf[js.Any]) if (floated != null) __obj.updateDynamic("floated")(floated.asInstanceOf[js.Any]) if (!js.isUndefined(fluid)) __obj.updateDynamic("fluid")(fluid.asInstanceOf[js.Any]) - if (form != null) __obj.updateDynamic("form")(form.asInstanceOf[js.Any]) if (formAction != null) __obj.updateDynamic("formAction")(formAction.asInstanceOf[js.Any]) if (formEncType != null) __obj.updateDynamic("formEncType")(formEncType.asInstanceOf[js.Any]) if (formMethod != null) __obj.updateDynamic("formMethod")(formMethod.asInstanceOf[js.Any]) @@ -290,6 +288,7 @@ object Button if (onBeforeInput != null) __obj.updateDynamic("onBeforeInput")(js.Any.fromFunction1(onBeforeInput)) if (onClick != null) __obj.updateDynamic("onClick")(js.Any.fromFunction2(onClick)) if (onReset != null) __obj.updateDynamic("onReset")(js.Any.fromFunction1(onReset)) + if (placeholder != null) __obj.updateDynamic("placeholder")(placeholder.asInstanceOf[js.Any]) if (!js.isUndefined(positive)) __obj.updateDynamic("positive")(positive.asInstanceOf[js.Any]) if (prefix != null) __obj.updateDynamic("prefix")(prefix.asInstanceOf[js.Any]) if (!js.isUndefined(primary)) __obj.updateDynamic("primary")(primary.asInstanceOf[js.Any]) @@ -302,19 +301,16 @@ object Button if (security != null) __obj.updateDynamic("security")(security.asInstanceOf[js.Any]) if (size != null) __obj.updateDynamic("size")(size.asInstanceOf[js.Any]) if (slot != null) __obj.updateDynamic("slot")(slot.asInstanceOf[js.Any]) - if (style != null) __obj.updateDynamic("style")(style.asInstanceOf[js.Any]) if (!js.isUndefined(suppressHydrationWarning)) __obj.updateDynamic("suppressHydrationWarning")(suppressHydrationWarning.asInstanceOf[js.Any]) if (tabIndex != null) __obj.updateDynamic("tabIndex")(tabIndex.asInstanceOf[js.Any]) - if (title != null) __obj.updateDynamic("title")(title.asInstanceOf[js.Any]) if (!js.isUndefined(toggle)) __obj.updateDynamic("toggle")(toggle.asInstanceOf[js.Any]) - if (`type` != null) __obj.updateDynamic("type")(`type`.asInstanceOf[js.Any]) if (typeof != null) __obj.updateDynamic("typeof")(typeof.asInstanceOf[js.Any]) if (unselectable != null) __obj.updateDynamic("unselectable")(unselectable.asInstanceOf[js.Any]) if (vocab != null) __obj.updateDynamic("vocab")(vocab.asInstanceOf[js.Any]) if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) super.apply(__obj.asInstanceOf[Props]) } - def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, default] = new slinky.core.BuildingComponent[slinky.web.html.`*`.tag.type, typingsSlinky.semanticUiReact.mod.default](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) + def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, default] = new slinky.core.BuildingComponent[slinky.web.html.button.tag.type, typingsSlinky.semanticUiReact.mod.default](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) type Props = ButtonProps } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Input.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Input.scala index acefc4625f..6b4b6b7eb2 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Input.scala +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/semantic-ui-react/src/main/scala/typingsSlinky/semanticUiReact/components/Input.scala @@ -9,8 +9,7 @@ import slinky.core.ExternalComponentWithAttributesWithRefType import slinky.core.SyntheticEvent import slinky.core.TagMod import slinky.web.SyntheticMouseEvent -import slinky.web.html.`*`.tag -import typingsSlinky.react.mod.CSSProperties +import slinky.web.html.input.tag import typingsSlinky.react.mod.ChangeEvent import typingsSlinky.react.reactStrings.`additions text` import typingsSlinky.react.reactStrings.`inline` @@ -74,12 +73,13 @@ object Input object componentImport extends js.Object override val component: String | js.Object = this.componentImport - /* The following DOM/SVG props were specified: accept, alt, autoComplete, autoFocus, capture, checked, className, contentEditable, dangerouslySetInnerHTML, defaultChecked, defaultValue, dir, disabled, draggable, height, hidden, id, lang, list, max, min, multiple, name, onAbort, onAnimationEnd, onAnimationIteration, onAnimationStart, onBlur, onCanPlay, onCanPlayThrough, onClick, onCompositionEnd, onCompositionStart, onCompositionUpdate, onContextMenu, onCopy, onCut, onDoubleClick, onDrag, onDragEnd, onDragEnter, onDragExit, onDragLeave, onDragOver, onDragStart, onDrop, onDurationChange, onEmptied, onEncrypted, onEnded, onError, onFocus, onInput, onInvalid, onKeyDown, onKeyPress, onKeyUp, onLoad, onLoadStart, onLoadedData, onLoadedMetadata, onMouseDown, onMouseEnter, onMouseLeave, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onPaste, onPause, onPlay, onPlaying, onPointerCancel, onPointerDown, onPointerEnter, onPointerLeave, onPointerMove, onPointerOut, onPointerOver, onPointerUp, onProgress, onRateChange, onScroll, onSeeked, onSeeking, onSelect, onStalled, onSubmit, onSuspend, onTimeUpdate, onTouchCancel, onTouchEnd, onTouchMove, onTouchStart, onTransitionEnd, onVolumeChange, onWaiting, onWheel, pattern, placeholder, readOnly, required, spellCheck, src, step, suppressContentEditableWarning, type, value, width */ + /* The following DOM/SVG props were specified: accept, autoComplete, autoFocus, capture, checked, className, contentEditable, dangerouslySetInnerHTML, defaultChecked, defaultValue, dir, disabled, draggable, form, height, hidden, id, lang, list, max, min, multiple, name, onAbort, onAnimationEnd, onAnimationIteration, onAnimationStart, onBlur, onCanPlay, onCanPlayThrough, onClick, onCompositionEnd, onCompositionStart, onCompositionUpdate, onContextMenu, onCopy, onCut, onDoubleClick, onDrag, onDragEnd, onDragEnter, onDragExit, onDragLeave, onDragOver, onDragStart, onDrop, onDurationChange, onEmptied, onEncrypted, onEnded, onError, onFocus, onInput, onInvalid, onKeyDown, onKeyPress, onKeyUp, onLoad, onLoadStart, onLoadedData, onLoadedMetadata, onMouseDown, onMouseEnter, onMouseLeave, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onPaste, onPause, onPlay, onPlaying, onPointerCancel, onPointerDown, onPointerEnter, onPointerLeave, onPointerMove, onPointerOut, onPointerOver, onPointerUp, onProgress, onRateChange, onScroll, onSeeked, onSeeking, onSelect, onStalled, onSubmit, onSuspend, onTimeUpdate, onTouchCancel, onTouchEnd, onTouchMove, onTouchStart, onTransitionEnd, onVolumeChange, onWaiting, onWheel, pattern, placeholder, readOnly, required, spellCheck, src, step, style, suppressContentEditableWarning, title, type, value, width */ def apply( about: String = null, accessKey: String = null, action: js.Any | Boolean = null, actionPosition: left = null, + alt: String = null, `aria-activedescendant`: String = null, `aria-atomic`: js.UndefOr[Boolean] = js.undefined, `aria-autocomplete`: none | `inline` | list | both = null, @@ -139,7 +139,6 @@ object Input error: js.UndefOr[Boolean] = js.undefined, fluid: js.UndefOr[Boolean] = js.undefined, focus: js.UndefOr[Boolean] = js.undefined, - form: String = null, formAction: String = null, formEncType: String = null, formMethod: String = null, @@ -177,10 +176,8 @@ object Input security: String = null, size: mini | small | large | big | huge | massive = null, slot: String = null, - style: CSSProperties = null, suppressHydrationWarning: js.UndefOr[Boolean] = js.undefined, tabIndex: Double | String = null, - title: String = null, transparent: js.UndefOr[Boolean] = js.undefined, typeof: String = null, unselectable: on | off = null, @@ -192,6 +189,7 @@ object Input if (accessKey != null) __obj.updateDynamic("accessKey")(accessKey.asInstanceOf[js.Any]) if (action != null) __obj.updateDynamic("action")(action.asInstanceOf[js.Any]) if (actionPosition != null) __obj.updateDynamic("actionPosition")(actionPosition.asInstanceOf[js.Any]) + if (alt != null) __obj.updateDynamic("alt")(alt.asInstanceOf[js.Any]) if (`aria-activedescendant` != null) __obj.updateDynamic("aria-activedescendant")(`aria-activedescendant`.asInstanceOf[js.Any]) if (!js.isUndefined(`aria-atomic`)) __obj.updateDynamic("aria-atomic")(`aria-atomic`.asInstanceOf[js.Any]) if (`aria-autocomplete` != null) __obj.updateDynamic("aria-autocomplete")(`aria-autocomplete`.asInstanceOf[js.Any]) @@ -251,7 +249,6 @@ object Input if (!js.isUndefined(error)) __obj.updateDynamic("error")(error.asInstanceOf[js.Any]) if (!js.isUndefined(fluid)) __obj.updateDynamic("fluid")(fluid.asInstanceOf[js.Any]) if (!js.isUndefined(focus)) __obj.updateDynamic("focus")(focus.asInstanceOf[js.Any]) - if (form != null) __obj.updateDynamic("form")(form.asInstanceOf[js.Any]) if (formAction != null) __obj.updateDynamic("formAction")(formAction.asInstanceOf[js.Any]) if (formEncType != null) __obj.updateDynamic("formEncType")(formEncType.asInstanceOf[js.Any]) if (formMethod != null) __obj.updateDynamic("formMethod")(formMethod.asInstanceOf[js.Any]) @@ -287,10 +284,8 @@ object Input if (security != null) __obj.updateDynamic("security")(security.asInstanceOf[js.Any]) if (size != null) __obj.updateDynamic("size")(size.asInstanceOf[js.Any]) if (slot != null) __obj.updateDynamic("slot")(slot.asInstanceOf[js.Any]) - if (style != null) __obj.updateDynamic("style")(style.asInstanceOf[js.Any]) if (!js.isUndefined(suppressHydrationWarning)) __obj.updateDynamic("suppressHydrationWarning")(suppressHydrationWarning.asInstanceOf[js.Any]) if (tabIndex != null) __obj.updateDynamic("tabIndex")(tabIndex.asInstanceOf[js.Any]) - if (title != null) __obj.updateDynamic("title")(title.asInstanceOf[js.Any]) if (!js.isUndefined(transparent)) __obj.updateDynamic("transparent")(transparent.asInstanceOf[js.Any]) if (typeof != null) __obj.updateDynamic("typeof")(typeof.asInstanceOf[js.Any]) if (unselectable != null) __obj.updateDynamic("unselectable")(unselectable.asInstanceOf[js.Any]) @@ -298,7 +293,7 @@ object Input if (_overrides != null) js.Dynamic.global.Object.assign(__obj, _overrides) super.apply(__obj.asInstanceOf[Props]) } - def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, default] = new slinky.core.BuildingComponent[slinky.web.html.`*`.tag.type, typingsSlinky.semanticUiReact.inputMod.default](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) + def apply(mods: TagMod[tag.type]*): BuildingComponent[tag.type, default] = new slinky.core.BuildingComponent[slinky.web.html.input.tag.type, typingsSlinky.semanticUiReact.inputMod.default](js.Array(component.asInstanceOf[js.Any], js.Dictionary.empty)).apply(mods: _*) type Props = InputProps } diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/build.sbt index af17c243c5..fe65f66b67 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-event-listener/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-event-listener" -version := "0.38.0-65ba95" +version := "0.38.0-e49227" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-b2066d", - "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") + "org.scalablytyped" %%% "react" % "16.9.2-33376e", + "org.scalablytyped" %%% "std" % "0.0-unknown-da34c0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/build.sbt index f173a0528b..48da8116aa 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/stardust-ui__react-component-ref/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-ref" -version := "0.38.0-e7b67d" +version := "0.38.0-a02e23" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "16.9.2-b2066d", - "org.scalablytyped" %%% "std" % "0.0-unknown-18a94a") + "org.scalablytyped" %%% "react" % "16.9.2-33376e", + "org.scalablytyped" %%% "std" % "0.0-unknown-da34c0") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/std/build.sbt b/importer/src/test/resources/react-integration-test/check-slinky/s/std/build.sbt index a61ddab49e..d592f9bbd8 100644 --- a/importer/src/test/resources/react-integration-test/check-slinky/s/std/build.sbt +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-18a94a" +version := "0.0-unknown-da34c0" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/std/src/main/scala/typingsSlinky/std/HTMLElementTagNameMap.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/std/src/main/scala/typingsSlinky/std/HTMLElementTagNameMap.scala new file mode 100644 index 0000000000..07a525749f --- /dev/null +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/std/src/main/scala/typingsSlinky/std/HTMLElementTagNameMap.scala @@ -0,0 +1,229 @@ +package typingsSlinky.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait HTMLElementTagNameMap extends js.Object { + var a: org.scalajs.dom.raw.HTMLAnchorElement = js.native + var abbr: org.scalajs.dom.raw.HTMLElement = js.native + var address: org.scalajs.dom.raw.HTMLElement = js.native + var area: org.scalajs.dom.raw.HTMLAreaElement = js.native + var article: org.scalajs.dom.raw.HTMLElement = js.native + var aside: org.scalajs.dom.raw.HTMLElement = js.native + var audio: org.scalajs.dom.raw.HTMLAudioElement = js.native + var b: org.scalajs.dom.raw.HTMLElement = js.native + var base: org.scalajs.dom.raw.HTMLBaseElement = js.native + var bdi: org.scalajs.dom.raw.HTMLElement = js.native + var bdo: org.scalajs.dom.raw.HTMLElement = js.native + var blockquote: org.scalajs.dom.raw.HTMLQuoteElement = js.native + var body: org.scalajs.dom.raw.HTMLBodyElement = js.native + var br: org.scalajs.dom.raw.HTMLBRElement = js.native + var button: org.scalajs.dom.raw.HTMLButtonElement = js.native + var canvas: org.scalajs.dom.raw.HTMLCanvasElement = js.native + var cite: org.scalajs.dom.raw.HTMLElement = js.native + var code: org.scalajs.dom.raw.HTMLElement = js.native + var col: org.scalajs.dom.raw.HTMLTableColElement = js.native + var colgroup: org.scalajs.dom.raw.HTMLTableColElement = js.native + var data: org.scalajs.dom.raw.Element = js.native + var datalist: org.scalajs.dom.raw.HTMLDataListElement = js.native + var dd: org.scalajs.dom.raw.HTMLElement = js.native + var del: org.scalajs.dom.raw.HTMLModElement = js.native + var dfn: org.scalajs.dom.raw.HTMLElement = js.native + var dialog: org.scalajs.dom.raw.Element = js.native + var div: org.scalajs.dom.raw.HTMLDivElement = js.native + var dl: org.scalajs.dom.raw.HTMLDListElement = js.native + var dt: org.scalajs.dom.raw.HTMLElement = js.native + var em: org.scalajs.dom.raw.HTMLElement = js.native + var embed: org.scalajs.dom.raw.HTMLEmbedElement = js.native + var fieldset: org.scalajs.dom.raw.HTMLFieldSetElement = js.native + var figcaption: org.scalajs.dom.raw.HTMLElement = js.native + var figure: org.scalajs.dom.raw.HTMLElement = js.native + var footer: org.scalajs.dom.raw.HTMLElement = js.native + var form: org.scalajs.dom.raw.HTMLFormElement = js.native + var h1: org.scalajs.dom.raw.HTMLHeadingElement = js.native + var h2: org.scalajs.dom.raw.HTMLHeadingElement = js.native + var h3: org.scalajs.dom.raw.HTMLHeadingElement = js.native + var h4: org.scalajs.dom.raw.HTMLHeadingElement = js.native + var h5: org.scalajs.dom.raw.HTMLHeadingElement = js.native + var h6: org.scalajs.dom.raw.HTMLHeadingElement = js.native + var head: org.scalajs.dom.raw.HTMLHeadElement = js.native + var header: org.scalajs.dom.raw.HTMLElement = js.native + var hgroup: org.scalajs.dom.raw.HTMLElement = js.native + var hr: org.scalajs.dom.raw.HTMLHRElement = js.native + var html: org.scalajs.dom.raw.HTMLHtmlElement = js.native + var i: org.scalajs.dom.raw.HTMLElement = js.native + var iframe: org.scalajs.dom.raw.HTMLIFrameElement = js.native + var img: org.scalajs.dom.raw.HTMLImageElement = js.native + var input: org.scalajs.dom.raw.HTMLInputElement = js.native + var ins: org.scalajs.dom.raw.HTMLModElement = js.native + var kbd: org.scalajs.dom.raw.HTMLElement = js.native + var label: org.scalajs.dom.raw.HTMLLabelElement = js.native + var legend: org.scalajs.dom.raw.HTMLLegendElement = js.native + var li: org.scalajs.dom.raw.HTMLLIElement = js.native + var link: org.scalajs.dom.raw.HTMLLinkElement = js.native + var main: org.scalajs.dom.raw.HTMLElement = js.native + var map: org.scalajs.dom.raw.HTMLMapElement = js.native + var mark: org.scalajs.dom.raw.HTMLElement = js.native + var meta: org.scalajs.dom.raw.HTMLMetaElement = js.native + var nav: org.scalajs.dom.raw.HTMLElement = js.native + var noscript: org.scalajs.dom.raw.HTMLElement = js.native + var `object`: org.scalajs.dom.raw.HTMLObjectElement = js.native + var ol: org.scalajs.dom.raw.HTMLOListElement = js.native + var optgroup: org.scalajs.dom.raw.HTMLOptGroupElement = js.native + var option: org.scalajs.dom.raw.HTMLOptionElement = js.native + var p: org.scalajs.dom.raw.HTMLParagraphElement = js.native + var param: org.scalajs.dom.raw.HTMLParamElement = js.native + var pre: org.scalajs.dom.raw.HTMLPreElement = js.native + var progress: org.scalajs.dom.raw.HTMLProgressElement = js.native + var q: org.scalajs.dom.raw.HTMLQuoteElement = js.native + var rp: org.scalajs.dom.raw.HTMLElement = js.native + var rt: org.scalajs.dom.raw.HTMLElement = js.native + var ruby: org.scalajs.dom.raw.HTMLElement = js.native + var s: org.scalajs.dom.raw.HTMLElement = js.native + var samp: org.scalajs.dom.raw.HTMLElement = js.native + var script: org.scalajs.dom.raw.HTMLScriptElement = js.native + var section: org.scalajs.dom.raw.HTMLElement = js.native + var select: org.scalajs.dom.raw.HTMLSelectElement = js.native + var small: org.scalajs.dom.raw.HTMLElement = js.native + var source: org.scalajs.dom.raw.HTMLSourceElement = js.native + var span: org.scalajs.dom.raw.HTMLSpanElement = js.native + var strong: org.scalajs.dom.raw.HTMLElement = js.native + var style: org.scalajs.dom.raw.HTMLStyleElement = js.native + var sub: org.scalajs.dom.raw.HTMLElement = js.native + var summary: org.scalajs.dom.raw.HTMLElement = js.native + var sup: org.scalajs.dom.raw.HTMLElement = js.native + var table: org.scalajs.dom.raw.HTMLTableElement = js.native + var tbody: org.scalajs.dom.raw.HTMLTableSectionElement = js.native + var td: org.scalajs.dom.raw.Element = js.native + var template: org.scalajs.dom.raw.Element = js.native + var textarea: org.scalajs.dom.raw.HTMLTextAreaElement = js.native + var tfoot: org.scalajs.dom.raw.HTMLTableSectionElement = js.native + var th: org.scalajs.dom.raw.Element = js.native + var thead: org.scalajs.dom.raw.HTMLTableSectionElement = js.native + var title: org.scalajs.dom.raw.HTMLTitleElement = js.native + var tr: org.scalajs.dom.raw.HTMLTableRowElement = js.native + var track: org.scalajs.dom.raw.HTMLTrackElement = js.native + var u: org.scalajs.dom.raw.HTMLElement = js.native + var ul: org.scalajs.dom.raw.HTMLUListElement = js.native + var `var`: org.scalajs.dom.raw.HTMLElement = js.native + var video: org.scalajs.dom.raw.HTMLVideoElement = js.native + var wbr: org.scalajs.dom.raw.HTMLElement = js.native +} + +object HTMLElementTagNameMap { + @scala.inline + def apply( + a: org.scalajs.dom.raw.HTMLAnchorElement, + abbr: org.scalajs.dom.raw.HTMLElement, + address: org.scalajs.dom.raw.HTMLElement, + area: org.scalajs.dom.raw.HTMLAreaElement, + article: org.scalajs.dom.raw.HTMLElement, + aside: org.scalajs.dom.raw.HTMLElement, + audio: org.scalajs.dom.raw.HTMLAudioElement, + b: org.scalajs.dom.raw.HTMLElement, + base: org.scalajs.dom.raw.HTMLBaseElement, + bdi: org.scalajs.dom.raw.HTMLElement, + bdo: org.scalajs.dom.raw.HTMLElement, + blockquote: org.scalajs.dom.raw.HTMLQuoteElement, + body: org.scalajs.dom.raw.HTMLBodyElement, + br: org.scalajs.dom.raw.HTMLBRElement, + button: org.scalajs.dom.raw.HTMLButtonElement, + canvas: org.scalajs.dom.raw.HTMLCanvasElement, + cite: org.scalajs.dom.raw.HTMLElement, + code: org.scalajs.dom.raw.HTMLElement, + col: org.scalajs.dom.raw.HTMLTableColElement, + colgroup: org.scalajs.dom.raw.HTMLTableColElement, + data: org.scalajs.dom.raw.Element, + datalist: org.scalajs.dom.raw.HTMLDataListElement, + dd: org.scalajs.dom.raw.HTMLElement, + del: org.scalajs.dom.raw.HTMLModElement, + dfn: org.scalajs.dom.raw.HTMLElement, + dialog: org.scalajs.dom.raw.Element, + div: org.scalajs.dom.raw.HTMLDivElement, + dl: org.scalajs.dom.raw.HTMLDListElement, + dt: org.scalajs.dom.raw.HTMLElement, + em: org.scalajs.dom.raw.HTMLElement, + embed: org.scalajs.dom.raw.HTMLEmbedElement, + fieldset: org.scalajs.dom.raw.HTMLFieldSetElement, + figcaption: org.scalajs.dom.raw.HTMLElement, + figure: org.scalajs.dom.raw.HTMLElement, + footer: org.scalajs.dom.raw.HTMLElement, + form: org.scalajs.dom.raw.HTMLFormElement, + h1: org.scalajs.dom.raw.HTMLHeadingElement, + h2: org.scalajs.dom.raw.HTMLHeadingElement, + h3: org.scalajs.dom.raw.HTMLHeadingElement, + h4: org.scalajs.dom.raw.HTMLHeadingElement, + h5: org.scalajs.dom.raw.HTMLHeadingElement, + h6: org.scalajs.dom.raw.HTMLHeadingElement, + head: org.scalajs.dom.raw.HTMLHeadElement, + header: org.scalajs.dom.raw.HTMLElement, + hgroup: org.scalajs.dom.raw.HTMLElement, + hr: org.scalajs.dom.raw.HTMLHRElement, + html: org.scalajs.dom.raw.HTMLHtmlElement, + i: org.scalajs.dom.raw.HTMLElement, + iframe: org.scalajs.dom.raw.HTMLIFrameElement, + img: org.scalajs.dom.raw.HTMLImageElement, + input: org.scalajs.dom.raw.HTMLInputElement, + ins: org.scalajs.dom.raw.HTMLModElement, + kbd: org.scalajs.dom.raw.HTMLElement, + label: org.scalajs.dom.raw.HTMLLabelElement, + legend: org.scalajs.dom.raw.HTMLLegendElement, + li: org.scalajs.dom.raw.HTMLLIElement, + link: org.scalajs.dom.raw.HTMLLinkElement, + main: org.scalajs.dom.raw.HTMLElement, + map: org.scalajs.dom.raw.HTMLMapElement, + mark: org.scalajs.dom.raw.HTMLElement, + meta: org.scalajs.dom.raw.HTMLMetaElement, + nav: org.scalajs.dom.raw.HTMLElement, + noscript: org.scalajs.dom.raw.HTMLElement, + `object`: org.scalajs.dom.raw.HTMLObjectElement, + ol: org.scalajs.dom.raw.HTMLOListElement, + optgroup: org.scalajs.dom.raw.HTMLOptGroupElement, + option: org.scalajs.dom.raw.HTMLOptionElement, + p: org.scalajs.dom.raw.HTMLParagraphElement, + param: org.scalajs.dom.raw.HTMLParamElement, + pre: org.scalajs.dom.raw.HTMLPreElement, + progress: org.scalajs.dom.raw.HTMLProgressElement, + q: org.scalajs.dom.raw.HTMLQuoteElement, + rp: org.scalajs.dom.raw.HTMLElement, + rt: org.scalajs.dom.raw.HTMLElement, + ruby: org.scalajs.dom.raw.HTMLElement, + s: org.scalajs.dom.raw.HTMLElement, + samp: org.scalajs.dom.raw.HTMLElement, + script: org.scalajs.dom.raw.HTMLScriptElement, + section: org.scalajs.dom.raw.HTMLElement, + select: org.scalajs.dom.raw.HTMLSelectElement, + small: org.scalajs.dom.raw.HTMLElement, + source: org.scalajs.dom.raw.HTMLSourceElement, + span: org.scalajs.dom.raw.HTMLSpanElement, + strong: org.scalajs.dom.raw.HTMLElement, + style: org.scalajs.dom.raw.HTMLStyleElement, + sub: org.scalajs.dom.raw.HTMLElement, + summary: org.scalajs.dom.raw.HTMLElement, + sup: org.scalajs.dom.raw.HTMLElement, + table: org.scalajs.dom.raw.HTMLTableElement, + tbody: org.scalajs.dom.raw.HTMLTableSectionElement, + td: org.scalajs.dom.raw.Element, + template: org.scalajs.dom.raw.Element, + textarea: org.scalajs.dom.raw.HTMLTextAreaElement, + tfoot: org.scalajs.dom.raw.HTMLTableSectionElement, + th: org.scalajs.dom.raw.Element, + thead: org.scalajs.dom.raw.HTMLTableSectionElement, + title: org.scalajs.dom.raw.HTMLTitleElement, + tr: org.scalajs.dom.raw.HTMLTableRowElement, + track: org.scalajs.dom.raw.HTMLTrackElement, + u: org.scalajs.dom.raw.HTMLElement, + ul: org.scalajs.dom.raw.HTMLUListElement, + `var`: org.scalajs.dom.raw.HTMLElement, + video: org.scalajs.dom.raw.HTMLVideoElement, + wbr: org.scalajs.dom.raw.HTMLElement + ): HTMLElementTagNameMap = { + val __obj = js.Dynamic.literal(a = a.asInstanceOf[js.Any], abbr = abbr.asInstanceOf[js.Any], address = address.asInstanceOf[js.Any], area = area.asInstanceOf[js.Any], article = article.asInstanceOf[js.Any], aside = aside.asInstanceOf[js.Any], audio = audio.asInstanceOf[js.Any], b = b.asInstanceOf[js.Any], base = base.asInstanceOf[js.Any], bdi = bdi.asInstanceOf[js.Any], bdo = bdo.asInstanceOf[js.Any], blockquote = blockquote.asInstanceOf[js.Any], body = body.asInstanceOf[js.Any], br = br.asInstanceOf[js.Any], button = button.asInstanceOf[js.Any], canvas = canvas.asInstanceOf[js.Any], cite = cite.asInstanceOf[js.Any], code = code.asInstanceOf[js.Any], col = col.asInstanceOf[js.Any], colgroup = colgroup.asInstanceOf[js.Any], data = data.asInstanceOf[js.Any], datalist = datalist.asInstanceOf[js.Any], dd = dd.asInstanceOf[js.Any], del = del.asInstanceOf[js.Any], dfn = dfn.asInstanceOf[js.Any], dialog = dialog.asInstanceOf[js.Any], div = div.asInstanceOf[js.Any], dl = dl.asInstanceOf[js.Any], dt = dt.asInstanceOf[js.Any], em = em.asInstanceOf[js.Any], embed = embed.asInstanceOf[js.Any], fieldset = fieldset.asInstanceOf[js.Any], figcaption = figcaption.asInstanceOf[js.Any], figure = figure.asInstanceOf[js.Any], footer = footer.asInstanceOf[js.Any], form = form.asInstanceOf[js.Any], h1 = h1.asInstanceOf[js.Any], h2 = h2.asInstanceOf[js.Any], h3 = h3.asInstanceOf[js.Any], h4 = h4.asInstanceOf[js.Any], h5 = h5.asInstanceOf[js.Any], h6 = h6.asInstanceOf[js.Any], head = head.asInstanceOf[js.Any], header = header.asInstanceOf[js.Any], hgroup = hgroup.asInstanceOf[js.Any], hr = hr.asInstanceOf[js.Any], html = html.asInstanceOf[js.Any], i = i.asInstanceOf[js.Any], iframe = iframe.asInstanceOf[js.Any], img = img.asInstanceOf[js.Any], input = input.asInstanceOf[js.Any], ins = ins.asInstanceOf[js.Any], kbd = kbd.asInstanceOf[js.Any], label = label.asInstanceOf[js.Any], legend = legend.asInstanceOf[js.Any], li = li.asInstanceOf[js.Any], link = link.asInstanceOf[js.Any], main = main.asInstanceOf[js.Any], map = map.asInstanceOf[js.Any], mark = mark.asInstanceOf[js.Any], meta = meta.asInstanceOf[js.Any], nav = nav.asInstanceOf[js.Any], noscript = noscript.asInstanceOf[js.Any], ol = ol.asInstanceOf[js.Any], optgroup = optgroup.asInstanceOf[js.Any], option = option.asInstanceOf[js.Any], p = p.asInstanceOf[js.Any], param = param.asInstanceOf[js.Any], pre = pre.asInstanceOf[js.Any], progress = progress.asInstanceOf[js.Any], q = q.asInstanceOf[js.Any], rp = rp.asInstanceOf[js.Any], rt = rt.asInstanceOf[js.Any], ruby = ruby.asInstanceOf[js.Any], s = s.asInstanceOf[js.Any], samp = samp.asInstanceOf[js.Any], script = script.asInstanceOf[js.Any], section = section.asInstanceOf[js.Any], select = select.asInstanceOf[js.Any], small = small.asInstanceOf[js.Any], source = source.asInstanceOf[js.Any], span = span.asInstanceOf[js.Any], strong = strong.asInstanceOf[js.Any], style = style.asInstanceOf[js.Any], sub = sub.asInstanceOf[js.Any], summary = summary.asInstanceOf[js.Any], sup = sup.asInstanceOf[js.Any], table = table.asInstanceOf[js.Any], tbody = tbody.asInstanceOf[js.Any], td = td.asInstanceOf[js.Any], template = template.asInstanceOf[js.Any], textarea = textarea.asInstanceOf[js.Any], tfoot = tfoot.asInstanceOf[js.Any], th = th.asInstanceOf[js.Any], thead = thead.asInstanceOf[js.Any], title = title.asInstanceOf[js.Any], tr = tr.asInstanceOf[js.Any], track = track.asInstanceOf[js.Any], u = u.asInstanceOf[js.Any], ul = ul.asInstanceOf[js.Any], video = video.asInstanceOf[js.Any], wbr = wbr.asInstanceOf[js.Any]) + __obj.updateDynamic("object")(`object`.asInstanceOf[js.Any]) + __obj.updateDynamic("var")(`var`.asInstanceOf[js.Any]) + __obj.asInstanceOf[HTMLElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/react-integration-test/check-slinky/s/std/src/main/scala/typingsSlinky/std/SVGElementTagNameMap.scala b/importer/src/test/resources/react-integration-test/check-slinky/s/std/src/main/scala/typingsSlinky/std/SVGElementTagNameMap.scala new file mode 100644 index 0000000000..644d20df08 --- /dev/null +++ b/importer/src/test/resources/react-integration-test/check-slinky/s/std/src/main/scala/typingsSlinky/std/SVGElementTagNameMap.scala @@ -0,0 +1,26 @@ +package typingsSlinky.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait SVGElementTagNameMap extends js.Object { + var circle: org.scalajs.dom.raw.SVGCircleElement = js.native + var clipPath: org.scalajs.dom.raw.SVGClipPathElement = js.native + var defs: org.scalajs.dom.raw.SVGDefsElement = js.native +} + +object SVGElementTagNameMap { + @scala.inline + def apply( + circle: org.scalajs.dom.raw.SVGCircleElement, + clipPath: org.scalajs.dom.raw.SVGClipPathElement, + defs: org.scalajs.dom.raw.SVGDefsElement + ): SVGElementTagNameMap = { + val __obj = js.Dynamic.literal(circle = circle.asInstanceOf[js.Any], clipPath = clipPath.asInstanceOf[js.Any], defs = defs.asInstanceOf[js.Any]) + + __obj.asInstanceOf[SVGElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/react-integration-test/check/c/componentstest/build.sbt b/importer/src/test/resources/react-integration-test/check/c/componentstest/build.sbt index 051a59cf59..9ff01472d6 100644 --- a/importer/src/test/resources/react-integration-test/check/c/componentstest/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/c/componentstest/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "componentstest" -version := "0.0-unknown-6e420e" +version := "0.0-unknown-a43bcb" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", - "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") + "org.scalablytyped" %%% "react" % "16.9.2-59b62d", + "org.scalablytyped" %%% "std" % "0.0-unknown-b0247b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/r/react-bootstrap/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react-bootstrap/build.sbt index 12ec9ebc36..05ab2e19d1 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-bootstrap/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react-bootstrap/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-bootstrap" -version := "0.32-003a4a" +version := "0.32-62366a" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", - "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") + "org.scalablytyped" %%% "react" % "16.9.2-59b62d", + "org.scalablytyped" %%% "std" % "0.0-unknown-b0247b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/r/react-contextmenu/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react-contextmenu/build.sbt index 7e0ddd1078..e9dcf085fa 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-contextmenu/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react-contextmenu/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-contextmenu" -version := "2.13.0-81c302" +version := "2.13.0-7d56b6" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", - "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") + "org.scalablytyped" %%% "react" % "16.9.2-59b62d", + "org.scalablytyped" %%% "std" % "0.0-unknown-b0247b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt index 7c8a936c7e..af1bc53ecc 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react-dropzone/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-dropzone" -version := "10.1.10-b3d691" +version := "10.1.10-f76e60" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", - "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") + "org.scalablytyped" %%% "react" % "16.9.2-59b62d", + "org.scalablytyped" %%% "std" % "0.0-unknown-b0247b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/r/react-select/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react-select/build.sbt index 1c74ff1708..38e627e42e 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react-select/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react-select/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-select" -version := "0.0-unknown-2421e4" +version := "0.0-unknown-34f1f8" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", - "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") + "org.scalablytyped" %%% "react" % "16.9.2-59b62d", + "org.scalablytyped" %%% "std" % "0.0-unknown-b0247b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/r/react/build.sbt b/importer/src/test/resources/react-integration-test/check/r/react/build.sbt index 7c7bf8091c..61af3162ca 100644 --- a/importer/src/test/resources/react-integration-test/check/r/react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/r/react/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "react" -version := "16.9.2-6e4c5b" +version := "16.9.2-59b62d" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") + "org.scalablytyped" %%% "std" % "0.0-unknown-b0247b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/s/semantic-ui-react/build.sbt b/importer/src/test/resources/react-integration-test/check/s/semantic-ui-react/build.sbt index ca31e4742c..53f1396bb9 100644 --- a/importer/src/test/resources/react-integration-test/check/s/semantic-ui-react/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/s/semantic-ui-react/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "semantic-ui-react" -version := "0.0-unknown-eaaa62" +version := "0.0-unknown-a19e59" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", - "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") + "org.scalablytyped" %%% "react" % "16.9.2-59b62d", + "org.scalablytyped" %%% "std" % "0.0-unknown-b0247b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/build.sbt b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/build.sbt index 2f429fb6b7..344c7405f9 100644 --- a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-event-listener/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-event-listener" -version := "0.38.0-73ff32" +version := "0.38.0-40711a" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", - "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") + "org.scalablytyped" %%% "react" % "16.9.2-59b62d", + "org.scalablytyped" %%% "std" % "0.0-unknown-b0247b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/build.sbt b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/build.sbt index aa7a7aa21d..5305b8ae3e 100644 --- a/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/s/stardust-ui__react-component-ref/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "stardust-ui__react-component-ref" -version := "0.38.0-d4fc7a" +version := "0.38.0-8fdd06" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "16.9.2-6e4c5b", - "org.scalablytyped" %%% "std" % "0.0-unknown-624b5b") + "org.scalablytyped" %%% "react" % "16.9.2-59b62d", + "org.scalablytyped" %%% "std" % "0.0-unknown-b0247b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-integration-test/check/s/std/build.sbt b/importer/src/test/resources/react-integration-test/check/s/std/build.sbt index 1de647738a..b8007b0073 100644 --- a/importer/src/test/resources/react-integration-test/check/s/std/build.sbt +++ b/importer/src/test/resources/react-integration-test/check/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-624b5b" +version := "0.0-unknown-b0247b" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-integration-test/check/s/std/src/main/scala/typings/std/HTMLElementTagNameMap.scala b/importer/src/test/resources/react-integration-test/check/s/std/src/main/scala/typings/std/HTMLElementTagNameMap.scala new file mode 100644 index 0000000000..bb1fd6f57a --- /dev/null +++ b/importer/src/test/resources/react-integration-test/check/s/std/src/main/scala/typings/std/HTMLElementTagNameMap.scala @@ -0,0 +1,229 @@ +package typings.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait HTMLElementTagNameMap extends js.Object { + var a: HTMLAnchorElement = js.native + var abbr: HTMLElement = js.native + var address: HTMLElement = js.native + var area: HTMLAreaElement = js.native + var article: HTMLElement = js.native + var aside: HTMLElement = js.native + var audio: HTMLAudioElement = js.native + var b: HTMLElement = js.native + var base: HTMLBaseElement = js.native + var bdi: HTMLElement = js.native + var bdo: HTMLElement = js.native + var blockquote: HTMLQuoteElement = js.native + var body: HTMLBodyElement = js.native + var br: HTMLBRElement = js.native + var button: HTMLButtonElement = js.native + var canvas: HTMLCanvasElement = js.native + var cite: HTMLElement = js.native + var code: HTMLElement = js.native + var col: HTMLTableColElement = js.native + var colgroup: HTMLTableColElement = js.native + var data: HTMLDataElement = js.native + var datalist: HTMLDataListElement = js.native + var dd: HTMLElement = js.native + var del: HTMLModElement = js.native + var dfn: HTMLElement = js.native + var dialog: HTMLDialogElement = js.native + var div: HTMLDivElement = js.native + var dl: HTMLDListElement = js.native + var dt: HTMLElement = js.native + var em: HTMLElement = js.native + var embed: HTMLEmbedElement = js.native + var fieldset: HTMLFieldSetElement = js.native + var figcaption: HTMLElement = js.native + var figure: HTMLElement = js.native + var footer: HTMLElement = js.native + var form: HTMLFormElement = js.native + var h1: HTMLHeadingElement = js.native + var h2: HTMLHeadingElement = js.native + var h3: HTMLHeadingElement = js.native + var h4: HTMLHeadingElement = js.native + var h5: HTMLHeadingElement = js.native + var h6: HTMLHeadingElement = js.native + var head: HTMLHeadElement = js.native + var header: HTMLElement = js.native + var hgroup: HTMLElement = js.native + var hr: HTMLHRElement = js.native + var html: HTMLHtmlElement = js.native + var i: HTMLElement = js.native + var iframe: HTMLIFrameElement = js.native + var img: HTMLImageElement = js.native + var input: HTMLInputElement = js.native + var ins: HTMLModElement = js.native + var kbd: HTMLElement = js.native + var label: HTMLLabelElement = js.native + var legend: HTMLLegendElement = js.native + var li: HTMLLIElement = js.native + var link: HTMLLinkElement = js.native + var main: HTMLElement = js.native + var map: HTMLMapElement = js.native + var mark: HTMLElement = js.native + var meta: HTMLMetaElement = js.native + var nav: HTMLElement = js.native + var noscript: HTMLElement = js.native + var `object`: HTMLObjectElement = js.native + var ol: HTMLOListElement = js.native + var optgroup: HTMLOptGroupElement = js.native + var option: HTMLOptionElement = js.native + var p: HTMLParagraphElement = js.native + var param: HTMLParamElement = js.native + var pre: HTMLPreElement = js.native + var progress: HTMLProgressElement = js.native + var q: HTMLQuoteElement = js.native + var rp: HTMLElement = js.native + var rt: HTMLElement = js.native + var ruby: HTMLElement = js.native + var s: HTMLElement = js.native + var samp: HTMLElement = js.native + var script: HTMLScriptElement = js.native + var section: HTMLElement = js.native + var select: HTMLSelectElement = js.native + var small: HTMLElement = js.native + var source: HTMLSourceElement = js.native + var span: HTMLSpanElement = js.native + var strong: HTMLElement = js.native + var style: HTMLStyleElement = js.native + var sub: HTMLElement = js.native + var summary: HTMLElement = js.native + var sup: HTMLElement = js.native + var table: HTMLTableElement = js.native + var tbody: HTMLTableSectionElement = js.native + var td: HTMLTableDataCellElement = js.native + var template: HTMLTemplateElement = js.native + var textarea: HTMLTextAreaElement = js.native + var tfoot: HTMLTableSectionElement = js.native + var th: HTMLTableHeaderCellElement = js.native + var thead: HTMLTableSectionElement = js.native + var title: HTMLTitleElement = js.native + var tr: HTMLTableRowElement = js.native + var track: HTMLTrackElement = js.native + var u: HTMLElement = js.native + var ul: HTMLUListElement = js.native + var `var`: HTMLElement = js.native + var video: HTMLVideoElement = js.native + var wbr: HTMLElement = js.native +} + +object HTMLElementTagNameMap { + @scala.inline + def apply( + a: HTMLAnchorElement, + abbr: HTMLElement, + address: HTMLElement, + area: HTMLAreaElement, + article: HTMLElement, + aside: HTMLElement, + audio: HTMLAudioElement, + b: HTMLElement, + base: HTMLBaseElement, + bdi: HTMLElement, + bdo: HTMLElement, + blockquote: HTMLQuoteElement, + body: HTMLBodyElement, + br: HTMLBRElement, + button: HTMLButtonElement, + canvas: HTMLCanvasElement, + cite: HTMLElement, + code: HTMLElement, + col: HTMLTableColElement, + colgroup: HTMLTableColElement, + data: HTMLDataElement, + datalist: HTMLDataListElement, + dd: HTMLElement, + del: HTMLModElement, + dfn: HTMLElement, + dialog: HTMLDialogElement, + div: HTMLDivElement, + dl: HTMLDListElement, + dt: HTMLElement, + em: HTMLElement, + embed: HTMLEmbedElement, + fieldset: HTMLFieldSetElement, + figcaption: HTMLElement, + figure: HTMLElement, + footer: HTMLElement, + form: HTMLFormElement, + h1: HTMLHeadingElement, + h2: HTMLHeadingElement, + h3: HTMLHeadingElement, + h4: HTMLHeadingElement, + h5: HTMLHeadingElement, + h6: HTMLHeadingElement, + head: HTMLHeadElement, + header: HTMLElement, + hgroup: HTMLElement, + hr: HTMLHRElement, + html: HTMLHtmlElement, + i: HTMLElement, + iframe: HTMLIFrameElement, + img: HTMLImageElement, + input: HTMLInputElement, + ins: HTMLModElement, + kbd: HTMLElement, + label: HTMLLabelElement, + legend: HTMLLegendElement, + li: HTMLLIElement, + link: HTMLLinkElement, + main: HTMLElement, + map: HTMLMapElement, + mark: HTMLElement, + meta: HTMLMetaElement, + nav: HTMLElement, + noscript: HTMLElement, + `object`: HTMLObjectElement, + ol: HTMLOListElement, + optgroup: HTMLOptGroupElement, + option: HTMLOptionElement, + p: HTMLParagraphElement, + param: HTMLParamElement, + pre: HTMLPreElement, + progress: HTMLProgressElement, + q: HTMLQuoteElement, + rp: HTMLElement, + rt: HTMLElement, + ruby: HTMLElement, + s: HTMLElement, + samp: HTMLElement, + script: HTMLScriptElement, + section: HTMLElement, + select: HTMLSelectElement, + small: HTMLElement, + source: HTMLSourceElement, + span: HTMLSpanElement, + strong: HTMLElement, + style: HTMLStyleElement, + sub: HTMLElement, + summary: HTMLElement, + sup: HTMLElement, + table: HTMLTableElement, + tbody: HTMLTableSectionElement, + td: HTMLTableDataCellElement, + template: HTMLTemplateElement, + textarea: HTMLTextAreaElement, + tfoot: HTMLTableSectionElement, + th: HTMLTableHeaderCellElement, + thead: HTMLTableSectionElement, + title: HTMLTitleElement, + tr: HTMLTableRowElement, + track: HTMLTrackElement, + u: HTMLElement, + ul: HTMLUListElement, + `var`: HTMLElement, + video: HTMLVideoElement, + wbr: HTMLElement + ): HTMLElementTagNameMap = { + val __obj = js.Dynamic.literal(a = a.asInstanceOf[js.Any], abbr = abbr.asInstanceOf[js.Any], address = address.asInstanceOf[js.Any], area = area.asInstanceOf[js.Any], article = article.asInstanceOf[js.Any], aside = aside.asInstanceOf[js.Any], audio = audio.asInstanceOf[js.Any], b = b.asInstanceOf[js.Any], base = base.asInstanceOf[js.Any], bdi = bdi.asInstanceOf[js.Any], bdo = bdo.asInstanceOf[js.Any], blockquote = blockquote.asInstanceOf[js.Any], body = body.asInstanceOf[js.Any], br = br.asInstanceOf[js.Any], button = button.asInstanceOf[js.Any], canvas = canvas.asInstanceOf[js.Any], cite = cite.asInstanceOf[js.Any], code = code.asInstanceOf[js.Any], col = col.asInstanceOf[js.Any], colgroup = colgroup.asInstanceOf[js.Any], data = data.asInstanceOf[js.Any], datalist = datalist.asInstanceOf[js.Any], dd = dd.asInstanceOf[js.Any], del = del.asInstanceOf[js.Any], dfn = dfn.asInstanceOf[js.Any], dialog = dialog.asInstanceOf[js.Any], div = div.asInstanceOf[js.Any], dl = dl.asInstanceOf[js.Any], dt = dt.asInstanceOf[js.Any], em = em.asInstanceOf[js.Any], embed = embed.asInstanceOf[js.Any], fieldset = fieldset.asInstanceOf[js.Any], figcaption = figcaption.asInstanceOf[js.Any], figure = figure.asInstanceOf[js.Any], footer = footer.asInstanceOf[js.Any], form = form.asInstanceOf[js.Any], h1 = h1.asInstanceOf[js.Any], h2 = h2.asInstanceOf[js.Any], h3 = h3.asInstanceOf[js.Any], h4 = h4.asInstanceOf[js.Any], h5 = h5.asInstanceOf[js.Any], h6 = h6.asInstanceOf[js.Any], head = head.asInstanceOf[js.Any], header = header.asInstanceOf[js.Any], hgroup = hgroup.asInstanceOf[js.Any], hr = hr.asInstanceOf[js.Any], html = html.asInstanceOf[js.Any], i = i.asInstanceOf[js.Any], iframe = iframe.asInstanceOf[js.Any], img = img.asInstanceOf[js.Any], input = input.asInstanceOf[js.Any], ins = ins.asInstanceOf[js.Any], kbd = kbd.asInstanceOf[js.Any], label = label.asInstanceOf[js.Any], legend = legend.asInstanceOf[js.Any], li = li.asInstanceOf[js.Any], link = link.asInstanceOf[js.Any], main = main.asInstanceOf[js.Any], map = map.asInstanceOf[js.Any], mark = mark.asInstanceOf[js.Any], meta = meta.asInstanceOf[js.Any], nav = nav.asInstanceOf[js.Any], noscript = noscript.asInstanceOf[js.Any], ol = ol.asInstanceOf[js.Any], optgroup = optgroup.asInstanceOf[js.Any], option = option.asInstanceOf[js.Any], p = p.asInstanceOf[js.Any], param = param.asInstanceOf[js.Any], pre = pre.asInstanceOf[js.Any], progress = progress.asInstanceOf[js.Any], q = q.asInstanceOf[js.Any], rp = rp.asInstanceOf[js.Any], rt = rt.asInstanceOf[js.Any], ruby = ruby.asInstanceOf[js.Any], s = s.asInstanceOf[js.Any], samp = samp.asInstanceOf[js.Any], script = script.asInstanceOf[js.Any], section = section.asInstanceOf[js.Any], select = select.asInstanceOf[js.Any], small = small.asInstanceOf[js.Any], source = source.asInstanceOf[js.Any], span = span.asInstanceOf[js.Any], strong = strong.asInstanceOf[js.Any], style = style.asInstanceOf[js.Any], sub = sub.asInstanceOf[js.Any], summary = summary.asInstanceOf[js.Any], sup = sup.asInstanceOf[js.Any], table = table.asInstanceOf[js.Any], tbody = tbody.asInstanceOf[js.Any], td = td.asInstanceOf[js.Any], template = template.asInstanceOf[js.Any], textarea = textarea.asInstanceOf[js.Any], tfoot = tfoot.asInstanceOf[js.Any], th = th.asInstanceOf[js.Any], thead = thead.asInstanceOf[js.Any], title = title.asInstanceOf[js.Any], tr = tr.asInstanceOf[js.Any], track = track.asInstanceOf[js.Any], u = u.asInstanceOf[js.Any], ul = ul.asInstanceOf[js.Any], video = video.asInstanceOf[js.Any], wbr = wbr.asInstanceOf[js.Any]) + __obj.updateDynamic("object")(`object`.asInstanceOf[js.Any]) + __obj.updateDynamic("var")(`var`.asInstanceOf[js.Any]) + __obj.asInstanceOf[HTMLElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/react-integration-test/check/s/std/src/main/scala/typings/std/SVGElementTagNameMap.scala b/importer/src/test/resources/react-integration-test/check/s/std/src/main/scala/typings/std/SVGElementTagNameMap.scala new file mode 100644 index 0000000000..d19fef0bfe --- /dev/null +++ b/importer/src/test/resources/react-integration-test/check/s/std/src/main/scala/typings/std/SVGElementTagNameMap.scala @@ -0,0 +1,22 @@ +package typings.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait SVGElementTagNameMap extends js.Object { + var circle: SVGCircleElement = js.native + var clipPath: SVGClipPathElement = js.native + var defs: SVGDefsElement = js.native +} + +object SVGElementTagNameMap { + @scala.inline + def apply(circle: SVGCircleElement, clipPath: SVGClipPathElement, defs: SVGDefsElement): SVGElementTagNameMap = { + val __obj = js.Dynamic.literal(circle = circle.asInstanceOf[js.Any], clipPath = clipPath.asInstanceOf[js.Any], defs = defs.asInstanceOf[js.Any]) + + __obj.asInstanceOf[SVGElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/react-integration-test/in/stdlib.d.ts b/importer/src/test/resources/react-integration-test/in/stdlib.d.ts index 79634c176d..123086f109 100644 --- a/importer/src/test/resources/react-integration-test/in/stdlib.d.ts +++ b/importer/src/test/resources/react-integration-test/in/stdlib.d.ts @@ -166,3 +166,117 @@ type Pick = { type Record = { [P in K]: T; }; + + +interface HTMLElementTagNameMap { + "a": HTMLAnchorElement; + "abbr": HTMLElement; + "address": HTMLElement; + "area": HTMLAreaElement; + "article": HTMLElement; + "aside": HTMLElement; + "audio": HTMLAudioElement; + "b": HTMLElement; + "base": HTMLBaseElement; + "bdi": HTMLElement; + "bdo": HTMLElement; + "blockquote": HTMLQuoteElement; + "body": HTMLBodyElement; + "br": HTMLBRElement; + "button": HTMLButtonElement; + "canvas": HTMLCanvasElement; + "cite": HTMLElement; + "code": HTMLElement; + "col": HTMLTableColElement; + "colgroup": HTMLTableColElement; + "data": HTMLDataElement; + "datalist": HTMLDataListElement; + "dd": HTMLElement; + "del": HTMLModElement; + "dfn": HTMLElement; + "dialog": HTMLDialogElement; + "div": HTMLDivElement; + "dl": HTMLDListElement; + "dt": HTMLElement; + "em": HTMLElement; + "embed": HTMLEmbedElement; + "fieldset": HTMLFieldSetElement; + "figcaption": HTMLElement; + "figure": HTMLElement; + "footer": HTMLElement; + "form": HTMLFormElement; + "h1": HTMLHeadingElement; + "h2": HTMLHeadingElement; + "h3": HTMLHeadingElement; + "h4": HTMLHeadingElement; + "h5": HTMLHeadingElement; + "h6": HTMLHeadingElement; + "head": HTMLHeadElement; + "header": HTMLElement; + "hgroup": HTMLElement; + "hr": HTMLHRElement; + "html": HTMLHtmlElement; + "i": HTMLElement; + "iframe": HTMLIFrameElement; + "img": HTMLImageElement; + "input": HTMLInputElement; + "ins": HTMLModElement; + "kbd": HTMLElement; + "label": HTMLLabelElement; + "legend": HTMLLegendElement; + "li": HTMLLIElement; + "link": HTMLLinkElement; + "main": HTMLElement; + "map": HTMLMapElement; + "mark": HTMLElement; + "meta": HTMLMetaElement; + "nav": HTMLElement; + "noscript": HTMLElement; + "object": HTMLObjectElement; + "ol": HTMLOListElement; + "optgroup": HTMLOptGroupElement; + "option": HTMLOptionElement; + "p": HTMLParagraphElement; + "param": HTMLParamElement; + "pre": HTMLPreElement; + "progress": HTMLProgressElement; + "q": HTMLQuoteElement; + "rp": HTMLElement; + "rt": HTMLElement; + "ruby": HTMLElement; + "s": HTMLElement; + "samp": HTMLElement; + "script": HTMLScriptElement; + "section": HTMLElement; + "select": HTMLSelectElement; + "small": HTMLElement; + "source": HTMLSourceElement; + "span": HTMLSpanElement; + "strong": HTMLElement; + "style": HTMLStyleElement; + "sub": HTMLElement; + "summary": HTMLElement; + "sup": HTMLElement; + "table": HTMLTableElement; + "tbody": HTMLTableSectionElement; + "td": HTMLTableDataCellElement; + "template": HTMLTemplateElement; + "textarea": HTMLTextAreaElement; + "tfoot": HTMLTableSectionElement; + "th": HTMLTableHeaderCellElement; + "thead": HTMLTableSectionElement; + "title": HTMLTitleElement; + "tr": HTMLTableRowElement; + "track": HTMLTrackElement; + "u": HTMLElement; + "ul": HTMLUListElement; + "var": HTMLElement; + "video": HTMLVideoElement; + "wbr": HTMLElement; +} + +interface SVGElementTagNameMap { + "circle": SVGCircleElement; + "clipPath": SVGClipPathElement; + "defs": SVGDefsElement; +} diff --git a/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/build.sbt b/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/build.sbt index bc6229f042..202e375324 100644 --- a/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/build.sbt +++ b/importer/src/test/resources/react-transition-group/check-japgolly/r/react-transition-group/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-transition-group" -version := "2.0-791c6b" +version := "2.0-577273" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "0.0-unknown-32fc3d", - "org.scalablytyped" %%% "std" % "0.0-unknown-6ba6b2") + "org.scalablytyped" %%% "react" % "0.0-unknown-8b7c30", + "org.scalablytyped" %%% "std" % "0.0-unknown-fe6ecf") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-transition-group/check-japgolly/r/react/build.sbt b/importer/src/test/resources/react-transition-group/check-japgolly/r/react/build.sbt index 1b521f33ae..bb78823c66 100644 --- a/importer/src/test/resources/react-transition-group/check-japgolly/r/react/build.sbt +++ b/importer/src/test/resources/react-transition-group/check-japgolly/r/react/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react" -version := "0.0-unknown-32fc3d" +version := "0.0-unknown-8b7c30" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.github.japgolly.scalajs-react" %%% "core" % "1.5.0", "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "std" % "0.0-unknown-6ba6b2") + "org.scalablytyped" %%% "std" % "0.0-unknown-fe6ecf") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-transition-group/check-japgolly/s/std/build.sbt b/importer/src/test/resources/react-transition-group/check-japgolly/s/std/build.sbt index 49433ab611..da63a31a5a 100644 --- a/importer/src/test/resources/react-transition-group/check-japgolly/s/std/build.sbt +++ b/importer/src/test/resources/react-transition-group/check-japgolly/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-6ba6b2" +version := "0.0-unknown-fe6ecf" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-transition-group/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/HTMLElementTagNameMap.scala b/importer/src/test/resources/react-transition-group/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/HTMLElementTagNameMap.scala new file mode 100644 index 0000000000..154708d327 --- /dev/null +++ b/importer/src/test/resources/react-transition-group/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/HTMLElementTagNameMap.scala @@ -0,0 +1,34 @@ +package typingsJapgolly.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait HTMLElementTagNameMap extends js.Object { + var a: org.scalajs.dom.raw.HTMLAnchorElement = js.native + var abbr: org.scalajs.dom.raw.HTMLElement = js.native + var address: org.scalajs.dom.raw.HTMLElement = js.native + var area: org.scalajs.dom.raw.HTMLAreaElement = js.native + var article: org.scalajs.dom.raw.HTMLElement = js.native + var aside: org.scalajs.dom.raw.HTMLElement = js.native + var audio: org.scalajs.dom.raw.HTMLAudioElement = js.native +} + +object HTMLElementTagNameMap { + @scala.inline + def apply( + a: org.scalajs.dom.raw.HTMLAnchorElement, + abbr: org.scalajs.dom.raw.HTMLElement, + address: org.scalajs.dom.raw.HTMLElement, + area: org.scalajs.dom.raw.HTMLAreaElement, + article: org.scalajs.dom.raw.HTMLElement, + aside: org.scalajs.dom.raw.HTMLElement, + audio: org.scalajs.dom.raw.HTMLAudioElement + ): HTMLElementTagNameMap = { + val __obj = js.Dynamic.literal(a = a.asInstanceOf[js.Any], abbr = abbr.asInstanceOf[js.Any], address = address.asInstanceOf[js.Any], area = area.asInstanceOf[js.Any], article = article.asInstanceOf[js.Any], aside = aside.asInstanceOf[js.Any], audio = audio.asInstanceOf[js.Any]) + + __obj.asInstanceOf[HTMLElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/react-transition-group/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/SVGElementTagNameMap.scala b/importer/src/test/resources/react-transition-group/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/SVGElementTagNameMap.scala new file mode 100644 index 0000000000..a05b5c1a4b --- /dev/null +++ b/importer/src/test/resources/react-transition-group/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/SVGElementTagNameMap.scala @@ -0,0 +1,20 @@ +package typingsJapgolly.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait SVGElementTagNameMap extends js.Object { + var circle: org.scalajs.dom.raw.SVGCircleElement = js.native +} + +object SVGElementTagNameMap { + @scala.inline + def apply(circle: org.scalajs.dom.raw.SVGCircleElement): SVGElementTagNameMap = { + val __obj = js.Dynamic.literal(circle = circle.asInstanceOf[js.Any]) + + __obj.asInstanceOf[SVGElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/react-transition-group/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/package.scala b/importer/src/test/resources/react-transition-group/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/package.scala index d90156ec3f..4ee6f08b0b 100644 --- a/importer/src/test/resources/react-transition-group/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/package.scala +++ b/importer/src/test/resources/react-transition-group/check-japgolly/s/std/src/main/scala/typingsJapgolly/std/package.scala @@ -6,7 +6,11 @@ import scala.scalajs.js.annotation._ package object std { type AnimationEvent = org.scalajs.dom.raw.Event + type HTMLAnchorElement = org.scalajs.dom.raw.HTMLElement + type HTMLAreaElement = org.scalajs.dom.raw.HTMLElement + type HTMLAudioElement = org.scalajs.dom.raw.HTMLElement type HTMLElement = org.scalajs.dom.raw.Element type Partial[T] = T + type SVGCircleElement = org.scalajs.dom.raw.SVGElement type SVGElement = org.scalajs.dom.raw.Element } diff --git a/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/build.sbt b/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/build.sbt index f0c11485d6..7a4e7636a4 100644 --- a/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/build.sbt +++ b/importer/src/test/resources/react-transition-group/check-slinky/r/react-transition-group/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "react-transition-group" -version := "2.0-f9a7d1" +version := "2.0-180a21" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "react" % "0.0-unknown-1fc958", - "org.scalablytyped" %%% "std" % "0.0-unknown-dac7b3") + "org.scalablytyped" %%% "react" % "0.0-unknown-f405d4", + "org.scalablytyped" %%% "std" % "0.0-unknown-e61d7f") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-transition-group/check-slinky/r/react/build.sbt b/importer/src/test/resources/react-transition-group/check-slinky/r/react/build.sbt index 2a9c07b2ac..778fa8ffd5 100644 --- a/importer/src/test/resources/react-transition-group/check-slinky/r/react/build.sbt +++ b/importer/src/test/resources/react-transition-group/check-slinky/r/react/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react" -version := "0.0-unknown-1fc958" +version := "0.0-unknown-f405d4" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", "me.shadaj" %%% "slinky-web" % "0.6.4", - "org.scalablytyped" %%% "std" % "0.0-unknown-dac7b3") + "org.scalablytyped" %%% "std" % "0.0-unknown-e61d7f") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-transition-group/check-slinky/s/std/build.sbt b/importer/src/test/resources/react-transition-group/check-slinky/s/std/build.sbt index b228e1add3..6364e57fec 100644 --- a/importer/src/test/resources/react-transition-group/check-slinky/s/std/build.sbt +++ b/importer/src/test/resources/react-transition-group/check-slinky/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-dac7b3" +version := "0.0-unknown-e61d7f" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-transition-group/check-slinky/s/std/src/main/scala/typingsSlinky/std/HTMLElementTagNameMap.scala b/importer/src/test/resources/react-transition-group/check-slinky/s/std/src/main/scala/typingsSlinky/std/HTMLElementTagNameMap.scala new file mode 100644 index 0000000000..1e76b4da18 --- /dev/null +++ b/importer/src/test/resources/react-transition-group/check-slinky/s/std/src/main/scala/typingsSlinky/std/HTMLElementTagNameMap.scala @@ -0,0 +1,34 @@ +package typingsSlinky.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait HTMLElementTagNameMap extends js.Object { + var a: org.scalajs.dom.raw.HTMLAnchorElement = js.native + var abbr: org.scalajs.dom.raw.HTMLElement = js.native + var address: org.scalajs.dom.raw.HTMLElement = js.native + var area: org.scalajs.dom.raw.HTMLAreaElement = js.native + var article: org.scalajs.dom.raw.HTMLElement = js.native + var aside: org.scalajs.dom.raw.HTMLElement = js.native + var audio: org.scalajs.dom.raw.HTMLAudioElement = js.native +} + +object HTMLElementTagNameMap { + @scala.inline + def apply( + a: org.scalajs.dom.raw.HTMLAnchorElement, + abbr: org.scalajs.dom.raw.HTMLElement, + address: org.scalajs.dom.raw.HTMLElement, + area: org.scalajs.dom.raw.HTMLAreaElement, + article: org.scalajs.dom.raw.HTMLElement, + aside: org.scalajs.dom.raw.HTMLElement, + audio: org.scalajs.dom.raw.HTMLAudioElement + ): HTMLElementTagNameMap = { + val __obj = js.Dynamic.literal(a = a.asInstanceOf[js.Any], abbr = abbr.asInstanceOf[js.Any], address = address.asInstanceOf[js.Any], area = area.asInstanceOf[js.Any], article = article.asInstanceOf[js.Any], aside = aside.asInstanceOf[js.Any], audio = audio.asInstanceOf[js.Any]) + + __obj.asInstanceOf[HTMLElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/react-transition-group/check-slinky/s/std/src/main/scala/typingsSlinky/std/SVGElementTagNameMap.scala b/importer/src/test/resources/react-transition-group/check-slinky/s/std/src/main/scala/typingsSlinky/std/SVGElementTagNameMap.scala new file mode 100644 index 0000000000..904ccf916f --- /dev/null +++ b/importer/src/test/resources/react-transition-group/check-slinky/s/std/src/main/scala/typingsSlinky/std/SVGElementTagNameMap.scala @@ -0,0 +1,20 @@ +package typingsSlinky.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait SVGElementTagNameMap extends js.Object { + var circle: org.scalajs.dom.raw.SVGCircleElement = js.native +} + +object SVGElementTagNameMap { + @scala.inline + def apply(circle: org.scalajs.dom.raw.SVGCircleElement): SVGElementTagNameMap = { + val __obj = js.Dynamic.literal(circle = circle.asInstanceOf[js.Any]) + + __obj.asInstanceOf[SVGElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/react-transition-group/check-slinky/s/std/src/main/scala/typingsSlinky/std/package.scala b/importer/src/test/resources/react-transition-group/check-slinky/s/std/src/main/scala/typingsSlinky/std/package.scala index dc15e90fd5..929430f6ba 100644 --- a/importer/src/test/resources/react-transition-group/check-slinky/s/std/src/main/scala/typingsSlinky/std/package.scala +++ b/importer/src/test/resources/react-transition-group/check-slinky/s/std/src/main/scala/typingsSlinky/std/package.scala @@ -6,7 +6,11 @@ import scala.scalajs.js.annotation._ package object std { type AnimationEvent = org.scalajs.dom.raw.Event + type HTMLAnchorElement = org.scalajs.dom.raw.HTMLElement + type HTMLAreaElement = org.scalajs.dom.raw.HTMLElement + type HTMLAudioElement = org.scalajs.dom.raw.HTMLElement type HTMLElement = org.scalajs.dom.raw.Element type Partial[T] = T + type SVGCircleElement = org.scalajs.dom.raw.SVGElement type SVGElement = org.scalajs.dom.raw.Element } diff --git a/importer/src/test/resources/react-transition-group/check/r/react-transition-group/build.sbt b/importer/src/test/resources/react-transition-group/check/r/react-transition-group/build.sbt index 2560b3f142..d8af90f27d 100644 --- a/importer/src/test/resources/react-transition-group/check/r/react-transition-group/build.sbt +++ b/importer/src/test/resources/react-transition-group/check/r/react-transition-group/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "react-transition-group" -version := "2.0-2bef44" +version := "2.0-361c42" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "react" % "0.0-unknown-815f87", - "org.scalablytyped" %%% "std" % "0.0-unknown-6a59f8") + "org.scalablytyped" %%% "react" % "0.0-unknown-f6b6bb", + "org.scalablytyped" %%% "std" % "0.0-unknown-40b83e") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-transition-group/check/r/react/build.sbt b/importer/src/test/resources/react-transition-group/check/r/react/build.sbt index 957a7bc5af..927512e7bc 100644 --- a/importer/src/test/resources/react-transition-group/check/r/react/build.sbt +++ b/importer/src/test/resources/react-transition-group/check/r/react/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "react" -version := "0.0-unknown-815f87" +version := "0.0-unknown-f6b6bb" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.1.0", - "org.scalablytyped" %%% "std" % "0.0-unknown-6a59f8") + "org.scalablytyped" %%% "std" % "0.0-unknown-40b83e") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-g:notailcalls", "-P:scalajs:sjsDefinedByDefault") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/importer/src/test/resources/react-transition-group/check/s/std/build.sbt b/importer/src/test/resources/react-transition-group/check/s/std/build.sbt index 5e2669c2cd..27edf886b3 100644 --- a/importer/src/test/resources/react-transition-group/check/s/std/build.sbt +++ b/importer/src/test/resources/react-transition-group/check/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-6a59f8" +version := "0.0-unknown-40b83e" scalaVersion := "2.13.1" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/importer/src/test/resources/react-transition-group/check/s/std/src/main/scala/typings/std/HTMLElementTagNameMap.scala b/importer/src/test/resources/react-transition-group/check/s/std/src/main/scala/typings/std/HTMLElementTagNameMap.scala new file mode 100644 index 0000000000..e88544bdd0 --- /dev/null +++ b/importer/src/test/resources/react-transition-group/check/s/std/src/main/scala/typings/std/HTMLElementTagNameMap.scala @@ -0,0 +1,34 @@ +package typings.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait HTMLElementTagNameMap extends js.Object { + var a: HTMLAnchorElement = js.native + var abbr: HTMLElement = js.native + var address: HTMLElement = js.native + var area: HTMLAreaElement = js.native + var article: HTMLElement = js.native + var aside: HTMLElement = js.native + var audio: HTMLAudioElement = js.native +} + +object HTMLElementTagNameMap { + @scala.inline + def apply( + a: HTMLAnchorElement, + abbr: HTMLElement, + address: HTMLElement, + area: HTMLAreaElement, + article: HTMLElement, + aside: HTMLElement, + audio: HTMLAudioElement + ): HTMLElementTagNameMap = { + val __obj = js.Dynamic.literal(a = a.asInstanceOf[js.Any], abbr = abbr.asInstanceOf[js.Any], address = address.asInstanceOf[js.Any], area = area.asInstanceOf[js.Any], article = article.asInstanceOf[js.Any], aside = aside.asInstanceOf[js.Any], audio = audio.asInstanceOf[js.Any]) + + __obj.asInstanceOf[HTMLElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/react-transition-group/check/s/std/src/main/scala/typings/std/SVGElementTagNameMap.scala b/importer/src/test/resources/react-transition-group/check/s/std/src/main/scala/typings/std/SVGElementTagNameMap.scala new file mode 100644 index 0000000000..6148083e33 --- /dev/null +++ b/importer/src/test/resources/react-transition-group/check/s/std/src/main/scala/typings/std/SVGElementTagNameMap.scala @@ -0,0 +1,20 @@ +package typings.std + +import scala.scalajs.js +import scala.scalajs.js.`|` +import scala.scalajs.js.annotation._ + +@js.native +trait SVGElementTagNameMap extends js.Object { + var circle: SVGCircleElement = js.native +} + +object SVGElementTagNameMap { + @scala.inline + def apply(circle: SVGCircleElement): SVGElementTagNameMap = { + val __obj = js.Dynamic.literal(circle = circle.asInstanceOf[js.Any]) + + __obj.asInstanceOf[SVGElementTagNameMap] + } +} + diff --git a/importer/src/test/resources/react-transition-group/check/s/std/src/main/scala/typings/std/package.scala b/importer/src/test/resources/react-transition-group/check/s/std/src/main/scala/typings/std/package.scala index 65d43ebc6b..31eb7769d1 100644 --- a/importer/src/test/resources/react-transition-group/check/s/std/src/main/scala/typings/std/package.scala +++ b/importer/src/test/resources/react-transition-group/check/s/std/src/main/scala/typings/std/package.scala @@ -6,7 +6,11 @@ import scala.scalajs.js.annotation._ package object std { type AnimationEvent = typings.std.Event + type HTMLAnchorElement = typings.std.HTMLElement + type HTMLAreaElement = typings.std.HTMLElement + type HTMLAudioElement = typings.std.HTMLElement type HTMLElement = typings.std.Element type Partial[T] = T + type SVGCircleElement = typings.std.SVGElement type SVGElement = typings.std.Element } diff --git a/importer/src/test/resources/react-transition-group/in/stdlib.d.ts b/importer/src/test/resources/react-transition-group/in/stdlib.d.ts index 3420c9d88e..8698ab88a0 100644 --- a/importer/src/test/resources/react-transition-group/in/stdlib.d.ts +++ b/importer/src/test/resources/react-transition-group/in/stdlib.d.ts @@ -1,6 +1,6 @@ -declare interface Array { +/// -} +declare interface Array { } declare type Partial = T; @@ -9,4 +9,23 @@ interface AnimationEvent extends Event { } interface EventTarget { } interface Element { } interface HTMLElement extends Element { } +interface HTMLAnchorElement extends HTMLElement { } +interface HTMLAreaElement extends HTMLElement { } +interface HTMLAudioElement extends HTMLElement { } +interface HTMLAudioElement extends HTMLElement { } interface SVGElement extends Element { } +interface SVGCircleElement extends SVGElement { } + +interface HTMLElementTagNameMap { + "a": HTMLAnchorElement; + "abbr": HTMLElement; + "address": HTMLElement; + "area": HTMLAreaElement; + "article": HTMLElement; + "aside": HTMLElement; + "audio": HTMLAudioElement; +} + +interface SVGElementTagNameMap { + "circle": SVGCircleElement; +} diff --git a/importer/src/test/scala/org/scalablytyped/converter/internal/importer/ImporterHarness.scala b/importer/src/test/scala/org/scalablytyped/converter/internal/importer/ImporterHarness.scala index 282129dde4..d4a5fc9a6a 100644 --- a/importer/src/test/scala/org/scalablytyped/converter/internal/importer/ImporterHarness.scala +++ b/importer/src/test/scala/org/scalablytyped/converter/internal/importer/ImporterHarness.scala @@ -13,7 +13,7 @@ import org.scalablytyped.converter.internal.importer.build.{BloopCompiler, Publi import org.scalablytyped.converter.internal.importer.documentation.Npmjs import org.scalablytyped.converter.internal.phases.{PhaseListener, PhaseRes, PhaseRunner, RecPhase} import org.scalablytyped.converter.internal.scalajs.{Name, Versions} -import org.scalablytyped.converter.internal.scalajs.flavours.FlavourImpl +import org.scalablytyped.converter.internal.scalajs.flavours.{FlavourImpl, SlinkyFlavour} import org.scalablytyped.converter.internal.ts._ import org.scalatest.Assertion import org.scalatest.funsuite.AnyFunSuite @@ -123,7 +123,7 @@ trait ImporterHarness extends AnyFunSuite { val targetFolder = os.Path(Files.createTempDirectory("scalablytyped-test-")) val checkFolder = testFolder.path / (flavour match { case _: FlavourImpl.Normal => "check" - case _: FlavourImpl.Slinky => "check-slinky" + case _: SlinkyFlavour => "check-slinky" case _: FlavourImpl.SlinkyNative => "check-slinky-native" case _: FlavourImpl.Japgolly => "check-japgolly" }) diff --git a/importer/src/test/scala/org/scalablytyped/converter/internal/importer/ImporterTest.scala b/importer/src/test/scala/org/scalablytyped/converter/internal/importer/ImporterTest.scala index d2ac38aae1..6ce1f5f3f2 100644 --- a/importer/src/test/scala/org/scalablytyped/converter/internal/importer/ImporterTest.scala +++ b/importer/src/test/scala/org/scalablytyped/converter/internal/importer/ImporterTest.scala @@ -2,13 +2,13 @@ package org.scalablytyped.converter.internal package importer import org.scalablytyped.converter.internal.scalajs.Name -import org.scalablytyped.converter.internal.scalajs.flavours.FlavourImpl +import org.scalablytyped.converter.internal.scalajs.flavours.{FlavourImpl, SlinkyFlavour} import org.scalatest.ParallelTestExecution import org.scalatest.funsuite.AnyFunSuite class ImporterTest extends AnyFunSuite with ImporterHarness with ParallelTestExecution { val update = !constants.isCi - val Slinky = FlavourImpl.Slinky(Name("typingsSlinky")) + val Slinky = SlinkyFlavour(Name("typingsSlinky")) val Japgolly = FlavourImpl.Japgolly(Name("typingsJapgolly")) test("augment-module")(assertImportsOk("augment-module", pedantic = false, update = update)) diff --git a/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterExternalNpmPlugin.scala b/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterExternalNpmPlugin.scala index aca60d3b6b..3dce06ea5b 100644 --- a/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterExternalNpmPlugin.scala +++ b/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterExternalNpmPlugin.scala @@ -6,10 +6,19 @@ import java.time.Instant import com.olvind.logging import com.olvind.logging.{Formatter, LogLevel} import org.scalablytyped.converter.internal.importer.jsonCodecs.PackageJsonDepsDecoder -import org.scalablytyped.converter.internal.importer.{Json, SharedInput} +import org.scalablytyped.converter.internal.importer.SharedInput import org.scalablytyped.converter.internal.scalajs.{Dep, Name, Versions} import org.scalablytyped.converter.internal.ts.{PackageJsonDeps, TsIdentLibrary} -import org.scalablytyped.converter.internal.{BuildInfo, Deps, Digest, IArray, ImportTypings, InFolder, WrapSbtLogger} +import org.scalablytyped.converter.internal.{ + BuildInfo, + Deps, + Digest, + IArray, + ImportTypings, + InFolder, + Json, + WrapSbtLogger, +} import sbt.Keys._ import sbt._ @@ -42,7 +51,7 @@ object ScalablyTypedConverterExternalNpmPlugin extends AutoPlugin { else WrapSbtLogger(sbtLog, Instant.now).filter(LogLevel.warn).void.withContext("project", projectName) val wantedLibs: Set[TsIdentLibrary] = - Json[PackageJsonDeps](packageJsonFile).dependencies.getOrElse(Map()).keys.to[Set].map(TsIdentLibrary.apply) + Json.force[PackageJsonDeps](packageJsonFile).dependencies.getOrElse(Map()).keys.to[Set].map(TsIdentLibrary.apply) val versions = Versions( Versions.Scala( @@ -81,7 +90,7 @@ object ScalablyTypedConverterExternalNpmPlugin extends AutoPlugin { type InOut = (ImportTypings.Input, ImportTypings.Output) val result: Set[Dep] = - Try(Json[InOut](runCache)).toOption match { + Try(Json.force[InOut](runCache)).toOption match { case Some((`input`, output)) if output.allJars.forall(os.exists) => stLogger.withContext(runCache).info(s"Using cached result :)") output.deps diff --git a/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterPlugin.scala b/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterPlugin.scala index 96ef35ff38..8d36545f97 100644 --- a/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterPlugin.scala +++ b/sbt-converter06/src/main/scala/org/scalablytyped/converter/plugin/ScalablyTypedConverterPlugin.scala @@ -6,10 +6,19 @@ import java.time.Instant import com.olvind.logging import com.olvind.logging.{Formatter, LogLevel} -import org.scalablytyped.converter.internal.importer.{Json, SharedInput} +import org.scalablytyped.converter.internal.importer.SharedInput import org.scalablytyped.converter.internal.scalajs.{Name, Versions} import org.scalablytyped.converter.internal.ts.TsIdentLibrary -import org.scalablytyped.converter.internal.{BuildInfo, Deps, Digest, IArray, ImportTypings, InFolder, WrapSbtLogger} +import org.scalablytyped.converter.internal.{ + BuildInfo, + Deps, + Digest, + IArray, + ImportTypings, + InFolder, + Json, + WrapSbtLogger, +} import sbt.Keys._ import sbt._ import scalajsbundler.sbtplugin.{NpmUpdateTasks, PackageJsonTasks, ScalaJSBundlerPlugin} @@ -88,7 +97,7 @@ object ScalablyTypedConverterPlugin extends AutoPlugin { type InOut = (ImportTypings.Input, ImportTypings.Output) - val result = Try(Json[InOut](runCache)).toOption match { + val result = Try(Json.force[InOut](runCache)).toOption match { case Some((`input`, output)) if output.allJars.forall(os.exists) => stLogger.withContext(runCache).info(s"Using cached result :)") output.deps diff --git a/scalajs/src/main/resources/html.json b/scalajs/src/main/resources/html.json new file mode 100644 index 0000000000..6dd652f9f5 --- /dev/null +++ b/scalajs/src/main/resources/html.json @@ -0,0 +1,2801 @@ +{ + "tags" : [ + { + "tagName" : "a", + "scalaJSType": "org.scalajs.dom.html.Anchor", + "docLines" : [ + "The HTML <a> element (or anchor element) creates a hyperlink to other web pages, files, locations within the same page, email addresses, or any other URL." + ] + }, + { + "tagName" : "abbr", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <abbr> element represents an abbreviation and optionally provides a full description for it. If present, the title attribute must contain this full description and nothing else." + ] + }, + { + "tagName" : "address", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <address> element supplies contact information for its nearest element represents a self-contained composition in a document, page, application, or site, which is intended to be independently distributable or reusable (e.g., in syndication). Examples include: a forum post, a magazine or newspaper article, or a blog entry.\" href=\"/en-US/docs/Web/HTML/Element/article\"><article> or Element represents the content of an HTML document. There can be only one element in a document.\" href=\"/en-US/docs/Web/HTML/Element/body\"><body> ancestor; in the latter case, it applies to the whole document." + ] + }, + { + "tagName" : "area", + "scalaJSType": "org.scalajs.dom.html.Area", + "docLines" : [ + "The HTML <area> element defines a hot-spot region on an image, and optionally associates it with a elements define hyperlinks from a spot on a webpage (like a text string or image) to another spot on some other webpage (or even on the same page).\" class=\"glossaryLink\" href=\"/en-US/docs/Glossary/Hyperlink\">hypertext link. This element is used only within a element is used with elements to define an image map (a clickable link area).\" href=\"/en-US/docs/Web/HTML/Element/map\"><map> element." + ] + }, + { + "tagName" : "article", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <article> element represents a self-contained composition in a document, page, application, or site, which is intended to be independently distributable or reusable (e.g., in syndication). Examples include: a forum post, a magazine or newspaper article, or a blog entry." + ] + }, + { + "tagName" : "aside", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <aside> element represents a section of a document with content connected tangentially to the main content of the document (often presented as a sidebar)." + ] + }, + { + "tagName" : "audio", + "scalaJSType": "org.scalajs.dom.html.Audio", + "docLines" : [ + "The HTML <audio> element is used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the element specifies multiple media resources for either the , the element: the browser will choose the most suitable one. It can also be the destination for streamed media, using a MediaStream." + ] + }, + { + "tagName" : "b", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <b> element represents a span of text stylistically different from normal text, without conveying any special importance or relevance, and that is typically rendered in boldface." + ] + }, + { + "tagName" : "base", + "scalaJSType": "org.scalajs.dom.html.Base", + "docLines" : [ + "The HTML <base> element specifies the base URL to use for all relative URLs contained within a document. There can be only one <base> element in a document. " + ] + }, + { + "tagName" : "bdi", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <bdi> element (bidirectional isolation) isolates a span of text that might be formatted in a different direction from other text outside it." + ] + }, + { + "tagName" : "bdo", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <bdo> element (bidirectional override) is used to override the current directionality of text. It causes the directionality of the characters to be ignored in favor of the specified directionality." + ] + }, + { + "tagName" : "big", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML Big Element (<big>) makes the text font size one size bigger (for example, from small to medium, or from large to x-large) up to the browser's maximum font size." + ] + }, + { + "tagName" : "blockquote", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <blockquote> Element (or HTML Block Quotation Element) indicates that the enclosed text is an extended quotation. Usually, this is rendered visually by indentation (see Notes for how to change it). A URL for the source of the quotation may be given using the cite attribute, while a text representation of the source can be given using the element represents a reference to a creative work. It must include the title of a work or a URL reference, which may be in an abbreviated form according to the conventions used for the addition of citation metadata.\" href=\"/en-US/docs/Web/HTML/Element/cite\"><cite> element." + ] + }, + { + "tagName" : "body", + "scalaJSType": "org.scalajs.dom.html.Body", + "docLines" : [ + "The HTML <body> Element represents the content of an HTML document. There can be only one <body> element in a document." + ] + }, + { + "tagName" : "br", + "scalaJSType": "org.scalajs.dom.html.BR", + "docLines" : [ + "The HTML <br> element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the division of lines is significant." + ] + }, + { + "tagName" : "button", + "scalaJSType": "org.scalajs.dom.html.Button", + "docLines" : [ + "The HTML <button> element represents a clickable button." + ] + }, + { + "tagName" : "canvas", + "scalaJSType": "org.scalajs.dom.html.Canvas", + "docLines" : [ + "Use the HTML <canvas> element with the canvas scripting API to draw graphics and animations." + ] + }, + { + "tagName" : "caption", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <caption> element represents the title of a table. Though it is always the first descendant of a element represents tabular data — that is, information expressed via a two-dimensional data table.\" href=\"/en-US/docs/Web/HTML/Element/table\"><table>, its styling, using CSS, may place it elsewhere, relative to the table." + ] + }, + { + "tagName" : "cite", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <cite> element represents a reference to a creative work. It must include the title of a work or a URL reference, which may be in an abbreviated form according to the conventions used for the addition of citation metadata." + ] + }, + { + "tagName" : "code", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <code> element represents a fragment of computer code. By default, it is displayed in the browser's default monospace font." + ] + }, + { + "tagName" : "col", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <col> element defines a column within a table and is used for defining common semantics on all common cells. It is generally found within a element defines a group of columns within a table.\" href=\"/en-US/docs/Web/HTML/Element/colgroup\"><colgroup> element." + ] + }, + { + "tagName" : "colgroup", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <colgroup> element defines a group of columns within a table." + ] + }, + { + "tagName" : "data", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <data> element links a given content with a machine-readable translation. If the content is time- or date-related, the element represents either a time on a 24-hour clock or a precise date in the Gregorian calendar (with optional time and timezone information).\" href=\"/en-US/docs/Web/HTML/Element/time\"><time> element must be used." + ] + }, + { + "tagName" : "datalist", + "scalaJSType": "org.scalajs.dom.html.DataList", + "docLines" : [ + "The HTML <datalist> element contains a set of element is used to define an item contained in a element.\" href=\"/en-US/docs/Web/HTML/Element/optgroup\"><optgroup>, or a element contains a set of  element. As such, <option> can represent menu items in popups and other lists of items in an HTML document." + ] + }, + { + "tagName" : "output", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <output> element represents the result of a calculation or user action." + ] + }, + { + "tagName" : "p", + "scalaJSType": "org.scalajs.dom.html.Paragraph", + "docLines" : [ + "The HTML <p> element represents a paragraph of text. Paragraphs are usually represented in visual media as blocks of text that are separated from adjacent blocks by vertical blank space and/or first-line indentation. Paragraphs are block-level elements." + ] + }, + { + "tagName" : "param", + "scalaJSType": "org.scalajs.dom.html.Param", + "docLines" : [ + "The HTML <param> element defines parameters for an element represents an external resource, which can be treated as an image, a nested browsing context, or a resource to be handled by a plugin.\" href=\"/en-US/docs/Web/HTML/Element/object\"><object> element." + ] + }, + { + "tagName" : "picture", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <picture> element is a container used to specify multiple element specifies multiple media resources for either the , the elements for a specific element represents an image in the document.\" href=\"/en-US/docs/Web/HTML/Element/img\"><img> contained in it. The browser will choose the most suitable source according to the current layout of the page (the constraints of the box the image will appear in) and the device it will be displayed on (e.g. a normal or hiDPI device.)" + ] + }, + { + "tagName" : "pre", + "scalaJSType": "org.scalajs.dom.html.Pre", + "docLines" : [ + "The HTML <pre> element represents preformatted text. Text within this element is typically displayed in a non-proportional (\"monospace\") font exactly as it is laid out in the file. Whitespace inside this element is displayed as typed." + ] + }, + { + "tagName" : "progress", + "scalaJSType": "org.scalajs.dom.html.Progress", + "docLines" : [ + "The HTML <progress> element represents the completion progress of a task, typically displayed as a progress bar." + ] + }, + { + "tagName" : "q", + "scalaJSType": "org.scalajs.dom.html.Quote", + "docLines" : [ + "The HTML <q> element indicates that the enclosed text is a short inline quotation. This element is intended for short quotations that don't require paragraph breaks; for long quotations use the Element (or HTML Block Quotation Element) indicates that the enclosed text is an extended quotation. Usually, this is rendered visually by indentation (see Notes for how to change it). A URL for the source of the quotation may be given using the cite attribute, while a text representation of the source can be given using the element.\" href=\"/en-US/docs/Web/HTML/Element/blockquote\"><blockquote> element." + ] + }, + { + "tagName" : "rp", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <rp> element is used to provide fall-back parentheses for browsers that do not support display of ruby annotations using the element represents a ruby annotation. Ruby annotations are for showing pronunciation of East Asian characters.\" href=\"/en-US/docs/Web/HTML/Element/ruby\"><ruby> element." + ] + }, + { + "tagName" : "rt", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <rt> element embraces pronunciation of characters presented in a ruby annotations, which are used to describe the pronunciation of East Asian characters. This element is always used inside a element represents a ruby annotation. Ruby annotations are for showing pronunciation of East Asian characters.\" href=\"/en-US/docs/Web/HTML/Element/ruby\"><ruby> element." + ] + }, + { + "tagName" : "ruby", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <ruby> element represents a ruby annotation. Ruby annotations are for showing pronunciation of East Asian characters." + ] + }, + { + "tagName" : "s", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <s> element renders text with a strikethrough, or a line through it. Use the <s> element to represent things that are no longer relevant or no longer accurate. However, <s> is not appropriate when indicating document edits; for that, use the element represents a range of text that has been deleted from a document. This element is often (but need not be) rendered with strike-through text.\" href=\"/en-US/docs/Web/HTML/Element/del\"><del> and element represents a range of text that has been added to a document.\" href=\"/en-US/docs/Web/HTML/Element/ins\"><ins> elements, as appropriate." + ] + }, + { + "tagName" : "samp", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <samp> element is an element intended to identify sample output from a computer program. It is usually displayed in the browser's default monotype font (such as Lucida Console)." + ] + }, + { + "tagName" : "script", + "scalaJSType": "org.scalajs.dom.html.Script", + "docLines" : [ + "The HTML <script> element is used to embed or reference an executable script." + ] + }, + { + "tagName" : "section", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <section> element represents a standalone section of functionality contained within an HTML document, typically with a heading, which doesn't have a more specific semantic element to represent it." + ] + }, + { + "tagName" : "select", + "scalaJSType": "org.scalajs.dom.html.Select", + "docLines" : [ + "The HTML <select> element represents a control that provides a menu of options:" + ] + }, + { + "tagName" : "small", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <small> element makes the text font size one size smaller (for example, from large to medium, or from small to x-small) down to the browser's minimum font size.  In HTML5, this element is repurposed to represent side-comments and small print, including copyright and legal text, independent of its styled presentation." + ] + }, + { + "tagName" : "source", + "scalaJSType": "org.scalajs.dom.html.Source", + "docLines" : [ + "The HTML <source> element specifies multiple media resources for either the element is a container used to specify multiple elements for a specific contained in it. The browser will choose the most suitable source according to the current layout of the page (the constraints of the box the image will appear in) and the device it will be displayed on (e.g. a normal or hiDPI device.)\" href=\"/en-US/docs/Web/HTML/Element/picture\"><picture>, the element is used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the element: the browser will choose the most suitable one. It can also be the destination for streamed media, using a MediaStream.\" href=\"/en-US/docs/Web/HTML/Element/audio\"><audio> or the element to embed video content in a document.\" href=\"/en-US/docs/Web/HTML/Element/video\"><video> element. It is an empty element. It is commonly used to serve the same media content in multiple formats supported by different browsers." + ] + }, + { + "tagName" : "span", + "scalaJSType": "org.scalajs.dom.html.Span", + "docLines" : [ + "The HTML <span> element is a generic inline container for phrasing content, which does not inherently represent anything. It can be used to group elements for styling purposes (using the class or id attributes), or because they share attribute values, such as lang. It should be used only when no other semantic element is appropriate. <span> is very much like a element is the generic container for flow content and does not inherently represent anything. Use it to group elements for purposes such as styling (using the class or id attributes), marking a section of a document in a different language (using the lang attribute), and so on.\" href=\"/en-US/docs/Web/HTML/Element/div\"><div> element, but element is the generic container for flow content and does not inherently represent anything. Use it to group elements for purposes such as styling (using the class or id attributes), marking a section of a document in a different language (using the lang attribute), and so on.\" href=\"/en-US/docs/Web/HTML/Element/div\"><div> is a block-level element whereas a <span> is an inline element." + ] + }, + { + "tagName" : "strong", + "scalaJSType": "org.scalajs.dom.Element", + "docLines" : [ + "The HTML <strong> element gives text strong importance, and is typically displayed in bold." + ] + }, + { + "tagName" : "style", + "scalaJSType": "org.scalajs.dom.html.Style", + "docLines" : [ + "The HTML <style> element contains style information for a document, or part of a document. By default, the style instructions written inside that element are expected to be CSS." + ] + }, + { + "tagName" : "sub", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <sub> element defines a span of text that should be displayed, for typographic reasons, lower, and often smaller, than the main span of text." + ] + }, + { + "tagName" : "summary", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <summary> element is used as a summary, caption, or legend for the content of a element is used as a disclosure widget from which the user can retrieve additional information.\" href=\"/en-US/docs/Web/HTML/Element/details\"><details> element." + ] + }, + { + "tagName" : "sup", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <sup> element defines a span of text that should be displayed, for typographic reasons, higher, and often smaller, than the main span of text." + ] + }, + { + "tagName" : "table", + "scalaJSType": "org.scalajs.dom.html.Table", + "docLines" : [ + "The HTML <table> element represents tabular data — that is, information expressed via a two-dimensional data table." + ] + }, + { + "tagName" : "tbody", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <tbody> element groups one or more element specifies that the markup contained inside the block comprises one row of a table, inside which the and elements create header and data cells, respectively, within the row.\" href=\"/en-US/docs/Web/HTML/Element/tr\"><tr> elements as the body of a element represents tabular data — that is, information expressed via a two-dimensional data table.\" href=\"/en-US/docs/Web/HTML/Element/table\"><table> element." + ] + }, + { + "tagName" : "td", + "scalaJSType": "org.scalajs.dom.html.TableDataCell", + "docLines" : [ + "The HTML <td> element defines a cell of a table that contains data. It participates in the table model." + ] + }, + { + "tagName" : "textarea", + "scalaJSType": "org.scalajs.dom.html.TextArea", + "docLines" : [ + "The HTML <textarea> element represents a multi-line plain-text editing control." + ] + }, + { + "tagName" : "tfoot", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <tfoot> element defines a set of rows summarizing the columns of the table." + ] + }, + { + "tagName" : "th", + "scalaJSType": "org.scalajs.dom.html.TableHeaderCell", + "docLines" : [ + "The HTML <th> element defines a cell as header of a group of table cells. The exact nature of this group is defined by the scope and headers attributes." + ] + }, + { + "tagName" : "thead", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <thead> element defines a set of rows defining the head of the columns of the table." + ] + }, + { + "tagName" : "time", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <time> element represents either a time on a 24-hour clock or a precise date in the Gregorian calendar (with optional time and timezone information)." + ] + }, + { + "tagName" : "title", + "scalaJSType": "org.scalajs.dom.html.Title", + "docLines" : [ + "The HTML <title> element defines the title of the document, shown in a browser's title bar or on the page's tab. It can only contain text, and any contained tags are ignored." + ] + }, + { + "tagName" : "tr", + "scalaJSType": "org.scalajs.dom.html.TableRow", + "docLines" : [ + "The HTML <tr> element defines a row of cells in a table. Those can be a mix of element defines a cell of a table that contains data. It participates in the table model.\" href=\"/en-US/docs/Web/HTML/Element/td\"><td> and element defines a cell as header of a group of table cells. The exact nature of this group is defined by the scope and headers attributes.\" href=\"/en-US/docs/Web/HTML/Element/th\"><th> elements." + ] + }, + { + "tagName" : "track", + "scalaJSType": "org.scalajs.dom.html.Track", + "docLines" : [ + "The HTML <track> element is used as a child of the media elements element is used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the element: the browser will choose the most suitable one. It can also be the destination for streamed media, using a MediaStream.\" href=\"/en-US/docs/Web/HTML/Element/audio\"><audio> and element to embed video content in a document.\" href=\"/en-US/docs/Web/HTML/Element/video\"><video>. It lets you specify timed text tracks (or time-based data), for example to automatically handle subtitles. The tracks are formatted in WebVTT format (.vtt files) — Web Video Text Tracks." + ] + }, + { + "tagName" : "u", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <u> element renders text with an underline, a line under the baseline of its content. In HTML5, this element represents a span of text with an unarticulated, though explicitly rendered, non-textual annotation, such as labeling the text as being a proper name in Chinese text (a Chinese proper name mark), or labeling the text as being misspelled." + ] + }, + { + "tagName" : "ul", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <ul> element represents an unordered list of items, typically rendered as a bulleted list." + ] + }, + { + "tagName" : "var", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <var> element represents a variable in a mathematical expression or a programming context." + ] + }, + { + "tagName" : "video", + "scalaJSType": "org.scalajs.dom.html.Video", + "docLines" : [ + "Use the HTML <video> element to embed video content in a document." + ] + }, + { + "tagName" : "wbr", + "scalaJSType": "org.scalajs.dom.html.Element", + "docLines" : [ + "The HTML <wbr> element represents a word break opportunity—a position within text where the browser may optionally break a line, though its line-breaking rules would not otherwise create a break at that location." + ] + } + ], + "attributes" : [ + { + "attributeName" : "preload", + "attributeType" : "String", + "docLines" : [ + "audio - This enumerated attribute is intended to provide a hint to the browser about what the author thinks will lead to the best user experience. It may have one of the following values:
  • none: indicates that the audio should not be preloaded;
  • metadata: indicates that only audio metadata (e.g. length) is fetched;
  • auto: indicates that the whole audio file could be downloaded, even if the user is not expected to use it;
  • the empty string: synonym of the auto value.

If not set, its default value is browser-defined (i.e. each browser may have its own default value). The spec advises it to be set to metadata.

Usage notes:
  • The autoplay attribute has precedence over preload. If autoplay is specified, the browser would obviously need to start downloading the audio for playback.
  • The browser is not forced by the specification to follow the value of this attribute; it is a mere hint.
", + "video - This enumerated attribute is intended to provide a hint to the browser about what the author thinks will lead to the best user experience. It may have one of the following values:
  • none: indicates that the video should not be preloaded.
  • metadata: indicates that only video metadata (e.g. length) is fetched.
  • auto: indicates that the whole video file could be downloaded, even if the user is not expected to use it.
  • the empty string: synonym of the auto value.

If not set, its default value is browser-defined (i.e. each browser may have its default value). The spec advises it to be set to metadata.

Usage notes:
  • The autoplay attribute has precedence over preload. If autoplay is specified, the browser would obviously need to start downloading the video for playback.
  • The specification does not force the browser to follow the value of this attribute; it is a mere hint.
" + ], + "compatibleTags" : [ + "audio", + "video" + ], + "withDash" : false + }, + { + "attributeName" : "download", + "attributeType" : "Boolean", + "docLines" : [ + "area - This attribute, if present, indicates that the author intends the hyperlink to be used for downloading a resource. See element (or anchor element) creates a hyperlink to other web pages, files, locations within the same page, email addresses, or any other URL.\" href=\"/en-US/docs/Web/HTML/Element/a\"><a> for a full description of the download attribute.", + "a - This attribute instructs browsers to download a URL instead of navigating to it, so the user will be prompted to save it as a local file. If the attribute has a value, it is used as the pre-filled file name in the Save prompt (the user can still change the file name if they want). There are no restrictions on allowed values, though / and \\ are converted to underscores. Most file systems limit some punctuation in file names, and browsers will adjust the suggested name accordingly.
Notes:
  • This attribute only works for same-origin URLs.
  • This attribute can be used with blob: URLs and data: URLs to download content generated by JavaScript, such as pictures created in an image-editor Web app.
  • If the HTTP header Content-Disposition: gives a different filename than this attribute, the HTTP header takes priority over this attribute.
  • If Content-Disposition: is set to inline, Firefox prioritizes Content-Disposition, like the filename case, while Chrome prioritizes the download attribute.
" + ], + "compatibleTags" : [ + "a", + "area" + ], + "withDash" : false + }, + { + "attributeName" : "src", + "attributeType" : "String", + "docLines" : [ + "track - Address of the track (.vtt file). Must be a valid URL. This attribute must be defined.", + "source - Required for element is used to embed sound content in documents. It may contain one or more audio sources, represented using the src attribute or the element: the browser will choose the most suitable one. It can also be the destination for streamed media, using a MediaStream.\" href=\"/en-US/docs/Web/HTML/Element/audio\"><audio> and element to embed video content in a document.\" href=\"/en-US/docs/Web/HTML/Element/video\"><video>, address of the media resource. The value of this attribute is ignored when the <source> element is placed inside a element is a container used to specify multiple elements for a specific contained in it. The browser will choose the most suitable source according to the current layout of the page (the constraints of the box the image will appear in) and the device it will be displayed on (e.g. a normal or hiDPI device.)\" href=\"/en-US/docs/Web/HTML/Element/picture\"><picture> element.", + "video - The URL of the video to embed. This is optional; you may instead use the element specifies multiple media resources for either the , the element within the video block to specify the video to embed.", + "audio - The URL of the audio to embed. This is subject to HTTP access controls. This is optional; you may instead use the element specifies multiple media resources for either the , the element within the audio block to specify the audio to embed.", + "img - The image URL. This attribute is mandatory for the <img> element. On browsers supporting srcset, src is treated like a candidate image with a pixel density descriptor 1x unless an image with this pixel density descriptor is already defined in srcset, or unless srcset contains 'w' descriptors.", + "input - If the value of the type attribute is image, this attribute specifies a URI for the location of an image to display on the graphical submit button, otherwise it is ignored.", + "iframe - The URL of the page to embed. Use 'about:blank' for empty pages that conform to Same-Origin Policy.", + "embed - The URL of the resource being embedded.", + "script - This attribute specifies the URI of an external script; this can be used as an alternative to embedding a script directly within a document. If a script element has a src attribute specified, it should not have a script embedded inside its tags." + ], + "compatibleTags" : [ + "audio", + "embed", + "iframe", + "img", + "input", + "script", + "source", + "track", + "video" + ], + "withDash" : false + }, + { + "attributeName" : "action", + "attributeType" : "String", + "docLines" : [ + "The URI of a program that processes the form information. This value can be overridden by a formaction attribute on a element represents a clickable button.\" href=\"/en-US/docs/Web/HTML/Element/button\"><button> or element is used to create interactive controls for web-based forms in order to accept data from the user.\" href=\"/en-US/docs/Web/HTML/Element/input\"><input> element." + ], + "compatibleTags" : [ + "form" + ], + "withDash" : false + }, + { + "attributeName" : "poster", + "attributeType" : "String", + "docLines" : [ + "A URL indicating a poster frame to show until the user plays or seeks. If this attribute isn't specified, nothing is displayed until the first frame is available; then the first frame is shown as the poster frame." + ], + "compatibleTags" : [ + "video" + ], + "withDash" : false + }, + { + "attributeName" : "step", + "attributeType" : "String", + "docLines" : [ + "Works with the min and max attributes to limit the increments at which a numeric or date-time value can be set. It can be the string any or a positive floating point number. If this attribute is not set to any, the control accepts only values at multiples of the step value greater than the minimum." + ], + "compatibleTags" : [ + "input" + ], + "withDash" : false + }, + { + "attributeName" : "default", + "attributeType" : "Boolean", + "docLines" : [ + "menuitem - This Boolean attribute indicates use of the same command as the menu's subject element (such as a button or input).", + "track - This attribute indicates that the track should be enabled unless the user's preferences indicate that another track is more appropriate. This may only be used on one track element per media element." + ], + "compatibleTags" : [ + "menuitem", + "track" + ], + "withDash" : false + }, + { + "attributeName" : "type", + "attributeType" : "String", + "docLines" : [ + "style - This attribute defines the styling language as a MIME type (charset should not be specified). This attribute is optional and defaults to text/css if it's missing.", + "object - The content type of the resource specified by data. At least one of data and type must be defined.", + "li - This character attribute indicates the numbering type:
  • a: lowercase letters
  • A: uppercase letters
  • i: lowercase Roman numerals
  • I: uppercase Roman numerals
  • 1: numbers
This type overrides the one used by its parent element represents an ordered list of items, typically rendered as a numbered list.\" href=\"/en-US/docs/Web/HTML/Element/ol\"><ol> element, if any.
Usage note: This attribute has been deprecated: use the CSS list-style-type property instead.
", + "param - Only used if the valuetype is set to \"ref\". Specifies the MIME type of values found at the URI specified by value.", + "source - The MIME-type of the resource, optionally with a codecs parameter. See RFC 4281 for information about how to specify codecs.", + "button - The type of the button. Possible values are:
  • submit: The button submits the form data to the server. This is the default if the attribute is not specified, or if the attribute is dynamically changed to an empty or invalid value.
  • reset: The button resets all the controls to their initial values.
  • button: The button has no default behavior. It can have client-side scripts associated with the element's events, which are triggered when the events occur.
", + "script -

Indicates the type of script represented. The value of this attribute will be in one of the following categories:

  • Omitted or a JavaScript MIME type: For HTML5-compliant browsers this indicates the script is JavaScript. HTML5 spec urges authors to omit the attribute rather than provided a redundant MIME type. In earlier browsers, this identified the scripting language of the embedded or imported (via the src attribute) code. JavaScript MIME types are listed in the specification.
  • module: HTML5 For HTML5-compliant browsers the code is treated as a JavaScript module. Processing of the script contents are not affected by the charset and defer attributes. For information on using module, see ES6 in Depth: Modules
  • Any other value or MIME type: Embedded content is treated as a data block which won't be processed by the browser. The src attribute will be ignored.

Note that in Firefox you can use advanced features such as let statements and other features in later JS versions, by using type=application/javascript;version=1.8  . Beware, however, that as this is a non-standard feature, this will most likely break support for other browsers, in particular Chromium-based browsers.

For how to include exotic programming languages, read about Rosetta.

", + "link - This attribute is used to define the type of the content linked to. The value of the attribute should be a MIME type such as text/html, text/css, and so on. The common use of this attribute is to define the type of style sheet linked and the most common current value is text/css, which indicates a Cascading Style Sheet format. It is also used on rel=\"preload\" link types, to make sure the browser only downloads file types that it supports.", + "embed - The MIME type to use to select the plug-in to instantiate.", + "ul - Used to set the bullet style for the list. The values defined under HTML3.2 and the transitional version of HTML 4.0/4.01 are:
  • circle,
  • disc,
  • and square.

A fourth bullet type has been defined in the WebTV interface, but not all browsers support it: triangle.

If not present and if no CSS list-style-type property does apply to the element, the user agent decide to use a kind of bullets depending on the nesting level of the list.

Usage note: Do not use this attribute, as it has been deprecated; use the CSS list-style-type property instead.
", + "a - Specifies the media type in the form of a MIME type for the linked URL. It is purely advisory, with no built-in functionality.", + "input - The type of control to render. See _types\">Form <input> types for the individual types, with links to more information about each.", + "area - This attribute specifies the media type in the form of a MIME type for the link target. Generally, this is provided strictly as advisory information; however, in the future a browser might add a small icon for multimedia types. For example, a browser might add a small speaker icon when type is set to audio/wav. For a complete list of recognized MIME types, see https://www.w3.org/TR/html4/references.html#ref-MIMETYPES. Use this attribute only if the href attribute is present.", + "ol - Indicates the numbering type:
  • 'a' indicates lowercase letters,
  • 'A' indicates uppercase letters,
  • 'i' indicates lowercase Roman numerals,
  • 'I' indicates uppercase Roman numerals,
  • and '1' indicates numbers (default).

The type set is used for the entire list unless a different type attribute is used within an enclosed element is used to represent an item in a list. It must be contained in a parent element: an ordered list (

    ), an unordered list (