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

Scala JSGlobal类代码示例

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

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



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

示例1: Exception

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

import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal


@js.native
@JSGlobal("Exception")
object Exception extends js.Object {
  val OK: String                         = js.native
  val SYSTEM_ERROR: String               = js.native
  val RUNTIME_INCONSISTENCY: String      = js.native
  val DATA_INCONSISTENCY: String         = js.native
  val CONNECTION_LOSS: String            = js.native
  val MARSHALLING_ERROR: String          = js.native
  val UNIMPLEMENTED: String              = js.native
  val OPERATION_TIMEOUT: String          = js.native
  val BAD_ARGUMENTS: String              = js.native
  val API_ERROR: String                  = js.native
  val NO_NODE: String                    = js.native
  val NO_AUTH: String                    = js.native
  val BAD_VERSION: String                = js.native
  val NO_CHILDREN_FOR_EPHEMERALS: String = js.native
  val NODE_EXISTS: String                = js.native
  val NOT_EMPTY: String                  = js.native
  val SESSION_EXPIRED: String            = js.native
  val INVALID_CALLBACK: String           = js.native
  val INVALID_ACL: String                = js.native
  val AUTH_FAILED: String                = js.native

} 
开发者ID:scalajs-io,项目名称:node-zookeeper-client,代码行数:32,代码来源:Exception.scala


示例2: Tween

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

import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal

@js.native
@JSGlobal("Phaser.Tween")
class Tween extends js.Object {

  def to(properties: js.Dictionary[_],
         duration: Int = 1000,
         ease: Any = null,
         autoStart: Boolean = false,
         delay: Int = 0,
         repeat: Int = 0,
         yoyo: Boolean = false): Tween = js.native

  def onLoop: Signal = js.native

} 
开发者ID:scalajs-io,项目名称:phaser,代码行数:21,代码来源:Tween.scala


示例3: AABB

//设置package包名称以及导入依赖的类
package io.scalajs.dom.html.phaser
package physics.ninja

import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal


@js.native
@JSGlobal("Phaser.Physics.Ninja.AABB")
class AABB(var body: Phaser.Physics.Ninja.Body,
           var x: Double,
           var y: Double,
           var width: Double,
           var height: Double)
  extends js.Object {

} 
开发者ID:scalajs-io,项目名称:phaser,代码行数:18,代码来源:AABB.scala


示例4: TimerEvent

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

import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal


@js.native
@JSGlobal("Phaser.TimerEvent")
class TimerEvent(val timer: Phaser.Timer,
                 val delay: Double,
                 val tick: Double,
                 val repeatCount: Int,
                 val loop: Boolean,
                 val callback: js.Function,
                 val callbackContext: js.Any,
                 val arguments: js.Array[_]) extends js.Object 
开发者ID:scalajs-io,项目名称:phaser,代码行数:17,代码来源:TimerEvent.scala


示例5: Cache

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

import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal


@js.native
@JSGlobal("Phaser.Cache")
class Cache(var game: Phaser.Game) extends js.Object

@js.native
@JSGlobal("Phaser.Cache")
object Cache extends js.Object {
  val BINARY: Int     = js.native
  val BITMAPDATA: Int = js.native
  val BITMAPFONT: Int = js.native
  val CANVAS: Int     = js.native

} 
开发者ID:scalajs-io,项目名称:phaser,代码行数:20,代码来源:Cache.scala


示例6: IncomingMessage

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

import fr.hmil.roshttp.node.events.EventEmitter

import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal

@js.native
@JSGlobal
private[roshttp] class IncomingMessage extends EventEmitter {
  val headers: js.Dictionary[String] = js.native
  val httpVersion: String = js.native
  val method: String = js.native
  val rawHeaders: js.Dictionary[String] = js.native
  val rawTrailers: js.Dictionary[String] = js.native
  def setTimeout(msecs: Int, callback: js.Function): IncomingMessage = js.native
  val statusCode: Int = js.native
  val statusMessage: String = js.native
  // message.socket -- not facaded here
  val trailers: js.Dictionary[String] = js.native
  val url: String = js.native

  def pause(): Unit = js.native
  def resume(): Unit = js.native
} 
开发者ID:hmil,项目名称:RosHTTP,代码行数:26,代码来源:IncomingMessage.scala


示例7: Impl

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

import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal

@js.native
@JSGlobal("chrome.runtime")
private[runtime] object Impl extends js.Any {
  def openOptionsPage(callback: js.Function0[_]): Unit = js.native
  def getManifest(): js.Dictionary[js.Any] = js.native
  def getURL(path: String): String = js.native

  def sendMessage(extensionId: String, message: js.Any, options: MessageOptions, responseCallback: js.Function1[js.Any, _]): Unit = js.native
  def sendMessage(extensionId: String, message: js.Any, options: MessageOptions): Unit = js.native
  def sendMessage(extensionId: String, message: js.Any, responseCallback: js.Function1[js.Any, _]): Unit = js.native
  def sendMessage(extensionId: String, message: js.Any): Unit = js.native
  def sendMessage(message: js.Any, options: MessageOptions, responseCallback: js.Function1[js.Any, _]): Unit = js.native
  def sendMessage(message: js.Any, options: MessageOptions): Unit = js.native
  def sendMessage(message: js.Any, responseCallback: js.Function1[js.Any, _]): Unit = js.native
  def sendMessage(message: js.Any): Unit = js.native
} 
开发者ID:erdavila,项目名称:auto-steamgifts,代码行数:22,代码来源:Impl.scala


