forked from ScalablyTyped/Converter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with imports from sibling to main typings (ScalablyTyped#638)
- Loading branch information
Showing
16 changed files
with
299 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
organization := "org.scalablytyped" | ||
name := "std" | ||
version := "0.0-unknown-5a9d90" | ||
scalaVersion := "3.3.1" | ||
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")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.9.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
addSbtPlugin("org.scala-js" %% "sbt-scalajs" % "1.11.0") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
||
|
7 changes: 7 additions & 0 deletions
7
tests/stripe/check-3/s/std/src/main/scala/typings/std/Array.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
18 changes: 18 additions & 0 deletions
18
tests/stripe/check-3/s/std/src/main/scala/typings/std/Promise.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
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 { | ||
|
||
@scala.inline | ||
implicit open class PromiseOps[T] (val promise: Promise[T]) extends AnyVal { | ||
|
||
def toFuture: Future[T] = toPromise.toFuture | ||
|
||
def toPromise: js.Promise[T] = promise.asInstanceOf[js.Promise[T]] | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/stripe/check-3/s/std/src/main/scala/typings/std/stdRequire.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
organization := "org.scalablytyped" | ||
name := "stripe-js" | ||
version := "4.1.0-084381" | ||
version := "4.1.0-a4332d" | ||
scalaVersion := "3.3.1" | ||
enablePlugins(ScalaJSPlugin) | ||
libraryDependencies ++= Seq( | ||
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2") | ||
"com.olvind" %%% "scalablytyped-runtime" % "2.4.2", | ||
"org.scalablytyped" %%% "std" % "0.0-unknown-5a9d90") | ||
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")) |
44 changes: 44 additions & 0 deletions
44
tests/stripe/check-3/s/stripe-js/src/main/scala/typings/stripeJs/anon.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package typings.stripeJs | ||
|
||
import org.scalablytyped.runtime.StObject | ||
import scala.scalajs.js | ||
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} | ||
|
||
object anon { | ||
|
||
trait AdvancedFraudSignals extends StObject { | ||
|
||
var advancedFraudSignals: Boolean | ||
} | ||
object AdvancedFraudSignals { | ||
|
||
inline def apply(advancedFraudSignals: Boolean): AdvancedFraudSignals = { | ||
val __obj = js.Dynamic.literal(advancedFraudSignals = advancedFraudSignals.asInstanceOf[js.Any]) | ||
__obj.asInstanceOf[AdvancedFraudSignals] | ||
} | ||
|
||
@scala.inline | ||
implicit open class MutableBuilder[Self <: AdvancedFraudSignals] (val x: Self) extends AnyVal { | ||
|
||
inline def setAdvancedFraudSignals(value: Boolean): Self = StObject.set(x, "advancedFraudSignals", value.asInstanceOf[js.Any]) | ||
} | ||
} | ||
|
||
trait SetLoadParameters extends StObject { | ||
|
||
def setLoadParameters(params: AdvancedFraudSignals): Unit | ||
} | ||
object SetLoadParameters { | ||
|
||
inline def apply(setLoadParameters: AdvancedFraudSignals => Unit): SetLoadParameters = { | ||
val __obj = js.Dynamic.literal(setLoadParameters = js.Any.fromFunction1(setLoadParameters)) | ||
__obj.asInstanceOf[SetLoadParameters] | ||
} | ||
|
||
@scala.inline | ||
implicit open class MutableBuilder[Self <: SetLoadParameters] (val x: Self) extends AnyVal { | ||
|
||
inline def setSetLoadParameters(value: AdvancedFraudSignals => Unit): Self = StObject.set(x, "setLoadParameters", js.Any.fromFunction1(value)) | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/stripe/check-3/s/stripe-js/src/main/scala/typings/stripeJs/distPureMod.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package typings.stripeJs | ||
|
||
import typings.stripeJs.anon.SetLoadParameters | ||
import typings.stripeJs.distStripeJsStripeMod.Stripe | ||
import typings.stripeJs.distStripeJsStripeMod.StripeConstructorOptions | ||
import org.scalablytyped.runtime.StObject | ||
import scala.scalajs.js | ||
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} | ||
|
||
object distPureMod { | ||
|
||
@JSImport("stripe-js/dist/pure", "loadStripe") | ||
@js.native | ||
val loadStripe: (js.Function2[ | ||
/* publishableKey */ String, | ||
/* options */ js.UndefOr[StripeConstructorOptions], | ||
js.Promise[Stripe | Null] | ||
]) & SetLoadParameters = js.native | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/stripe/check-3/s/stripe-js/src/main/scala/typings/stripeJs/distSharedMod.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package typings.stripeJs | ||
|
||
import typings.stripeJs.distStripeJsStripeMod.Stripe | ||
import typings.stripeJs.distStripeJsStripeMod.StripeConstructorOptions | ||
import org.scalablytyped.runtime.StObject | ||
import scala.scalajs.js | ||
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} | ||
|
||
object distSharedMod { | ||
|
||
@JSImport("stripe-js/dist/shared", JSImport.Namespace) | ||
@js.native | ||
val ^ : js.Any = js.native | ||
|
||
inline def loadStripe(publishableKey: String): js.Promise[Stripe | Null] = ^.asInstanceOf[js.Dynamic].applyDynamic("loadStripe")(publishableKey.asInstanceOf[js.Any]).asInstanceOf[js.Promise[Stripe | Null]] | ||
inline def loadStripe(publishableKey: String, options: StripeConstructorOptions): js.Promise[Stripe | Null] = (^.asInstanceOf[js.Dynamic].applyDynamic("loadStripe")(publishableKey.asInstanceOf[js.Any], options.asInstanceOf[js.Any])).asInstanceOf[js.Promise[Stripe | Null]] | ||
} |
94 changes: 94 additions & 0 deletions
94
tests/stripe/check-3/s/stripe-js/src/main/scala/typings/stripeJs/distStripeJsStripeMod.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package typings.stripeJs | ||
|
||
import org.scalablytyped.runtime.StObject | ||
import scala.scalajs.js | ||
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} | ||
|
||
object distStripeJsStripeMod { | ||
|
||
trait Stripe extends StObject { | ||
|
||
def foo(): Unit | ||
} | ||
object Stripe { | ||
|
||
inline def apply(foo: () => Unit): Stripe = { | ||
val __obj = js.Dynamic.literal(foo = js.Any.fromFunction0(foo)) | ||
__obj.asInstanceOf[Stripe] | ||
} | ||
|
||
@scala.inline | ||
implicit open class MutableBuilder[Self <: Stripe] (val x: Self) extends AnyVal { | ||
|
||
inline def setFoo(value: () => Unit): Self = StObject.set(x, "foo", js.Any.fromFunction0(value)) | ||
} | ||
} | ||
|
||
type StripeConstructor = js.Function2[ | ||
/* publishableKey */ String, | ||
/* options */ js.UndefOr[StripeConstructorOptions], | ||
Stripe | ||
] | ||
|
||
trait StripeConstructorOptions extends StObject { | ||
|
||
/** | ||
* Override your account's [API version](https://stripe.com/docs/api/versioning). | ||
*/ | ||
var apiVersion: js.UndefOr[String] = js.undefined | ||
|
||
/** | ||
* Opt-in to prerelease Stripe.js features by passing `betas` when instantiating a `Stripe` object. | ||
* | ||
* Supported values for the `betas` option can be found in integration guides for prerelease features. | ||
* Most users of Stripe.js do not pass this option. | ||
*/ | ||
var betas: js.UndefOr[js.Array[String]] = js.undefined | ||
|
||
/** | ||
* The [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) used to globally configure localization in Stripe.js. | ||
* Setting the locale here will localize error strings for all Stripe.js methods. | ||
* It will also configure the locale for [Elements](#element_mount) and [Checkout](https://stripe.com/docs/js/checkout/redirect_to_checkout). Default is `auto` (Stripe detects the locale of the browser). | ||
* | ||
* Supported values depend on which features you are using. | ||
* Checkout supports a slightly different set of locales than the rest of Stripe.js. | ||
* If you are planning on using Checkout, make sure to use a [value](#checkout_redirect_to_checkout-options-locale) that it supports. | ||
*/ | ||
var locale: js.UndefOr[String] = js.undefined | ||
|
||
/** | ||
* For usage with [Connect](https://stripe.com/docs/connect) only. | ||
* Specifying a connected account ID (e.g., `acct_24BFMpJ1svR5A89k`) allows you to perform actions on behalf of that account. | ||
*/ | ||
var stripeAccount: js.UndefOr[String] = js.undefined | ||
} | ||
object StripeConstructorOptions { | ||
|
||
inline def apply(): StripeConstructorOptions = { | ||
val __obj = js.Dynamic.literal() | ||
__obj.asInstanceOf[StripeConstructorOptions] | ||
} | ||
|
||
@scala.inline | ||
implicit open class MutableBuilder[Self <: StripeConstructorOptions] (val x: Self) extends AnyVal { | ||
|
||
inline def setApiVersion(value: String): Self = StObject.set(x, "apiVersion", value.asInstanceOf[js.Any]) | ||
|
||
inline def setApiVersionUndefined: Self = StObject.set(x, "apiVersion", js.undefined) | ||
|
||
inline def setBetas(value: js.Array[String]): Self = StObject.set(x, "betas", value.asInstanceOf[js.Any]) | ||
|
||
inline def setBetasUndefined: Self = StObject.set(x, "betas", js.undefined) | ||
|
||
inline def setBetasVarargs(value: String*): Self = StObject.set(x, "betas", js.Array(value*)) | ||
|
||
inline def setLocale(value: String): Self = StObject.set(x, "locale", value.asInstanceOf[js.Any]) | ||
|
||
inline def setLocaleUndefined: Self = StObject.set(x, "locale", js.undefined) | ||
|
||
inline def setStripeAccount(value: String): Self = StObject.set(x, "stripeAccount", value.asInstanceOf[js.Any]) | ||
|
||
inline def setStripeAccountUndefined: Self = StObject.set(x, "stripeAccount", js.undefined) | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
tests/stripe/check-3/s/stripe-js/src/main/scala/typings/stripeJs/mod.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package typings.stripeJs | ||
|
||
import typings.stripeJs.distStripeJsStripeMod.Stripe | ||
import typings.stripeJs.distStripeJsStripeMod.StripeConstructor | ||
import typings.stripeJs.distStripeJsStripeMod.StripeConstructorOptions | ||
import org.scalablytyped.runtime.StObject | ||
import scala.scalajs.js | ||
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} | ||
|
||
object mod { | ||
|
||
@JSImport("stripe-js", JSImport.Namespace) | ||
@js.native | ||
val ^ : js.Any = js.native | ||
|
||
inline def loadStripe(publishableKey: String): js.Promise[Stripe | Null] = ^.asInstanceOf[js.Dynamic].applyDynamic("loadStripe")(publishableKey.asInstanceOf[js.Any]).asInstanceOf[js.Promise[Stripe | Null]] | ||
inline def loadStripe(publishableKey: String, options: StripeConstructorOptions): js.Promise[Stripe | Null] = (^.asInstanceOf[js.Dynamic].applyDynamic("loadStripe")(publishableKey.asInstanceOf[js.Any], options.asInstanceOf[js.Any])).asInstanceOf[js.Promise[Stripe | Null]] | ||
|
||
object global { | ||
|
||
trait Window extends StObject { | ||
|
||
// Stripe.js must be loaded directly from https://js.stripe.com/v3, which | ||
// places a `Stripe` object on the window | ||
var Stripe: js.UndefOr[StripeConstructor] = js.undefined | ||
} | ||
object Window { | ||
|
||
inline def apply(): Window = { | ||
val __obj = js.Dynamic.literal() | ||
__obj.asInstanceOf[Window] | ||
} | ||
|
||
@scala.inline | ||
implicit open class MutableBuilder[Self <: Window] (val x: Self) extends AnyVal { | ||
|
||
inline def setStripe(value: (/* publishableKey */ String, /* options */ js.UndefOr[StripeConstructorOptions]) => Stripe): Self = StObject.set(x, "Stripe", js.Any.fromFunction2(value)) | ||
|
||
inline def setStripeUndefined: Self = StObject.set(x, "Stripe", js.undefined) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters