Skip to content

Commit

Permalink
Add pixi.js test case
Browse files Browse the repository at this point in the history
  • Loading branch information
lgirault committed Sep 1, 2022
1 parent f0195db commit 3dc9719
Show file tree
Hide file tree
Showing 17 changed files with 270 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ trait ImporterTest extends AnyFunSuite with ImporterHarness with ParallelTestExe
val Japgolly = JapgollyFlavour(Name("typingsJapgolly"), enableLongApplyMethod = false, version, Selection.All)
val JapgollyLong = JapgollyFlavour(Name("typingsJapgolly"), enableLongApplyMethod = true, version, Selection.All)

test("pixi.js")(assertImportsOk("pixi.js", pedantic = false))
test("augment-module")(assertImportsOk("augment-module", pedantic = false))
test("typings-json")(assertImportsOk("typings-json", pedantic = true))
test("export-as-namespace")(assertImportsOk("export-as-namespace", pedantic = true))
Expand Down
10 changes: 10 additions & 0 deletions tests/pixi.js/check-3/e/eventemitter3/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
organization := "org.scalablytyped"
name := "eventemitter3"
version := "0.0-unknown-292498"
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"))
15 changes: 15 additions & 0 deletions tests/pixi.js/check-3/e/eventemitter3/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# Scala.js typings for eventemitter3




## 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.


Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package typings.eventemitter3

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("eventemitter3", JSImport.Namespace)
@js.native
object eventemitter3Require extends StObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package typings.eventemitter3

import org.scalablytyped.runtime.Instantiable0
import org.scalablytyped.runtime.Shortcut
import org.scalablytyped.runtime.StObject
import scala.scalajs.js
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess}

object mod extends Shortcut {

@JSImport("eventemitter3", JSImport.Namespace)
@js.native
open class ^[EventTypes] ()
extends StObject
with typings.eventemitter3.mod.EventEmitter[EventTypes]
@JSImport("eventemitter3", JSImport.Namespace)
@js.native
val ^ : EventEmitterStatic = js.native

trait EventEmitter[EventTypes] extends StObject
@JSImport("eventemitter3", "EventEmitter")
@js.native
val EventEmitter: EventEmitterStatic = js.native

/* This class was inferred from a value with a constructor, it was renamed because a distinct type already exists with the same name. */
@JSImport("eventemitter3", "EventEmitter")
@js.native
open class EventEmitterCls[EventTypes] ()
extends StObject
with typings.eventemitter3.mod.EventEmitter[EventTypes]

@js.native
trait EventEmitterStatic
extends StObject
with Instantiable0[typings.eventemitter3.mod.EventEmitter[js.Object]]

type _To = EventEmitterStatic

/* This means you don't have to write `^`, but can instead just say `mod.foo` */
override def _to: EventEmitterStatic = ^
}
11 changes: 11 additions & 0 deletions tests/pixi.js/check-3/p/pixi__utils/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
organization := "org.scalablytyped"
name := "pixi__utils"
version := "0.0-unknown-98d092"
scalaVersion := "3.1.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2",
"org.scalablytyped" %%% "eventemitter3" % "0.0-unknown-292498")
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"))
15 changes: 15 additions & 0 deletions tests/pixi.js/check-3/p/pixi__utils/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# Scala.js typings for pixi__utils




## 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.


Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package typings.pixiUtils

import org.scalablytyped.runtime.Shortcut
import typings.eventemitter3.mod.EventEmitterStatic
import typings.eventemitter3.mod.^
import org.scalablytyped.runtime.StObject
import scala.scalajs.js
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess}

