Window

abstract external class Window : 
    EventTarget,
    GlobalEventHandlers,
    WindowEventHandlers,
    WindowOrWorkerGlobalScope,
    WindowSessionStorage,
    WindowLocalStorage,
    GlobalPerformance,
    UnionMessagePortOrWindow
(source)

Platform and version requirements: JS

Exposes the JavaScript Window to Kotlin

Constructors

<init>

Window()

Exposes the JavaScript Window to Kotlin

Properties

applicationCache

open val applicationCache: ApplicationCache

closed

open val closed: Boolean

customElements

open val customElements: CustomElementRegistry

devicePixelRatio

open val devicePixelRatio: Double

document

open val document: Document

external

open val external: External

frameElement

open val frameElement: Element?

frames

open val frames: Window

history

open val history: History

innerHeight

open val innerHeight: Int

innerWidth

open val innerWidth: Int

length

open val length: Int

location

open val location: Location

locationbar

open val locationbar: BarProp

menubar

open val menubar: BarProp

name

open var name: String

navigator

open val navigator: Navigator

opener

open var opener: Any?

outerHeight

open val outerHeight: Int

outerWidth

open val outerWidth: Int

pageXOffset

open val pageXOffset: Double

pageYOffset

open val pageYOffset: Double

parent

open val parent: Window

performance

open val performance: Performance

personalbar

open val personalbar: BarProp

screen

open val screen: Screen

screenX

open val screenX: Int

screenY

open val screenY: Int

scrollX

open val scrollX: Double

scrollY

open val scrollY: Double

scrollbars

open val scrollbars: BarProp

self

open val self: Window

status

open var status: String

statusbar

open val statusbar: BarProp

toolbar

open val toolbar: BarProp

top

open val top: Window

window

open val window: Window

Inherited Properties

caches

abstract val caches: CacheStorage

localStorage

abstract val localStorage: Storage

onabort

abstract var onabort: (Event) -> dynamic

onafterprint

abstract var onafterprint: (Event) -> dynamic

onbeforeprint

abstract var onbeforeprint: (Event) -> dynamic

onbeforeunload

abstract var onbeforeunload: (Event) -> String?

onblur

abstract var onblur: (Event) -> dynamic

oncancel

abstract var oncancel: (Event) -> dynamic

oncanplay

abstract var oncanplay: (Event) -> dynamic

oncanplaythrough

abstract var oncanplaythrough: (Event) -> dynamic

onchange

abstract var onchange: (Event) -> dynamic

onclick

abstract var onclick: (Event) -> dynamic

onclose

abstract var onclose: (Event) -> dynamic

oncontextmenu

abstract var oncontextmenu: (Event) -> dynamic

oncuechange

abstract var oncuechange: (Event) -> dynamic

ondblclick

abstract var ondblclick: (Event) -> dynamic

ondrag

abstract var ondrag: (Event) -> dynamic

ondragend

abstract var ondragend: (Event) -> dynamic

ondragenter

abstract var ondragenter: (Event) -> dynamic

ondragexit

abstract var ondragexit: (Event) -> dynamic

ondragleave

abstract var ondragleave: (Event) -> dynamic

ondragover

abstract var ondragover: (Event) -> dynamic

ondragstart

abstract var ondragstart: (Event) -> dynamic

ondrop

abstract var ondrop: (Event) -> dynamic

ondurationchange

abstract var ondurationchange: (Event) -> dynamic

onemptied

abstract var onemptied: (Event) -> dynamic

onended

abstract var onended: (Event) -> dynamic

onerror

abstract var onerror: (dynamic, String, Int, Int, Any?) -> dynamic

onfocus

abstract var onfocus: (Event) -> dynamic

onhashchange

abstract var onhashchange: (Event) -> dynamic

oninput

abstract var oninput: (Event) -> dynamic

oninvalid

abstract var oninvalid: (Event) -> dynamic

onkeydown

abstract var onkeydown: (Event) -> dynamic

onkeypress

abstract var onkeypress: (Event) -> dynamic

onkeyup

abstract var onkeyup: (Event) -> dynamic

onlanguagechange

abstract var onlanguagechange: (Event) -> dynamic

onload

abstract var onload: (Event) -> dynamic

onloadeddata

abstract var onloadeddata: (Event) -> dynamic

onloadedmetadata

abstract var onloadedmetadata: (Event) -> dynamic

onloadend

abstract var onloadend: (Event) -> dynamic

onloadstart

abstract var onloadstart: (Event) -> dynamic

onmessage

abstract var onmessage: (Event) -> dynamic

onmousedown

abstract var onmousedown: (Event) -> dynamic

onmouseenter

abstract var onmouseenter: (Event) -> dynamic

onmouseleave

abstract var onmouseleave: (Event) -> dynamic

onmousemove

abstract var onmousemove: (Event) -> dynamic

onmouseout

abstract var onmouseout: (Event) -> dynamic

onmouseover

abstract var onmouseover: (Event) -> dynamic

onmouseup

abstract var onmouseup: (Event) -> dynamic

onoffline

abstract var onoffline: (Event) -> dynamic

ononline

abstract var ononline: (Event) -> dynamic

