• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Scala ScalaJSDefined类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Scala中scala.scalajs.js.annotation.ScalaJSDefined的典型用法代码示例。如果您正苦于以下问题:Scala ScalaJSDefined类的具体用法?Scala ScalaJSDefined怎么用?Scala ScalaJSDefined使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ScalaJSDefined类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Scala代码示例。

示例1: ConsumerGroupOptions

//设置package包名称以及导入依赖的类
package io.scalajs.npm.kafkanode

import io.scalajs.RawOptions

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined
import scala.scalajs.js.|


@ScalaJSDefined
class ConsumerGroupOptions(var batch: js.UndefOr[String] = js.undefined,
                           var fromOffset: js.UndefOr[String] = js.undefined,
                           var host: js.UndefOr[String] = js.undefined,
                           var groupId: js.UndefOr[String] = js.undefined,
                           var outOfRangeOffset: js.UndefOr[String | js.Array[String]] = js.undefined,
                           var migrateHLC: js.UndefOr[Boolean] = js.undefined,
                           var migrateRolling: js.UndefOr[Boolean] = js.undefined,
                           var protocol: js.UndefOr[js.Array[String]] = js.undefined,
                           var sessionTimeout: js.UndefOr[Int] = js.undefined,
                           var ssl: js.UndefOr[Boolean] = js.undefined,
                           var zk: js.UndefOr[RawOptions] = js.undefined)
    extends js.Object 
开发者ID:scalajs-io,项目名称:kafka-node,代码行数:23,代码来源:ConsumerGroupOptions.scala


示例2: GetAuthTokenOptions

//设置package包名称以及导入依赖的类
package slate
package chrome

import scala.scalajs.js
import scala.scalajs.js.annotation.{JSName, ScalaJSDefined}
import scala.scalajs.js.{UndefOr, native, undefined}

@ScalaJSDefined
class GetAuthTokenOptions(val interactive: UndefOr[Boolean] = undefined,
                          val account: UndefOr[AccountInfo] = undefined,
                          val scopes: UndefOr[js.Array[String]] = undefined) extends js.Object

@ScalaJSDefined
class LaunchWebAuthFlowOptions(val url: String,
                               val interactive: UndefOr[Boolean] = undefined) extends js.Object

@ScalaJSDefined
class RemoveCachedAuthTokenOptions(val token: String) extends js.Object

@ScalaJSDefined
class AccountInfo(val id: String) extends js.Object

@native
@JSName("chrome.identity")
object ChromeIdentity extends js.Object {
  @JSName("getAuthToken")
  @native
  def fetchAuthToken(details: UndefOr[GetAuthTokenOptions] = undefined,
                     callback: js.Function1[String, Unit]): Unit = native

  @native
  def launchWebAuthFlow(details: LaunchWebAuthFlowOptions,
                        callback: js.Function1[String, Unit]): Unit = native

  @native
  def removeCachedAuthToken(details: RemoveCachedAuthTokenOptions,
                            callback: js.Function1[Unit, Unit]): Unit = native
}

@ScalaJSDefined
class LastError(val message: UndefOr[String]) extends js.Object

@native
@JSName("chrome.runtime")
object ChromeRuntime extends js.Object {
  @native
  def lastError: UndefOr[LastError] = native
} 
开发者ID:edmundnoble,项目名称:slate,代码行数:49,代码来源:ChromeIdentity.scala


示例3: HttpConfig

//设置package包名称以及导入依赖的类
package io.scalajs.npm.angularjs.http

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined
import scala.scalajs.js.|


@ScalaJSDefined
class HttpConfig(var method: js.UndefOr[String] = js.undefined,
                 var url: js.UndefOr[String] = js.undefined,
                 var params: js.UndefOr[js.Dictionary[js.Any]] = js.undefined,
                 var data: js.Any = js.undefined,
                 var headers: js.UndefOr[js.Dictionary[js.Any]] = js.undefined,
                 var xsrfHeaderName: js.UndefOr[String] = js.undefined,
                 var xsrfCookieName: js.UndefOr[String] = js.undefined,
                 var transformResponse: js.UndefOr[js.Array[js.Function]] = js.undefined,
                 // js.Function2[js.Any = js.undefined, js.Any, js.Any]
                 var transformRequest: js.UndefOr[js.Array[js.Function]] = js.undefined,
                 // js.Function2[js.Any, js.Any, js.Any]
                 var cache: js.Any = js.undefined,
                 var withCredentials: js.UndefOr[Boolean] = js.undefined,
                 var timeout: js.UndefOr[Int | Double] = js.undefined,
                 var responseType: js.UndefOr[String] = js.undefined)
    extends js.Object 