示例8: Impl

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

import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal

@js.native
@JSGlobal("chrome.alarms")
private[alarms] object Impl extends js.Any {
  def create(name: String, alarmInfo: AlarmInfo): Unit = js.native
  def create(alarmInfo: AlarmInfo): Unit = js.native

  def get(name: String, callback: js.Function1[js.UndefOr[Alarm], _]): Unit = js.native
  def get(callback: js.Function1[js.UndefOr[Alarm], _]): Unit = js.native

  def clear(name: String, callback: js.Function1[Boolean, _]): Unit = js.native
  def clear(name: String): Unit = js.native
  def clear(callback: js.Function1[Boolean, _]): Unit = js.native
  def clear(): Unit = js.native
} 
开发者ID:erdavila,项目名称:auto-steamgifts,代码行数:20,代码来源:Impl.scala


示例9: Impl

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

import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal

@js.native
@JSGlobal("chrome.notifications")
private[notifications] object Impl extends js.Any {
  def create(notificationId: String, options: NotificationOptions, callback: js.Function1[String, _]): Unit = js.native
  def create(notificationId: String, options: NotificationOptions): Unit = js.native
  def create(options: NotificationOptions, callback: js.Function1[String, _]): Unit = js.native
  def create(options: NotificationOptions): Unit = js.native

  def clear(notificationId: String, callback: js.Function1[Boolean, _]): Unit = js.native
  def clear(notificationId: String): Unit = js.native
} 
开发者ID:erdavila,项目名称:auto-steamgifts,代码行数:17,代码来源:Impl.scala


示例10: transducers

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

import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal


  @js.native
  @JSGlobal("transducers")
  object transducers extends TransducersJs

  @js.native
  @JSGlobal("com.cognitect.transducers.isArray")
  object isArray extends js.Object {
    def apply(value: js.Any): Boolean = js.native
  }

  @js.native
  @JSGlobal("com.cognitect.transducers.isObject")
  object isObject extends js.Object {
    def apply(value: js.Any): Boolean = js.native
  }

  @js.native
  @JSGlobal("com.cognitect.transducers.isString")
  object isString extends js.Object {
    def apply(value: js.Any): Boolean = js.native
  }

  @js.native
  @JSGlobal("com.cognitect.transducers.wrap")
  object wrap extends js.Object {
    def apply[T <: js.Any](value: T): js.Function0[T] = js.native
  }

} 
开发者ID:scalajs-io,项目名称:transducers-js,代码行数:36,代码来源:package.scala


示例11: Storage

//设置package包名称以及导入依赖的类
package bloom.model

import bloom.View
import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal

object Storage {

  // Returns string representation of categories
  def categories(callback: String => Unit): Unit =
    _Storage.categories((location: String) => View.updateLocation(location))

  // Returns string representation of current location
  def location(callback: String => Unit): Unit =
    _Storage.location((location: String) => View.updateLocation(location))

}

@js.native
@JSGlobal("storage")
object _Storage extends js.Object {
  def categories(callback: js.Function1[String, _]): Unit = js.native
  def location(callback: js.Function1[String, _]): Unit = js.native
} 
开发者ID:AndrewMcBurney,项目名称:bloom,代码行数:25,代码来源:Storage.scala


示例12: MobileWindow

//设置package包名称以及导入依赖的类
package com.mogproject.mogami.playground.api

import org.scalajs.dom

import scala.scalajs.js
import scala.scalajs.js.UndefOr
import scala.scalajs.js.annotation.JSGlobal

@js.native
@JSGlobal("MobileWindow")
sealed class MobileWindow extends js.Object {
  @js.native
  def orientation: UndefOr[Int] = js.native
}

@js.native
@JSGlobal("MobileScreen")
sealed class MobileScreen extends js.Object {
  @js.native
  def orientation: UndefOr[Orientation] = js.native
}

@js.native
@JSGlobal("Orientation")
sealed class Orientation extends js.Object {
  @js.native
  def angle: UndefOr[Int] = js.native
}

object MobileScreen {
  private[this] def getAngle1: UndefOr[Int] = dom.window.asInstanceOf[MobileWindow].orientation

  private[this] def getAngle2: UndefOr[Int] = dom.window.screen.asInstanceOf[MobileScreen].orientation.flatMap(_.angle)

  
  def isLandscape: Boolean = math.abs(getAngle1.getOrElse(getAngle2.getOrElse(0))) == 90
} 
开发者ID:mogproject,项目名称:mog-playground,代码行数:38,代码来源:MobileScreen.scala


示例13: RequestParams

//设置package包名称以及导入依赖的类
package com.mogproject.mogami.playground.api.google

