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 d74c3f6e65..2216bda2e4 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 @@ -44,8 +44,6 @@ class ImportType(stdNames: QualifiedName.StdNames) { TsQIdent.Std.ConcatArray -> NameMapping(stdNames.ConcatArray, stdNames.ConcatArray, QualifiedName.JsArray), TsQIdent.Std.Function -> FunctionM, TsQIdent.Std.Object -> ObjectM, - TsQIdent.Std.PromiseLike -> NameMapping(stdNames.PromiseLike, stdNames.PromiseLike, QualifiedName.JsThenable), - TsQIdent.Std.Promise -> NameMapping(QualifiedName.JsPromise, stdNames.Promise, QualifiedName.JsPromise), TsQIdent.Std.ReadonlyArray -> NameMapping(stdNames.ReadonlyArray, stdNames.ReadonlyArray, QualifiedName.JsArray), TsQIdent.Std.String -> StringM, TsQIdent.string -> StringM, diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenPromiseOps.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenPromiseOps.scala new file mode 100644 index 0000000000..f8f9df384b --- /dev/null +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/GenPromiseOps.scala @@ -0,0 +1,122 @@ +package org.scalablytyped.converter.internal +package scalajs +package flavours + +object GenPromiseOps extends TreeTransformation { + override def leaveContainerTree(scope: TreeScope)(s: ContainerTree): ContainerTree = + if (scope.libName == Name.std && s.name == Name.std) { + val newCompanions = IArray + .fromOptions( + flaff(s, Name("Promise")), + flaff(s, Name("PromiseLike")), + ) + .toMap + + val filteredMembers = s.members.filter { + case x: ModuleTree if newCompanions.contains(x.name) => false + case _ => true + } + s.withMembers(filteredMembers ++ IArray.fromTraversable(newCompanions.values)) + } else s + + def flaff(s: ContainerTree, name: Name): Option[(Name, ModuleTree)] = { + val (existingClass, existingModule, _) = s.index + .getOrElse(name, IArray.Empty) + .partitionCollect2({ case x: ClassTree => x }, { case x: ModuleTree => x }) + + existingClass match { + case IArray.first(cls) => + val mod = existingModule.headOption.getOrElse( + ModuleTree( + Empty, + level = ProtectionLevel.Public, + name = cls.name, + parents = Empty, + members = Empty, + comments = NoComments, + codePath = cls.codePath, + isOverride = false, + ), + ) + val ops = genPromiseOps(cls, mod) + val mod1 = mod.copy(members = mod.members :+ ops) + Some((name, mod1)) + case _ => None + } + } + + def genPromiseOps(cls: ClassTree, mod: ModuleTree) = { + val paramName = Name("promise") + val Ops = Name(cls.name.unescaped + "Ops") + val OpsCP = mod.codePath + Ops + + val toPromise = { + val name = Name("toPromise") + val tpe = TypeRef(QualifiedName.JsPromise, TypeParamTree.asTypeArgs(cls.tparams), NoComments) + MethodTree( + annotations = Empty, + level = ProtectionLevel.Public, + name = name, + tparams = Empty, + params = Empty, + impl = ExprTree.Cast(ExprTree.Ref(paramName), tpe), + resultType = tpe, + isOverride = false, + comments = NoComments, + codePath = OpsCP + name, + isImplicit = false, + ) + } + + val toFuture = { + val name = Name("toFuture") + val tpe = TypeRef( + QualifiedName(IArray(Name.scala, Name("concurrent"), Name("Future"))), + TypeParamTree.asTypeArgs(cls.tparams), + NoComments, + ) + MethodTree( + annotations = Empty, + level = ProtectionLevel.Public, + name = name, + tparams = Empty, + params = Empty, + impl = ExprTree.Select(ExprTree.Ref(toPromise.name), Name("toFuture")), + resultType = tpe, + isOverride = false, + comments = NoComments, + codePath = OpsCP + name, + isImplicit = false, + ) + } + ClassTree( + isImplicit = true, + annotations = IArray(Annotation.Inline), + level = ProtectionLevel.Public, + name = Ops, + tparams = cls.tparams, + parents = IArray(TypeRef.AnyVal), + ctors = IArray( + CtorTree( + ProtectionLevel.Public, + IArray( + ParamTree( + name = paramName, + isImplicit = false, + isVal = true, + tpe = TypeRef(cls.codePath, TypeParamTree.asTypeArgs(cls.tparams), NoComments), + default = NotImplemented, + comments = NoComments, + ), + ), + NoComments, + ), + ), + members = IArray(toPromise, toFuture), + classType = ClassType.Class, + isSealed = false, + comments = NoComments, + codePath = OpsCP, + ) + } +} diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/JapgollyFlavour.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/JapgollyFlavour.scala index 0d1f58b2cb..3ba6bac58a 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/JapgollyFlavour.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/JapgollyFlavour.scala @@ -18,7 +18,7 @@ case class JapgollyFlavour( val genStBuildingComponent = new JapgollyGenStBuildingComponent(outputPkg, versions.scala) val genComponents = new JapgollyGenComponents(findProps, genStBuildingComponent, reactNamesProxy, enableLongApplyMethod) - val genCompanions = new GenCompanions(findProps, enableLongApplyMethod) + val genCompanions = new GenCompanions(findProps, enableLongApplyMethod) >> GenPromiseOps final override def rewrittenTree(scope: TreeScope, tree: PackageTree): PackageTree = { val withCompanions = genCompanions.visitPackageTree(scope)(tree) diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/NormalFlavour.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/NormalFlavour.scala index 8c0976b15e..07881cad88 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/NormalFlavour.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/NormalFlavour.scala @@ -23,7 +23,7 @@ case class NormalFlavour( val memberToProp = new MemberToProp.Default(rewrites) val findProps = new FindProps(new CleanIllegalNames(outputPkg), memberToProp, parentsResolver) - val genCompanions = new GenCompanions(findProps, enableLongApplyMethod) + val genCompanions = new GenCompanions(findProps, enableLongApplyMethod) >> GenPromiseOps final override def rewrittenTree(scope: TreeScope, tree: PackageTree): PackageTree = genCompanions.visitPackageTree(scope)(tree) diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/SlinkyFlavour.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/SlinkyFlavour.scala index 635d66defa..b29131cba9 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/SlinkyFlavour.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/SlinkyFlavour.scala @@ -17,7 +17,7 @@ case class SlinkyFlavour( val memberToProp = new MemberToProp.Default(rewrites) val findProps = new FindProps(new CleanIllegalNames(outputPkg), memberToProp, parentsResolver) - val genCompanions = new GenCompanions(findProps, enableLongApplyMethod) + val genCompanions = new GenCompanions(findProps, enableLongApplyMethod) >> GenPromiseOps val genStBuildingComponent = new SlinkyGenStBuildingComponent(outputPkg, versions.scala) /* we need the actual typescript react definitions at runtime to compute this lazily */ diff --git a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/SlinkyNativeFlavour.scala b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/SlinkyNativeFlavour.scala index 90678ca37d..c1d4e582e2 100644 --- a/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/SlinkyNativeFlavour.scala +++ b/scalajs/src/main/scala/org/scalablytyped/converter/internal/scalajs/flavours/SlinkyNativeFlavour.scala @@ -22,7 +22,7 @@ case class SlinkyNativeFlavour( val findProps = new FindProps(new CleanIllegalNames(outputPkg), memberToProp, parentsResolver) val genStBuildingComponent = new SlinkyGenStBuildingComponent(outputPkg, versions.scala) val gen = new SlinkyGenComponents(SlinkyGenComponents.Native(()), findProps, genStBuildingComponent, reactNamesProxy) - val genCompanions = new GenCompanions(findProps, enableLongApplyMethod) + val genCompanions = new GenCompanions(findProps, enableLongApplyMethod) >> GenPromiseOps final override def rewrittenTree(scope: TreeScope, tree: PackageTree): PackageTree = { val withCompanions = genCompanions.visitPackageTree(scope)(tree) diff --git a/tests/elasticsearch-js/check-3/e/elasticsearch-js/build.sbt b/tests/elasticsearch-js/check-3/e/elasticsearch-js/build.sbt index 60dab93f0f..a59d40b200 100644 --- a/tests/elasticsearch-js/check-3/e/elasticsearch-js/build.sbt +++ b/tests/elasticsearch-js/check-3/e/elasticsearch-js/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "elasticsearch-js" -version := "0.0-unknown-e3106b" +version := "0.0-unknown-d0fe82" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", - "org.scalablytyped" %%% "std" % "0.0-unknown-befc3c") + "org.scalablytyped" %%% "std" % "0.0-unknown-184a14") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/tests/elasticsearch-js/check-3/e/elasticsearch-js/src/main/scala/typings/elasticsearchJs/mod.scala b/tests/elasticsearch-js/check-3/e/elasticsearch-js/src/main/scala/typings/elasticsearchJs/mod.scala index 1f09a9e3b1..cb94b40c9d 100644 --- a/tests/elasticsearch-js/check-3/e/elasticsearch-js/src/main/scala/typings/elasticsearchJs/mod.scala +++ b/tests/elasticsearch-js/check-3/e/elasticsearch-js/src/main/scala/typings/elasticsearchJs/mod.scala @@ -1,5 +1,6 @@ package typings.elasticsearchJs +import typings.std.Promise import org.scalablytyped.runtime.StObject import scala.scalajs.js import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} @@ -7,21 +8,15 @@ import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, J object mod { trait TransportRequestPromise[T] - extends js.Promise[T] { + extends StObject + with Promise[T] { def abort(): Unit } object TransportRequestPromise { - inline def apply[T]( - abort: () => Unit, - `catch`: js.UndefOr[js.Function1[Any, Any | js.Thenable[Any]]] => js.Promise[Any], - executor: (js.Function1[T | js.Thenable[T], ?], js.Function1[Any, ?]) => ?, - `then`: ((js.Function1[T, Any | js.Thenable[Any]]) | Unit, js.UndefOr[js.Function1[Any, Any | js.Thenable[Any]]]) => js.Promise[Any] - ): TransportRequestPromise[T] = { - val __obj = js.Dynamic.literal(abort = js.Any.fromFunction0(abort), executor = js.Any.fromFunction2(executor)) - __obj.updateDynamic("catch")(js.Any.fromFunction1(`catch`)) - __obj.updateDynamic("then")(js.Any.fromFunction2(`then`)) + inline def apply[T](abort: () => Unit): TransportRequestPromise[T] = { + val __obj = js.Dynamic.literal(abort = js.Any.fromFunction0(abort)) __obj.asInstanceOf[TransportRequestPromise[T]] } diff --git a/tests/elasticsearch-js/check-3/s/std/build.sbt b/tests/elasticsearch-js/check-3/s/std/build.sbt index 690b46b79c..9c0993b87e 100644 --- a/tests/elasticsearch-js/check-3/s/std/build.sbt +++ b/tests/elasticsearch-js/check-3/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-befc3c" +version := "0.0-unknown-184a14" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/tests/elasticsearch-js/check-3/s/std/src/main/scala/typings/std/Promise.scala b/tests/elasticsearch-js/check-3/s/std/src/main/scala/typings/std/Promise.scala index 4d4cce0e98..d30119f408 100644 --- a/tests/elasticsearch-js/check-3/s/std/src/main/scala/typings/std/Promise.scala +++ b/tests/elasticsearch-js/check-3/s/std/src/main/scala/typings/std/Promise.scala @@ -1,7 +1,17 @@ package typings.std +import scala.concurrent.Future import org.scalablytyped.runtime.StObject import scala.scalajs.js import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} trait Promise[T] extends StObject +object Promise { + + extension [T](promise: Promise[T]) { + + def toFuture: Future[T] = toPromise.toFuture + + def toPromise: js.Promise[T] = promise.asInstanceOf[js.Promise[T]] + } +} diff --git a/tests/monaco-editor/check-3/m/monaco-editor/build.sbt b/tests/monaco-editor/check-3/m/monaco-editor/build.sbt index 884bef1ba7..1189cf66c7 100644 --- a/tests/monaco-editor/check-3/m/monaco-editor/build.sbt +++ b/tests/monaco-editor/check-3/m/monaco-editor/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "monaco-editor" -version := "0.0-unknown-615b53" +version := "0.0-unknown-e0fdf0" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/tests/monaco-editor/check-3/m/monaco-editor/src/main/scala/typings/monacoEditor/global.scala b/tests/monaco-editor/check-3/m/monaco-editor/src/main/scala/typings/monacoEditor/global.scala index 6b2f1005c5..3574c00707 100644 --- a/tests/monaco-editor/check-3/m/monaco-editor/src/main/scala/typings/monacoEditor/global.scala +++ b/tests/monaco-editor/check-3/m/monaco-editor/src/main/scala/typings/monacoEditor/global.scala @@ -1,6 +1,7 @@ package typings.monacoEditor import typings.monacoEditor.anon.Key +import typings.std.PromiseLike import org.scalablytyped.runtime.StObject import scala.scalajs.js import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} @@ -15,14 +16,14 @@ object global { extends StObject with typings.monacoEditor.monaco.Promise[T, TProgress] { def this(executor: js.Function3[ - /* resolve */ js.Function1[/* value */ T | js.Thenable[T], Unit], + /* resolve */ js.Function1[/* value */ T | PromiseLike[T], Unit], /* reject */ js.Function1[/* reason */ Any, Unit], /* progress */ js.Function1[/* progress */ TProgress, Unit], Unit ]) = this() def this( executor: js.Function3[ - /* resolve */ js.Function1[/* value */ T | js.Thenable[T], Unit], + /* resolve */ js.Function1[/* value */ T | PromiseLike[T], Unit], /* reject */ js.Function1[/* reason */ Any, Unit], /* progress */ js.Function1[/* progress */ TProgress, Unit], Unit @@ -37,7 +38,7 @@ object global { @js.native val ^ : js.Any = js.native - inline def any[T](promises: js.Array[T | js.Thenable[T]]): typings.monacoEditor.monaco.Promise[Key[T], Any] = ^.asInstanceOf[js.Dynamic].applyDynamic("any")(promises.asInstanceOf[js.Any]).asInstanceOf[typings.monacoEditor.monaco.Promise[Key[T], Any]] + inline def any[T](promises: js.Array[T | PromiseLike[T]]): typings.monacoEditor.monaco.Promise[Key[T], Any] = ^.asInstanceOf[js.Dynamic].applyDynamic("any")(promises.asInstanceOf[js.Any]).asInstanceOf[typings.monacoEditor.monaco.Promise[Key[T], Any]] } } } diff --git a/tests/monaco-editor/check-3/m/monaco-editor/src/main/scala/typings/monacoEditor/monaco.scala b/tests/monaco-editor/check-3/m/monaco-editor/src/main/scala/typings/monacoEditor/monaco.scala index 0c29132d00..f2553f3786 100644 --- a/tests/monaco-editor/check-3/m/monaco-editor/src/main/scala/typings/monacoEditor/monaco.scala +++ b/tests/monaco-editor/check-3/m/monaco-editor/src/main/scala/typings/monacoEditor/monaco.scala @@ -1,5 +1,6 @@ package typings.monacoEditor +import typings.std.PromiseLike import org.scalablytyped.runtime.StObject import scala.scalajs.js import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} @@ -8,5 +9,5 @@ object monaco { trait Promise[T, TProgress] extends StObject - type Thenable[T] = js.Thenable[T] + type Thenable[T] = PromiseLike[T] } diff --git a/tests/prisma/check-3/p/prisma/build.sbt b/tests/prisma/check-3/p/prisma/build.sbt new file mode 100644 index 0000000000..80b5512b92 --- /dev/null +++ b/tests/prisma/check-3/p/prisma/build.sbt @@ -0,0 +1,11 @@ +organization := "org.scalablytyped" +name := "prisma" +version := "0.0-unknown-7a849c" +scalaVersion := "3.1.2" +enablePlugins(ScalaJSPlugin) +libraryDependencies ++= Seq( + "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", + "org.scalablytyped" %%% "std" % "0.0-unknown-ba7c78") +publishArtifact in packageDoc := false +scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") +licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/tests/prisma/check-3/p/prisma/project/build.properties b/tests/prisma/check-3/p/prisma/project/build.properties new file mode 100644 index 0000000000..b1e589d9f4 --- /dev/null +++ b/tests/prisma/check-3/p/prisma/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.7.1 \ No newline at end of file diff --git a/tests/prisma/check-3/p/prisma/project/plugins.sbt b/tests/prisma/check-3/p/prisma/project/plugins.sbt new file mode 100644 index 0000000000..efff5a7004 --- /dev/null +++ b/tests/prisma/check-3/p/prisma/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("org.scala-js" %% "sbt-scalajs" % "1.10.0") diff --git a/tests/prisma/check-3/p/prisma/readme.md b/tests/prisma/check-3/p/prisma/readme.md new file mode 100644 index 0000000000..b7326290a3 --- /dev/null +++ b/tests/prisma/check-3/p/prisma/readme.md @@ -0,0 +1,15 @@ + +# Scala.js typings for prisma + + + + +## Note +This library has been generated from typescript code from first party type definitions. + +Provided with :purple_heart: from [ScalablyTyped](https://github.com/oyvindberg/ScalablyTyped) + +## Usage +See [the main readme](../../readme.md) for instructions. + + diff --git a/tests/prisma/check-3/p/prisma/src/main/scala/typings/prisma/mod.scala b/tests/prisma/check-3/p/prisma/src/main/scala/typings/prisma/mod.scala new file mode 100644 index 0000000000..381b4770f0 --- /dev/null +++ b/tests/prisma/check-3/p/prisma/src/main/scala/typings/prisma/mod.scala @@ -0,0 +1,41 @@ +package typings.prisma + +import typings.prisma.prismaStrings.PrismaClientPromise +import typings.std.Promise +import typings.std.PromiseLike +import org.scalablytyped.runtime.StObject +import scala.scalajs.js +import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} + +object mod { + + @JSImport("prisma", "Prisma__ColumnClient") + @js.native + open class PrismaColumnClient[T] () + extends StObject + with PrismaPromise[T] { + + def `catch`[TResult](): js.Promise[T | TResult] = js.native + def `catch`[TResult](onrejected: js.Function1[/* reason */ Any, TResult | PromiseLike[TResult]]): js.Promise[T | TResult] = js.native + + def `finally`(): js.Promise[T] = js.native + def `finally`(onfinally: js.Function0[Unit]): js.Promise[T] = js.native + + def `then`[TResult1, TResult2](): js.Promise[TResult1 | TResult2] = js.native + def `then`[TResult1, TResult2](onfulfilled: js.Function1[/* value */ T, TResult1 | PromiseLike[TResult1]]): js.Promise[TResult1 | TResult2] = js.native + def `then`[TResult1, TResult2]( + onfulfilled: js.Function1[/* value */ T, TResult1 | PromiseLike[TResult1]], + onrejected: js.Function1[/* reason */ Any, TResult2 | PromiseLike[TResult2]] + ): js.Promise[TResult1 | TResult2] = js.native + def `then`[TResult1, TResult2](onfulfilled: Null, onrejected: js.Function1[/* reason */ Any, TResult2 | PromiseLike[TResult2]]): js.Promise[TResult1 | TResult2] = js.native + def `then`[TResult1, TResult2](onfulfilled: Unit, onrejected: js.Function1[/* reason */ Any, TResult2 | PromiseLike[TResult2]]): js.Promise[TResult1 | TResult2] = js.native + + @JSName(js.Symbol.toStringTag) + val toStringTag: PrismaClientPromise = js.native + } + + @js.native + trait PrismaPromise[A] + extends StObject + with Promise[A] +} diff --git a/tests/prisma/check-3/p/prisma/src/main/scala/typings/prisma/prismaRequire.scala b/tests/prisma/check-3/p/prisma/src/main/scala/typings/prisma/prismaRequire.scala new file mode 100644 index 0000000000..23812a2b37 --- /dev/null +++ b/tests/prisma/check-3/p/prisma/src/main/scala/typings/prisma/prismaRequire.scala @@ -0,0 +1,11 @@ +package typings.prisma + +import org.scalablytyped.runtime.StObject +import scala.scalajs.js +import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} + +/* This can be used to `require` the library as a side effect. + If it is a global library this will make scalajs-bundler include it */ +@JSImport("prisma", JSImport.Namespace) +@js.native +object prismaRequire extends StObject diff --git a/tests/prisma/check-3/p/prisma/src/main/scala/typings/prisma/prismaStrings.scala b/tests/prisma/check-3/p/prisma/src/main/scala/typings/prisma/prismaStrings.scala new file mode 100644 index 0000000000..7e0a5042f8 --- /dev/null +++ b/tests/prisma/check-3/p/prisma/src/main/scala/typings/prisma/prismaStrings.scala @@ -0,0 +1,12 @@ +package typings.prisma + +import org.scalablytyped.runtime.StObject +import scala.scalajs.js +import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} + +object prismaStrings { + + @js.native + sealed trait PrismaClientPromise extends StObject + inline def PrismaClientPromise: PrismaClientPromise = "PrismaClientPromise".asInstanceOf[PrismaClientPromise] +} diff --git a/tests/prisma/check-3/s/std/build.sbt b/tests/prisma/check-3/s/std/build.sbt new file mode 100644 index 0000000000..114d9009c7 --- /dev/null +++ b/tests/prisma/check-3/s/std/build.sbt @@ -0,0 +1,10 @@ +organization := "org.scalablytyped" +name := "std" +version := "0.0-unknown-ba7c78" +scalaVersion := "3.1.2" +enablePlugins(ScalaJSPlugin) +libraryDependencies ++= Seq( + "com.olvind" %%% "scalablytyped-runtime" % "2.4.2") +publishArtifact in packageDoc := false +scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") +licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/tests/prisma/check-3/s/std/project/build.properties b/tests/prisma/check-3/s/std/project/build.properties new file mode 100644 index 0000000000..b1e589d9f4 --- /dev/null +++ b/tests/prisma/check-3/s/std/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.7.1 \ No newline at end of file diff --git a/tests/prisma/check-3/s/std/project/plugins.sbt b/tests/prisma/check-3/s/std/project/plugins.sbt new file mode 100644 index 0000000000..efff5a7004 --- /dev/null +++ b/tests/prisma/check-3/s/std/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("org.scala-js" %% "sbt-scalajs" % "1.10.0") diff --git a/tests/prisma/check-3/s/std/readme.md b/tests/prisma/check-3/s/std/readme.md new file mode 100644 index 0000000000..0e6d216516 --- /dev/null +++ b/tests/prisma/check-3/s/std/readme.md @@ -0,0 +1,15 @@ + +# Scala.js typings for std + + + + +## Note +This library has been generated from typescript code from first party type definitions. + +Provided with :purple_heart: from [ScalablyTyped](https://github.com/oyvindberg/ScalablyTyped) + +## Usage +See [the main readme](../../readme.md) for instructions. + + diff --git a/tests/prisma/check-3/s/std/src/main/scala/typings/std/Array.scala b/tests/prisma/check-3/s/std/src/main/scala/typings/std/Array.scala new file mode 100644 index 0000000000..8623763b87 --- /dev/null +++ b/tests/prisma/check-3/s/std/src/main/scala/typings/std/Array.scala @@ -0,0 +1,7 @@ +package typings.std + +import org.scalablytyped.runtime.StObject +import scala.scalajs.js +import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} + +trait Array[T] extends StObject diff --git a/tests/prisma/check-3/s/std/src/main/scala/typings/std/Error.scala b/tests/prisma/check-3/s/std/src/main/scala/typings/std/Error.scala new file mode 100644 index 0000000000..3cd45cecda --- /dev/null +++ b/tests/prisma/check-3/s/std/src/main/scala/typings/std/Error.scala @@ -0,0 +1,7 @@ +package typings.std + +import org.scalablytyped.runtime.StObject +import scala.scalajs.js +import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} + +trait Error extends StObject diff --git a/tests/prisma/check-3/s/std/src/main/scala/typings/std/Promise.scala b/tests/prisma/check-3/s/std/src/main/scala/typings/std/Promise.scala new file mode 100644 index 0000000000..d30119f408 --- /dev/null +++ b/tests/prisma/check-3/s/std/src/main/scala/typings/std/Promise.scala @@ -0,0 +1,17 @@ +package typings.std + +import scala.concurrent.Future +import org.scalablytyped.runtime.StObject +import scala.scalajs.js +import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} + +trait Promise[T] extends StObject +object Promise { + + extension [T](promise: Promise[T]) { + + def toFuture: Future[T] = toPromise.toFuture + + def toPromise: js.Promise[T] = promise.asInstanceOf[js.Promise[T]] + } +} diff --git a/tests/prisma/check-3/s/std/src/main/scala/typings/std/PromiseLike.scala b/tests/prisma/check-3/s/std/src/main/scala/typings/std/PromiseLike.scala new file mode 100644 index 0000000000..145e3a6d45 --- /dev/null +++ b/tests/prisma/check-3/s/std/src/main/scala/typings/std/PromiseLike.scala @@ -0,0 +1,17 @@ +package typings.std + +import scala.concurrent.Future +import org.scalablytyped.runtime.StObject +import scala.scalajs.js +import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} + +trait PromiseLike[T] extends StObject +object PromiseLike { + + extension [T](promise: PromiseLike[T]) { + + def toFuture: Future[T] = toPromise.toFuture + + def toPromise: js.Promise[T] = promise.asInstanceOf[js.Promise[T]] + } +} diff --git a/tests/prisma/check-3/s/std/src/main/scala/typings/std/ReadonlyArray.scala b/tests/prisma/check-3/s/std/src/main/scala/typings/std/ReadonlyArray.scala new file mode 100644 index 0000000000..2b93cae93c --- /dev/null +++ b/tests/prisma/check-3/s/std/src/main/scala/typings/std/ReadonlyArray.scala @@ -0,0 +1,7 @@ +package typings.std + +import org.scalablytyped.runtime.StObject +import scala.scalajs.js +import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} + +trait ReadonlyArray[T] extends StObject diff --git a/tests/prisma/check-3/s/std/src/main/scala/typings/std/RegExp.scala b/tests/prisma/check-3/s/std/src/main/scala/typings/std/RegExp.scala new file mode 100644 index 0000000000..fcca162bb4 --- /dev/null +++ b/tests/prisma/check-3/s/std/src/main/scala/typings/std/RegExp.scala @@ -0,0 +1,7 @@ +package typings.std + +import org.scalablytyped.runtime.StObject +import scala.scalajs.js +import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} + +trait RegExp extends StObject diff --git a/tests/prisma/check-3/s/std/src/main/scala/typings/std/TemplateStringsArray.scala b/tests/prisma/check-3/s/std/src/main/scala/typings/std/TemplateStringsArray.scala new file mode 100644 index 0000000000..9966a9892f --- /dev/null +++ b/tests/prisma/check-3/s/std/src/main/scala/typings/std/TemplateStringsArray.scala @@ -0,0 +1,26 @@ +package typings.std + +import org.scalablytyped.runtime.StObject +import scala.scalajs.js +import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} + +trait TemplateStringsArray + extends StObject + with ReadonlyArray[String] { + + val raw: js.Array[String] +} +object TemplateStringsArray { + + inline def apply(raw: js.Array[String]): TemplateStringsArray = { + val __obj = js.Dynamic.literal(raw = raw.asInstanceOf[js.Any]) + __obj.asInstanceOf[TemplateStringsArray] + } + + extension [Self <: TemplateStringsArray](x: Self) { + + inline def setRaw(value: js.Array[String]): Self = StObject.set(x, "raw", value.asInstanceOf[js.Any]) + + inline def setRawVarargs(value: String*): Self = StObject.set(x, "raw", js.Array(value*)) + } +} diff --git a/tests/prisma/check-3/s/std/src/main/scala/typings/std/package.scala b/tests/prisma/check-3/s/std/src/main/scala/typings/std/package.scala new file mode 100644 index 0000000000..4c81a9e7a4 --- /dev/null +++ b/tests/prisma/check-3/s/std/src/main/scala/typings/std/package.scala @@ -0,0 +1,9 @@ +package typings.std + +import org.scalablytyped.runtime.StringDictionary +import org.scalablytyped.runtime.StObject +import scala.scalajs.js +import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} + + +type Record[K /* <: /* keyof any */ String */, T] = StringDictionary[T] diff --git a/tests/prisma/check-3/s/std/src/main/scala/typings/std/stdRequire.scala b/tests/prisma/check-3/s/std/src/main/scala/typings/std/stdRequire.scala new file mode 100644 index 0000000000..5164c6f2a6 --- /dev/null +++ b/tests/prisma/check-3/s/std/src/main/scala/typings/std/stdRequire.scala @@ -0,0 +1,11 @@ +package typings.std + +import org.scalablytyped.runtime.StObject +import scala.scalajs.js +import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} + +/* This can be used to `require` the library as a side effect. + If it is a global library this will make scalajs-bundler include it */ +@JSImport("std", JSImport.Namespace) +@js.native +object stdRequire extends StObject diff --git a/tests/vue/check-3/s/std/build.sbt b/tests/vue/check-3/s/std/build.sbt index 590f9f8ad5..6d00483823 100644 --- a/tests/vue/check-3/s/std/build.sbt +++ b/tests/vue/check-3/s/std/build.sbt @@ -1,6 +1,6 @@ organization := "org.scalablytyped" name := "std" -version := "0.0-unknown-fff515" +version := "0.0-unknown-2447ad" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( diff --git a/tests/vue/check-3/s/std/src/main/scala/typings/std/Promise.scala b/tests/vue/check-3/s/std/src/main/scala/typings/std/Promise.scala index 4d4cce0e98..d30119f408 100644 --- a/tests/vue/check-3/s/std/src/main/scala/typings/std/Promise.scala +++ b/tests/vue/check-3/s/std/src/main/scala/typings/std/Promise.scala @@ -1,7 +1,17 @@ package typings.std +import scala.concurrent.Future import org.scalablytyped.runtime.StObject import scala.scalajs.js import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} trait Promise[T] extends StObject +object Promise { + + extension [T](promise: Promise[T]) { + + def toFuture: Future[T] = toPromise.toFuture + + def toPromise: js.Promise[T] = promise.asInstanceOf[js.Promise[T]] + } +} diff --git a/tests/vue/check-3/s/std/src/main/scala/typings/std/PromiseLike.scala b/tests/vue/check-3/s/std/src/main/scala/typings/std/PromiseLike.scala index 55920f7a42..145e3a6d45 100644 --- a/tests/vue/check-3/s/std/src/main/scala/typings/std/PromiseLike.scala +++ b/tests/vue/check-3/s/std/src/main/scala/typings/std/PromiseLike.scala @@ -1,7 +1,17 @@ package typings.std +import scala.concurrent.Future import org.scalablytyped.runtime.StObject import scala.scalajs.js import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} trait PromiseLike[T] extends StObject +object PromiseLike { + + extension [T](promise: PromiseLike[T]) { + + def toFuture: Future[T] = toPromise.toFuture + + def toPromise: js.Promise[T] = promise.asInstanceOf[js.Promise[T]] + } +} diff --git a/tests/vue/check-3/s/storybook__vue/build.sbt b/tests/vue/check-3/s/storybook__vue/build.sbt index fade0cea55..3ee2732411 100644 --- a/tests/vue/check-3/s/storybook__vue/build.sbt +++ b/tests/vue/check-3/s/storybook__vue/build.sbt @@ -1,13 +1,13 @@ organization := "org.scalablytyped" name := "storybook__vue" -version := "3.3-25e375" +version := "3.3-0e65b6" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", - "org.scalablytyped" %%% "std" % "0.0-unknown-fff515", - "org.scalablytyped" %%% "vue" % "2.5.13-e037fb", - "org.scalablytyped" %%% "webpack-env" % "1.13-128dc0") + "org.scalablytyped" %%% "std" % "0.0-unknown-2447ad", + "org.scalablytyped" %%% "vue" % "2.5.13-41a2ed", + "org.scalablytyped" %%% "webpack-env" % "1.13-e9cf3b") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/tests/vue/check-3/v/vue-resource/build.sbt b/tests/vue/check-3/v/vue-resource/build.sbt index bf2ca05796..06c2caa8eb 100644 --- a/tests/vue/check-3/v/vue-resource/build.sbt +++ b/tests/vue/check-3/v/vue-resource/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "vue-resource" -version := "0.9.3-a79aab" +version := "0.9.3-fc3de0" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", - "org.scalablytyped" %%% "std" % "0.0-unknown-fff515") + "org.scalablytyped" %%% "std" % "0.0-unknown-2447ad") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/tests/vue/check-3/v/vue-resource/src/main/scala/typings/vueResource/anon.scala b/tests/vue/check-3/v/vue-resource/src/main/scala/typings/vueResource/anon.scala index fb14883641..0814714afe 100644 --- a/tests/vue/check-3/v/vue-resource/src/main/scala/typings/vueResource/anon.scala +++ b/tests/vue/check-3/v/vue-resource/src/main/scala/typings/vueResource/anon.scala @@ -1,6 +1,7 @@ package typings.vueResource import org.scalablytyped.runtime.StringDictionary +import typings.std.PromiseLike import typings.vueResource.vuejs.HttpHeaders import typings.vueResource.vuejs.HttpOptions import typings.vueResource.vuejs.HttpResponse @@ -14,53 +15,53 @@ object anon { @js.native trait Call extends StObject { - def apply(options: HttpOptions): js.Thenable[HttpResponse] = js.native + def apply(options: HttpOptions): PromiseLike[HttpResponse] = js.native - def delete(url: String): js.Thenable[HttpResponse] = js.native - def delete(url: String, data: Any): js.Thenable[HttpResponse] = js.native - def delete(url: String, data: Any, options: HttpOptions): js.Thenable[HttpResponse] = js.native - def delete(url: String, data: Unit, options: HttpOptions): js.Thenable[HttpResponse] = js.native - def delete(url: String, options: HttpOptions): js.Thenable[HttpResponse] = js.native + def delete(url: String): PromiseLike[HttpResponse] = js.native + def delete(url: String, data: Any): PromiseLike[HttpResponse] = js.native + def delete(url: String, data: Any, options: HttpOptions): PromiseLike[HttpResponse] = js.native + def delete(url: String, data: Unit, options: HttpOptions): PromiseLike[HttpResponse] = js.native + def delete(url: String, options: HttpOptions): PromiseLike[HttpResponse] = js.native @JSName("delete") var delete_Original: http = js.native - def get(url: String): js.Thenable[HttpResponse] = js.native - def get(url: String, data: Any): js.Thenable[HttpResponse] = js.native - def get(url: String, data: Any, options: HttpOptions): js.Thenable[HttpResponse] = js.native - def get(url: String, data: Unit, options: HttpOptions): js.Thenable[HttpResponse] = js.native - def get(url: String, options: HttpOptions): js.Thenable[HttpResponse] = js.native + def get(url: String): PromiseLike[HttpResponse] = js.native + def get(url: String, data: Any): PromiseLike[HttpResponse] = js.native + def get(url: String, data: Any, options: HttpOptions): PromiseLike[HttpResponse] = js.native + def get(url: String, data: Unit, options: HttpOptions): PromiseLike[HttpResponse] = js.native + def get(url: String, options: HttpOptions): PromiseLike[HttpResponse] = js.native @JSName("get") var get_Original: http = js.native - def jsonp(url: String): js.Thenable[HttpResponse] = js.native - def jsonp(url: String, data: Any): js.Thenable[HttpResponse] = js.native - def jsonp(url: String, data: Any, options: HttpOptions): js.Thenable[HttpResponse] = js.native - def jsonp(url: String, data: Unit, options: HttpOptions): js.Thenable[HttpResponse] = js.native - def jsonp(url: String, options: HttpOptions): js.Thenable[HttpResponse] = js.native + def jsonp(url: String): PromiseLike[HttpResponse] = js.native + def jsonp(url: String, data: Any): PromiseLike[HttpResponse] = js.native + def jsonp(url: String, data: Any, options: HttpOptions): PromiseLike[HttpResponse] = js.native + def jsonp(url: String, data: Unit, options: HttpOptions): PromiseLike[HttpResponse] = js.native + def jsonp(url: String, options: HttpOptions): PromiseLike[HttpResponse] = js.native @JSName("jsonp") var jsonp_Original: http = js.native - def patch(url: String): js.Thenable[HttpResponse] = js.native - def patch(url: String, data: Any): js.Thenable[HttpResponse] = js.native - def patch(url: String, data: Any, options: HttpOptions): js.Thenable[HttpResponse] = js.native - def patch(url: String, data: Unit, options: HttpOptions): js.Thenable[HttpResponse] = js.native - def patch(url: String, options: HttpOptions): js.Thenable[HttpResponse] = js.native + def patch(url: String): PromiseLike[HttpResponse] = js.native + def patch(url: String, data: Any): PromiseLike[HttpResponse] = js.native + def patch(url: String, data: Any, options: HttpOptions): PromiseLike[HttpResponse] = js.native + def patch(url: String, data: Unit, options: HttpOptions): PromiseLike[HttpResponse] = js.native + def patch(url: String, options: HttpOptions): PromiseLike[HttpResponse] = js.native @JSName("patch") var patch_Original: http = js.native - def post(url: String): js.Thenable[HttpResponse] = js.native - def post(url: String, data: Any): js.Thenable[HttpResponse] = js.native - def post(url: String, data: Any, options: HttpOptions): js.Thenable[HttpResponse] = js.native - def post(url: String, data: Unit, options: HttpOptions): js.Thenable[HttpResponse] = js.native - def post(url: String, options: HttpOptions): js.Thenable[HttpResponse] = js.native + def post(url: String): PromiseLike[HttpResponse] = js.native + def post(url: String, data: Any): PromiseLike[HttpResponse] = js.native + def post(url: String, data: Any, options: HttpOptions): PromiseLike[HttpResponse] = js.native + def post(url: String, data: Unit, options: HttpOptions): PromiseLike[HttpResponse] = js.native + def post(url: String, options: HttpOptions): PromiseLike[HttpResponse] = js.native @JSName("post") var post_Original: http = js.native - def put(url: String): js.Thenable[HttpResponse] = js.native - def put(url: String, data: Any): js.Thenable[HttpResponse] = js.native - def put(url: String, data: Any, options: HttpOptions): js.Thenable[HttpResponse] = js.native - def put(url: String, data: Unit, options: HttpOptions): js.Thenable[HttpResponse] = js.native - def put(url: String, options: HttpOptions): js.Thenable[HttpResponse] = js.native + def put(url: String): PromiseLike[HttpResponse] = js.native + def put(url: String, data: Any): PromiseLike[HttpResponse] = js.native + def put(url: String, data: Any, options: HttpOptions): PromiseLike[HttpResponse] = js.native + def put(url: String, data: Unit, options: HttpOptions): PromiseLike[HttpResponse] = js.native + def put(url: String, options: HttpOptions): PromiseLike[HttpResponse] = js.native @JSName("put") var put_Original: http = js.native } diff --git a/tests/vue/check-3/v/vue-resource/src/main/scala/typings/vueResource/vuejs.scala b/tests/vue/check-3/v/vue-resource/src/main/scala/typings/vueResource/vuejs.scala index 42d53e2f4f..d11ead2211 100644 --- a/tests/vue/check-3/v/vue-resource/src/main/scala/typings/vueResource/vuejs.scala +++ b/tests/vue/check-3/v/vue-resource/src/main/scala/typings/vueResource/vuejs.scala @@ -2,6 +2,7 @@ package typings.vueResource import org.scalablytyped.runtime.StringDictionary import typings.std.Blob +import typings.std.PromiseLike import typings.vueResource.anon.Call import typings.vueResource.anon.HttpOptionsrootstring import typings.vueResource.anon.Method @@ -236,19 +237,19 @@ object vuejs { trait Http_ extends StObject { - def delete(url: String): js.Thenable[HttpResponse] - def delete(url: String, data: Any): js.Thenable[HttpResponse] - def delete(url: String, data: Any, options: HttpOptions): js.Thenable[HttpResponse] - def delete(url: String, data: Unit, options: HttpOptions): js.Thenable[HttpResponse] - def delete(url: String, options: HttpOptions): js.Thenable[HttpResponse] + def delete(url: String): PromiseLike[HttpResponse] + def delete(url: String, data: Any): PromiseLike[HttpResponse] + def delete(url: String, data: Any, options: HttpOptions): PromiseLike[HttpResponse] + def delete(url: String, data: Unit, options: HttpOptions): PromiseLike[HttpResponse] + def delete(url: String, options: HttpOptions): PromiseLike[HttpResponse] @JSName("delete") var delete_Original: http - def get(url: String): js.Thenable[HttpResponse] - def get(url: String, data: Any): js.Thenable[HttpResponse] - def get(url: String, data: Any, options: HttpOptions): js.Thenable[HttpResponse] - def get(url: String, data: Unit, options: HttpOptions): js.Thenable[HttpResponse] - def get(url: String, options: HttpOptions): js.Thenable[HttpResponse] + def get(url: String): PromiseLike[HttpResponse] + def get(url: String, data: Any): PromiseLike[HttpResponse] + def get(url: String, data: Any, options: HttpOptions): PromiseLike[HttpResponse] + def get(url: String, data: Unit, options: HttpOptions): PromiseLike[HttpResponse] + def get(url: String, options: HttpOptions): PromiseLike[HttpResponse] @JSName("get") var get_Original: http @@ -256,37 +257,37 @@ object vuejs { var interceptors: js.Array[HttpInterceptor | js.Function0[HttpInterceptor]] - def jsonp(url: String): js.Thenable[HttpResponse] - def jsonp(url: String, data: Any): js.Thenable[HttpResponse] - def jsonp(url: String, data: Any, options: HttpOptions): js.Thenable[HttpResponse] - def jsonp(url: String, data: Unit, options: HttpOptions): js.Thenable[HttpResponse] - def jsonp(url: String, options: HttpOptions): js.Thenable[HttpResponse] + def jsonp(url: String): PromiseLike[HttpResponse] + def jsonp(url: String, data: Any): PromiseLike[HttpResponse] + def jsonp(url: String, data: Any, options: HttpOptions): PromiseLike[HttpResponse] + def jsonp(url: String, data: Unit, options: HttpOptions): PromiseLike[HttpResponse] + def jsonp(url: String, options: HttpOptions): PromiseLike[HttpResponse] @JSName("jsonp") var jsonp_Original: http var options: HttpOptionsrootstring - def patch(url: String): js.Thenable[HttpResponse] - def patch(url: String, data: Any): js.Thenable[HttpResponse] - def patch(url: String, data: Any, options: HttpOptions): js.Thenable[HttpResponse] - def patch(url: String, data: Unit, options: HttpOptions): js.Thenable[HttpResponse] - def patch(url: String, options: HttpOptions): js.Thenable[HttpResponse] + def patch(url: String): PromiseLike[HttpResponse] + def patch(url: String, data: Any): PromiseLike[HttpResponse] + def patch(url: String, data: Any, options: HttpOptions): PromiseLike[HttpResponse] + def patch(url: String, data: Unit, options: HttpOptions): PromiseLike[HttpResponse] + def patch(url: String, options: HttpOptions): PromiseLike[HttpResponse] @JSName("patch") var patch_Original: http - def post(url: String): js.Thenable[HttpResponse] - def post(url: String, data: Any): js.Thenable[HttpResponse] - def post(url: String, data: Any, options: HttpOptions): js.Thenable[HttpResponse] - def post(url: String, data: Unit, options: HttpOptions): js.Thenable[HttpResponse] - def post(url: String, options: HttpOptions): js.Thenable[HttpResponse] + def post(url: String): PromiseLike[HttpResponse] + def post(url: String, data: Any): PromiseLike[HttpResponse] + def post(url: String, data: Any, options: HttpOptions): PromiseLike[HttpResponse] + def post(url: String, data: Unit, options: HttpOptions): PromiseLike[HttpResponse] + def post(url: String, options: HttpOptions): PromiseLike[HttpResponse] @JSName("post") var post_Original: http - def put(url: String): js.Thenable[HttpResponse] - def put(url: String, data: Any): js.Thenable[HttpResponse] - def put(url: String, data: Any, options: HttpOptions): js.Thenable[HttpResponse] - def put(url: String, data: Unit, options: HttpOptions): js.Thenable[HttpResponse] - def put(url: String, options: HttpOptions): js.Thenable[HttpResponse] + def put(url: String): PromiseLike[HttpResponse] + def put(url: String, data: Any): PromiseLike[HttpResponse] + def put(url: String, data: Any, options: HttpOptions): PromiseLike[HttpResponse] + def put(url: String, data: Unit, options: HttpOptions): PromiseLike[HttpResponse] + def put(url: String, options: HttpOptions): PromiseLike[HttpResponse] @JSName("put") var put_Original: http } @@ -371,123 +372,123 @@ object vuejs { @js.native trait ResourceMethod extends StObject { - def apply(): js.Thenable[HttpResponse] = js.native - def apply(params: Any): js.Thenable[HttpResponse] = js.native - def apply(params: Any, data: Any): js.Thenable[HttpResponse] = js.native - def apply(params: Any, data: Any, success: js.Function): js.Thenable[HttpResponse] = js.native - def apply(params: Any, data: Any, success: js.Function, error: js.Function): js.Thenable[HttpResponse] = js.native - def apply(params: Any, data: Any, success: Unit, error: js.Function): js.Thenable[HttpResponse] = js.native - def apply(params: Any, data: Unit, success: js.Function): js.Thenable[HttpResponse] = js.native - def apply(params: Any, data: Unit, success: js.Function, error: js.Function): js.Thenable[HttpResponse] = js.native - def apply(params: Any, data: Unit, success: Unit, error: js.Function): js.Thenable[HttpResponse] = js.native - def apply(params: Any, success: js.Function): js.Thenable[HttpResponse] = js.native - def apply(params: Any, success: js.Function, error: js.Function): js.Thenable[HttpResponse] = js.native - def apply(success: js.Function): js.Thenable[HttpResponse] = js.native - def apply(success: js.Function, error: js.Function): js.Thenable[HttpResponse] = js.native - def apply(success: Unit, error: js.Function): js.Thenable[HttpResponse] = js.native + def apply(): PromiseLike[HttpResponse] = js.native + def apply(params: Any): PromiseLike[HttpResponse] = js.native + def apply(params: Any, data: Any): PromiseLike[HttpResponse] = js.native + def apply(params: Any, data: Any, success: js.Function): PromiseLike[HttpResponse] = js.native + def apply(params: Any, data: Any, success: js.Function, error: js.Function): PromiseLike[HttpResponse] = js.native + def apply(params: Any, data: Any, success: Unit, error: js.Function): PromiseLike[HttpResponse] = js.native + def apply(params: Any, data: Unit, success: js.Function): PromiseLike[HttpResponse] = js.native + def apply(params: Any, data: Unit, success: js.Function, error: js.Function): PromiseLike[HttpResponse] = js.native + def apply(params: Any, data: Unit, success: Unit, error: js.Function): PromiseLike[HttpResponse] = js.native + def apply(params: Any, success: js.Function): PromiseLike[HttpResponse] = js.native + def apply(params: Any, success: js.Function, error: js.Function): PromiseLike[HttpResponse] = js.native + def apply(success: js.Function): PromiseLike[HttpResponse] = js.native + def apply(success: js.Function, error: js.Function): PromiseLike[HttpResponse] = js.native + def apply(success: Unit, error: js.Function): PromiseLike[HttpResponse] = js.native } trait ResourceMethods extends StObject { - def delete(): js.Thenable[HttpResponse] - def delete(params: Any): js.Thenable[HttpResponse] - def delete(params: Any, data: Any): js.Thenable[HttpResponse] - def delete(params: Any, data: Any, success: js.Function): js.Thenable[HttpResponse] - def delete(params: Any, data: Any, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def delete(params: Any, data: Any, success: Unit, error: js.Function): js.Thenable[HttpResponse] - def delete(params: Any, data: Unit, success: js.Function): js.Thenable[HttpResponse] - def delete(params: Any, data: Unit, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def delete(params: Any, data: Unit, success: Unit, error: js.Function): js.Thenable[HttpResponse] - def delete(params: Any, success: js.Function): js.Thenable[HttpResponse] - def delete(params: Any, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def delete(success: js.Function): js.Thenable[HttpResponse] - def delete(success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def delete(success: Unit, error: js.Function): js.Thenable[HttpResponse] + def delete(): PromiseLike[HttpResponse] + def delete(params: Any): PromiseLike[HttpResponse] + def delete(params: Any, data: Any): PromiseLike[HttpResponse] + def delete(params: Any, data: Any, success: js.Function): PromiseLike[HttpResponse] + def delete(params: Any, data: Any, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def delete(params: Any, data: Any, success: Unit, error: js.Function): PromiseLike[HttpResponse] + def delete(params: Any, data: Unit, success: js.Function): PromiseLike[HttpResponse] + def delete(params: Any, data: Unit, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def delete(params: Any, data: Unit, success: Unit, error: js.Function): PromiseLike[HttpResponse] + def delete(params: Any, success: js.Function): PromiseLike[HttpResponse] + def delete(params: Any, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def delete(success: js.Function): PromiseLike[HttpResponse] + def delete(success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def delete(success: Unit, error: js.Function): PromiseLike[HttpResponse] @JSName("delete") var delete_Original: ResourceMethod - def get(): js.Thenable[HttpResponse] - def get(params: Any): js.Thenable[HttpResponse] - def get(params: Any, data: Any): js.Thenable[HttpResponse] - def get(params: Any, data: Any, success: js.Function): js.Thenable[HttpResponse] - def get(params: Any, data: Any, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def get(params: Any, data: Any, success: Unit, error: js.Function): js.Thenable[HttpResponse] - def get(params: Any, data: Unit, success: js.Function): js.Thenable[HttpResponse] - def get(params: Any, data: Unit, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def get(params: Any, data: Unit, success: Unit, error: js.Function): js.Thenable[HttpResponse] - def get(params: Any, success: js.Function): js.Thenable[HttpResponse] - def get(params: Any, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def get(success: js.Function): js.Thenable[HttpResponse] - def get(success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def get(success: Unit, error: js.Function): js.Thenable[HttpResponse] + def get(): PromiseLike[HttpResponse] + def get(params: Any): PromiseLike[HttpResponse] + def get(params: Any, data: Any): PromiseLike[HttpResponse] + def get(params: Any, data: Any, success: js.Function): PromiseLike[HttpResponse] + def get(params: Any, data: Any, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def get(params: Any, data: Any, success: Unit, error: js.Function): PromiseLike[HttpResponse] + def get(params: Any, data: Unit, success: js.Function): PromiseLike[HttpResponse] + def get(params: Any, data: Unit, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def get(params: Any, data: Unit, success: Unit, error: js.Function): PromiseLike[HttpResponse] + def get(params: Any, success: js.Function): PromiseLike[HttpResponse] + def get(params: Any, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def get(success: js.Function): PromiseLike[HttpResponse] + def get(success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def get(success: Unit, error: js.Function): PromiseLike[HttpResponse] @JSName("get") var get_Original: ResourceMethod - def query(): js.Thenable[HttpResponse] - def query(params: Any): js.Thenable[HttpResponse] - def query(params: Any, data: Any): js.Thenable[HttpResponse] - def query(params: Any, data: Any, success: js.Function): js.Thenable[HttpResponse] - def query(params: Any, data: Any, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def query(params: Any, data: Any, success: Unit, error: js.Function): js.Thenable[HttpResponse] - def query(params: Any, data: Unit, success: js.Function): js.Thenable[HttpResponse] - def query(params: Any, data: Unit, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def query(params: Any, data: Unit, success: Unit, error: js.Function): js.Thenable[HttpResponse] - def query(params: Any, success: js.Function): js.Thenable[HttpResponse] - def query(params: Any, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def query(success: js.Function): js.Thenable[HttpResponse] - def query(success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def query(success: Unit, error: js.Function): js.Thenable[HttpResponse] + def query(): PromiseLike[HttpResponse] + def query(params: Any): PromiseLike[HttpResponse] + def query(params: Any, data: Any): PromiseLike[HttpResponse] + def query(params: Any, data: Any, success: js.Function): PromiseLike[HttpResponse] + def query(params: Any, data: Any, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def query(params: Any, data: Any, success: Unit, error: js.Function): PromiseLike[HttpResponse] + def query(params: Any, data: Unit, success: js.Function): PromiseLike[HttpResponse] + def query(params: Any, data: Unit, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def query(params: Any, data: Unit, success: Unit, error: js.Function): PromiseLike[HttpResponse] + def query(params: Any, success: js.Function): PromiseLike[HttpResponse] + def query(params: Any, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def query(success: js.Function): PromiseLike[HttpResponse] + def query(success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def query(success: Unit, error: js.Function): PromiseLike[HttpResponse] @JSName("query") var query_Original: ResourceMethod - def remove(): js.Thenable[HttpResponse] - def remove(params: Any): js.Thenable[HttpResponse] - def remove(params: Any, data: Any): js.Thenable[HttpResponse] - def remove(params: Any, data: Any, success: js.Function): js.Thenable[HttpResponse] - def remove(params: Any, data: Any, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def remove(params: Any, data: Any, success: Unit, error: js.Function): js.Thenable[HttpResponse] - def remove(params: Any, data: Unit, success: js.Function): js.Thenable[HttpResponse] - def remove(params: Any, data: Unit, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def remove(params: Any, data: Unit, success: Unit, error: js.Function): js.Thenable[HttpResponse] - def remove(params: Any, success: js.Function): js.Thenable[HttpResponse] - def remove(params: Any, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def remove(success: js.Function): js.Thenable[HttpResponse] - def remove(success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def remove(success: Unit, error: js.Function): js.Thenable[HttpResponse] + def remove(): PromiseLike[HttpResponse] + def remove(params: Any): PromiseLike[HttpResponse] + def remove(params: Any, data: Any): PromiseLike[HttpResponse] + def remove(params: Any, data: Any, success: js.Function): PromiseLike[HttpResponse] + def remove(params: Any, data: Any, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def remove(params: Any, data: Any, success: Unit, error: js.Function): PromiseLike[HttpResponse] + def remove(params: Any, data: Unit, success: js.Function): PromiseLike[HttpResponse] + def remove(params: Any, data: Unit, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def remove(params: Any, data: Unit, success: Unit, error: js.Function): PromiseLike[HttpResponse] + def remove(params: Any, success: js.Function): PromiseLike[HttpResponse] + def remove(params: Any, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def remove(success: js.Function): PromiseLike[HttpResponse] + def remove(success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def remove(success: Unit, error: js.Function): PromiseLike[HttpResponse] @JSName("remove") var remove_Original: ResourceMethod - def save(): js.Thenable[HttpResponse] - def save(params: Any): js.Thenable[HttpResponse] - def save(params: Any, data: Any): js.Thenable[HttpResponse] - def save(params: Any, data: Any, success: js.Function): js.Thenable[HttpResponse] - def save(params: Any, data: Any, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def save(params: Any, data: Any, success: Unit, error: js.Function): js.Thenable[HttpResponse] - def save(params: Any, data: Unit, success: js.Function): js.Thenable[HttpResponse] - def save(params: Any, data: Unit, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def save(params: Any, data: Unit, success: Unit, error: js.Function): js.Thenable[HttpResponse] - def save(params: Any, success: js.Function): js.Thenable[HttpResponse] - def save(params: Any, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def save(success: js.Function): js.Thenable[HttpResponse] - def save(success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def save(success: Unit, error: js.Function): js.Thenable[HttpResponse] + def save(): PromiseLike[HttpResponse] + def save(params: Any): PromiseLike[HttpResponse] + def save(params: Any, data: Any): PromiseLike[HttpResponse] + def save(params: Any, data: Any, success: js.Function): PromiseLike[HttpResponse] + def save(params: Any, data: Any, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def save(params: Any, data: Any, success: Unit, error: js.Function): PromiseLike[HttpResponse] + def save(params: Any, data: Unit, success: js.Function): PromiseLike[HttpResponse] + def save(params: Any, data: Unit, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def save(params: Any, data: Unit, success: Unit, error: js.Function): PromiseLike[HttpResponse] + def save(params: Any, success: js.Function): PromiseLike[HttpResponse] + def save(params: Any, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def save(success: js.Function): PromiseLike[HttpResponse] + def save(success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def save(success: Unit, error: js.Function): PromiseLike[HttpResponse] @JSName("save") var save_Original: ResourceMethod - def update(): js.Thenable[HttpResponse] - def update(params: Any): js.Thenable[HttpResponse] - def update(params: Any, data: Any): js.Thenable[HttpResponse] - def update(params: Any, data: Any, success: js.Function): js.Thenable[HttpResponse] - def update(params: Any, data: Any, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def update(params: Any, data: Any, success: Unit, error: js.Function): js.Thenable[HttpResponse] - def update(params: Any, data: Unit, success: js.Function): js.Thenable[HttpResponse] - def update(params: Any, data: Unit, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def update(params: Any, data: Unit, success: Unit, error: js.Function): js.Thenable[HttpResponse] - def update(params: Any, success: js.Function): js.Thenable[HttpResponse] - def update(params: Any, success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def update(success: js.Function): js.Thenable[HttpResponse] - def update(success: js.Function, error: js.Function): js.Thenable[HttpResponse] - def update(success: Unit, error: js.Function): js.Thenable[HttpResponse] + def update(): PromiseLike[HttpResponse] + def update(params: Any): PromiseLike[HttpResponse] + def update(params: Any, data: Any): PromiseLike[HttpResponse] + def update(params: Any, data: Any, success: js.Function): PromiseLike[HttpResponse] + def update(params: Any, data: Any, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def update(params: Any, data: Any, success: Unit, error: js.Function): PromiseLike[HttpResponse] + def update(params: Any, data: Unit, success: js.Function): PromiseLike[HttpResponse] + def update(params: Any, data: Unit, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def update(params: Any, data: Unit, success: Unit, error: js.Function): PromiseLike[HttpResponse] + def update(params: Any, success: js.Function): PromiseLike[HttpResponse] + def update(params: Any, success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def update(success: js.Function): PromiseLike[HttpResponse] + def update(success: js.Function, error: js.Function): PromiseLike[HttpResponse] + def update(success: Unit, error: js.Function): PromiseLike[HttpResponse] @JSName("update") var update_Original: ResourceMethod } @@ -530,7 +531,7 @@ object vuejs { trait Vue extends StObject { @JSName("$http") - def $http(options: HttpOptions): js.Thenable[HttpResponse] + def $http(options: HttpOptions): PromiseLike[HttpResponse] @JSName("$http") var $http_Original: Call @@ -597,11 +598,11 @@ object vuejs { @js.native trait http extends StObject { - def apply(url: String): js.Thenable[HttpResponse] = js.native - def apply(url: String, data: Any): js.Thenable[HttpResponse] = js.native - def apply(url: String, data: Any, options: HttpOptions): js.Thenable[HttpResponse] = js.native - def apply(url: String, data: Unit, options: HttpOptions): js.Thenable[HttpResponse] = js.native - def apply(url: String, options: HttpOptions): js.Thenable[HttpResponse] = js.native + def apply(url: String): PromiseLike[HttpResponse] = js.native + def apply(url: String, data: Any): PromiseLike[HttpResponse] = js.native + def apply(url: String, data: Any, options: HttpOptions): PromiseLike[HttpResponse] = js.native + def apply(url: String, data: Unit, options: HttpOptions): PromiseLike[HttpResponse] = js.native + def apply(url: String, options: HttpOptions): PromiseLike[HttpResponse] = js.native } type resource = js.Function4[ diff --git a/tests/vue/check-3/v/vue-scrollto/build.sbt b/tests/vue/check-3/v/vue-scrollto/build.sbt index 0b665dc965..c55e430756 100644 --- a/tests/vue/check-3/v/vue-scrollto/build.sbt +++ b/tests/vue/check-3/v/vue-scrollto/build.sbt @@ -1,12 +1,12 @@ organization := "org.scalablytyped" name := "vue-scrollto" -version := "2.7-e37ae4" +version := "2.7-b956f5" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", - "org.scalablytyped" %%% "std" % "0.0-unknown-fff515", - "org.scalablytyped" %%% "vue" % "2.5.13-e037fb") + "org.scalablytyped" %%% "std" % "0.0-unknown-2447ad", + "org.scalablytyped" %%% "vue" % "2.5.13-41a2ed") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/tests/vue/check-3/v/vue/build.sbt b/tests/vue/check-3/v/vue/build.sbt index 3310f75736..3f7cdb242f 100644 --- a/tests/vue/check-3/v/vue/build.sbt +++ b/tests/vue/check-3/v/vue/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "vue" -version := "2.5.13-e037fb" +version := "2.5.13-41a2ed" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", - "org.scalablytyped" %%% "std" % "0.0-unknown-fff515") + "org.scalablytyped" %%% "std" % "0.0-unknown-2447ad") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") licenses += ("MIT", url("http://opensource.org/licenses/MIT")) diff --git a/tests/vue/check-3/w/webpack-env/build.sbt b/tests/vue/check-3/w/webpack-env/build.sbt index 95cbee3249..7f974134f9 100644 --- a/tests/vue/check-3/w/webpack-env/build.sbt +++ b/tests/vue/check-3/w/webpack-env/build.sbt @@ -1,11 +1,11 @@ organization := "org.scalablytyped" name := "webpack-env" -version := "1.13-128dc0" +version := "1.13-e9cf3b" scalaVersion := "3.1.2" enablePlugins(ScalaJSPlugin) libraryDependencies ++= Seq( "com.olvind" %%% "scalablytyped-runtime" % "2.4.2", - "org.scalablytyped" %%% "std" % "0.0-unknown-fff515") + "org.scalablytyped" %%% "std" % "0.0-unknown-2447ad") publishArtifact in packageDoc := false scalacOptions ++= List("-encoding", "utf-8", "-feature", "-language:implicitConversions", "-language:higherKinds", "-language:existentials", "-no-indent", "-source:future") licenses += ("MIT", url("http://opensource.org/licenses/MIT"))