开发者ID:scalajs-io,项目名称:angular,代码行数:25,代码来源:HttpConfig.scala


示例4: ConsumerOptions

//设置package包名称以及导入依赖的类
package io.scalajs.npm.kafkanode

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined


@ScalaJSDefined
class ConsumerOptions(var groupId: js.UndefOr[String] = js.undefined,
                      var autoCommit: js.UndefOr[Boolean] = js.undefined,
                      var autoCommitIntervalMs: js.UndefOr[Int] = js.undefined,
                      var fetchMaxWaitMs: js.UndefOr[Int] = js.undefined,
                      var fetchMinBytes: js.UndefOr[Int] = js.undefined,
                      var fetchMaxBytes: js.UndefOr[Int] = js.undefined,
                      var fromOffset: js.UndefOr[Long] = js.undefined,
                      var encoding: js.UndefOr[String] = js.undefined)
    extends js.Object 
开发者ID:scalajs-io,项目名称:kafka-node,代码行数:17,代码来源:ConsumerOptions.scala


示例5: ModalOptions

//设置package包名称以及导入依赖的类
package io.scalajs.npm.angularjs.uibootstrap

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined


@ScalaJSDefined
class ModalOptions(var template: js.UndefOr[String] = js.undefined,
                   var templateUrl: js.UndefOr[String] = js.undefined,
                   var controller: js.UndefOr[String] = js.undefined,
                   var controllerAs: js.Any = js.undefined,
                   var scope: js.Any = js.undefined,
                   var size: js.UndefOr[String] = "lg",
                   var windowClass: js.UndefOr[String] = js.undefined,
                   var windowTemplateUrl: js.UndefOr[String] = js.undefined,
                   var animation: js.UndefOr[Boolean] = js.undefined,
                   var backdrop: js.UndefOr[Boolean] = js.undefined,
                   var backdropClass: js.UndefOr[String] = js.undefined,
                   var keyboard: js.UndefOr[Boolean] = js.undefined,
                   var resolve: js.Any = js.undefined)
    extends js.Object 
开发者ID:scalajs-io,项目名称:angular-ui-bootstrap,代码行数:22,代码来源:ModalOptions.scala


示例6: MarkedOptions

//设置package包名称以及导入依赖的类
package com.karasiq.markedjs

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined
import scala.scalajs.js.{Any, UndefOr}

@ScalaJSDefined
class MarkedOptions extends js.Object {
  
  def apply(highlight: UndefOr[(String, UndefOr[String], js.Function) ? String] = js.undefined, renderer: MarkedRenderer = new MarkedRenderer(), gfm: Boolean = true, tables: Boolean = true, breaks: Boolean = false, pedantic: Boolean = false, sanitize: Boolean = false, smartLists: Boolean = true, smartypants: Boolean = false): MarkedOptions = {
    val _highlight = highlight
    val _renderer = renderer
    val _gfm = gfm
    val _tables = tables
    val _breaks = breaks
    val _pedantic = pedantic
    val _sanitize = sanitize
    val _smartLists = smartLists
    val _smartypants = smartypants
    new MarkedOptions {
      override val highlight: Any = _highlight
      override val renderer: MarkedRenderer = _renderer
      override val gfm: Boolean = _gfm
      override val tables: Boolean = _tables
      override val breaks: Boolean = _breaks
      override val pedantic: Boolean = _pedantic
      override val sanitize: Boolean = _sanitize
      override val smartLists: Boolean = _smartLists
      override val smartypants: Boolean = _smartypants
    }
  }
} 
开发者ID:Karasiq,项目名称:scalajs-marked,代码行数:33,代码来源:MarkedOptions.scala


示例7: PieChart

//设置package包名称以及导入依赖的类
package io.scalajs.npm.angularjs.nvd3.chart

