Skip to content

Commit

Permalink
Slinky: TagMod[Any] => ReactElement
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindberg committed Jun 21, 2020
1 parent 25ac01d commit 56c04d0
Show file tree
Hide file tree
Showing 53 changed files with 157 additions and 160 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object SlinkyTypeConversions {
// CastConversion(reactNames.ReactType, ReactComponentClass, _1),
CastConversion(reactNames.ComponentState, QualifiedName.Object),
CastConversion(reactNames.ReactDOM, QualifiedName.Any),
CastConversion(reactNames.ReactNode, TagMod, Ref(TypeRef.ScalaAny)),
CastConversion(reactNames.ReactNode, ReactElement),
CastConversion(reactNames.RefObject, ReactRef, _1),
// CastConversion(reactNames.Component, rawReactComponent, _1, TypeRef.Object),
// CastConversion(reactNames.ComponentClass, rawReactComponentClassP, _1Object),
Expand Down
4 changes: 2 additions & 2 deletions tests/material-ui/check-slinky/m/material-ui/build.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
organization := "org.scalablytyped"
name := "material-ui"
version := "0.0-unknown-3ac7af"
version := "0.0-unknown-614c02"
scalaVersion := "2.13.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.1.0",
"me.shadaj" %%% "slinky-web" % "0.6.5",
"org.scalablytyped" %%% "react" % "0.0-unknown-c6c500",
"org.scalablytyped" %%% "react" % "0.0-unknown-e3bc89",
"org.scalablytyped" %%% "std" % "0.0-unknown-e37381")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-g:notailcalls", "-language:implicitConversions", "-language:higherKinds", "-language:existentials")
Expand Down
2 changes: 1 addition & 1 deletion tests/material-ui/check-slinky/r/react/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
organization := "org.scalablytyped"
name := "react"
version := "0.0-unknown-c6c500"
version := "0.0-unknown-e3bc89"
scalaVersion := "2.13.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package typingsSlinky.react.anon

import slinky.core.TagMod
import slinky.core.facade.ReactElement
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation._

@js.native
trait Children extends js.Object {
var children: js.UndefOr[TagMod[Any]] = js.native
var children: js.UndefOr[ReactElement] = js.native
}

