oyvindberg on v1.0.0-beta41
oyvindberg on gh-pages
Deploy website Deploy website … (compare)
oyvindberg on master
Update coursier to 2.1.0-RC4 (#… (compare)
oyvindberg on master
Update scalatest to 3.2.15 (#51… (compare)
oyvindberg on master
Update sbt-tpolecat to 0.4.2 (#… (compare)
oyvindberg on master
release snapshots disable extension methods - in… ImportTypingsGenSources: Add `o… (compare)
oyvindberg on mui5-support
ImportTypingsGenSources: Add `o… (compare)
oyvindberg on mui5-support
tree shaking: mui forbids diggi… (compare)
oyvindberg on master
Update sbt-assembly to 2.1.0 (#… (compare)
oyvindberg on master
Update coursier to 2.1.0-RC3-1 … (compare)
oyvindberg on master
Update sbt-bloop to 1.5.6 (#507) (compare)
oyvindberg on mui5-support
ignore `OverridableStringUnion`… (compare)
oyvindberg on mui5-support
improve component variant naming (compare)
oyvindberg on mui5-support
trim code release snapshots (compare)
oyvindberg on master
scalajs-react: don't overload `… (compare)
oyvindberg on master
Avoid superfluous `T & Object` react: add a `Props` type alias scalajs-react: add syntax to ap… and 3 more (compare)
oyvindberg on mui5-support
limit mangled objects to 5k mem… mapped indices in type mappings… remove a source of irritating t… and 4 more (compare)
oyvindberg on master
Update sbt-scalafmt to 2.5.0 (#… (compare)
oyvindberg on master
Update coursier to 2.1.0-RC2 (#… (compare)
oyvindberg on true-literal-and-union-types
True literal types and union ty… (compare)
I'm trying to implement a language client in vscode, in the recent versions of the languageclient library you're supposedly supposed to use an import likeimport { LanguageClient } from 'vscode-languageclient/node';
and this page https://scalablytyped.org/docs/encoding suggests I import something like typings.vscodeLanguageclientNode.LanguageClient
, but that vscodeLanguageclientNode
part doesn't seem to exist - what could I be doing wrong?
"vscode-languageclient": "8.0.2"
and I'm kinda shocked that I'm not seeing that node
import in completions or anything
node
-mentioning jar at all
common
folder inside vscode-languageclient
, and drops browser
and node
. The reason is that it follows the typings
entry in package.json
[error] java.lang.RuntimeException: FromFolder(InFolder(/home/kc/workspace/scala/pixala/target/scala-2.13/scalajs-bundler/main/node_modules/pixi.js),TsIdentLibrarySimple(pixi.js)) -> Right(Compilation failed: )
typeof this
ends up being any
So I wasn't going crazy then 😮💨
Thanks a lot for the quick reply. The typings of interactjs seem to be absolutely wild, because scalablytyped generates an absolute ton of confusing stuff.
I assumed it was working at first because I got a confusing error message in the browser console, but now I cannot get it to do anything at all.
The typings.interactjsInteract.mod.{default => interact}
import definitely works, because printing it to the console yields a method that just makes sense.
However, calling any method on it, i.e. .draggable
causes the frontend to just hang indefinitely.
The .apply
method of the DraggableOptions
object that has to be passed to the .draggable
method also has no arguments.
CSSProperties
but it can be annoying
DraggableOptions
is meant to be mutated after you call apply
, see https://scalablytyped.org/docs/objects
@oyvindberg Ah, I did not see the setter methods on that object.
Doesn't matter though, since I cannot pass it to the .draggable
method since the compiler cannot find the right method for that parameter.
[error] /<path>/foo.scala:60:16: overloaded method draggable with alternatives:
[error] (options: typings.std.Partial[typings.interactjsTypes.typesMod.OrBoolean[typings.interactjsTypes.pluginMod.DraggableOptions]])Any <and>
[error] (options: Boolean)Any
[error] cannot be applied to (typings.interactjsTypes.pluginMod.DraggableOptions)
[error] .draggable(draggableOptions)
[error]
The type signature of the .draggable
method is also plenty weird.options: Partial[OrBoolean[DraggableOptions]]
From what that sounds like, I should just be able to pass a DraggableOptions
object, right?
Finally, I am unable to set an event listener on the DraggableOptions
object, since it's setOnmove
method expects a
type ListenersArg = typings.interactjsTypes.typesMod._ListenersArg | (js.Array[
typings.interactjsTypes.typesMod.Listener | typings.interactjsTypes.typesMod.ListenerMap
])
and following those types just leaves me with a trait _ListenersArg extends StObject
or
@js.native
trait Listener
extends StObject
with _ListenersArg {
def apply(args: Any*): Any = js.native
}
typings.std.Partial[typings.interactjsTypes.typesMod.OrBoolean[typings.interactjsTypes.pluginMod.DraggableOptions]]
for instance is very javascripty
DraggableOptions
| boolean) because Partial
, whatever that means
Partial<DraggableOptions>
, but not Partial<DraggableOptions | boolean>
(if that is what OrBoolean
does)
Listener
is awkward because it's an untyped vararg function. there is no good scala syntax for that
I am guessing that this would be right?
interact(element).draggable(
DraggableOptions()
.setOnstart(((event: InteractEvent) => println(event)).asInstanceOf[ListenersArg])
.asInstanceOf[Partial[OrBoolean[DraggableOptions]]],
)
While that does compile, it does not run. Javascript complains that:
scala.scalajs.js.JavaScriptException: TypeError: $$x1.draggable is not a function