import io.scalajs.npm.angularjs.nvd3.Legend

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined


@ScalaJSDefined
class PieChart(val id: js.UndefOr[String] = js.undefined,
               val width: js.UndefOr[Int] = js.undefined,
               val height: js.UndefOr[Int] = js.undefined,
               val donutRatio: js.UndefOr[Double] = js.undefined,
               val donut: js.UndefOr[Boolean] = js.undefined,
               val x: js.Function,
               val y: js.Function,
               val duration: js.UndefOr[Int] = js.undefined,
               val labelThreshold: js.UndefOr[Double] = js.undefined,
               val labelSunbeamLayout: js.UndefOr[Boolean] = js.undefined,
               val showLegend: js.UndefOr[Boolean] = js.undefined,
               val showLabels: js.UndefOr[Boolean] = js.undefined,
               val legend: js.UndefOr[Legend] = js.undefined)
    extends Chart {

  override val `type` = "pieChart"

} 
开发者ID:scalajs-io,项目名称:angularjs,代码行数:28,代码来源:PieChart.scala


示例8: SunburstChart

//设置package包名称以及导入依赖的类
package io.scalajs.npm.angularjs.nvd3.chart

import io.scalajs.npm.angularjs.nvd3.Legend

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined


@ScalaJSDefined
class SunburstChart(val id: js.UndefOr[String] = js.undefined,
                    val width: js.UndefOr[Int] = js.undefined,
                    val height: js.UndefOr[Int] = js.undefined,
                    val donutRatio: js.UndefOr[Double] = js.undefined,
                    val donut: js.UndefOr[Boolean] = js.undefined,
                    val x: js.Function,
                    val y: js.Function,
                    val duration: js.UndefOr[Int] = js.undefined,
                    val labelThreshold: js.UndefOr[Double] = js.undefined,
                    val labelSunbeamLayout: js.UndefOr[Boolean] = js.undefined,
                    val showLegend: js.UndefOr[Boolean] = js.undefined,
                    val showLabels: js.UndefOr[Boolean] = js.undefined,
                    val legend: js.UndefOr[Legend] = js.undefined)
    extends Chart {

  override def `type` = "sunburstChart"

} 
开发者ID:scalajs-io,项目名称:angularjs,代码行数:28,代码来源:SunburstChart.scala


示例9: LineChart

//设置package包名称以及导入依赖的类
package io.scalajs.npm.angularjs.nvd3.chart

import io.scalajs.npm.angularjs.nvd3._

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined


@ScalaJSDefined
class LineChart(val id: js.UndefOr[String] = js.undefined,
                val width: js.UndefOr[Int] = js.undefined,
                val height: js.UndefOr[Int] = js.undefined,
                val x: js.Function,
                val y: js.Function,
                val duration: js.UndefOr[Int] = js.undefined,
                val labelSunbeamLayout: js.UndefOr[Boolean] = js.undefined,
                val showLegend: js.UndefOr[Boolean] = js.undefined,
                val showLabels: js.UndefOr[Boolean] = js.undefined,
                val caption: js.UndefOr[Caption] = js.undefined,
                val margin: js.UndefOr[Margin] = js.undefined,
                val title: js.UndefOr[Title] = js.undefined,
                val subtitle: js.UndefOr[Title] = js.undefined,
                val useInteractiveGuideline: js.UndefOr[Boolean] = js.undefined,
                val xAxis: js.UndefOr[AxisLabel] = js.undefined,
                val yAxis: js.UndefOr[AxisLabel] = js.undefined)
    extends Chart {

  override val `type`: String = "lineChart"

} 
开发者ID:scalajs-io,项目名称:angularjs,代码行数:31,代码来源:LineChart.scala


示例10: apply

//设置package包名称以及导入依赖的类
package io.scalajs.npm.brake

import io.scalajs.RawOptions
import io.scalajs.nodejs.stream.{Readable, Writable}

import scala.scalajs.js
import scala.scalajs.js.annotation.{JSImport, ScalaJSDefined}
import scala.scalajs.js.|

/**
  * brake - throttle a stream with backpressure
  * @see https://www.npmjs.com/package/brake
  * @author [email protected]
  */
@js.native
trait Brake extends js.Object {