object Children {
Expand All @@ -28,7 +28,7 @@ object Children {
x
}
@scala.inline
def setChildren(value: TagMod[Any]): Self = this.set("children", value.asInstanceOf[js.Any])
def setChildren(value: ReactElement): Self = this.set("children", value.asInstanceOf[js.Any])
@scala.inline
def deleteChildren: Self = this.set("children", js.undefined)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package typingsSlinky.react.mod

import slinky.core.TagMod
import typingsSlinky.react.anon.Html
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation._

@js.native
trait DOMAttributes[T] extends js.Object {
var children: js.UndefOr[TagMod[Any]] = js.native
var children: js.UndefOr[slinky.core.facade.ReactElement] = js.native
var dangerouslySetInnerHTML: js.UndefOr[Html] = js.native
var onClick: js.UndefOr[Double | (js.Function1[/* x */ String, Unit])] = js.native
}
Expand All @@ -31,7 +30,7 @@ object DOMAttributes {
x
}
@scala.inline
def setChildren(value: TagMod[Any]): Self = this.set("children", value.asInstanceOf[js.Any])
def setChildren(value: slinky.core.facade.ReactElement): Self = this.set("children", value.asInstanceOf[js.Any])
@scala.inline
def deleteChildren: Self = this.set("children", js.undefined)
@scala.inline
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
organization := "org.scalablytyped"
name := "componentstest"
version := "0.0-unknown-9cbc83"
version := "0.0-unknown-8c14dd"
scalaVersion := "2.13.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.1.0",
"me.shadaj" %%% "slinky-web" % "0.6.5",
"org.scalablytyped" %%% "react" % "16.9.2-46bbda",
"org.scalablytyped" %%% "react" % "16.9.2-7f52cd",
"org.scalablytyped" %%% "std" % "0.0-unknown-d0ed57")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-g:notailcalls", "-language:implicitConversions", "-language:higherKinds", "-language:existentials")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
organization := "org.scalablytyped"
name := "react-bootstrap"
version := "0.32-21afab"
version := "0.32-2c56d3"
scalaVersion := "2.13.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.1.0",
"me.shadaj" %%% "slinky-web" % "0.6.5",
"org.scalablytyped" %%% "react" % "16.9.2-46bbda",
"org.scalablytyped" %%% "react" % "16.9.2-7f52cd",
"org.scalablytyped" %%% "std" % "0.0-unknown-d0ed57")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-g:notailcalls", "-language:implicitConversions", "-language:higherKinds", "-language:existentials")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
organization := "org.scalablytyped"
name := "react-contextmenu"
version := "2.13.0-133270"
version := "2.13.0-15dbfd"
scalaVersion := "2.13.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.1.0",
"me.shadaj" %%% "slinky-web" % "0.6.5",
"org.scalablytyped" %%% "react" % "16.9.2-46bbda",
"org.scalablytyped" %%% "react" % "16.9.2-7f52cd",
"org.scalablytyped" %%% "std" % "0.0-unknown-d0ed57")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-g:notailcalls", "-language:implicitConversions", "-language:higherKinds", "-language:existentials")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
organization := "org.scalablytyped"
name := "react-dropzone"
version := "10.1.10-fa69dc"
version := "10.1.10-61bc0b"
scalaVersion := "2.13.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.1.0",
"me.shadaj" %%% "slinky-web" % "0.6.5",
"org.scalablytyped" %%% "react" % "16.9.2-46bbda",
"org.scalablytyped" %%% "react" % "16.9.2-7f52cd",
"org.scalablytyped" %%% "std" % "0.0-unknown-d0ed57")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-g:notailcalls", "-language:implicitConversions", "-language:higherKinds", "-language:existentials")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
organization := "org.scalablytyped"
name := "react-select"
version := "0.0-unknown-55a081"
version := "0.0-unknown-50a4f9"
scalaVersion := "2.13.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.1.0",
"me.shadaj" %%% "slinky-web" % "0.6.5",
"org.scalablytyped" %%% "react" % "16.9.2-46bbda",
"org.scalablytyped" %%% "react" % "16.9.2-7f52cd",
"org.scalablytyped" %%% "std" % "0.0-unknown-d0ed57")
publishArtifact in packageDoc := false
scalacOptions ++= List("-encoding", "utf-8", "-feature", "-g:notailcalls", "-language:implicitConversions", "-language:higherKinds", "-language:existentials")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
organization := "org.scalablytyped"
name := "react"
version := "16.9.2-46bbda"
version := "16.9.2-7f52cd"
scalaVersion := "2.13.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package typingsSlinky.react.anon

import slinky.core.TagMod
import slinky.core.facade.ReactElement
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation._

@js.native
trait Children extends js.Object {
var children: js.UndefOr[TagMod[Any]] = js.native
var children: js.UndefOr[ReactElement] = js.native
}