object mod {

@JSImport("@pixi/utils", "EventEmitter")
@js.native
open class EventEmitter[EventTypes] () extends ^[EventTypes]
object EventEmitter extends Shortcut {

/* This class was inferred from a value with a constructor. In rare cases (like HTMLElement in the DOM) it might not work as you expect. */
@JSImport("@pixi/utils", "EventEmitter")
@js.native
open class ^[EventTypes] ()
extends StObject
with typings.eventemitter3.mod.EventEmitter[EventTypes]

@JSImport("@pixi/utils", "EventEmitter")
@js.native
val ^ : js.Object & EventEmitterStatic = js.native
@JSImport("@pixi/utils", "EventEmitter.EventEmitter")
@js.native
val EventEmitter: EventEmitterStatic = js.native

/* This class was inferred from a value with a constructor, it was renamed because a distinct type already exists with the same name. */
@JSImport("@pixi/utils", "EventEmitter.EventEmitterCls")
@js.native
open class EventEmitterCls[EventTypes] ()
extends typings.eventemitter3.mod.EventEmitterCls[EventTypes]

type _To = js.Object & EventEmitterStatic

/* This means you don't have to write `^`, but can instead just say `EventEmitter.foo` */
override def _to: js.Object & EventEmitterStatic = ^
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package typings.pixiUtils

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("@pixi/utils", JSImport.Namespace)
@js.native
object pixiUtilsRequire extends StObject
12 changes: 12 additions & 0 deletions tests/pixi.js/check-3/p/pixi_dot_js/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
organization := "org.scalablytyped"
name := "pixi_dot_js"
version := "0.0-unknown-3024a5"
scalaVersion := "3.1.2"
enablePlugins(ScalaJSPlugin)
libraryDependencies ++= Seq(
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2",
"org.scalablytyped" %%% "eventemitter3" % "0.0-unknown-292498",
"org.scalablytyped" %%% "pixi__utils" % "0.0-unknown-98d092")
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"))
15 changes: 15 additions & 0 deletions tests/pixi.js/check-3/p/pixi_dot_js/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# Scala.js typings for pixi_dot_js




## 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.


Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package typings.pixiJs

import org.scalablytyped.runtime.Shortcut
import typings.eventemitter3.mod.EventEmitterStatic
import org.scalablytyped.runtime.StObject
import scala.scalajs.js
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess}

object mod {

object utils {

@JSImport("pixi.js", "utils.EventEmitter")
@js.native
open class EventEmitter[EventTypes] ()
extends typings.pixiUtils.mod.EventEmitter[EventTypes]
object EventEmitter extends Shortcut {

/* This class was inferred from a value with a constructor. In rare cases (like HTMLElement in the DOM) it might not work as you expect. */
@JSImport("pixi.js", "utils.EventEmitter")
@js.native
open class ^[EventTypes] ()
extends StObject
with typings.pixiUtils.mod.^[EventTypes]

@JSImport("pixi.js", "utils.EventEmitter")
@js.native
val ^ : js.Object & EventEmitterStatic = js.native
@JSImport("pixi.js", "utils.EventEmitter.EventEmitter")
@js.native
val EventEmitter: EventEmitterStatic = js.native

/* This class was inferred from a value with a constructor, it was renamed because a distinct type already exists with the same name. */
@JSImport("pixi.js", "utils.EventEmitter.EventEmitterCls")
@js.native
open class EventEmitterCls[EventTypes] ()
extends typings.pixiUtils.mod.EventEmitter.EventEmitterCls[EventTypes]

type _To = js.Object & EventEmitterStatic

/* This means you don't have to write `^`, but can instead just say `EventEmitter.foo` */
override def _to: js.Object & EventEmitterStatic = ^
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package typings.pixiJs

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("pixi.js", JSImport.Namespace)
@js.native
object pixiJsRequire extends StObject
3 changes: 3 additions & 0 deletions tests/pixi.js/in/@pixi/utils/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import EventEmitter from 'eventemitter3';

export { EventEmitter }
17 changes: 17 additions & 0 deletions tests/pixi.js/in/eventemitter3/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Minimal `EventEmitter` interface that is molded against the Node.js
* `EventEmitter` interface.
*/
declare class EventEmitter<EventTypes> {
}

declare namespace EventEmitter {

export interface EventEmitterStatic {
new<EventTypes>(): EventEmitter<EventTypes>;
}

export const EventEmitter: EventEmitterStatic;
}

export = EventEmitter;
5 changes: 5 additions & 0 deletions tests/pixi.js/in/pixi.js/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

import * as utils from '@pixi/utils';

export { utils }

5 changes: 5 additions & 0 deletions tests/pixi.js/in/stdlib.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type Partial<T> = T;
type Array<T> = T;
type ArrayLike<T> = T;
interface CanvasRenderingContext2D {}
interface HTMLCanvasElement {}

0 comments on commit 3dc9719

Please sign in to comment.