  /**
    * Return a transform stream b that applies backpressure when more data than the rate allows is written.
    * @param rate    the throttle rate
    * @param options the throttle options
    * @return a [[Readable]] / [[Writable]] instance
    */
  def apply(rate: Double, options: ThrottleOptions | RawOptions = js.native): Readable with Writable = js.native

}

/**
  * Brake Singleton
  * @author [email protected]
  */
@js.native
@JSImport("brake", JSImport.Namespace)
object Brake extends Brake

/**
  * Throttle Options
  * @param rate   How many bytes to emit for each interval of length period
  * @param period How often to check the output length in milliseconds. Default value: 1000.
  */
@ScalaJSDefined
class ThrottleOptions(var rate: js.UndefOr[Double] = js.undefined,
                      var period: js.UndefOr[Int] = js.undefined) extends js.Object 
开发者ID:scalajs-io,项目名称:brake,代码行数:44,代码来源:Brake.scala


示例11: createToken

//设置package包名称以及导入依赖的类
package com.outr.stripe.pii

import com.outr.stripe.TokenError

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined

@js.native
trait StripePII extends js.Object {
  def createToken(info: StripePIIInfo, responseHandler: js.Function2[Int, PIITokenInfo, Unit]): Unit = js.native
}

@ScalaJSDefined
trait StripePIIInfo extends js.Object {
  var personal_id_number: js.UndefOr[String] = js.undefined
}

@js.native
trait PIITokenInfo extends js.Object {
  def id: String = js.native
  def created: Long = js.native
  def livemode: Boolean = js.native
  def `type`: String = js.native
  def `object`: String = js.native
  def used: Boolean = js.native
  def error: TokenError = js.native
} 
开发者ID:outr,项目名称:scala-stripe,代码行数:28,代码来源:StripePII.scala


示例12:

//设置package包名称以及导入依赖的类
package com.outr.stripe.card

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined

@ScalaJSDefined
trait StripeCardInfo extends js.Object {
  var name: js.UndefOr[String] = js.undefined
  var number: js.UndefOr[String] = js.undefined
  var cvc: js.UndefOr[String] = js.undefined
  var exp_month: js.UndefOr[Int] = js.undefined
  var exp_year: js.UndefOr[Int] = js.undefined
  var address_line1: js.UndefOr[String] = js.undefined
  var address_line2: js.UndefOr[String] = js.undefined
  var address_city: js.UndefOr[String] = js.undefined
  var address_state: js.UndefOr[String] = js.undefined
  var address_zip: js.UndefOr[String] = js.undefined
  var address_country: js.UndefOr[String] = js.undefined
} 
开发者ID:outr,项目名称:scala-stripe,代码行数:20,代码来源:StripeCardInfo.scala


示例13: StaticOptions

//设置package包名称以及导入依赖的类
package io.scalajs.npm.express

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined


@ScalaJSDefined
class StaticOptions(var dotfiles: js.UndefOr[String] = js.undefined,
                    var etag: js.UndefOr[Boolean] = js.undefined,
                    var extensions: js.UndefOr[Boolean] = js.undefined,
                    var fallthrough: js.UndefOr[Boolean] = js.undefined,
                    var index: js.UndefOr[js.Any] = js.undefined,
                    var lastModified: js.UndefOr[Boolean] = js.undefined,
                    var maxAge: js.UndefOr[Double] = js.undefined,
                    var redirect: js.UndefOr[Boolean] = js.undefined,
                    var setHeaders: js.UndefOr[js.Function] = js.undefined)
    extends js.Object 
开发者ID:scalajs-io,项目名称:express,代码行数:18,代码来源:StaticOptions.scala


示例14: CookieOptions

//设置package包名称以及导入依赖的类
package io.scalajs.npm.express

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined


@ScalaJSDefined
class CookieOptions(var domain: js.UndefOr[String] = js.undefined,
                    var encode: js.UndefOr[js.Function] = js.undefined,
                    var expires: js.UndefOr[js.Date] = js.undefined,
                    var httpOnly: js.UndefOr[Boolean] = js.undefined,
                    var maxAge: js.UndefOr[String] = js.undefined,
                    var path: js.UndefOr[String] = js.undefined,
                    var secure: js.UndefOr[Boolean] = js.undefined,
                    var signed: js.UndefOr[Boolean] = js.undefined)
    extends js.Object 