onpagehide

abstract var onpagehide: (Event) -> dynamic

onpageshow

abstract var onpageshow: (Event) -> dynamic

onpause

abstract var onpause: (Event) -> dynamic

onplay

abstract var onplay: (Event) -> dynamic

onplaying

abstract var onplaying: (Event) -> dynamic

onpopstate

abstract var onpopstate: (Event) -> dynamic

onprogress

abstract var onprogress: (Event) -> dynamic

onratechange

abstract var onratechange: (Event) -> dynamic

onrejectionhandled

abstract var onrejectionhandled: (Event) -> dynamic

onreset

abstract var onreset: (Event) -> dynamic

onresize

abstract var onresize: (Event) -> dynamic

onscroll

abstract var onscroll: (Event) -> dynamic

onseeked

abstract var onseeked: (Event) -> dynamic

onseeking

abstract var onseeking: (Event) -> dynamic

onselect

abstract var onselect: (Event) -> dynamic

onshow

abstract var onshow: (Event) -> dynamic

onstalled

abstract var onstalled: (Event) -> dynamic

onstorage

abstract var onstorage: (Event) -> dynamic

onsubmit

abstract var onsubmit: (Event) -> dynamic

onsuspend

abstract var onsuspend: (Event) -> dynamic

ontimeupdate

abstract var ontimeupdate: (Event) -> dynamic

ontoggle

abstract var ontoggle: (Event) -> dynamic

onunhandledrejection

abstract var onunhandledrejection: (Event) -> dynamic

onunload

abstract var onunload: (Event) -> dynamic

onvolumechange

abstract var onvolumechange: (Event) -> dynamic

onwaiting

abstract var onwaiting: (Event) -> dynamic

onwheel

abstract var onwheel: (Event) -> dynamic

origin

abstract val origin: String

sessionStorage

abstract val sessionStorage: Storage

Functions

alert

fun alert()
fun alert(message: String)

blur

fun blur()

cancelAnimationFrame

fun cancelAnimationFrame(handle: Int)

captureEvents

fun captureEvents()

close

fun close()

confirm

fun confirm(message: String = definedExternally): Boolean

focus

fun focus()

getComputedStyle

fun getComputedStyle(
    elt: Element,
    pseudoElt: String? = definedExternally
): CSSStyleDeclaration

matchMedia

fun matchMedia(query: String): MediaQueryList

moveBy

fun moveBy(x: Int, y: Int)

moveTo

fun moveTo(x: Int, y: Int)

open

fun open(
    url: String = definedExternally,
    target: String = definedExternally,
    features: String = definedExternally
): Window?

postMessage

fun postMessage(
    message: Any?,
    targetOrigin: String,
    transfer: Array<dynamic> = definedExternally)

print

fun print()

prompt

fun prompt(
    message: String = definedExternally,
    default: String = definedExternally
): String?

releaseEvents

fun releaseEvents()

requestAnimationFrame

fun requestAnimationFrame(callback: (Double) -> Unit): Int

resizeBy

fun resizeBy(x: Int, y: Int)

resizeTo

fun resizeTo(x: Int, y: Int)

scroll

fun scroll(options: ScrollToOptions = definedExternally)
fun scroll(x: Double, y: Double)

scrollBy

fun scrollBy(options: ScrollToOptions = definedExternally)
fun scrollBy(x: Double, y: Double)

scrollTo

fun scrollTo(options: ScrollToOptions = definedExternally)
fun scrollTo(x: Double, y: Double)

stop

fun stop()

Inherited Functions

addEventListener

fun addEventListener(
    type: String,
    callback: EventListener?,
    options: dynamic = definedExternally)
fun addEventListener(
    type: String,
    callback: (Event) -> Unit,
    options: dynamic = definedExternally)

atob

abstract fun atob(data: String): String

btoa

abstract fun btoa(data: String): String

clearInterval

abstract fun clearInterval(handle: Int = definedExternally)

clearTimeout

abstract fun clearTimeout(handle: Int = definedExternally)

createImageBitmap

abstract fun createImageBitmap(
    image: dynamic,
    options: ImageBitmapOptions = definedExternally
): Promise<ImageBitmap>
abstract fun createImageBitmap(
    image: dynamic,
    sx: Int,
    sy: Int,
    sw: Int,
    sh: Int,
    options: ImageBitmapOptions = definedExternally
): Promise<ImageBitmap>

dispatchEvent

fun dispatchEvent(event: Event): Boolean

fetch

abstract fun fetch(
    input: dynamic,
    init: RequestInit = definedExternally
): Promise<Response>

removeEventListener

fun removeEventListener(
    type: String,
    callback: EventListener?,
    options: dynamic = definedExternally)
fun removeEventListener(
    type: String,
    callback: (Event) -> Unit,
    options: dynamic = definedExternally)

setInterval

abstract fun setInterval(
    handler: dynamic,
    timeout: Int = definedExternally,
    vararg arguments: Any?
): Int

setTimeout

abstract fun setTimeout(
    handler: dynamic,
    timeout: Int = definedExternally,
    vararg arguments: Any?
): Int

Extension Functions

get

operator fun Window.get(name: String): dynamic