IDL2K better dictionary support: generate interfaces with builder function

suppress inline warning, replace Long with Int
This commit is contained in:
Sergey Mashkov
2015-06-17 15:25:40 +03:00
parent 8238883ac4
commit 342f35fb65
12 changed files with 461 additions and 409 deletions
@@ -31,17 +31,18 @@ native public interface WebGLContextAttributes {
var failIfMajorPerformanceCaveat: Boolean var failIfMajorPerformanceCaveat: Boolean
} }
suppress("NOTHING_TO_INLINE")
inline fun WebGLContextAttributes(alpha: Boolean = true, depth: Boolean = true, stencil: Boolean = false, antialias: Boolean = true, premultipliedAlpha: Boolean = true, preserveDrawingBuffer: Boolean = false, preferLowPowerToHighPerformance: Boolean = false, failIfMajorPerformanceCaveat: Boolean = false): WebGLContextAttributes { inline fun WebGLContextAttributes(alpha: Boolean = true, depth: Boolean = true, stencil: Boolean = false, antialias: Boolean = true, premultipliedAlpha: Boolean = true, preserveDrawingBuffer: Boolean = false, preferLowPowerToHighPerformance: Boolean = false, failIfMajorPerformanceCaveat: Boolean = false): WebGLContextAttributes {
val o = js("({})") as WebGLContextAttributes val o = js("({})")
o.`alpha` = alpha o["alpha"] = alpha
o.`depth` = depth o["depth"] = depth
o.`stencil` = stencil o["stencil"] = stencil
o.`antialias` = antialias o["antialias"] = antialias
o.`premultipliedAlpha` = premultipliedAlpha o["premultipliedAlpha"] = premultipliedAlpha
o.`preserveDrawingBuffer` = preserveDrawingBuffer o["preserveDrawingBuffer"] = preserveDrawingBuffer
o.`preferLowPowerToHighPerformance` = preferLowPowerToHighPerformance o["preferLowPowerToHighPerformance"] = preferLowPowerToHighPerformance
o.`failIfMajorPerformanceCaveat` = failIfMajorPerformanceCaveat o["failIfMajorPerformanceCaveat"] = failIfMajorPerformanceCaveat
return o return o
} }
@@ -111,9 +112,9 @@ native public interface WebGLRenderingContext : RenderingContext {
fun blendEquationSeparate(modeRGB: Int, modeAlpha: Int): Unit = noImpl fun blendEquationSeparate(modeRGB: Int, modeAlpha: Int): Unit = noImpl
fun blendFunc(sfactor: Int, dfactor: Int): Unit = noImpl fun blendFunc(sfactor: Int, dfactor: Int): Unit = noImpl
fun blendFuncSeparate(srcRGB: Int, dstRGB: Int, srcAlpha: Int, dstAlpha: Int): Unit = noImpl fun blendFuncSeparate(srcRGB: Int, dstRGB: Int, srcAlpha: Int, dstAlpha: Int): Unit = noImpl
fun bufferData(target: Int, size: Long, usage: Int): Unit = noImpl fun bufferData(target: Int, size: Int, usage: Int): Unit = noImpl
fun bufferData(target: Int, data: dynamic, usage: Int): Unit = noImpl fun bufferData(target: Int, data: dynamic, usage: Int): Unit = noImpl
fun bufferSubData(target: Int, offset: Long, data: dynamic): Unit = noImpl fun bufferSubData(target: Int, offset: Int, data: dynamic): Unit = noImpl
fun checkFramebufferStatus(target: Int): Int = noImpl fun checkFramebufferStatus(target: Int): Int = noImpl
fun clear(mask: Int): Unit = noImpl fun clear(mask: Int): Unit = noImpl
fun clearColor(red: Float, green: Float, blue: Float, alpha: Float): Unit = noImpl fun clearColor(red: Float, green: Float, blue: Float, alpha: Float): Unit = noImpl
@@ -145,7 +146,7 @@ native public interface WebGLRenderingContext : RenderingContext {
fun disable(cap: Int): Unit = noImpl fun disable(cap: Int): Unit = noImpl
fun disableVertexAttribArray(index: Int): Unit = noImpl fun disableVertexAttribArray(index: Int): Unit = noImpl
fun drawArrays(mode: Int, first: Int, count: Int): Unit = noImpl fun drawArrays(mode: Int, first: Int, count: Int): Unit = noImpl
fun drawElements(mode: Int, count: Int, type: Int, offset: Long): Unit = noImpl fun drawElements(mode: Int, count: Int, type: Int, offset: Int): Unit = noImpl
fun enable(cap: Int): Unit = noImpl fun enable(cap: Int): Unit = noImpl
fun enableVertexAttribArray(index: Int): Unit = noImpl fun enableVertexAttribArray(index: Int): Unit = noImpl
fun finish(): Unit = noImpl fun finish(): Unit = noImpl
@@ -173,7 +174,7 @@ native public interface WebGLRenderingContext : RenderingContext {
fun getUniform(program: WebGLProgram?, location: WebGLUniformLocation?): Any? = 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): Any? = noImpl fun getVertexAttrib(index: Int, pname: Int): Any? = noImpl
fun getVertexAttribOffset(index: Int, pname: Int): Long = noImpl fun getVertexAttribOffset(index: Int, pname: Int): Int = 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
fun isEnabled(cap: Int): Boolean = noImpl fun isEnabled(cap: Int): Boolean = noImpl
@@ -247,7 +248,7 @@ native public interface WebGLRenderingContext : RenderingContext {
fun vertexAttrib4f(indx: Int, x: Float, y: Float, z: Float, w: Float): Unit = noImpl fun vertexAttrib4f(indx: Int, x: Float, y: Float, z: Float, w: Float): Unit = noImpl
fun vertexAttrib4fv(indx: Int, values: Float32Array): Unit = noImpl fun vertexAttrib4fv(indx: Int, values: Float32Array): Unit = noImpl
fun vertexAttrib4fv(indx: Int, values: Array<Float>): Unit = noImpl fun vertexAttrib4fv(indx: Int, values: Array<Float>): Unit = noImpl
fun vertexAttribPointer(indx: Int, size: Int, type: Int, normalized: Boolean, stride: Int, offset: Long): Unit = noImpl fun vertexAttribPointer(indx: Int, size: Int, type: Int, normalized: Boolean, stride: Int, offset: Int): Unit = noImpl
fun viewport(x: Int, y: Int, width: Int, height: Int): Unit = noImpl fun viewport(x: Int, y: Int, width: Int, height: Int): Unit = noImpl
companion object { companion object {
@@ -560,12 +561,13 @@ native public interface WebGLContextEventInit : EventInit {
var statusMessage: String var statusMessage: String
} }
suppress("NOTHING_TO_INLINE")
inline fun WebGLContextEventInit(statusMessage: String, bubbles: Boolean = false, cancelable: Boolean = false): WebGLContextEventInit { inline fun WebGLContextEventInit(statusMessage: String, bubbles: Boolean = false, cancelable: Boolean = false): WebGLContextEventInit {
val o = js("({})") as WebGLContextEventInit val o = js("({})")
o.`statusMessage` = statusMessage o["statusMessage"] = statusMessage
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -126,13 +126,14 @@ native public interface UIEventInit : EventInit {
var detail: Int var detail: Int
} }
suppress("NOTHING_TO_INLINE")
inline fun UIEventInit(view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): UIEventInit { inline fun UIEventInit(view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): UIEventInit {
val o = js("({})") as UIEventInit val o = js("({})")
o.`view` = view o["view"] = view
o.`detail` = detail o["detail"] = detail
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -147,14 +148,15 @@ native public interface FocusEventInit : UIEventInit {
var relatedTarget: EventTarget? var relatedTarget: EventTarget?
} }
suppress("NOTHING_TO_INLINE")
inline fun FocusEventInit(relatedTarget: EventTarget? = null, view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): FocusEventInit { inline fun FocusEventInit(relatedTarget: EventTarget? = null, view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): FocusEventInit {
val o = js("({})") as FocusEventInit val o = js("({})")
o.`relatedTarget` = relatedTarget o["relatedTarget"] = relatedTarget
o.`view` = view o["view"] = view
o.`detail` = detail o["detail"] = detail
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -169,35 +171,36 @@ native public interface MouseEventInit : EventModifierInit {
var relatedTarget: EventTarget? var relatedTarget: EventTarget?
} }
suppress("NOTHING_TO_INLINE")
inline fun MouseEventInit(screenX: Int = 0, screenY: Int = 0, clientX: Int = 0, clientY: Int = 0, button: Short = 0, buttons: Short = 0, relatedTarget: EventTarget? = null, ctrlKey: Boolean = false, shiftKey: Boolean = false, altKey: Boolean = false, metaKey: Boolean = false, modifierAltGraph: Boolean = false, modifierCapsLock: Boolean = false, modifierFn: Boolean = false, modifierFnLock: Boolean = false, modifierHyper: Boolean = false, modifierNumLock: Boolean = false, modifierOS: Boolean = false, modifierScrollLock: Boolean = false, modifierSuper: Boolean = false, modifierSymbol: Boolean = false, modifierSymbolLock: Boolean = false, view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): MouseEventInit { inline fun MouseEventInit(screenX: Int = 0, screenY: Int = 0, clientX: Int = 0, clientY: Int = 0, button: Short = 0, buttons: Short = 0, relatedTarget: EventTarget? = null, ctrlKey: Boolean = false, shiftKey: Boolean = false, altKey: Boolean = false, metaKey: Boolean = false, modifierAltGraph: Boolean = false, modifierCapsLock: Boolean = false, modifierFn: Boolean = false, modifierFnLock: Boolean = false, modifierHyper: Boolean = false, modifierNumLock: Boolean = false, modifierOS: Boolean = false, modifierScrollLock: Boolean = false, modifierSuper: Boolean = false, modifierSymbol: Boolean = false, modifierSymbolLock: Boolean = false, view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): MouseEventInit {
val o = js("({})") as MouseEventInit val o = js("({})")
o.`screenX` = screenX o["screenX"] = screenX
o.`screenY` = screenY o["screenY"] = screenY
o.`clientX` = clientX o["clientX"] = clientX
o.`clientY` = clientY o["clientY"] = clientY
o.`button` = button o["button"] = button
o.`buttons` = buttons o["buttons"] = buttons
o.`relatedTarget` = relatedTarget o["relatedTarget"] = relatedTarget
o.`ctrlKey` = ctrlKey o["ctrlKey"] = ctrlKey
o.`shiftKey` = shiftKey o["shiftKey"] = shiftKey
o.`altKey` = altKey o["altKey"] = altKey
o.`metaKey` = metaKey o["metaKey"] = metaKey
o.`modifierAltGraph` = modifierAltGraph o["modifierAltGraph"] = modifierAltGraph
o.`modifierCapsLock` = modifierCapsLock o["modifierCapsLock"] = modifierCapsLock
o.`modifierFn` = modifierFn o["modifierFn"] = modifierFn
o.`modifierFnLock` = modifierFnLock o["modifierFnLock"] = modifierFnLock
o.`modifierHyper` = modifierHyper o["modifierHyper"] = modifierHyper
o.`modifierNumLock` = modifierNumLock o["modifierNumLock"] = modifierNumLock
o.`modifierOS` = modifierOS o["modifierOS"] = modifierOS
o.`modifierScrollLock` = modifierScrollLock o["modifierScrollLock"] = modifierScrollLock
o.`modifierSuper` = modifierSuper o["modifierSuper"] = modifierSuper
o.`modifierSymbol` = modifierSymbol o["modifierSymbol"] = modifierSymbol
o.`modifierSymbolLock` = modifierSymbolLock o["modifierSymbolLock"] = modifierSymbolLock
o.`view` = view o["view"] = view
o.`detail` = detail o["detail"] = detail
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -220,28 +223,29 @@ native public interface EventModifierInit : UIEventInit {
var modifierSymbolLock: Boolean var modifierSymbolLock: Boolean
} }
suppress("NOTHING_TO_INLINE")
inline fun EventModifierInit(ctrlKey: Boolean = false, shiftKey: Boolean = false, altKey: Boolean = false, metaKey: Boolean = false, modifierAltGraph: Boolean = false, modifierCapsLock: Boolean = false, modifierFn: Boolean = false, modifierFnLock: Boolean = false, modifierHyper: Boolean = false, modifierNumLock: Boolean = false, modifierOS: Boolean = false, modifierScrollLock: Boolean = false, modifierSuper: Boolean = false, modifierSymbol: Boolean = false, modifierSymbolLock: Boolean = false, view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): EventModifierInit { inline fun EventModifierInit(ctrlKey: Boolean = false, shiftKey: Boolean = false, altKey: Boolean = false, metaKey: Boolean = false, modifierAltGraph: Boolean = false, modifierCapsLock: Boolean = false, modifierFn: Boolean = false, modifierFnLock: Boolean = false, modifierHyper: Boolean = false, modifierNumLock: Boolean = false, modifierOS: Boolean = false, modifierScrollLock: Boolean = false, modifierSuper: Boolean = false, modifierSymbol: Boolean = false, modifierSymbolLock: Boolean = false, view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): EventModifierInit {
val o = js("({})") as EventModifierInit val o = js("({})")
o.`ctrlKey` = ctrlKey o["ctrlKey"] = ctrlKey
o.`shiftKey` = shiftKey o["shiftKey"] = shiftKey
o.`altKey` = altKey o["altKey"] = altKey
o.`metaKey` = metaKey o["metaKey"] = metaKey
o.`modifierAltGraph` = modifierAltGraph o["modifierAltGraph"] = modifierAltGraph
o.`modifierCapsLock` = modifierCapsLock o["modifierCapsLock"] = modifierCapsLock
o.`modifierFn` = modifierFn o["modifierFn"] = modifierFn
o.`modifierFnLock` = modifierFnLock o["modifierFnLock"] = modifierFnLock
o.`modifierHyper` = modifierHyper o["modifierHyper"] = modifierHyper
o.`modifierNumLock` = modifierNumLock o["modifierNumLock"] = modifierNumLock
o.`modifierOS` = modifierOS o["modifierOS"] = modifierOS
o.`modifierScrollLock` = modifierScrollLock o["modifierScrollLock"] = modifierScrollLock
o.`modifierSuper` = modifierSuper o["modifierSuper"] = modifierSuper
o.`modifierSymbol` = modifierSymbol o["modifierSymbol"] = modifierSymbol
o.`modifierSymbolLock` = modifierSymbolLock o["modifierSymbolLock"] = modifierSymbolLock
o.`view` = view o["view"] = view
o.`detail` = detail o["detail"] = detail
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -271,39 +275,40 @@ native public interface WheelEventInit : MouseEventInit {
var deltaMode: Int var deltaMode: Int
} }
suppress("NOTHING_TO_INLINE")
inline fun WheelEventInit(deltaX: Double = 0.0, deltaY: Double = 0.0, deltaZ: Double = 0.0, deltaMode: Int = 0, screenX: Int = 0, screenY: Int = 0, clientX: Int = 0, clientY: Int = 0, button: Short = 0, buttons: Short = 0, relatedTarget: EventTarget? = null, ctrlKey: Boolean = false, shiftKey: Boolean = false, altKey: Boolean = false, metaKey: Boolean = false, modifierAltGraph: Boolean = false, modifierCapsLock: Boolean = false, modifierFn: Boolean = false, modifierFnLock: Boolean = false, modifierHyper: Boolean = false, modifierNumLock: Boolean = false, modifierOS: Boolean = false, modifierScrollLock: Boolean = false, modifierSuper: Boolean = false, modifierSymbol: Boolean = false, modifierSymbolLock: Boolean = false, view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): WheelEventInit { inline fun WheelEventInit(deltaX: Double = 0.0, deltaY: Double = 0.0, deltaZ: Double = 0.0, deltaMode: Int = 0, screenX: Int = 0, screenY: Int = 0, clientX: Int = 0, clientY: Int = 0, button: Short = 0, buttons: Short = 0, relatedTarget: EventTarget? = null, ctrlKey: Boolean = false, shiftKey: Boolean = false, altKey: Boolean = false, metaKey: Boolean = false, modifierAltGraph: Boolean = false, modifierCapsLock: Boolean = false, modifierFn: Boolean = false, modifierFnLock: Boolean = false, modifierHyper: Boolean = false, modifierNumLock: Boolean = false, modifierOS: Boolean = false, modifierScrollLock: Boolean = false, modifierSuper: Boolean = false, modifierSymbol: Boolean = false, modifierSymbolLock: Boolean = false, view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): WheelEventInit {
val o = js("({})") as WheelEventInit val o = js("({})")
o.`deltaX` = deltaX o["deltaX"] = deltaX
o.`deltaY` = deltaY o["deltaY"] = deltaY
o.`deltaZ` = deltaZ o["deltaZ"] = deltaZ
o.`deltaMode` = deltaMode o["deltaMode"] = deltaMode
o.`screenX` = screenX o["screenX"] = screenX
o.`screenY` = screenY o["screenY"] = screenY
o.`clientX` = clientX o["clientX"] = clientX
o.`clientY` = clientY o["clientY"] = clientY
o.`button` = button o["button"] = button
o.`buttons` = buttons o["buttons"] = buttons
o.`relatedTarget` = relatedTarget o["relatedTarget"] = relatedTarget
o.`ctrlKey` = ctrlKey o["ctrlKey"] = ctrlKey
o.`shiftKey` = shiftKey o["shiftKey"] = shiftKey
o.`altKey` = altKey o["altKey"] = altKey
o.`metaKey` = metaKey o["metaKey"] = metaKey
o.`modifierAltGraph` = modifierAltGraph o["modifierAltGraph"] = modifierAltGraph
o.`modifierCapsLock` = modifierCapsLock o["modifierCapsLock"] = modifierCapsLock
o.`modifierFn` = modifierFn o["modifierFn"] = modifierFn
o.`modifierFnLock` = modifierFnLock o["modifierFnLock"] = modifierFnLock
o.`modifierHyper` = modifierHyper o["modifierHyper"] = modifierHyper
o.`modifierNumLock` = modifierNumLock o["modifierNumLock"] = modifierNumLock
o.`modifierOS` = modifierOS o["modifierOS"] = modifierOS
o.`modifierScrollLock` = modifierScrollLock o["modifierScrollLock"] = modifierScrollLock
o.`modifierSuper` = modifierSuper o["modifierSuper"] = modifierSuper
o.`modifierSymbol` = modifierSymbol o["modifierSymbol"] = modifierSymbol
o.`modifierSymbolLock` = modifierSymbolLock o["modifierSymbolLock"] = modifierSymbolLock
o.`view` = view o["view"] = view
o.`detail` = detail o["detail"] = detail
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -352,33 +357,34 @@ native public interface KeyboardEventInit : EventModifierInit {
var isComposing: Boolean var isComposing: Boolean
} }
suppress("NOTHING_TO_INLINE")
inline fun KeyboardEventInit(key: String = "", code: String = "", location: Int = 0, repeat: Boolean = false, isComposing: Boolean = false, ctrlKey: Boolean = false, shiftKey: Boolean = false, altKey: Boolean = false, metaKey: Boolean = false, modifierAltGraph: Boolean = false, modifierCapsLock: Boolean = false, modifierFn: Boolean = false, modifierFnLock: Boolean = false, modifierHyper: Boolean = false, modifierNumLock: Boolean = false, modifierOS: Boolean = false, modifierScrollLock: Boolean = false, modifierSuper: Boolean = false, modifierSymbol: Boolean = false, modifierSymbolLock: Boolean = false, view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): KeyboardEventInit { inline fun KeyboardEventInit(key: String = "", code: String = "", location: Int = 0, repeat: Boolean = false, isComposing: Boolean = false, ctrlKey: Boolean = false, shiftKey: Boolean = false, altKey: Boolean = false, metaKey: Boolean = false, modifierAltGraph: Boolean = false, modifierCapsLock: Boolean = false, modifierFn: Boolean = false, modifierFnLock: Boolean = false, modifierHyper: Boolean = false, modifierNumLock: Boolean = false, modifierOS: Boolean = false, modifierScrollLock: Boolean = false, modifierSuper: Boolean = false, modifierSymbol: Boolean = false, modifierSymbolLock: Boolean = false, view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): KeyboardEventInit {
val o = js("({})") as KeyboardEventInit val o = js("({})")
o.`key` = key o["key"] = key
o.`code` = code o["code"] = code
o.`location` = location o["location"] = location
o.`repeat` = repeat o["repeat"] = repeat
o.`isComposing` = isComposing o["isComposing"] = isComposing
o.`ctrlKey` = ctrlKey o["ctrlKey"] = ctrlKey
o.`shiftKey` = shiftKey o["shiftKey"] = shiftKey
o.`altKey` = altKey o["altKey"] = altKey
o.`metaKey` = metaKey o["metaKey"] = metaKey
o.`modifierAltGraph` = modifierAltGraph o["modifierAltGraph"] = modifierAltGraph
o.`modifierCapsLock` = modifierCapsLock o["modifierCapsLock"] = modifierCapsLock
o.`modifierFn` = modifierFn o["modifierFn"] = modifierFn
o.`modifierFnLock` = modifierFnLock o["modifierFnLock"] = modifierFnLock
o.`modifierHyper` = modifierHyper o["modifierHyper"] = modifierHyper
o.`modifierNumLock` = modifierNumLock o["modifierNumLock"] = modifierNumLock
o.`modifierOS` = modifierOS o["modifierOS"] = modifierOS
o.`modifierScrollLock` = modifierScrollLock o["modifierScrollLock"] = modifierScrollLock
o.`modifierSuper` = modifierSuper o["modifierSuper"] = modifierSuper
o.`modifierSymbol` = modifierSymbol o["modifierSymbol"] = modifierSymbol
o.`modifierSymbolLock` = modifierSymbolLock o["modifierSymbolLock"] = modifierSymbolLock
o.`view` = view o["view"] = view
o.`detail` = detail o["detail"] = detail
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -393,14 +399,15 @@ native public interface CompositionEventInit : UIEventInit {
var data: String var data: String
} }
suppress("NOTHING_TO_INLINE")
inline fun CompositionEventInit(data: String = "", view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): CompositionEventInit { inline fun CompositionEventInit(data: String = "", view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): CompositionEventInit {
val o = js("({})") as CompositionEventInit val o = js("({})")
o.`data` = data o["data"] = data
o.`view` = view o["view"] = view
o.`detail` = detail o["detail"] = detail
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
+171 -145
View File
@@ -1621,12 +1621,13 @@ native public interface TrackEventInit : EventInit {
var track: UnionAudioTrackOrTextTrackOrVideoTrack? var track: UnionAudioTrackOrTextTrackOrVideoTrack?
} }
suppress("NOTHING_TO_INLINE")
inline fun TrackEventInit(track: UnionAudioTrackOrTextTrackOrVideoTrack?, bubbles: Boolean = false, cancelable: Boolean = false): TrackEventInit { inline fun TrackEventInit(track: UnionAudioTrackOrTextTrackOrVideoTrack?, bubbles: Boolean = false, cancelable: Boolean = false): TrackEventInit {
val o = js("({})") as TrackEventInit val o = js("({})")
o.`track` = track o["track"] = track
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -2467,12 +2468,13 @@ native public interface AutocompleteErrorEventInit : EventInit {
var reason: String var reason: String
} }
suppress("NOTHING_TO_INLINE")
inline fun AutocompleteErrorEventInit(reason: String, bubbles: Boolean = false, cancelable: Boolean = false): AutocompleteErrorEventInit { inline fun AutocompleteErrorEventInit(reason: String, bubbles: Boolean = false, cancelable: Boolean = false): AutocompleteErrorEventInit {
val o = js("({})") as AutocompleteErrorEventInit val o = js("({})")
o.`reason` = reason o["reason"] = reason
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -2555,12 +2557,13 @@ native public interface RelatedEventInit : EventInit {
var relatedTarget: EventTarget? var relatedTarget: EventTarget?
} }
suppress("NOTHING_TO_INLINE")
inline fun RelatedEventInit(relatedTarget: EventTarget?, bubbles: Boolean = false, cancelable: Boolean = false): RelatedEventInit { inline fun RelatedEventInit(relatedTarget: EventTarget?, bubbles: Boolean = false, cancelable: Boolean = false): RelatedEventInit {
val o = js("({})") as RelatedEventInit val o = js("({})")
o.`relatedTarget` = relatedTarget o["relatedTarget"] = relatedTarget
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -2635,10 +2638,11 @@ native public interface CanvasRenderingContext2DSettings {
var alpha: Boolean var alpha: Boolean
} }
suppress("NOTHING_TO_INLINE")
inline fun CanvasRenderingContext2DSettings(alpha: Boolean = true): CanvasRenderingContext2DSettings { inline fun CanvasRenderingContext2DSettings(alpha: Boolean = true): CanvasRenderingContext2DSettings {
val o = js("({})") as CanvasRenderingContext2DSettings val o = js("({})")
o.`alpha` = alpha o["alpha"] = alpha
return o return o
} }
@@ -2815,17 +2819,18 @@ native public interface HitRegionOptions {
var role: String? var role: String?
} }
suppress("NOTHING_TO_INLINE")
inline fun HitRegionOptions(path: Path2D? = null, fillRule: String = "nonzero", id: String = "", parentID: String? = null, cursor: String = "inherit", control: Element? = null, label: String? = null, role: String? = null): HitRegionOptions { inline fun HitRegionOptions(path: Path2D? = null, fillRule: String = "nonzero", id: String = "", parentID: String? = null, cursor: String = "inherit", control: Element? = null, label: String? = null, role: String? = null): HitRegionOptions {
val o = js("({})") as HitRegionOptions val o = js("({})")
o.`path` = path o["path"] = path
o.`fillRule` = fillRule o["fillRule"] = fillRule
o.`id` = id o["id"] = id
o.`parentID` = parentID o["parentID"] = parentID
o.`cursor` = cursor o["cursor"] = cursor
o.`control` = control o["control"] = control
o.`label` = label o["label"] = label
o.`role` = role o["role"] = role
return o return o
} }
@@ -2947,36 +2952,37 @@ native public interface DragEventInit : MouseEventInit {
var dataTransfer: DataTransfer? var dataTransfer: DataTransfer?
} }
suppress("NOTHING_TO_INLINE")
inline fun DragEventInit(dataTransfer: DataTransfer?, screenX: Int = 0, screenY: Int = 0, clientX: Int = 0, clientY: Int = 0, button: Short = 0, buttons: Short = 0, relatedTarget: EventTarget? = null, ctrlKey: Boolean = false, shiftKey: Boolean = false, altKey: Boolean = false, metaKey: Boolean = false, modifierAltGraph: Boolean = false, modifierCapsLock: Boolean = false, modifierFn: Boolean = false, modifierFnLock: Boolean = false, modifierHyper: Boolean = false, modifierNumLock: Boolean = false, modifierOS: Boolean = false, modifierScrollLock: Boolean = false, modifierSuper: Boolean = false, modifierSymbol: Boolean = false, modifierSymbolLock: Boolean = false, view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): DragEventInit { inline fun DragEventInit(dataTransfer: DataTransfer?, screenX: Int = 0, screenY: Int = 0, clientX: Int = 0, clientY: Int = 0, button: Short = 0, buttons: Short = 0, relatedTarget: EventTarget? = null, ctrlKey: Boolean = false, shiftKey: Boolean = false, altKey: Boolean = false, metaKey: Boolean = false, modifierAltGraph: Boolean = false, modifierCapsLock: Boolean = false, modifierFn: Boolean = false, modifierFnLock: Boolean = false, modifierHyper: Boolean = false, modifierNumLock: Boolean = false, modifierOS: Boolean = false, modifierScrollLock: Boolean = false, modifierSuper: Boolean = false, modifierSymbol: Boolean = false, modifierSymbolLock: Boolean = false, view: Window? = null, detail: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): DragEventInit {
val o = js("({})") as DragEventInit val o = js("({})")
o.`dataTransfer` = dataTransfer o["dataTransfer"] = dataTransfer
o.`screenX` = screenX o["screenX"] = screenX
o.`screenY` = screenY o["screenY"] = screenY
o.`clientX` = clientX o["clientX"] = clientX
o.`clientY` = clientY o["clientY"] = clientY
o.`button` = button o["button"] = button
o.`buttons` = buttons o["buttons"] = buttons
o.`relatedTarget` = relatedTarget o["relatedTarget"] = relatedTarget
o.`ctrlKey` = ctrlKey o["ctrlKey"] = ctrlKey
o.`shiftKey` = shiftKey o["shiftKey"] = shiftKey
o.`altKey` = altKey o["altKey"] = altKey
o.`metaKey` = metaKey o["metaKey"] = metaKey
o.`modifierAltGraph` = modifierAltGraph o["modifierAltGraph"] = modifierAltGraph
o.`modifierCapsLock` = modifierCapsLock o["modifierCapsLock"] = modifierCapsLock
o.`modifierFn` = modifierFn o["modifierFn"] = modifierFn
o.`modifierFnLock` = modifierFnLock o["modifierFnLock"] = modifierFnLock
o.`modifierHyper` = modifierHyper o["modifierHyper"] = modifierHyper
o.`modifierNumLock` = modifierNumLock o["modifierNumLock"] = modifierNumLock
o.`modifierOS` = modifierOS o["modifierOS"] = modifierOS
o.`modifierScrollLock` = modifierScrollLock o["modifierScrollLock"] = modifierScrollLock
o.`modifierSuper` = modifierSuper o["modifierSuper"] = modifierSuper
o.`modifierSymbol` = modifierSymbol o["modifierSymbol"] = modifierSymbol
o.`modifierSymbolLock` = modifierSymbolLock o["modifierSymbolLock"] = modifierSymbolLock
o.`view` = view o["view"] = view
o.`detail` = detail o["detail"] = detail
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -3402,12 +3408,13 @@ native public interface PopStateEventInit : EventInit {
var state: Any? var state: Any?
} }
suppress("NOTHING_TO_INLINE")
inline fun PopStateEventInit(state: Any?, bubbles: Boolean = false, cancelable: Boolean = false): PopStateEventInit { inline fun PopStateEventInit(state: Any?, bubbles: Boolean = false, cancelable: Boolean = false): PopStateEventInit {
val o = js("({})") as PopStateEventInit val o = js("({})")
o.`state` = state o["state"] = state
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -3424,13 +3431,14 @@ native public interface HashChangeEventInit : EventInit {
var newURL: String var newURL: String
} }
suppress("NOTHING_TO_INLINE")
inline fun HashChangeEventInit(oldURL: String, newURL: String, bubbles: Boolean = false, cancelable: Boolean = false): HashChangeEventInit { inline fun HashChangeEventInit(oldURL: String, newURL: String, bubbles: Boolean = false, cancelable: Boolean = false): HashChangeEventInit {
val o = js("({})") as HashChangeEventInit val o = js("({})")
o.`oldURL` = oldURL o["oldURL"] = oldURL
o.`newURL` = newURL o["newURL"] = newURL
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -3444,12 +3452,13 @@ native public interface PageTransitionEventInit : EventInit {
var persisted: Boolean var persisted: Boolean
} }
suppress("NOTHING_TO_INLINE")
inline fun PageTransitionEventInit(persisted: Boolean, bubbles: Boolean = false, cancelable: Boolean = false): PageTransitionEventInit { inline fun PageTransitionEventInit(persisted: Boolean, bubbles: Boolean = false, cancelable: Boolean = false): PageTransitionEventInit {
val o = js("({})") as PageTransitionEventInit val o = js("({})")
o.`persisted` = persisted o["persisted"] = persisted
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -3522,16 +3531,17 @@ native public interface ErrorEventInit : EventInit {
var error: Any? var error: Any?
} }
suppress("NOTHING_TO_INLINE")
inline fun ErrorEventInit(message: String, filename: String, lineno: Int, colno: Int, error: Any?, bubbles: Boolean = false, cancelable: Boolean = false): ErrorEventInit { inline fun ErrorEventInit(message: String, filename: String, lineno: Int, colno: Int, error: Any?, bubbles: Boolean = false, cancelable: Boolean = false): ErrorEventInit {
val o = js("({})") as ErrorEventInit val o = js("({})")
o.`message` = message o["message"] = message
o.`filename` = filename o["filename"] = filename
o.`lineno` = lineno o["lineno"] = lineno
o.`colno` = colno o["colno"] = colno
o.`error` = error o["error"] = error
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -3657,16 +3667,17 @@ native public interface MessageEventInit : EventInit {
var ports: Array<MessagePort> var ports: Array<MessagePort>
} }
suppress("NOTHING_TO_INLINE")
inline fun MessageEventInit(data: Any?, origin: String, lastEventId: String, source: UnionMessagePortOrWindow?, ports: Array<MessagePort>, bubbles: Boolean = false, cancelable: Boolean = false): MessageEventInit { inline fun MessageEventInit(data: Any?, origin: String, lastEventId: String, source: UnionMessagePortOrWindow?, ports: Array<MessagePort>, bubbles: Boolean = false, cancelable: Boolean = false): MessageEventInit {
val o = js("({})") as MessageEventInit val o = js("({})")
o.`data` = data o["data"] = data
o.`origin` = origin o["origin"] = origin
o.`lastEventId` = lastEventId o["lastEventId"] = lastEventId
o.`source` = source o["source"] = source
o.`ports` = ports o["ports"] = ports
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -3700,10 +3711,11 @@ native public interface EventSourceInit {
var withCredentials: Boolean var withCredentials: Boolean
} }
suppress("NOTHING_TO_INLINE")
inline fun EventSourceInit(withCredentials: Boolean = false): EventSourceInit { inline fun EventSourceInit(withCredentials: Boolean = false): EventSourceInit {
val o = js("({})") as EventSourceInit val o = js("({})")
o.`withCredentials` = withCredentials o["withCredentials"] = withCredentials
return o return o
} }
@@ -3763,14 +3775,15 @@ native public interface CloseEventInit : EventInit {
var reason: String var reason: String
} }
suppress("NOTHING_TO_INLINE")
inline fun CloseEventInit(wasClean: Boolean, code: Short, reason: String, bubbles: Boolean = false, cancelable: Boolean = false): CloseEventInit { inline fun CloseEventInit(wasClean: Boolean, code: Short, reason: String, bubbles: Boolean = false, cancelable: Boolean = false): CloseEventInit {
val o = js("({})") as CloseEventInit val o = js("({})")
o.`wasClean` = wasClean o["wasClean"] = wasClean
o.`code` = code o["code"] = code
o.`reason` = reason o["reason"] = reason
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -3961,16 +3974,17 @@ native public interface StorageEventInit : EventInit {
var storageArea: Storage? var storageArea: Storage?
} }
suppress("NOTHING_TO_INLINE")
inline fun StorageEventInit(key: String?, oldValue: String?, newValue: String?, url: String, storageArea: Storage?, bubbles: Boolean = false, cancelable: Boolean = false): StorageEventInit { inline fun StorageEventInit(key: String?, oldValue: String?, newValue: String?, url: String, storageArea: Storage?, bubbles: Boolean = false, cancelable: Boolean = false): StorageEventInit {
val o = js("({})") as StorageEventInit val o = js("({})")
o.`key` = key o["key"] = key
o.`oldValue` = oldValue o["oldValue"] = oldValue
o.`newValue` = newValue o["newValue"] = newValue
o.`url` = url o["url"] = url
o.`storageArea` = storageArea o["storageArea"] = storageArea
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -4226,11 +4240,12 @@ native public interface EventInit {
var cancelable: Boolean var cancelable: Boolean
} }
suppress("NOTHING_TO_INLINE")
inline fun EventInit(bubbles: Boolean = false, cancelable: Boolean = false): EventInit { inline fun EventInit(bubbles: Boolean = false, cancelable: Boolean = false): EventInit {
val o = js("({})") as EventInit val o = js("({})")
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -4245,12 +4260,13 @@ native public interface CustomEventInit : EventInit {
var detail: Any? var detail: Any?
} }
suppress("NOTHING_TO_INLINE")
inline fun CustomEventInit(detail: Any? = null, bubbles: Boolean = false, cancelable: Boolean = false): CustomEventInit { inline fun CustomEventInit(detail: Any? = null, bubbles: Boolean = false, cancelable: Boolean = false): CustomEventInit {
val o = js("({})") as CustomEventInit val o = js("({})")
o.`detail` = detail o["detail"] = detail
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -4287,16 +4303,17 @@ native public interface MutationObserverInit {
var attributeFilter: Array<String> var attributeFilter: Array<String>
} }
suppress("NOTHING_TO_INLINE")
inline fun MutationObserverInit(childList: Boolean = false, attributes: Boolean, characterData: Boolean, subtree: Boolean = false, attributeOldValue: Boolean, characterDataOldValue: Boolean, attributeFilter: Array<String>): MutationObserverInit { inline fun MutationObserverInit(childList: Boolean = false, attributes: Boolean, characterData: Boolean, subtree: Boolean = false, attributeOldValue: Boolean, characterDataOldValue: Boolean, attributeFilter: Array<String>): MutationObserverInit {
val o = js("({})") as MutationObserverInit val o = js("({})")
o.`childList` = childList o["childList"] = childList
o.`attributes` = attributes o["attributes"] = attributes
o.`characterData` = characterData o["characterData"] = characterData
o.`subtree` = subtree o["subtree"] = subtree
o.`attributeOldValue` = attributeOldValue o["attributeOldValue"] = attributeOldValue
o.`characterDataOldValue` = characterDataOldValue o["characterDataOldValue"] = characterDataOldValue
o.`attributeFilter` = attributeFilter o["attributeFilter"] = attributeFilter
return o return o
} }
@@ -4766,13 +4783,14 @@ native public interface EditingBeforeInputEventInit : EventInit {
var value: String var value: String
} }
suppress("NOTHING_TO_INLINE")
inline fun EditingBeforeInputEventInit(command: String, value: String, bubbles: Boolean = false, cancelable: Boolean = false): EditingBeforeInputEventInit { inline fun EditingBeforeInputEventInit(command: String, value: String, bubbles: Boolean = false, cancelable: Boolean = false): EditingBeforeInputEventInit {
val o = js("({})") as EditingBeforeInputEventInit val o = js("({})")
o.`command` = command o["command"] = command
o.`value` = value o["value"] = value
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -4789,13 +4807,14 @@ native public interface EditingInputEventInit : EventInit {
var value: String var value: String
} }
suppress("NOTHING_TO_INLINE")
inline fun EditingInputEventInit(command: String, value: String, bubbles: Boolean = false, cancelable: Boolean = false): EditingInputEventInit { inline fun EditingInputEventInit(command: String, value: String, bubbles: Boolean = false, cancelable: Boolean = false): EditingInputEventInit {
val o = js("({})") as EditingInputEventInit val o = js("({})")
o.`command` = command o["command"] = command
o.`value` = value o["value"] = value
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -4836,13 +4855,14 @@ native public interface DOMPointInit {
var w: Double var w: Double
} }
suppress("NOTHING_TO_INLINE")
inline fun DOMPointInit(x: Double = 0.0, y: Double = 0.0, z: Double = 0.0, w: Double = 1.0): DOMPointInit { inline fun DOMPointInit(x: Double = 0.0, y: Double = 0.0, z: Double = 0.0, w: Double = 1.0): DOMPointInit {
val o = js("({})") as DOMPointInit val o = js("({})")
o.`x` = x o["x"] = x
o.`y` = y o["y"] = y
o.`z` = z o["z"] = z
o.`w` = w o["w"] = w
return o return o
} }
@@ -4888,13 +4908,14 @@ native public interface DOMRectInit {
var height: Double var height: Double
} }
suppress("NOTHING_TO_INLINE")
inline fun DOMRectInit(x: Double = 0.0, y: Double = 0.0, width: Double = 0.0, height: Double = 0.0): DOMRectInit { inline fun DOMRectInit(x: Double = 0.0, y: Double = 0.0, width: Double = 0.0, height: Double = 0.0): DOMRectInit {
val o = js("({})") as DOMRectInit val o = js("({})")
o.`x` = x o["x"] = x
o.`y` = y o["y"] = y
o.`width` = width o["width"] = width
o.`height` = height o["height"] = height
return o return o
} }
@@ -5072,10 +5093,11 @@ native public interface ScrollOptions {
var behavior: String var behavior: String
} }
suppress("NOTHING_TO_INLINE")
inline fun ScrollOptions(behavior: String = "auto"): ScrollOptions { inline fun ScrollOptions(behavior: String = "auto"): ScrollOptions {
val o = js("({})") as ScrollOptions val o = js("({})")
o.`behavior` = behavior o["behavior"] = behavior
return o return o
} }
@@ -5116,11 +5138,12 @@ native public interface ScrollOptionsHorizontal : ScrollOptions {
var x: Double var x: Double
} }
suppress("NOTHING_TO_INLINE")
inline fun ScrollOptionsHorizontal(x: Double, behavior: String = "auto"): ScrollOptionsHorizontal { inline fun ScrollOptionsHorizontal(x: Double, behavior: String = "auto"): ScrollOptionsHorizontal {
val o = js("({})") as ScrollOptionsHorizontal val o = js("({})")
o.`x` = x o["x"] = x
o.`behavior` = behavior o["behavior"] = behavior
return o return o
} }
@@ -5129,11 +5152,12 @@ native public interface ScrollOptionsVertical : ScrollOptions {
var y: Double var y: Double
} }
suppress("NOTHING_TO_INLINE")
inline fun ScrollOptionsVertical(y: Double, behavior: String = "auto"): ScrollOptionsVertical { inline fun ScrollOptionsVertical(y: Double, behavior: String = "auto"): ScrollOptionsVertical {
val o = js("({})") as ScrollOptionsVertical val o = js("({})")
o.`y` = y o["y"] = y
o.`behavior` = behavior o["behavior"] = behavior
return o return o
} }
@@ -5143,11 +5167,12 @@ native public interface BoxQuadOptions {
var relativeTo: GeometryNode var relativeTo: GeometryNode
} }
suppress("NOTHING_TO_INLINE")
inline fun BoxQuadOptions(box: String = "border", relativeTo: GeometryNode): BoxQuadOptions { inline fun BoxQuadOptions(box: String = "border", relativeTo: GeometryNode): BoxQuadOptions {
val o = js("({})") as BoxQuadOptions val o = js("({})")
o.`box` = box o["box"] = box
o.`relativeTo` = relativeTo o["relativeTo"] = relativeTo
return o return o
} }
@@ -5157,11 +5182,12 @@ native public interface ConvertCoordinateOptions {
var toBox: String var toBox: String
} }
suppress("NOTHING_TO_INLINE")
inline fun ConvertCoordinateOptions(fromBox: String = "border", toBox: String = "border"): ConvertCoordinateOptions { inline fun ConvertCoordinateOptions(fromBox: String = "border", toBox: String = "border"): ConvertCoordinateOptions {
val o = js("({})") as ConvertCoordinateOptions val o = js("({})")
o.`fromBox` = fromBox o["fromBox"] = fromBox
o.`toBox` = toBox o["toBox"] = toBox
return o return o
} }
+14 -12
View File
@@ -68,16 +68,17 @@ native public interface RequestInit {
var redirect: String var redirect: String
} }
suppress("NOTHING_TO_INLINE")
inline fun RequestInit(method: String, headers: dynamic, body: dynamic, mode: String, credentials: String, cache: String, redirect: String): RequestInit { inline fun RequestInit(method: String, headers: dynamic, body: dynamic, mode: String, credentials: String, cache: String, redirect: String): RequestInit {
val o = js("({})") as RequestInit val o = js("({})")
o.`method` = method o["method"] = method
o.`headers` = headers o["headers"] = headers
o.`body` = body o["body"] = body
o.`mode` = mode o["mode"] = mode
o.`credentials` = credentials o["credentials"] = credentials
o.`cache` = cache o["cache"] = cache
o.`redirect` = redirect o["redirect"] = redirect
return o return o
} }
@@ -116,12 +117,13 @@ native public interface ResponseInit {
var headers: dynamic var headers: dynamic
} }
suppress("NOTHING_TO_INLINE")
inline fun ResponseInit(status: Short = 200, statusText: String = "OK", headers: dynamic): ResponseInit { inline fun ResponseInit(status: Short = 200, statusText: String = "OK", headers: dynamic): ResponseInit {
val o = js("({})") as ResponseInit val o = js("({})")
o.`status` = status o["status"] = status
o.`statusText` = statusText o["statusText"] = statusText
o.`headers` = headers o["headers"] = headers
return o return o
} }
+12 -10
View File
@@ -22,13 +22,13 @@ import org.w3c.xhr.*
native public open class Blob() : ImageBitmapSource { native public open class Blob() : ImageBitmapSource {
constructor(blobParts: Array<dynamic>, options: BlobPropertyBag = noImpl) : this() constructor(blobParts: Array<dynamic>, options: BlobPropertyBag = noImpl) : this()
open val size: Long open val size: Int
get() = noImpl get() = noImpl
open val type: String open val type: String
get() = noImpl get() = noImpl
open val isClosed: Boolean open val isClosed: Boolean
get() = noImpl get() = noImpl
fun slice(start: Long = noImpl, end: Long = noImpl, contentType: String = noImpl): Blob = noImpl fun slice(start: Int = noImpl, end: Int = noImpl, contentType: String = noImpl): Blob = noImpl
fun close(): Unit = noImpl fun close(): Unit = noImpl
} }
@@ -36,10 +36,11 @@ native public interface BlobPropertyBag {
var type: String var type: String
} }
suppress("NOTHING_TO_INLINE")
inline fun BlobPropertyBag(type: String = ""): BlobPropertyBag { inline fun BlobPropertyBag(type: String = ""): BlobPropertyBag {
val o = js("({})") as BlobPropertyBag val o = js("({})")
o.`type` = type o["type"] = type
return o return o
} }
@@ -47,20 +48,21 @@ inline fun BlobPropertyBag(type: String = ""): BlobPropertyBag {
native public open class File(fileBits: Array<dynamic>, fileName: String, options: FilePropertyBag = noImpl) : Blob() { native public open class File(fileBits: Array<dynamic>, fileName: String, options: FilePropertyBag = noImpl) : Blob() {
open val name: String open val name: String
get() = noImpl get() = noImpl
open val lastModified: Long open val lastModified: Int
get() = noImpl get() = noImpl
} }
native public interface FilePropertyBag { native public interface FilePropertyBag {
var type: String var type: String
var lastModified: Long var lastModified: Int
} }
inline fun FilePropertyBag(type: String = "", lastModified: Long): FilePropertyBag { suppress("NOTHING_TO_INLINE")
val o = js("({})") as FilePropertyBag inline fun FilePropertyBag(type: String = "", lastModified: Int): FilePropertyBag {
val o = js("({})")
o.`type` = type o["type"] = type
o.`lastModified` = lastModified o["lastModified"] = lastModified
return o return o
} }
@@ -76,21 +76,22 @@ native public interface NotificationOptions {
var data: Any? var data: Any?
} }
suppress("NOTHING_TO_INLINE")
inline fun NotificationOptions(dir: String = "auto", lang: String = "", body: String = "", tag: String = "", icon: String, sound: String, vibrate: dynamic, renotify: Boolean = false, silent: Boolean = false, noscreen: Boolean = false, sticky: Boolean = false, data: Any? = null): NotificationOptions { inline fun NotificationOptions(dir: String = "auto", lang: String = "", body: String = "", tag: String = "", icon: String, sound: String, vibrate: dynamic, renotify: Boolean = false, silent: Boolean = false, noscreen: Boolean = false, sticky: Boolean = false, data: Any? = null): NotificationOptions {
val o = js("({})") as NotificationOptions val o = js("({})")
o.`dir` = dir o["dir"] = dir
o.`lang` = lang o["lang"] = lang
o.`body` = body o["body"] = body
o.`tag` = tag o["tag"] = tag
o.`icon` = icon o["icon"] = icon
o.`sound` = sound o["sound"] = sound
o.`vibrate` = vibrate o["vibrate"] = vibrate
o.`renotify` = renotify o["renotify"] = renotify
o.`silent` = silent o["silent"] = silent
o.`noscreen` = noscreen o["noscreen"] = noscreen
o.`sticky` = sticky o["sticky"] = sticky
o.`data` = data o["data"] = data
return o return o
} }
@@ -99,10 +100,11 @@ native public interface GetNotificationOptions {
var tag: String var tag: String
} }
suppress("NOTHING_TO_INLINE")
inline fun GetNotificationOptions(tag: String = ""): GetNotificationOptions { inline fun GetNotificationOptions(tag: String = ""): GetNotificationOptions {
val o = js("({})") as GetNotificationOptions val o = js("({})")
o.`tag` = tag o["tag"] = tag
return o return o
} }
@@ -116,12 +118,13 @@ native public interface NotificationEventInit : ExtendableEventInit {
var notification: Notification var notification: Notification
} }
suppress("NOTHING_TO_INLINE")
inline fun NotificationEventInit(notification: Notification, bubbles: Boolean = false, cancelable: Boolean = false): NotificationEventInit { inline fun NotificationEventInit(notification: Notification, bubbles: Boolean = false, cancelable: Boolean = false): NotificationEventInit {
val o = js("({})") as NotificationEventInit val o = js("({})")
o.`notification` = notification o["notification"] = notification
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -29,47 +29,47 @@ native public interface Performance {
} }
native public interface PerformanceTiming { native public interface PerformanceTiming {
val navigationStart: Long val navigationStart: Int
get() = noImpl get() = noImpl
val unloadEventStart: Long val unloadEventStart: Int
get() = noImpl get() = noImpl
val unloadEventEnd: Long val unloadEventEnd: Int
get() = noImpl get() = noImpl
val redirectStart: Long val redirectStart: Int
get() = noImpl get() = noImpl
val redirectEnd: Long val redirectEnd: Int
get() = noImpl get() = noImpl
val fetchStart: Long val fetchStart: Int
get() = noImpl get() = noImpl
val domainLookupStart: Long val domainLookupStart: Int
get() = noImpl get() = noImpl
val domainLookupEnd: Long val domainLookupEnd: Int
get() = noImpl get() = noImpl
val connectStart: Long val connectStart: Int
get() = noImpl get() = noImpl
val connectEnd: Long val connectEnd: Int
get() = noImpl get() = noImpl
val secureConnectionStart: Long val secureConnectionStart: Int
get() = noImpl get() = noImpl
val requestStart: Long val requestStart: Int
get() = noImpl get() = noImpl
val responseStart: Long val responseStart: Int
get() = noImpl get() = noImpl
val responseEnd: Long val responseEnd: Int
get() = noImpl get() = noImpl
val domLoading: Long val domLoading: Int
get() = noImpl get() = noImpl
val domInteractive: Long val domInteractive: Int
get() = noImpl get() = noImpl
val domContentLoadedEventStart: Long val domContentLoadedEventStart: Int
get() = noImpl get() = noImpl
val domContentLoadedEventEnd: Long val domContentLoadedEventEnd: Int
get() = noImpl get() = noImpl
val domComplete: Long val domComplete: Int
get() = noImpl get() = noImpl
val loadEventStart: Long val loadEventStart: Int
get() = noImpl get() = noImpl
val loadEventEnd: Long val loadEventEnd: Int
get() = noImpl get() = noImpl
} }
@@ -106,10 +106,11 @@ native public interface RegistrationOptions {
var scope: String var scope: String
} }
suppress("NOTHING_TO_INLINE")
inline fun RegistrationOptions(scope: String): RegistrationOptions { inline fun RegistrationOptions(scope: String): RegistrationOptions {
val o = js("({})") as RegistrationOptions val o = js("({})")
o.`scope` = scope o["scope"] = scope
return o return o
} }
@@ -136,16 +137,17 @@ native public interface ServiceWorkerMessageEventInit : EventInit {
var ports: Array<MessagePort> var ports: Array<MessagePort>
} }
suppress("NOTHING_TO_INLINE")
inline fun ServiceWorkerMessageEventInit(data: Any?, origin: String, lastEventId: String, source: UnionMessagePortOrServiceWorker?, ports: Array<MessagePort>, bubbles: Boolean = false, cancelable: Boolean = false): ServiceWorkerMessageEventInit { inline fun ServiceWorkerMessageEventInit(data: Any?, origin: String, lastEventId: String, source: UnionMessagePortOrServiceWorker?, ports: Array<MessagePort>, bubbles: Boolean = false, cancelable: Boolean = false): ServiceWorkerMessageEventInit {
val o = js("({})") as ServiceWorkerMessageEventInit val o = js("({})")
o.`data` = data o["data"] = data
o.`origin` = origin o["origin"] = origin
o.`lastEventId` = lastEventId o["lastEventId"] = lastEventId
o.`source` = source o["source"] = source
o.`ports` = ports o["ports"] = ports
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -179,11 +181,12 @@ native public interface ClientQueryOptions {
var type: String var type: String
} }
suppress("NOTHING_TO_INLINE")
inline fun ClientQueryOptions(includeUncontrolled: Boolean = false, type: String = "window"): ClientQueryOptions { inline fun ClientQueryOptions(includeUncontrolled: Boolean = false, type: String = "window"): ClientQueryOptions {
val o = js("({})") as ClientQueryOptions val o = js("({})")
o.`includeUncontrolled` = includeUncontrolled o["includeUncontrolled"] = includeUncontrolled
o.`type` = type o["type"] = type
return o return o
} }
@@ -195,11 +198,12 @@ native public open class ExtendableEvent(type: String, eventInitDict: Extendable
native public interface ExtendableEventInit : EventInit { native public interface ExtendableEventInit : EventInit {
} }
suppress("NOTHING_TO_INLINE")
inline fun ExtendableEventInit(bubbles: Boolean = false, cancelable: Boolean = false): ExtendableEventInit { inline fun ExtendableEventInit(bubbles: Boolean = false, cancelable: Boolean = false): ExtendableEventInit {
val o = js("({})") as ExtendableEventInit val o = js("({})")
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -220,14 +224,15 @@ native public interface FetchEventInit : ExtendableEventInit {
var isReload: Boolean var isReload: Boolean
} }
suppress("NOTHING_TO_INLINE")
inline fun FetchEventInit(request: Request, client: Client, isReload: Boolean = false, bubbles: Boolean = false, cancelable: Boolean = false): FetchEventInit { inline fun FetchEventInit(request: Request, client: Client, isReload: Boolean = false, bubbles: Boolean = false, cancelable: Boolean = false): FetchEventInit {
val o = js("({})") as FetchEventInit val o = js("({})")
o.`request` = request o["request"] = request
o.`client` = client o["client"] = client
o.`isReload` = isReload o["isReload"] = isReload
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -254,16 +259,17 @@ native public interface ExtendableMessageEventInit : ExtendableEventInit {
var ports: Array<MessagePort> var ports: Array<MessagePort>
} }
suppress("NOTHING_TO_INLINE")
inline fun ExtendableMessageEventInit(data: Any?, origin: String, lastEventId: String, source: UnionClientOrMessagePortOrServiceWorker?, ports: Array<MessagePort>, bubbles: Boolean = false, cancelable: Boolean = false): ExtendableMessageEventInit { inline fun ExtendableMessageEventInit(data: Any?, origin: String, lastEventId: String, source: UnionClientOrMessagePortOrServiceWorker?, ports: Array<MessagePort>, bubbles: Boolean = false, cancelable: Boolean = false): ExtendableMessageEventInit {
val o = js("({})") as ExtendableMessageEventInit val o = js("({})")
o.`data` = data o["data"] = data
o.`origin` = origin o["origin"] = origin
o.`lastEventId` = lastEventId o["lastEventId"] = lastEventId
o.`source` = source o["source"] = source
o.`ports` = ports o["ports"] = ports
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
@@ -285,13 +291,14 @@ native public interface CacheQueryOptions {
var cacheName: String var cacheName: String
} }
suppress("NOTHING_TO_INLINE")
inline fun CacheQueryOptions(ignoreSearch: Boolean = false, ignoreMethod: Boolean = false, ignoreVary: Boolean = false, cacheName: String): CacheQueryOptions { inline fun CacheQueryOptions(ignoreSearch: Boolean = false, ignoreMethod: Boolean = false, ignoreVary: Boolean = false, cacheName: String): CacheQueryOptions {
val o = js("({})") as CacheQueryOptions val o = js("({})")
o.`ignoreSearch` = ignoreSearch o["ignoreSearch"] = ignoreSearch
o.`ignoreMethod` = ignoreMethod o["ignoreMethod"] = ignoreMethod
o.`ignoreVary` = ignoreVary o["ignoreVary"] = ignoreVary
o.`cacheName` = cacheName o["cacheName"] = cacheName
return o return o
} }
@@ -303,13 +310,14 @@ native public interface CacheBatchOperation {
var options: CacheQueryOptions var options: CacheQueryOptions
} }
suppress("NOTHING_TO_INLINE")
inline fun CacheBatchOperation(type: String, request: Request, response: Response, options: CacheQueryOptions): CacheBatchOperation { inline fun CacheBatchOperation(type: String, request: Request, response: Response, options: CacheQueryOptions): CacheBatchOperation {
val o = js("({})") as CacheBatchOperation val o = js("({})")
o.`type` = type o["type"] = type
o.`request` = request o["request"] = request
o.`response` = response o["response"] = response
o.`options` = options o["options"] = options
return o return o
} }
+12 -11
View File
@@ -106,26 +106,27 @@ native public open class FormData(form: HTMLFormElement = noImpl) {
native public open class ProgressEvent(type: String, eventInitDict: ProgressEventInit = noImpl) : Event(type, eventInitDict) { native public open class ProgressEvent(type: String, eventInitDict: ProgressEventInit = noImpl) : Event(type, eventInitDict) {
open val lengthComputable: Boolean open val lengthComputable: Boolean
get() = noImpl get() = noImpl
open val loaded: Long open val loaded: Int
get() = noImpl get() = noImpl
open val total: Long open val total: Int
get() = noImpl get() = noImpl
} }
native public interface ProgressEventInit : EventInit { native public interface ProgressEventInit : EventInit {
var lengthComputable: Boolean var lengthComputable: Boolean
var loaded: Long var loaded: Int
var total: Long var total: Int
} }
inline fun ProgressEventInit(lengthComputable: Boolean = false, loaded: Long = 0, total: Long = 0, bubbles: Boolean = false, cancelable: Boolean = false): ProgressEventInit { suppress("NOTHING_TO_INLINE")
val o = js("({})") as ProgressEventInit inline fun ProgressEventInit(lengthComputable: Boolean = false, loaded: Int = 0, total: Int = 0, bubbles: Boolean = false, cancelable: Boolean = false): ProgressEventInit {
val o = js("({})")
o.`lengthComputable` = lengthComputable o["lengthComputable"] = lengthComputable
o.`loaded` = loaded o["loaded"] = loaded
o.`total` = total o["total"] = total
o.`bubbles` = bubbles o["bubbles"] = bubbles
o.`cancelable` = cancelable o["cancelable"] = cancelable
return o return o
} }
+6 -6
View File
@@ -414,14 +414,14 @@ class DefinitionVisitor(val extendedAttributes: List<ExtendedAttribute>, val nam
} }
override fun visitReadOnly(ctx: WebIDLParser.ReadOnlyContext): Definition { override fun visitReadOnly(ctx: WebIDLParser.ReadOnlyContext): Definition {
readOnly = true return visitReadOnlyImpl(ctx)
visitChildren(ctx)
readOnly = false
return defaultResult()
} }
override fun visitReadonlyMemberRest(ctx: ReadonlyMemberRestContext?): Definition? { override fun visitReadonlyMemberRest(ctx: ReadonlyMemberRestContext): Definition? {
return visitReadOnlyImpl(ctx)
}
private fun visitReadOnlyImpl(ctx: ParserRuleContext): Definition {
readOnly = true readOnly = true
visitChildren(ctx) visitChildren(ctx)
readOnly = false readOnly = false
@@ -32,7 +32,7 @@ private fun Appendable.renderAttributeDeclaration(arg: GenerateAttribute, overri
} }
} }
private fun Appendable.renderAttributeDeclarationAsProperty(arg: GenerateAttribute, override: Boolean, open: Boolean, commented: Boolean, level: Int, omitDefaults: Boolean) { private fun Appendable.renderAttributeDeclarationAsProperty(arg: GenerateAttribute, override: Boolean, open: Boolean, commented: Boolean, level: Int, omitDefaults: Boolean = false) {
indent(commented, level) indent(commented, level)
renderAttributeDeclaration(arg, override, open, omitDefaults) renderAttributeDeclaration(arg, override, open, omitDefaults)
@@ -169,10 +169,10 @@ fun Appendable.render(allTypes: Map<String, GenerateTraitOrClass>, typeNamesToUn
indent(false, 1) indent(false, 1)
appendln("companion object {") appendln("companion object {")
iface.constants.forEach { iface.constants.forEach {
renderAttributeDeclarationAsProperty(it, override = false, open = false, level = 2, commented = it.isCommented(iface.name), omitDefaults = false) renderAttributeDeclarationAsProperty(it, override = false, open = false, level = 2, commented = it.isCommented(iface.name))
} }
staticAttributes.forEach { staticAttributes.forEach {
renderAttributeDeclarationAsProperty(it, override = false, open = false, level = 2, commented = it.isCommented(iface.name), omitDefaults = false) renderAttributeDeclarationAsProperty(it, override = false, open = false, level = 2, commented = it.isCommented(iface.name))
} }
staticFunctions.forEach { staticFunctions.forEach {
renderFunctionDeclaration(it.fixRequiredArguments(iface.name), override = false, level = 2, commented = it.isCommented(iface.name)) renderFunctionDeclaration(it.fixRequiredArguments(iface.name), override = false, level = 2, commented = it.isCommented(iface.name))
@@ -192,17 +192,18 @@ fun Appendable.render(allTypes: Map<String, GenerateTraitOrClass>, typeNamesToUn
fun Appendable.renderBuilderFunction(dictionary: GenerateTraitOrClass, allSuperTypes: List<GenerateTraitOrClass>, allTypes: Set<String>) { fun Appendable.renderBuilderFunction(dictionary: GenerateTraitOrClass, allSuperTypes: List<GenerateTraitOrClass>, allTypes: Set<String>) {
val fields = (dictionary.memberAttributes + allSuperTypes.flatMap { it.memberAttributes }).distinctBy { it.signature }.map { it.copy(kind = AttributeKind.ARGUMENT) }.dynamicIfUnknownType(allTypes) val fields = (dictionary.memberAttributes + allSuperTypes.flatMap { it.memberAttributes }).distinctBy { it.signature }.map { it.copy(kind = AttributeKind.ARGUMENT) }.dynamicIfUnknownType(allTypes)
appendln("suppress(\"NOTHING_TO_INLINE\")")
append("inline fun ${dictionary.name}") append("inline fun ${dictionary.name}")
renderArgumentsDeclaration(fields) renderArgumentsDeclaration(fields)
appendln(": ${dictionary.name} {") appendln(": ${dictionary.name} {")
indent(level = 1) indent(level = 1)
appendln("val o = js(\"({})\") as ${dictionary.name}") appendln("val o = js(\"({})\")")
appendln() appendln()
for (field in fields) { for (field in fields) {
indent(level = 1) indent(level = 1)
appendln("o.`${field.name}` = ${field.name.replaceKeywords()}") appendln("o[\"${field.name}\"] = ${field.name.replaceKeywords()}")
} }
appendln() appendln()
@@ -20,8 +20,8 @@ import java.util.*
private val typeMapper = mapOf( private val typeMapper = mapOf(
"unsignedlong" to SimpleType("Int", false), "unsignedlong" to SimpleType("Int", false),
"unsignedlonglong" to SimpleType("Long", false), "unsignedlonglong" to SimpleType("Int", false),
"longlong" to SimpleType("Long", false), "longlong" to SimpleType("Int", false),
"unsignedshort" to SimpleType("Short", false), "unsignedshort" to SimpleType("Short", false),
"unsignedbyte" to SimpleType("Byte", false), "unsignedbyte" to SimpleType("Byte", false),
"octet" to SimpleType("Byte", false), "octet" to SimpleType("Byte", false),