开发者ID:scalajs-io,项目名称:express,代码行数:17,代码来源:CookieOptions.scala


示例15: CssNumberOptions

//设置package包名称以及导入依赖的类
package io.scalajs.jquery

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined


@ScalaJSDefined
class CssNumberOptions(var zIndex: String = null,
                       var fontWeight: String = null,
                       var opacity: String = null,
                       var zoom: String = null,
                       var lineHeight: String = null,
                       var widows: String = null,
                       var orphans: String = null,
                       var fillOpacity: String = null,
                       var columnCount: String = null,
                       var order: String = null,
                       var flexGrow: String = null,
                       var flexShrink: String = null)
    extends js.Object 
开发者ID:scalajs-io,项目名称:jquery,代码行数:21,代码来源:CssNumberOptions.scala


示例16: HomeScreen

//设置package包名称以及导入依赖的类
package $package$.components.screens

import $package$.components.styles.GlobalStyle
import sri.web.all._
import sri.web.vdom.tags._
import sri.core._
import sri.universal.components._
import sri.web.all._

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined
import scala.scalajs.js.{undefined, UndefOr => U}
import scalacss.Defaults._
import sri.scalacss.Defaults._
import sri.web.vdom.DOMProps

object HomeScreen {

  @ScalaJSDefined
  class Component extends ReactComponent[Unit, Unit] {
    def render() = {
      div(new DOMProps {
        className = GlobalStyle.flexOneAndCenter
      })(
        span(new DOMProps {
          className = GlobalStyle.bigText
        })("Home Screen")
      )
    }
  }

  def apply(key: js.UndefOr[String] = js.undefined, ref: js.Function1[Component, Unit] = null) = makeElementNoProps[Component](key = key, ref = ref)

} 
开发者ID:scalajs-react-interface,项目名称:web.g8,代码行数:35,代码来源:HomeScreen.scala


示例17: CounterScreen

//设置package包名称以及导入依赖的类
package sri.templates.diode.screens

import sri.core._
import sri.diode.ModelProxy
import sri.templates.diode.actions.AppAction
import sri.templates.diode.models.Count
import sri.templates.diode.store.AppCircuit
import sri.templates.diode.styles.GlobalStyle
import sri.web.all._
import sri.web.vdom.htmltags._

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined
import sri.scalacss.Defaults._

object CounterScreen {

  @ScalaJSDefined
  class Component extends ReactComponent[ModelProxy[Count], Unit] {

    def render() = {
      div(className = GlobalStyle.center)(
        h1()(s"Count : ${props().i}"),
        div()(
          button(name = "Increase", onClick = (e: ReactEventH) => AppCircuit.dispatch(AppAction.Increase(2)))(h4()("Increase")),
          button(name = "Increase", onClick = (e: ReactEventH) => AppCircuit.dispatch(AppAction.Decrease(2)))(h4()("Dcrease")),
          button(name = "Increase", onClick = (e: ReactEventH) => AppCircuit.dispatch(AppAction.Reset))(h4()("Reset"))
        )
      )
    }

    override def componentDidMount(): Unit = {
      props.dispatch(AppAction.Reset)
    }
  }


  def apply(p: ModelProxy[Count], key: js.UndefOr[String] = js.undefined, ref: js.Function1[Component, Unit] = null) = makeElement[Component](p, key = key, ref = ref)
} 
开发者ID:chandu0101,项目名称:sri-diode-example,代码行数:40,代码来源:CounterScreen.scala


示例18: MongoClientOptions

//设置package包名称以及导入依赖的类
package io.scalajs.npm.mongodb

import io.scalajs.RawOptions

import scala.scalajs.js
import scala.scalajs.js.annotation.{JSImport, ScalaJSDefined}
import scala.scalajs.js.|