import scala.scalajs.js
import scala.scalajs.js.|
import scala.scalajs.js.annotation.JSGlobal



@js.native
trait Thenable extends js.Object {
  def `then`(callback: js.Function): Unit = js.native
}

@js.native
trait RequestParams extends js.Object {
  var longUrl: String = js.native
}

object RequestParams {
  def apply(longUrl: String): RequestParams = {
    val r = js.Dynamic.literal()
    r.longUrl = longUrl
    r.asInstanceOf[RequestParams]
  }
}

@js.native
@JSGlobal
object gapi extends js.Object {

  @js.native
  object client extends js.Object {

    def setApiKey(apiKey: String): Unit = js.native

    def load(urlOrObject: String | js.Object): Thenable = js.native

    @js.native
    class HttpRequest[T] extends js.Object {
      def execute(callback: js.Function2[T, js.Any, Any]): Unit = js.native
    }

    @js.native
    object urlshortener extends js.Object {

      @js.native
      trait Response extends js.Object {
        var id: String | Null = js.native
      }

      @js.native
      object url extends js.Object {
        def insert(params: RequestParams): HttpRequest[Response] = js.native
      }

    }

  }

} 
开发者ID:mogproject,项目名称:mog-playground,代码行数:61,代码来源:GoogleAPIClient.scala


示例14: Clipboard

//设置package包名称以及导入依赖的类
package com.mogproject.mogami.playground.api

import org.scalajs.dom.{Element, NodeListOf}

import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal
import scala.scalajs.js.|

@js.native
@JSGlobal("Clipboard")
class Clipboard(selector: String | Element | NodeListOf[Element] = js.native,
                options: Clipboard.Options = js.native) extends js.Object {

  def on(`type`: String, handler: js.Function): Clipboard = js.native

  def destroy(): Unit = js.native
}

@js.native
@JSGlobal("Clipboard")
object Clipboard extends js.Object {

  @js.native
  trait Options extends js.Object {
    var action: js.Function1[Element, String] = js.native
    var target: js.Function1[Element, Element] = js.native
    var text: js.Function1[Element, String] = js.native
  }

  @js.native
  trait Event extends js.Object {
    var action: String = js.native
    var text: String = js.native
    var trigger: Element = js.native

    def clearSelection(): Unit = js.native
  }

} 
开发者ID:mogproject,项目名称:mog-playground,代码行数:40,代码来源:Clipboard.scala


示例15: Navigator

//设置package包名称以及导入依赖的类
package com.mogproject.mogami.playground.api

import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal

@js.native
@JSGlobal("Navigator")
class Navigator extends js.Object {
  @js.native
  def languages: js.UndefOr[js.Array[String]] = js.native

  @js.native
  def language: js.UndefOr[String] = js.native

  @js.native
  def userLanguage: js.UndefOr[String] = js.native

  @js.native
  def browserLanguage: js.UndefOr[String] = js.native
} 
开发者ID:mogproject,项目名称:mog-playground,代码行数:21,代码来源:Navigator.scala


示例16: Buffer

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

import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal
import scala.scalajs.js.typedarray.ArrayBuffer

@js.native
@JSGlobal
abstract class Buffer extends js.typedarray.Uint8Array(0) {
  def toString(encoding: String = "utf8", start: Int = 0, end: Int = this.length): String = js.native
}


@js.native
@JSGlobal
object Buffer extends js.Object {
  def from(s: String, encoding: String = "utf8"): Buffer = js.native
  def from(msg: ArrayBuffer): Buffer = js.native
} 
开发者ID:sherpal,项目名称:oh-hell-card-game,代码行数:20,代码来源:Buffer.scala


示例17: Socket

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

import org.scalajs.dom.Event

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

@ScalaJSDefined
trait ErrorEvent extends Event {
  val stack: String
}

@ScalaJSDefined
trait RInfo extends js.Object {
  val address: String
  val port: Int
  val family: String
}

@ScalaJSDefined
trait Address extends js.Object {
  val address: String
  val port: Int
}

@js.native
@JSGlobal("dgram.Socket")
abstract class Socket extends EventEmitter {
  def address(): Address = js.native

  def bind(port: Int, address: String = js.native): Unit = js.native

  def close(): Unit = js.native

  def send(msg: String | Buffer | js.Array[Buffer], port: Int, address: String): Unit = js.native
  def send(msg: String | Buffer | js.Array[Buffer], port: Int, address: String, callback: js.Function): Unit = js.native
  def send(msg: String | Buffer | js.Array[Buffer], offset: Int, length: Int, port: Int, address: String): Unit = js.native
  def send(msg: String | Buffer | js.Array[Buffer], offset: Int, length: Int,
           port: Int, address: String, callback: js.Function): Unit = js.native
}

@js.native
@JSImport("dgram", JSImport.Namespace)
object DgramModule extends js.Object {
  def createSocket(t: String): Socket = js.native
} 
开发者ID:sherpal,项目名称:oh-hell-card-game,代码行数:48,代码来源:Socket.scala



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Scala _类代码示例发布时间:2022-05-23
下一篇:
Scala GsonBuilder类代码示例发布时间: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