object Children {
Expand All @@ -31,7 +30,7 @@ object Children {
@scala.inline
def setChildrenReactElement(value: ReactElement): Self = this.set("children", value.asInstanceOf[js.Any])
@scala.inline
def setChildren(value: TagMod[Any]): Self = this.set("children", value.asInstanceOf[js.Any])
def setChildren(value: ReactElement): Self = this.set("children", value.asInstanceOf[js.Any])
@scala.inline
def deleteChildren: Self = this.set("children", js.undefined)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package typingsSlinky.react.mod

import org.scalablytyped.runtime.StringDictionary
import slinky.core.TagMod
import typingsSlinky.std.Pick
import scala.scalajs.js
import scala.scalajs.js.`|`
Expand Down Expand Up @@ -42,7 +41,7 @@ class Component[P, S, SS] protected () extends ComponentLifecycle[P, S, SS] {
var state: S = js.native
def forceUpdate(): Unit = js.native
def forceUpdate(callback: js.Function0[Unit]): Unit = js.native
def render(): TagMod[Any] = js.native
def render(): slinky.core.facade.ReactElement = js.native
def setState[K /* <: /* keyof S */ String */](): Unit = js.native
def setState[K /* <: /* keyof S */ String */](state: S): Unit = js.native
def setState[K /* <: /* keyof S */ String */](state: S, callback: js.Function0[Unit]): Unit = js.native
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package typingsSlinky.react.mod

import org.scalablytyped.runtime.StringDictionary
import slinky.core.TagMod
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation._
Expand All @@ -10,12 +9,12 @@ import scala.scalajs.js.annotation._
trait ComponentSpec[P, S]
extends Mixin[P, S]
with /* propertyName */ StringDictionary[js.Any] {
def render(): TagMod[Any] = js.native
def render(): slinky.core.facade.ReactElement = js.native
}

object ComponentSpec {
@scala.inline
def apply[P, S](render: () => TagMod[Any]): ComponentSpec[P, S] = {
def apply[P, S](render: () => slinky.core.facade.ReactElement): ComponentSpec[P, S] = {
val __obj = js.Dynamic.literal(render = js.Any.fromFunction0(render))
__obj.asInstanceOf[ComponentSpec[P, S]]
}
Expand All @@ -31,7 +30,7 @@ object ComponentSpec {
x
}
@scala.inline
def setRender(value: () => TagMod[Any]): Self = this.set("render", js.Any.fromFunction0(value))
def setRender(value: () => slinky.core.facade.ReactElement): Self = this.set("render", js.Any.fromFunction0(value))
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package typingsSlinky.react.mod

import slinky.core.TagMod
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation._

@js.native
trait ConsumerProps[T] extends js.Object {
var unstable_observedBits: js.UndefOr[Double] = js.native
def children(value: T): TagMod[Any] = js.native
def children(value: T): slinky.core.facade.ReactElement = js.native
}

object ConsumerProps {
@scala.inline
def apply[T](children: T => TagMod[Any]): ConsumerProps[T] = {
def apply[T](children: T => slinky.core.facade.ReactElement): ConsumerProps[T] = {
val __obj = js.Dynamic.literal(children = js.Any.fromFunction1(children))
__obj.asInstanceOf[ConsumerProps[T]]
}
Expand All @@ -29,7 +28,7 @@ object ConsumerProps {
x
}
@scala.inline
def setChildren(value: T => TagMod[Any]): Self = this.set("children", js.Any.fromFunction1(value))
def setChildren(value: T => slinky.core.facade.ReactElement): Self = this.set("children", js.Any.fromFunction1(value))
@scala.inline
def setUnstable_observedBits(value: Double): Self = this.set("unstable_observedBits", value.asInstanceOf[js.Any])
@scala.inline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package typingsSlinky.react.mod

import org.scalajs.dom.raw.Event
import org.scalajs.dom.raw.EventTarget
import slinky.core.TagMod
import slinky.web.SyntheticAnimationEvent
import slinky.web.SyntheticClipboardEvent
import slinky.web.SyntheticCompositionEvent
Expand All @@ -21,7 +20,7 @@ import scala.scalajs.js.annotation._

@js.native
trait DOMAttributes[T] extends js.Object {
var children: js.UndefOr[TagMod[Any]] = js.native
var children: js.UndefOr[slinky.core.facade.ReactElement] = js.native
var dangerouslySetInnerHTML: js.UndefOr[Html] = js.native
// Media Events
var onAbort: js.UndefOr[ReactEventHandler[T]] = js.native
Expand Down Expand Up @@ -140,7 +139,7 @@ object DOMAttributes {
@scala.inline
def setChildrenReactElement(value: slinky.core.facade.ReactElement): Self = this.set("children", value.asInstanceOf[js.Any])
@scala.inline
def setChildren(value: TagMod[Any]): Self = this.set("children", value.asInstanceOf[js.Any])
def setChildren(value: slinky.core.facade.ReactElement): Self = this.set("children", value.asInstanceOf[js.Any])
@scala.inline
def deleteChildren: Self = this.set("children", js.undefined)
@scala.inline
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package typingsSlinky.react.mod

import org.scalajs.dom.raw.HTMLElement
import slinky.core.TagMod
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation._

@js.native
trait DetailedHTMLFactory[P /* <: HTMLAttributes[T] */, T /* <: HTMLElement */] extends DOMFactory[P, T] {
def apply(): DetailedReactHTMLElement[P, T] = js.native
def apply(children: TagMod[Any]*): DetailedReactHTMLElement[P, T] = js.native
def apply(props: ClassAttributes[T] with P, children: TagMod[Any]*): DetailedReactHTMLElement[P, T] = js.native
def apply(children: slinky.core.facade.ReactElement*): DetailedReactHTMLElement[P, T] = js.native
def apply(props: ClassAttributes[T] with P, children: slinky.core.facade.ReactElement*): DetailedReactHTMLElement[P, T] = js.native
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package typingsSlinky.react.mod

import slinky.core.TagMod
import typingsSlinky.react.reactStrings.mount
import typingsSlinky.react.reactStrings.update
import scala.scalajs.js
Expand All @@ -9,7 +8,7 @@ import scala.scalajs.js.annotation._

@js.native
trait ProfilerProps extends js.Object {
var children: js.UndefOr[TagMod[Any]] = js.native
var children: js.UndefOr[slinky.core.facade.ReactElement] = js.native
var id: String = js.native
var onRender: ProfilerOnRenderCallback = js.native
}
Expand Down Expand Up @@ -43,7 +42,7 @@ object ProfilerProps {
@scala.inline
def setChildrenReactElement(value: slinky.core.facade.ReactElement): Self = this.set("children", value.asInstanceOf[js.Any])
@scala.inline
def setChildren(value: TagMod[Any]): Self = this.set("children", value.asInstanceOf[js.Any])
def setChildren(value: slinky.core.facade.ReactElement): Self = this.set("children", value.asInstanceOf[js.Any])
@scala.inline
def deleteChildren: Self = this.set("children", js.undefined)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package typingsSlinky.react.mod

import slinky.core.TagMod
import slinky.core.facade.ReactRef
import scala.scalajs.js
import scala.scalajs.js.`|`
Expand All @@ -25,7 +24,7 @@ import scala.scalajs.js.annotation._
*/
@js.native
trait Props[T] extends js.Object {
var children: js.UndefOr[TagMod[Any]] = js.native
var children: js.UndefOr[slinky.core.facade.ReactElement] = js.native
var key: js.UndefOr[Key] = js.native
var ref: js.UndefOr[LegacyRef[T]] = js.native
}
Expand All @@ -50,7 +49,7 @@ object Props {
@scala.inline
def setChildrenReactElement(value: slinky.core.facade.ReactElement): Self = this.set("children", value.asInstanceOf[js.Any])
@scala.inline
def setChildren(value: TagMod[Any]): Self = this.set("children", value.asInstanceOf[js.Any])
def setChildren(value: slinky.core.facade.ReactElement): Self = this.set("children", value.asInstanceOf[js.Any])
@scala.inline
def deleteChildren: Self = this.set("children", js.undefined)
@scala.inline
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package typingsSlinky.react.mod

import slinky.core.TagMod
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation._

// Context via RenderProps
@js.native
trait ProviderProps[T] extends js.Object {
var children: js.UndefOr[TagMod[Any]] = js.native
var children: js.UndefOr[slinky.core.facade.ReactElement] = js.native
var value: T = js.native
}

Expand All @@ -34,7 +33,7 @@ object ProviderProps {
@scala.inline
def setChildrenReactElement(value: slinky.core.facade.ReactElement): Self = this.set("children", value.asInstanceOf[js.Any])
@scala.inline
def setChildren(value: TagMod[Any]): Self = this.set("children", value.asInstanceOf[js.Any])
def setChildren(value: slinky.core.facade.ReactElement): Self = this.set("children", value.asInstanceOf[js.Any])
@scala.inline
def deleteChildren: Self = this.set("children", js.undefined)
}
Expand Down
Loading

0 comments on commit 56c04d0

Please sign in to comment.