@ScalaJSDefined
class MongoClientOptions(var w: js.UndefOr[js.Any] = js.undefined,
                         var wtimeout: js.UndefOr[Int] = js.undefined,
                         var fsync: js.UndefOr[Boolean] = js.undefined,
                         var j: js.UndefOr[Boolean] = js.undefined,
                         var readPreference: js.UndefOr[String] = js.undefined,
                         var native_parser: js.UndefOr[Boolean] = js.undefined,
                         var forceServerObjectId: js.UndefOr[Boolean] = js.undefined,
                         var pkFactory: js.UndefOr[js.Object] = js.undefined,
                         var serializeFunctions: js.UndefOr[Boolean] = js.undefined,
                         var raw: js.UndefOr[Boolean] = js.undefined,
                         var recordQueryStats: js.UndefOr[Boolean] = js.undefined,
                         var retryMiliSeconds: js.UndefOr[Int] = js.undefined,
                         var numberOfRetries: js.UndefOr[Int] = js.undefined,
                         var bufferMaxEntries: js.UndefOr[Int] = js.undefined) extends js.Object 
开发者ID:scalajs-io,项目名称:mongodb,代码行数:25,代码来源:MongoClient.scala


示例19: RequestOptions

//设置package包名称以及导入依赖的类
package fr.hmil.roshttp.node.http

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined



@ScalaJSDefined
private[roshttp] trait RequestOptions extends js.Object {
  val protocol: String
  val host: String
  val hostname: String
  val family: Int
  val port: Int
  val localAddress: String
  val socketPath: String
  val method: String
  val path: String
  val headers: Map[String, String]
  val auth: String
  val agent: Agent
  // val createConnection
}

private[roshttp] object RequestOptions {

  
  def apply(
    protocol: js.UndefOr[String] = js.undefined,
    host: js.UndefOr[String] = js.undefined,
    hostname: js.UndefOr[String] = js.undefined,
    family: js.UndefOr[Int] = js.undefined,
    port: js.UndefOr[Int] = js.undefined,
    localAddress: js.UndefOr[String] = js.undefined,
    socketPath: js.UndefOr[String] = js.undefined,
    method: js.UndefOr[String] = js.undefined,
    path: js.UndefOr[String] = js.undefined,
    headers: js.UndefOr[js.Dictionary[String]] = js.undefined,
    auth: js.UndefOr[String] = js.undefined,
    agent: js.UndefOr[Agent] = js.undefined

  ): RequestOptions = {
    val r = js.Dynamic.literal()

    protocol.foreach(r.protocol = _)
    host.foreach(r.host = _)
    hostname.foreach(r.hostname = _)
    family.foreach(r.family = _)
    port.foreach(r.port = _)
    localAddress.foreach(r.localAddress = _)
    socketPath.foreach(r.socketPath = _)
    method.foreach(r.method = _)
    path.foreach(r.path = _)
    headers.foreach(r.headers = _)
    auth.foreach(r.auth = _)
    agent.foreach(r.agent = _)

    r.asInstanceOf[RequestOptions]
  }
} 
开发者ID:hmil,项目名称:RosHTTP,代码行数:61,代码来源:RequestOptions.scala


示例20: AgentOptions

//设置package包名称以及导入依赖的类
package fr.hmil.roshttp.node.http

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined


@ScalaJSDefined
private[roshttp] trait AgentOptions extends js.Object {
  val keepAlive: Boolean
  val keepAliveMsecs: Integer
  val maxSockets: Integer
  val maxFreeSockets: Integer
}


private[roshttp] object AgentOptions {

  
  def apply(
    keepAlive: js.UndefOr[Boolean] = js.undefined,
    keepAliveMsecs: js.UndefOr[Integer] = js.undefined,
    maxSockets: js.UndefOr[Integer] = js.undefined,
    maxFreeSockets: js.UndefOr[Integer] = js.undefined

  ): AgentOptions = {
    val r = js.Dynamic.literal()

    keepAlive.foreach(r.keepAlive = _)
    keepAliveMsecs.foreach(r.keepAliveMsecs = _)
    maxSockets.foreach(r.maxSockets = _)
    maxFreeSockets.foreach(r.maxFreeSockets = _)

    r.asInstanceOf[AgentOptions]
  }
} 
开发者ID:hmil,项目名称:RosHTTP,代码行数:36,代码来源:AgentOptions.scala



注:本文中的scala.scalajs.js.annotation.ScalaJSDefined类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Scala ContextHandler类代码示例发布时间:2022-05-23
下一篇:
Scala SessionManager类代码示例发布时间:2022-05-23
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap