JS IDL2K use Any? type for "any" but callback functions return types that returns dynamic instead of Any?

This commit is contained in:
Sergey Mashkov
2015-05-13 19:23:23 +03:00
committed by Sergey Mashkov
parent 42f1f9df03
commit e9c2b33d2d
6 changed files with 62 additions and 60 deletions
@@ -151,21 +151,21 @@ native public trait WebGLRenderingContext : RenderingContext {
fun getActiveUniform(program: WebGLProgram?, index: Int): WebGLActiveInfo? = noImpl fun getActiveUniform(program: WebGLProgram?, index: Int): WebGLActiveInfo? = noImpl
fun getAttachedShaders(program: WebGLProgram?): Array<dynamic> = noImpl fun getAttachedShaders(program: WebGLProgram?): Array<dynamic> = noImpl
fun getAttribLocation(program: WebGLProgram?, name: String): Int = noImpl fun getAttribLocation(program: WebGLProgram?, name: String): Int = noImpl
fun getBufferParameter(target: Int, pname: Int): dynamic = noImpl fun getBufferParameter(target: Int, pname: Int): Any? = noImpl
fun getParameter(pname: Int): dynamic = noImpl fun getParameter(pname: Int): Any? = noImpl
fun getError(): Int = noImpl fun getError(): Int = noImpl
fun getFramebufferAttachmentParameter(target: Int, attachment: Int, pname: Int): dynamic = noImpl fun getFramebufferAttachmentParameter(target: Int, attachment: Int, pname: Int): Any? = noImpl
fun getProgramParameter(program: WebGLProgram?, pname: Int): dynamic = noImpl fun getProgramParameter(program: WebGLProgram?, pname: Int): Any? = noImpl
fun getProgramInfoLog(program: WebGLProgram?): String? = noImpl fun getProgramInfoLog(program: WebGLProgram?): String? = noImpl
fun getRenderbufferParameter(target: Int, pname: Int): dynamic = noImpl fun getRenderbufferParameter(target: Int, pname: Int): Any? = noImpl
fun getShaderParameter(shader: WebGLShader?, pname: Int): dynamic = noImpl fun getShaderParameter(shader: WebGLShader?, pname: Int): Any? = noImpl
fun getShaderPrecisionFormat(shadertype: Int, precisiontype: Int): WebGLShaderPrecisionFormat? = noImpl fun getShaderPrecisionFormat(shadertype: Int, precisiontype: Int): WebGLShaderPrecisionFormat? = noImpl
fun getShaderInfoLog(shader: WebGLShader?): String? = noImpl fun getShaderInfoLog(shader: WebGLShader?): String? = noImpl
fun getShaderSource(shader: WebGLShader?): String? = noImpl fun getShaderSource(shader: WebGLShader?): String? = noImpl
fun getTexParameter(target: Int, pname: Int): dynamic = noImpl fun getTexParameter(target: Int, pname: Int): Any? = noImpl
fun getUniform(program: WebGLProgram?, location: WebGLUniformLocation?): dynamic = noImpl fun getUniform(program: WebGLProgram?, location: WebGLUniformLocation?): Any? = noImpl
fun getUniformLocation(program: WebGLProgram?, name: String): WebGLUniformLocation? = noImpl fun getUniformLocation(program: WebGLProgram?, name: String): WebGLUniformLocation? = noImpl
fun getVertexAttrib(index: Int, pname: Int): dynamic = noImpl fun getVertexAttrib(index: Int, pname: Int): Any? = noImpl
fun getVertexAttribOffset(index: Int, pname: Int): Long = noImpl fun getVertexAttribOffset(index: Int, pname: Int): Long = noImpl
fun hint(target: Int, mode: Int): Unit = noImpl fun hint(target: Int, mode: Int): Unit = noImpl
fun isBuffer(buffer: WebGLBuffer?): Boolean = noImpl fun isBuffer(buffer: WebGLBuffer?): Boolean = noImpl
+38 -38
View File
@@ -54,7 +54,7 @@ native public trait HTMLPropertiesCollection : HTMLCollection {
} }
native public trait PropertyNodeList : NodeList { native public trait PropertyNodeList : NodeList {
fun getValues(): Array<dynamic> = noImpl fun getValues(): Array<Any?> = noImpl
} }
native public trait DOMStringMap { native public trait DOMStringMap {
@@ -290,7 +290,7 @@ native public open class Document : Node {
var onended: ((Event) -> dynamic)? var onended: ((Event) -> dynamic)?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var onerror: ((dynamic, dynamic, String, Int, Int, dynamic) -> dynamic)? var onerror: ((dynamic, dynamic, String, Int, Int, Any?) -> dynamic)?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var onfocus: ((Event) -> dynamic)? var onfocus: ((Event) -> dynamic)?
@@ -506,7 +506,7 @@ native public trait HTMLElement : Element {
var properties: HTMLPropertiesCollection var properties: HTMLPropertiesCollection
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var itemValue: dynamic var itemValue: Any?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var hidden: Boolean var hidden: Boolean
@@ -623,7 +623,7 @@ native public trait HTMLElement : Element {
var onended: ((Event) -> dynamic)? var onended: ((Event) -> dynamic)?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var onerror: ((dynamic, dynamic, String, Int, Int, dynamic) -> dynamic)? var onerror: ((dynamic, dynamic, String, Int, Int, Any?) -> dynamic)?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var onfocus: ((Event) -> dynamic)? var onfocus: ((Event) -> dynamic)?
@@ -2699,12 +2699,12 @@ native public trait HTMLCanvasElement : HTMLElement, CanvasImageSource, ImageBit
var height: Int var height: Int
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
fun getContext(contextId: String, vararg arguments: dynamic): RenderingContext? = noImpl fun getContext(contextId: String, vararg arguments: Any?): RenderingContext? = noImpl
fun probablySupportsContext(contextId: String, vararg arguments: dynamic): Boolean = noImpl fun probablySupportsContext(contextId: String, vararg arguments: Any?): Boolean = noImpl
fun setContext(context: RenderingContext): Unit = noImpl fun setContext(context: RenderingContext): Unit = noImpl
fun transferControlToProxy(): CanvasProxy = noImpl fun transferControlToProxy(): CanvasProxy = noImpl
fun toDataURL(type: String = noImpl, vararg arguments: dynamic): String = noImpl fun toDataURL(type: String = noImpl, vararg arguments: Any?): String = noImpl
fun toBlob(_callback: ((File) -> Unit)?, type: String = noImpl, vararg arguments: dynamic): Unit = noImpl fun toBlob(_callback: ((File) -> Unit)?, type: String = noImpl, vararg arguments: Any?): Unit = noImpl
} }
native public trait CanvasProxy : Transferable { native public trait CanvasProxy : Transferable {
@@ -3080,7 +3080,7 @@ native public trait Window : EventTarget, UnionMessagePortOrWindow {
var top: Window var top: Window
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var opener: dynamic var opener: Any?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var parent: Window var parent: Window
@@ -3170,7 +3170,7 @@ native public trait Window : EventTarget, UnionMessagePortOrWindow {
var onended: ((Event) -> dynamic)? var onended: ((Event) -> dynamic)?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var onerror: ((dynamic, dynamic, String, Int, Int, dynamic) -> dynamic)? var onerror: ((dynamic, dynamic, String, Int, Int, Any?) -> dynamic)?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var onfocus: ((Event) -> dynamic)? var onfocus: ((Event) -> dynamic)?
@@ -3345,20 +3345,20 @@ native public trait Window : EventTarget, UnionMessagePortOrWindow {
fun confirm(message: String = ""): Boolean = noImpl fun confirm(message: String = ""): Boolean = noImpl
fun prompt(message: String = "", default: String = ""): String? = noImpl fun prompt(message: String = "", default: String = ""): String? = noImpl
fun print(): Unit = noImpl fun print(): Unit = noImpl
fun showModalDialog(url: String, argument: dynamic = noImpl): dynamic = noImpl fun showModalDialog(url: String, argument: Any? = noImpl): Any? = noImpl
fun requestAnimationFrame(callback: (Double) -> Unit): Int = noImpl fun requestAnimationFrame(callback: (Double) -> Unit): Int = noImpl
fun cancelAnimationFrame(handle: Int): Unit = noImpl fun cancelAnimationFrame(handle: Int): Unit = noImpl
fun postMessage(message: dynamic, targetOrigin: String, transfer: Array<Transferable> = noImpl): Unit = noImpl fun postMessage(message: Any?, targetOrigin: String, transfer: Array<Transferable> = noImpl): Unit = noImpl
fun captureEvents(): Unit = noImpl fun captureEvents(): Unit = noImpl
fun releaseEvents(): Unit = noImpl fun releaseEvents(): Unit = noImpl
fun getSelection(): Selection = noImpl fun getSelection(): Selection = noImpl
fun btoa(btoa: String): String = noImpl fun btoa(btoa: String): String = noImpl
fun atob(atob: String): String = noImpl fun atob(atob: String): String = noImpl
fun setTimeout(handler: () -> dynamic, timeout: Int = 0, vararg arguments: dynamic): Int = noImpl fun setTimeout(handler: () -> dynamic, timeout: Int = 0, vararg arguments: Any?): Int = noImpl
fun setTimeout(handler: String, timeout: Int = 0, vararg arguments: dynamic): Int = noImpl fun setTimeout(handler: String, timeout: Int = 0, vararg arguments: Any?): Int = noImpl
fun clearTimeout(handle: Int = 0): Unit = noImpl fun clearTimeout(handle: Int = 0): Unit = noImpl
fun setInterval(handler: () -> dynamic, timeout: Int = 0, vararg arguments: dynamic): Int = noImpl fun setInterval(handler: () -> dynamic, timeout: Int = 0, vararg arguments: Any?): Int = noImpl
fun setInterval(handler: String, timeout: Int = 0, vararg arguments: dynamic): Int = noImpl fun setInterval(handler: String, timeout: Int = 0, vararg arguments: Any?): Int = noImpl
fun clearInterval(handle: Int = 0): Unit = noImpl fun clearInterval(handle: Int = 0): Unit = noImpl
fun createImageBitmap(image: ImageBitmapSource): dynamic = noImpl fun createImageBitmap(image: ImageBitmapSource): dynamic = noImpl
fun createImageBitmap(image: ImageBitmapSource, sx: Int, sy: Int, sw: Int, sh: Int): dynamic = noImpl fun createImageBitmap(image: ImageBitmapSource, sx: Int, sy: Int, sw: Int, sh: Int): dynamic = noImpl
@@ -3375,14 +3375,14 @@ native public trait History {
var length: Int var length: Int
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var state: dynamic var state: Any?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
fun go(delta: Int = noImpl): Unit = noImpl fun go(delta: Int = noImpl): Unit = noImpl
fun back(): Unit = noImpl fun back(): Unit = noImpl
fun forward(): Unit = noImpl fun forward(): Unit = noImpl
fun pushState(data: dynamic, title: String, url: String? = null): Unit = noImpl fun pushState(data: Any?, title: String, url: String? = null): Unit = noImpl
fun replaceState(data: dynamic, title: String, url: String? = null): Unit = noImpl fun replaceState(data: Any?, title: String, url: String? = null): Unit = noImpl
} }
native public trait Location { native public trait Location {
@@ -3395,13 +3395,13 @@ native public trait Location {
} }
native public open class PopStateEvent(type: String, eventInitDict: PopStateEventInit = noImpl) : Event(type, eventInitDict) { native public open class PopStateEvent(type: String, eventInitDict: PopStateEventInit = noImpl) : Event(type, eventInitDict) {
var state: dynamic var state: Any?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
} }
native public open class PopStateEventInit : EventInit() { native public open class PopStateEventInit : EventInit() {
var state: dynamic var state: Any?
} }
native public open class HashChangeEvent(type: String, eventInitDict: HashChangeEventInit = noImpl) : Event(type, eventInitDict) { native public open class HashChangeEvent(type: String, eventInitDict: HashChangeEventInit = noImpl) : Event(type, eventInitDict) {
@@ -3489,7 +3489,7 @@ native public open class ErrorEvent(type: String, eventInitDict: ErrorEventInit
var colno: Int var colno: Int
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var error: dynamic var error: Any?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
} }
@@ -3499,7 +3499,7 @@ native public open class ErrorEventInit : EventInit() {
var filename: String var filename: String
var lineno: Int var lineno: Int
var colno: Int var colno: Int
var error: dynamic var error: Any?
} }
native public trait Navigator { native public trait Navigator {
@@ -3629,7 +3629,7 @@ native public trait ImageBitmap : CanvasImageSource, ImageBitmapSource {
} }
native public open class MessageEvent(type: String, eventInitDict: MessageEventInit = noImpl) : Event(type, eventInitDict) { native public open class MessageEvent(type: String, eventInitDict: MessageEventInit = noImpl) : Event(type, eventInitDict) {
var data: dynamic var data: Any?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var origin: String var origin: String
@@ -3644,11 +3644,11 @@ native public open class MessageEvent(type: String, eventInitDict: MessageEventI
var ports: Array<dynamic> var ports: Array<dynamic>
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
fun initMessageEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, dataArg: dynamic, originArg: String, lastEventIdArg: String, sourceArg: UnionMessagePortOrWindow, portsArg: Array<dynamic>): Unit = noImpl fun initMessageEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, dataArg: Any?, originArg: String, lastEventIdArg: String, sourceArg: UnionMessagePortOrWindow, portsArg: Array<dynamic>): Unit = noImpl
} }
native public open class MessageEventInit : EventInit() { native public open class MessageEventInit : EventInit() {
var data: dynamic var data: Any?
var origin: String var origin: String
var lastEventId: String var lastEventId: String
var source: UnionMessagePortOrWindow? var source: UnionMessagePortOrWindow?
@@ -3763,7 +3763,7 @@ native public trait MessagePort : EventTarget, UnionMessagePortOrWindow, UnionMe
var onmessage: ((Event) -> dynamic)? var onmessage: ((Event) -> dynamic)?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
fun postMessage(message: dynamic, transfer: Array<Transferable> = noImpl): Unit = noImpl fun postMessage(message: Any?, transfer: Array<Transferable> = noImpl): Unit = noImpl
fun start(): Unit = noImpl fun start(): Unit = noImpl
fun close(): Unit = noImpl fun close(): Unit = noImpl
} }
@@ -3782,7 +3782,7 @@ native public open class BroadcastChannel(channel: String) : EventTarget {
var onmessage: ((Event) -> dynamic)? var onmessage: ((Event) -> dynamic)?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
fun postMessage(message: dynamic): Unit = noImpl fun postMessage(message: Any?): Unit = noImpl
fun close(): Unit = noImpl fun close(): Unit = noImpl
} }
@@ -3796,7 +3796,7 @@ native public trait WorkerGlobalScope : EventTarget {
var location: WorkerLocation var location: WorkerLocation
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var onerror: ((dynamic, dynamic, String, Int, Int, dynamic) -> dynamic)? var onerror: ((dynamic, dynamic, String, Int, Int, Any?) -> dynamic)?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var onlanguagechange: ((Event) -> dynamic)? var onlanguagechange: ((Event) -> dynamic)?
@@ -3815,11 +3815,11 @@ native public trait WorkerGlobalScope : EventTarget {
fun importScripts(vararg urls: String): Unit = noImpl fun importScripts(vararg urls: String): Unit = noImpl
fun createImageBitmap(image: ImageBitmapSource): dynamic = noImpl fun createImageBitmap(image: ImageBitmapSource): dynamic = noImpl
fun createImageBitmap(image: ImageBitmapSource, sx: Int, sy: Int, sw: Int, sh: Int): dynamic = noImpl fun createImageBitmap(image: ImageBitmapSource, sx: Int, sy: Int, sw: Int, sh: Int): dynamic = noImpl
fun setTimeout(handler: () -> dynamic, timeout: Int = 0, vararg arguments: dynamic): Int = noImpl fun setTimeout(handler: () -> dynamic, timeout: Int = 0, vararg arguments: Any?): Int = noImpl
fun setTimeout(handler: String, timeout: Int = 0, vararg arguments: dynamic): Int = noImpl fun setTimeout(handler: String, timeout: Int = 0, vararg arguments: Any?): Int = noImpl
fun clearTimeout(handle: Int = 0): Unit = noImpl fun clearTimeout(handle: Int = 0): Unit = noImpl
fun setInterval(handler: () -> dynamic, timeout: Int = 0, vararg arguments: dynamic): Int = noImpl fun setInterval(handler: () -> dynamic, timeout: Int = 0, vararg arguments: Any?): Int = noImpl
fun setInterval(handler: String, timeout: Int = 0, vararg arguments: dynamic): Int = noImpl fun setInterval(handler: String, timeout: Int = 0, vararg arguments: Any?): Int = noImpl
fun clearInterval(handle: Int = 0): Unit = noImpl fun clearInterval(handle: Int = 0): Unit = noImpl
fun btoa(btoa: String): String = noImpl fun btoa(btoa: String): String = noImpl
fun atob(atob: String): String = noImpl fun atob(atob: String): String = noImpl
@@ -3830,7 +3830,7 @@ native public trait DedicatedWorkerGlobalScope : WorkerGlobalScope {
var onmessage: ((Event) -> dynamic)? var onmessage: ((Event) -> dynamic)?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
fun postMessage(message: dynamic, transfer: Array<Transferable> = noImpl): Unit = noImpl fun postMessage(message: Any?, transfer: Array<Transferable> = noImpl): Unit = noImpl
} }
native public trait SharedWorkerGlobalScope : WorkerGlobalScope { native public trait SharedWorkerGlobalScope : WorkerGlobalScope {
@@ -3853,7 +3853,7 @@ native public open class Worker(scriptURL: String) : EventTarget {
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
fun terminate(): Unit = noImpl fun terminate(): Unit = noImpl
fun postMessage(message: dynamic, transfer: Array<Transferable> = noImpl): Unit = noImpl fun postMessage(message: Any?, transfer: Array<Transferable> = noImpl): Unit = noImpl
} }
native public open class SharedWorker(scriptURL: String, name: String = noImpl) : EventTarget { native public open class SharedWorker(scriptURL: String, name: String = noImpl) : EventTarget {
@@ -4239,14 +4239,14 @@ native public open class EventInit {
} }
native public open class CustomEvent(type: String, eventInitDict: CustomEventInit = noImpl) : Event(type, eventInitDict) { native public open class CustomEvent(type: String, eventInitDict: CustomEventInit = noImpl) : Event(type, eventInitDict) {
var detail: dynamic var detail: Any?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
fun initCustomEvent(type: String, bubbles: Boolean, cancelable: Boolean, detail: dynamic): Unit = noImpl fun initCustomEvent(type: String, bubbles: Boolean, cancelable: Boolean, detail: Any?): Unit = noImpl
} }
native public open class CustomEventInit : EventInit() { native public open class CustomEventInit : EventInit() {
var detail: dynamic = null var detail: Any? = null
} }
native public trait EventTarget { native public trait EventTarget {
@@ -62,7 +62,7 @@ native public open class Notification(title: String, options: NotificationOption
var sticky: Boolean var sticky: Boolean
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var data: dynamic var data: Any?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
fun close(): Unit = noImpl fun close(): Unit = noImpl
@@ -80,7 +80,7 @@ native public open class NotificationOptions {
var silent: Boolean = false var silent: Boolean = false
var noscreen: Boolean = false var noscreen: Boolean = false
var sticky: Boolean = false var sticky: Boolean = false
var data: dynamic = null var data: Any? = null
} }
native public open class GetNotificationOptions { native public open class GetNotificationOptions {
@@ -89,7 +89,7 @@ native public trait ServiceWorker : EventTarget, UnionMessagePortOrServiceWorker
var onerror: ((Event) -> dynamic)? var onerror: ((Event) -> dynamic)?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
fun postMessage(message: dynamic, transfer: Array<Transferable> = noImpl): Unit = noImpl fun postMessage(message: Any?, transfer: Array<Transferable> = noImpl): Unit = noImpl
} }
native public trait ServiceWorkerContainer : EventTarget { native public trait ServiceWorkerContainer : EventTarget {
@@ -118,7 +118,7 @@ native public open class RegistrationOptions {
} }
native public open class ServiceWorkerMessageEvent(type: String, eventInitDict: ServiceWorkerMessageEventInit = noImpl) : Event(type, eventInitDict) { native public open class ServiceWorkerMessageEvent(type: String, eventInitDict: ServiceWorkerMessageEventInit = noImpl) : Event(type, eventInitDict) {
var data: dynamic var data: Any?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var origin: String var origin: String
@@ -133,11 +133,11 @@ native public open class ServiceWorkerMessageEvent(type: String, eventInitDict:
var ports: Array<dynamic> var ports: Array<dynamic>
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
fun initServiceWorkerMessageEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, dataArg: dynamic, originArg: String, lastEventIdArg: String, sourceArg: UnionMessagePortOrServiceWorker, portsArg: Array<dynamic>): Unit = noImpl fun initServiceWorkerMessageEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, dataArg: Any?, originArg: String, lastEventIdArg: String, sourceArg: UnionMessagePortOrServiceWorker, portsArg: Array<dynamic>): Unit = noImpl
} }
native public open class ServiceWorkerMessageEventInit : EventInit() { native public open class ServiceWorkerMessageEventInit : EventInit() {
var data: dynamic var data: Any?
var origin: String var origin: String
var lastEventId: String var lastEventId: String
var source: UnionMessagePortOrServiceWorker? var source: UnionMessagePortOrServiceWorker?
@@ -154,7 +154,7 @@ native public trait Client : UnionClientOrMessagePortOrServiceWorker {
var id: String var id: String
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
fun postMessage(message: dynamic, transfer: Array<Transferable> = noImpl): Unit = noImpl fun postMessage(message: Any?, transfer: Array<Transferable> = noImpl): Unit = noImpl
} }
native public trait WindowClient : Client { native public trait WindowClient : Client {
@@ -205,7 +205,7 @@ native public open class FetchEventInit : ExtendableEventInit() {
} }
native public open class ExtendableMessageEvent(type: String, eventInitDict: ExtendableMessageEventInit = noImpl) : ExtendableEvent(type, eventInitDict) { native public open class ExtendableMessageEvent(type: String, eventInitDict: ExtendableMessageEventInit = noImpl) : ExtendableEvent(type, eventInitDict) {
var data: dynamic var data: Any?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var origin: String var origin: String
@@ -220,11 +220,11 @@ native public open class ExtendableMessageEvent(type: String, eventInitDict: Ext
var ports: Array<dynamic> var ports: Array<dynamic>
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
fun initExtendableMessageEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, dataArg: dynamic, originArg: String, lastEventIdArg: String, sourceArg: UnionClientOrMessagePortOrServiceWorker, portsArg: Array<dynamic>): Unit = noImpl fun initExtendableMessageEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, dataArg: Any?, originArg: String, lastEventIdArg: String, sourceArg: UnionClientOrMessagePortOrServiceWorker, portsArg: Array<dynamic>): Unit = noImpl
} }
native public open class ExtendableMessageEventInit : ExtendableEventInit() { native public open class ExtendableMessageEventInit : ExtendableEventInit() {
var data: dynamic var data: Any?
var origin: String var origin: String
var lastEventId: String var lastEventId: String
var source: UnionClientOrMessagePortOrServiceWorker? var source: UnionClientOrMessagePortOrServiceWorker?
+1 -1
View File
@@ -74,7 +74,7 @@ native public open class XMLHttpRequest : XMLHttpRequestEventTarget {
var responseType: String var responseType: String
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var response: dynamic var response: Any?
get() = noImpl get() = noImpl
set(value) = noImpl set(value) = noImpl
var responseText: String var responseText: String
@@ -32,7 +32,7 @@ private val typeMapper = mapOf(
"long" to "Int", "long" to "Int",
"float" to "Float", "float" to "Float",
"double" to "Double", "double" to "Double",
"any" to "dynamic", "any" to "Any?",
"DOMTimeStamp" to "Number", "DOMTimeStamp" to "Number",
"object" to "dynamic", // TODO map to Any? "object" to "dynamic", // TODO map to Any?
"WindowProxy" to "Window", "WindowProxy" to "Window",
@@ -93,6 +93,8 @@ fun String.dynamicIfUnknownType(allTypes: Set<String>, standardTypes: Set<String
else -> "dynamic" else -> "dynamic"
} }
private fun String.dynamicIfAnyType() = if (this == "Any?") "dynamic" else this
private fun mapType(repository: Repository, type: String): String = private fun mapType(repository: Repository, type: String): String =
when { when {
type in typeMapper -> typeMapper[type]!! type in typeMapper -> typeMapper[type]!!
@@ -110,7 +112,7 @@ private fun mapType(repository: Repository, type: String): String =
// TODO: Remove takeWhile { !vararg } when we have varargs supported. See KT-3115 // TODO: Remove takeWhile { !vararg } when we have varargs supported. See KT-3115
function.copy( function.copy(
returnType = mapType(repository, function.returnType), returnType = mapType(repository, function.returnType).dynamicIfAnyType(),
parameterTypes = function.parameterTypes.takeWhile { !it.vararg }.map { it.copy(type = mapType(repository, it.type)) } parameterTypes = function.parameterTypes.takeWhile { !it.vararg }.map { it.copy(type = mapType(repository, it.type)) }
).text ).text
} }