IDL2K restrict readonly attributes to vals

This commit is contained in:
Sergey Mashkov
2015-06-16 19:44:48 +03:00
parent c0c0f6152a
commit 2cc708c5a9
14 changed files with 1137 additions and 2043 deletions

View File

@@ -56,39 +56,30 @@ native public interface WebGLUniformLocation {
}
native public interface WebGLActiveInfo {
var size: Int
val size: Int
get() = noImpl
set(value) = noImpl
var type: Int
val type: Int
get() = noImpl
set(value) = noImpl
var name: String
val name: String
get() = noImpl
set(value) = noImpl
}
native public interface WebGLShaderPrecisionFormat {
var rangeMin: Int
val rangeMin: Int
get() = noImpl
set(value) = noImpl
var rangeMax: Int
val rangeMax: Int
get() = noImpl
set(value) = noImpl
var precision: Int
val precision: Int
get() = noImpl
set(value) = noImpl
}
native public interface WebGLRenderingContext : RenderingContext {
var canvas: HTMLCanvasElement
val canvas: HTMLCanvasElement
get() = noImpl
set(value) = noImpl
var drawingBufferWidth: Int
val drawingBufferWidth: Int
get() = noImpl
set(value) = noImpl
var drawingBufferHeight: Int
val drawingBufferHeight: Int
get() = noImpl
set(value) = noImpl
fun getContextAttributes(): WebGLContextAttributes? = noImpl
fun isContextLost(): Boolean = noImpl
fun getSupportedExtensions(): Array<String>? = noImpl
@@ -546,9 +537,8 @@ native public interface WebGLRenderingContext : RenderingContext {
}
native public open class WebGLContextEvent(type: String, eventInit: WebGLContextEventInit = noImpl) : Event(type, noImpl) {
var statusMessage: String
open val statusMessage: String
get() = noImpl
set(value) = noImpl
}
native public open class WebGLContextEventInit : EventInit() {
@@ -556,9 +546,8 @@ native public open class WebGLContextEventInit : EventInit() {
}
native public open class ArrayBuffer(length: Int) : Transferable {
var byteLength: Int
open val byteLength: Int
get() = noImpl
set(value) = noImpl
fun slice(begin: Int, end: Int = noImpl): ArrayBuffer = noImpl
companion object {
@@ -571,18 +560,14 @@ native public open class Int8Array : ArrayBufferView {
constructor(array: Int8Array)
constructor(array: Array<Byte>)
constructor(buffer: ArrayBuffer, byteOffset: Int = noImpl, length: Int = noImpl)
var length: Int
open val length: Int
get() = noImpl
set(value) = noImpl
var buffer: ArrayBuffer
open val buffer: ArrayBuffer
get() = noImpl
set(value) = noImpl
var byteOffset: Int
open val byteOffset: Int
get() = noImpl
set(value) = noImpl
var byteLength: Int
open val byteLength: Int
get() = noImpl
set(value) = noImpl
fun get(index: Int): Byte = noImpl
fun set(index: Int, value: Byte): Unit = noImpl
fun set(array: Int8Array, offset: Int = noImpl): Unit = noImpl
@@ -599,18 +584,14 @@ native public open class Uint8Array : ArrayBufferView {
constructor(array: Uint8Array)
constructor(array: Array<Byte>)
constructor(buffer: ArrayBuffer, byteOffset: Int = noImpl, length: Int = noImpl)
var length: Int
open val length: Int
get() = noImpl
set(value) = noImpl
var buffer: ArrayBuffer
open val buffer: ArrayBuffer
get() = noImpl
set(value) = noImpl
var byteOffset: Int
open val byteOffset: Int
get() = noImpl
set(value) = noImpl
var byteLength: Int
open val byteLength: Int
get() = noImpl
set(value) = noImpl
fun get(index: Int): Byte = noImpl
fun set(index: Int, value: Byte): Unit = noImpl
fun set(array: Uint8Array, offset: Int = noImpl): Unit = noImpl
@@ -627,18 +608,14 @@ native public open class Uint8ClampedArray : ArrayBufferView {
constructor(array: Uint8ClampedArray)
constructor(array: Array<Byte>)
constructor(buffer: ArrayBuffer, byteOffset: Int = noImpl, length: Int = noImpl)
var length: Int
open val length: Int
get() = noImpl
set(value) = noImpl
var buffer: ArrayBuffer
open val buffer: ArrayBuffer
get() = noImpl
set(value) = noImpl
var byteOffset: Int
open val byteOffset: Int
get() = noImpl
set(value) = noImpl
var byteLength: Int
open val byteLength: Int
get() = noImpl
set(value) = noImpl
fun get(index: Int): Byte = noImpl
fun set(index: Int, value: Byte): Unit = noImpl
fun set(array: Uint8ClampedArray, offset: Int = noImpl): Unit = noImpl
@@ -655,18 +632,14 @@ native public open class Int16Array : ArrayBufferView {
constructor(array: Int16Array)
constructor(array: Array<Short>)
constructor(buffer: ArrayBuffer, byteOffset: Int = noImpl, length: Int = noImpl)
var length: Int
open val length: Int
get() = noImpl
set(value) = noImpl
var buffer: ArrayBuffer
open val buffer: ArrayBuffer
get() = noImpl
set(value) = noImpl
var byteOffset: Int
open val byteOffset: Int
get() = noImpl
set(value) = noImpl
var byteLength: Int
open val byteLength: Int
get() = noImpl
set(value) = noImpl
fun get(index: Int): Short = noImpl
fun set(index: Int, value: Short): Unit = noImpl
fun set(array: Int16Array, offset: Int = noImpl): Unit = noImpl
@@ -683,18 +656,14 @@ native public open class Uint16Array : ArrayBufferView {
constructor(array: Uint16Array)
constructor(array: Array<Short>)
constructor(buffer: ArrayBuffer, byteOffset: Int = noImpl, length: Int = noImpl)
var length: Int
open val length: Int
get() = noImpl
set(value) = noImpl
var buffer: ArrayBuffer
open val buffer: ArrayBuffer
get() = noImpl
set(value) = noImpl
var byteOffset: Int
open val byteOffset: Int
get() = noImpl
set(value) = noImpl
var byteLength: Int
open val byteLength: Int
get() = noImpl
set(value) = noImpl
fun get(index: Int): Short = noImpl
fun set(index: Int, value: Short): Unit = noImpl
fun set(array: Uint16Array, offset: Int = noImpl): Unit = noImpl
@@ -711,18 +680,14 @@ native public open class Int32Array : ArrayBufferView {
constructor(array: Int32Array)
constructor(array: Array<Int>)
constructor(buffer: ArrayBuffer, byteOffset: Int = noImpl, length: Int = noImpl)
var length: Int
open val length: Int
get() = noImpl
set(value) = noImpl
var buffer: ArrayBuffer
open val buffer: ArrayBuffer
get() = noImpl
set(value) = noImpl
var byteOffset: Int
open val byteOffset: Int
get() = noImpl
set(value) = noImpl
var byteLength: Int
open val byteLength: Int
get() = noImpl
set(value) = noImpl
fun get(index: Int): Int = noImpl
fun set(index: Int, value: Int): Unit = noImpl
fun set(array: Int32Array, offset: Int = noImpl): Unit = noImpl
@@ -739,18 +704,14 @@ native public open class Uint32Array : ArrayBufferView {
constructor(array: Uint32Array)
constructor(array: Array<Int>)
constructor(buffer: ArrayBuffer, byteOffset: Int = noImpl, length: Int = noImpl)
var length: Int
open val length: Int
get() = noImpl
set(value) = noImpl
var buffer: ArrayBuffer
open val buffer: ArrayBuffer
get() = noImpl
set(value) = noImpl
var byteOffset: Int
open val byteOffset: Int
get() = noImpl
set(value) = noImpl
var byteLength: Int
open val byteLength: Int
get() = noImpl
set(value) = noImpl
fun get(index: Int): Int = noImpl
fun set(index: Int, value: Int): Unit = noImpl
fun set(array: Uint32Array, offset: Int = noImpl): Unit = noImpl
@@ -767,18 +728,14 @@ native public open class Float32Array : ArrayBufferView {
constructor(array: Float32Array)
constructor(array: Array<Float>)
constructor(buffer: ArrayBuffer, byteOffset: Int = noImpl, length: Int = noImpl)
var length: Int
open val length: Int
get() = noImpl
set(value) = noImpl
var buffer: ArrayBuffer
open val buffer: ArrayBuffer
get() = noImpl
set(value) = noImpl
var byteOffset: Int
open val byteOffset: Int
get() = noImpl
set(value) = noImpl
var byteLength: Int
open val byteLength: Int
get() = noImpl
set(value) = noImpl
fun get(index: Int): Float = noImpl
fun set(index: Int, value: Float): Unit = noImpl
fun set(array: Float32Array, offset: Int = noImpl): Unit = noImpl
@@ -795,18 +752,14 @@ native public open class Float64Array : ArrayBufferView {
constructor(array: Float64Array)
constructor(array: Array<Double>)
constructor(buffer: ArrayBuffer, byteOffset: Int = noImpl, length: Int = noImpl)
var length: Int
open val length: Int
get() = noImpl
set(value) = noImpl
var buffer: ArrayBuffer
open val buffer: ArrayBuffer
get() = noImpl
set(value) = noImpl
var byteOffset: Int
open val byteOffset: Int
get() = noImpl
set(value) = noImpl
var byteLength: Int
open val byteLength: Int
get() = noImpl
set(value) = noImpl
fun get(index: Int): Double = noImpl
fun set(index: Int, value: Double): Unit = noImpl
fun set(array: Float64Array, offset: Int = noImpl): Unit = noImpl
@@ -819,15 +772,12 @@ native public open class Float64Array : ArrayBufferView {
}
native public open class DataView(buffer: ArrayBuffer, byteOffset: Int = noImpl, byteLength: Int = noImpl) : ArrayBufferView {
var buffer: ArrayBuffer
open val buffer: ArrayBuffer
get() = noImpl
set(value) = noImpl
var byteOffset: Int
open val byteOffset: Int
get() = noImpl
set(value) = noImpl
var byteLength: Int
open val byteLength: Int
get() = noImpl
set(value) = noImpl
fun getInt8(byteOffset: Int): Byte = noImpl
fun getUint8(byteOffset: Int): Byte = noImpl
fun getInt16(byteOffset: Int, littleEndian: Boolean = noImpl): Short = noImpl

View File

@@ -24,9 +24,8 @@ native public interface MediaList {
var mediaText: String
get() = noImpl
set(value) = noImpl
var length: Int
val length: Int
get() = noImpl
set(value) = noImpl
fun item(index: Int): String? = noImpl
nativeGetter fun get(index: Int): String? = noImpl
fun appendMedium(medium: String): Unit = noImpl
@@ -34,69 +33,56 @@ native public interface MediaList {
}
native public interface StyleSheet {
var type: String
val type: String
get() = noImpl
set(value) = noImpl
var href: String?
val href: String?
get() = noImpl
set(value) = noImpl
var ownerNode: UnionElementOrProcessingInstruction?
val ownerNode: UnionElementOrProcessingInstruction?
get() = noImpl
set(value) = noImpl
var parentStyleSheet: StyleSheet?
val parentStyleSheet: StyleSheet?
get() = noImpl
set(value) = noImpl
var title: String?
val title: String?
get() = noImpl
set(value) = noImpl
var media: MediaList
val media: MediaList
get() = noImpl
set(value) = noImpl
var disabled: Boolean
get() = noImpl
set(value) = noImpl
}
native public interface CSSStyleSheet : StyleSheet {
var ownerRule: CSSRule?
val ownerRule: CSSRule?
get() = noImpl
set(value) = noImpl
var cssRules: CSSRuleList
val cssRules: CSSRuleList
get() = noImpl
set(value) = noImpl
fun insertRule(rule: String, index: Int): Int = noImpl
fun deleteRule(index: Int): Unit = noImpl
}
native public interface StyleSheetList {
var length: Int
val length: Int
get() = noImpl
set(value) = noImpl
fun item(index: Int): StyleSheet? = noImpl
nativeGetter fun get(index: Int): StyleSheet? = noImpl
}
native public interface CSSRuleList {
var length: Int
val length: Int
get() = noImpl
set(value) = noImpl
fun item(index: Int): CSSRule? = noImpl
nativeGetter fun get(index: Int): CSSRule? = noImpl
}
native public interface CSSRule {
var type: Short
val type: Short
get() = noImpl
set(value) = noImpl
var cssText: String
get() = noImpl
set(value) = noImpl
var parentRule: CSSRule?
val parentRule: CSSRule?
get() = noImpl
set(value) = noImpl
var parentStyleSheet: CSSStyleSheet?
val parentStyleSheet: CSSStyleSheet?
get() = noImpl
set(value) = noImpl
companion object {
val STYLE_RULE: Short = 1
@@ -114,53 +100,44 @@ native public interface CSSStyleRule : CSSRule {
var selectorText: String
get() = noImpl
set(value) = noImpl
var style: CSSStyleDeclaration
val style: CSSStyleDeclaration
get() = noImpl
set(value) = noImpl
}
native public interface CSSImportRule : CSSRule {
var href: String
val href: String
get() = noImpl
set(value) = noImpl
var media: MediaList
val media: MediaList
get() = noImpl
set(value) = noImpl
var styleSheet: CSSStyleSheet
val styleSheet: CSSStyleSheet
get() = noImpl
set(value) = noImpl
}
native public interface CSSGroupingRule : CSSRule {
var cssRules: CSSRuleList
val cssRules: CSSRuleList
get() = noImpl
set(value) = noImpl
fun insertRule(rule: String, index: Int): Int = noImpl
fun deleteRule(index: Int): Unit = noImpl
}
native public interface CSSMediaRule : CSSGroupingRule {
var media: MediaList
val media: MediaList
get() = noImpl
set(value) = noImpl
}
native public interface CSSPageRule : CSSGroupingRule {
var selectorText: String
get() = noImpl
set(value) = noImpl
var style: CSSStyleDeclaration
val style: CSSStyleDeclaration
get() = noImpl
set(value) = noImpl
}
native public interface CSSMarginRule : CSSRule {
var name: String
val name: String
get() = noImpl
set(value) = noImpl
var style: CSSStyleDeclaration
val style: CSSStyleDeclaration
get() = noImpl
set(value) = noImpl
}
native public interface CSSNamespaceRule : CSSRule {
@@ -848,12 +825,10 @@ native public interface CSSStyleDeclaration {
var cssText: String
get() = noImpl
set(value) = noImpl
var length: Int
val length: Int
get() = noImpl
set(value) = noImpl
var parentRule: CSSRule?
val parentRule: CSSRule?
get() = noImpl
set(value) = noImpl
var _dashed_attribute: String
get() = noImpl
set(value) = noImpl
@@ -871,18 +846,14 @@ native public interface CSSStyleDeclaration {
}
native public interface PseudoElement : GeometryNode {
var cascadedStyle: CSSStyleDeclaration
val cascadedStyle: CSSStyleDeclaration
get() = noImpl
set(value) = noImpl
var defaultStyle: CSSStyleDeclaration
val defaultStyle: CSSStyleDeclaration
get() = noImpl
set(value) = noImpl
var rawComputedStyle: CSSStyleDeclaration
val rawComputedStyle: CSSStyleDeclaration
get() = noImpl
set(value) = noImpl
var usedStyle: CSSStyleDeclaration
val usedStyle: CSSStyleDeclaration
get() = noImpl
set(value) = noImpl
fun getBoxQuads(options: BoxQuadOptions = noImpl): Array<DOMQuad> = noImpl
fun convertQuadFromNode(quad: DOMQuad, from: GeometryNode, options: ConvertCoordinateOptions = noImpl): DOMQuad = noImpl
fun convertRectFromNode(rect: DOMRectReadOnly, from: GeometryNode, options: ConvertCoordinateOptions = noImpl): DOMQuad = noImpl

View File

@@ -21,104 +21,73 @@ import org.w3c.workers.*
import org.w3c.xhr.*
native public open class MouseEvent(typeArg: String, mouseEventInitDict: MouseEventInit = noImpl) : UIEvent(noImpl, noImpl), UnionElementOrMouseEvent {
var screenX: Int
open val screenX: Int
get() = noImpl
set(value) = noImpl
var screenY: Int
open val screenY: Int
get() = noImpl
set(value) = noImpl
var clientX: Int
open val clientX: Int
get() = noImpl
set(value) = noImpl
var clientY: Int
open val clientY: Int
get() = noImpl
set(value) = noImpl
var ctrlKey: Boolean
open val ctrlKey: Boolean
get() = noImpl
set(value) = noImpl
var shiftKey: Boolean
open val shiftKey: Boolean
get() = noImpl
set(value) = noImpl
var altKey: Boolean
open val altKey: Boolean
get() = noImpl
set(value) = noImpl
var metaKey: Boolean
open val metaKey: Boolean
get() = noImpl
set(value) = noImpl
var button: Short
open val button: Short
get() = noImpl
set(value) = noImpl
var relatedTarget: EventTarget?
open val relatedTarget: EventTarget?
get() = noImpl
set(value) = noImpl
var buttons: Short
open val buttons: Short
get() = noImpl
set(value) = noImpl
var region: String?
open val region: String?
get() = noImpl
set(value) = noImpl
// var screenX: Double
// open val screenX: Double
// get() = noImpl
// set(value) = noImpl
// var screenY: Double
// open val screenY: Double
// get() = noImpl
// set(value) = noImpl
var pageX: Double
open val pageX: Double
get() = noImpl
set(value) = noImpl
var pageY: Double
open val pageY: Double
get() = noImpl
set(value) = noImpl
// var clientX: Double
// open val clientX: Double
// get() = noImpl
// set(value) = noImpl
// var clientY: Double
// open val clientY: Double
// get() = noImpl
// set(value) = noImpl
// var x: Double
// open val x: Double
// get() = noImpl
// set(value) = noImpl
// var y: Double
// open val y: Double
// get() = noImpl
// set(value) = noImpl
var offsetX: Double
open val offsetX: Double
get() = noImpl
set(value) = noImpl
var offsetY: Double
open val offsetY: Double
get() = noImpl
set(value) = noImpl
fun getModifierState(keyArg: String): Boolean = noImpl
fun initMouseEvent(typeArg: String, bubblesArg: Boolean, cancelableArg: Boolean, viewArg: Window?, detailArg: Int, screenXArg: Int, screenYArg: Int, clientXArg: Int, clientYArg: Int, ctrlKeyArg: Boolean, altKeyArg: Boolean, shiftKeyArg: Boolean, metaKeyArg: Boolean, buttonArg: Short, relatedTargetArg: EventTarget?): Unit = noImpl
}
native public open class Event(type: String, eventInitDict: EventInit = noImpl) {
var type: String
open val type: String
get() = noImpl
set(value) = noImpl
var target: EventTarget?
open val target: EventTarget?
get() = noImpl
set(value) = noImpl
var currentTarget: EventTarget?
open val currentTarget: EventTarget?
get() = noImpl
set(value) = noImpl
var eventPhase: Short
open val eventPhase: Short
get() = noImpl
set(value) = noImpl
var bubbles: Boolean
open val bubbles: Boolean
get() = noImpl
set(value) = noImpl
var cancelable: Boolean
open val cancelable: Boolean
get() = noImpl
set(value) = noImpl
var defaultPrevented: Boolean
open val defaultPrevented: Boolean
get() = noImpl
set(value) = noImpl
var isTrusted: Boolean
open val isTrusted: Boolean
get() = noImpl
set(value) = noImpl
var timeStamp: Number
open val timeStamp: Number
get() = noImpl
set(value) = noImpl
fun stopPropagation(): Unit = noImpl
fun stopImmediatePropagation(): Unit = noImpl
fun preventDefault(): Unit = noImpl
@@ -145,12 +114,10 @@ native public interface EventListener {
}
native public open class UIEvent(type: String, eventInitDict: UIEventInit = noImpl) : Event(type, eventInitDict) {
var view: Window?
open val view: Window?
get() = noImpl
set(value) = noImpl
var detail: Int
open val detail: Int
get() = noImpl
set(value) = noImpl
fun initUIEvent(typeArg: String, bubblesArg: Boolean, cancelableArg: Boolean, viewArg: Window?, detailArg: Int): Unit = noImpl
}
@@ -160,9 +127,8 @@ native public open class UIEventInit : EventInit() {
}
native public open class FocusEvent(typeArg: String, focusEventInitDict: FocusEventInit = noImpl) : UIEvent(noImpl, noImpl) {
var relatedTarget: EventTarget?
open val relatedTarget: EventTarget?
get() = noImpl
set(value) = noImpl
fun initFocusEvent(typeArg: String, bubblesArg: Boolean, cancelableArg: Boolean, viewArg: Window?, detailArg: Int, relatedTargetArg: EventTarget?): Unit = noImpl
}
@@ -199,18 +165,14 @@ native public open class EventModifierInit : UIEventInit() {
}
native public open class WheelEvent(typeArg: String, wheelEventInitDict: WheelEventInit = noImpl) : MouseEvent(typeArg, noImpl) {
var deltaX: Double
open val deltaX: Double
get() = noImpl
set(value) = noImpl
var deltaY: Double
open val deltaY: Double
get() = noImpl
set(value) = noImpl
var deltaZ: Double
open val deltaZ: Double
get() = noImpl
set(value) = noImpl
var deltaMode: Int
open val deltaMode: Int
get() = noImpl
set(value) = noImpl
fun initWheelEvent(typeArg: String, bubblesArg: Boolean, cancelableArg: Boolean, viewArg: Window?, detailArg: Int, screenXArg: Int, screenYArg: Int, clientXArg: Int, clientYArg: Int, buttonArg: Short, relatedTargetArg: EventTarget?, modifiersListArg: String, deltaXArg: Double, deltaYArg: Double, deltaZArg: Double, deltaMode: Int): Unit = noImpl
companion object {
@@ -228,42 +190,30 @@ native public open class WheelEventInit : MouseEventInit() {
}
native public open class KeyboardEvent(typeArg: String, keyboardEventInitDict: KeyboardEventInit = noImpl) : UIEvent(noImpl, noImpl) {
var key: String
open val key: String
get() = noImpl
set(value) = noImpl
var code: String
open val code: String
get() = noImpl
set(value) = noImpl
var location: Int
open val location: Int
get() = noImpl
set(value) = noImpl
var ctrlKey: Boolean
open val ctrlKey: Boolean
get() = noImpl
set(value) = noImpl
var shiftKey: Boolean
open val shiftKey: Boolean
get() = noImpl
set(value) = noImpl
var altKey: Boolean
open val altKey: Boolean
get() = noImpl
set(value) = noImpl
var metaKey: Boolean
open val metaKey: Boolean
get() = noImpl
set(value) = noImpl
var repeat: Boolean
open val repeat: Boolean
get() = noImpl
set(value) = noImpl
var isComposing: Boolean
open val isComposing: Boolean
get() = noImpl
set(value) = noImpl
var charCode: Int
open val charCode: Int
get() = noImpl
set(value) = noImpl
var keyCode: Int
open val keyCode: Int
get() = noImpl
set(value) = noImpl
var which: Int
open val which: Int
get() = noImpl
set(value) = noImpl
fun getModifierState(keyArg: String): Boolean = noImpl
fun initKeyboardEvent(typeArg: String, bubblesArg: Boolean, cancelableArg: Boolean, viewArg: Window?, keyArg: String, locationArg: Int, modifiersListArg: String, repeat: Boolean, locale: String): Unit = noImpl
@@ -284,9 +234,8 @@ native public open class KeyboardEventInit : EventModifierInit() {
}
native public open class CompositionEvent(typeArg: String, compositionEventInitDict: CompositionEventInit = noImpl) : UIEvent(noImpl, noImpl) {
var data: String
open val data: String
get() = noImpl
set(value) = noImpl
fun initCompositionEvent(typeArg: String, bubblesArg: Boolean, cancelableArg: Boolean, viewArg: Window?, dataArg: String, locale: String): Unit = noImpl
}
@@ -295,21 +244,16 @@ native public open class CompositionEventInit : UIEventInit() {
}
native public open class MutationEvent : Event(noImpl, noImpl) {
var relatedNode: Node?
open val relatedNode: Node?
get() = noImpl
set(value) = noImpl
var prevValue: String
open val prevValue: String
get() = noImpl
set(value) = noImpl
var newValue: String
open val newValue: String
get() = noImpl
set(value) = noImpl
var attrName: String
open val attrName: String
get() = noImpl
set(value) = noImpl
var attrChange: Short
open val attrChange: Short
get() = noImpl
set(value) = noImpl
fun initMutationEvent(typeArg: String, bubblesArg: Boolean, cancelableArg: Boolean, relatedNodeArg: Node?, prevValueArg: String, newValueArg: String, attrNameArg: String, attrChangeArg: Short): Unit = noImpl
companion object {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -24,9 +24,8 @@ native public open class URL(url: String, base: String = noImpl) {
var href: String
get() = noImpl
set(value) = noImpl
var origin: String
open val origin: String
get() = noImpl
set(value) = noImpl
var protocol: String
get() = noImpl
set(value) = noImpl

View File

@@ -30,36 +30,26 @@ native public open class Headers(init: dynamic = noImpl) {
}
native public open class Request(input: dynamic, init: RequestInit = noImpl) {
var method: String
open val method: String
get() = noImpl
set(value) = noImpl
var url: String
open val url: String
get() = noImpl
set(value) = noImpl
var headers: Headers
open val headers: Headers
get() = noImpl
set(value) = noImpl
var context: String
open val context: String
get() = noImpl
set(value) = noImpl
var referrer: String
open val referrer: String
get() = noImpl
set(value) = noImpl
var mode: String
open val mode: String
get() = noImpl
set(value) = noImpl
var credentials: String
open val credentials: String
get() = noImpl
set(value) = noImpl
var cache: String
open val cache: String
get() = noImpl
set(value) = noImpl
var redirect: String
open val redirect: String
get() = noImpl
set(value) = noImpl
var bodyUsed: Boolean
open val bodyUsed: Boolean
get() = noImpl
set(value) = noImpl
fun clone(): Request = noImpl
fun arrayBuffer(): dynamic = noImpl
fun blob(): dynamic = noImpl
@@ -79,27 +69,20 @@ native public open class RequestInit {
}
native public open class Response(body: dynamic = noImpl, init: ResponseInit = noImpl) {
var type: String
open val type: String
get() = noImpl
set(value) = noImpl
var url: String
open val url: String
get() = noImpl
set(value) = noImpl
var status: Short
open val status: Short
get() = noImpl
set(value) = noImpl
var ok: Boolean
open val ok: Boolean
get() = noImpl
set(value) = noImpl
var statusText: String
open val statusText: String
get() = noImpl
set(value) = noImpl
var headers: Headers
open val headers: Headers
get() = noImpl
set(value) = noImpl
var bodyUsed: Boolean
open val bodyUsed: Boolean
get() = noImpl
set(value) = noImpl
fun clone(): Response = noImpl
fun arrayBuffer(): dynamic = noImpl
fun blob(): dynamic = noImpl

View File

@@ -22,15 +22,12 @@ import org.w3c.xhr.*
native public open class Blob() : ImageBitmapSource {
constructor(blobParts: Array<dynamic>, options: BlobPropertyBag = noImpl) : this()
var size: Long
open val size: Long
get() = noImpl
set(value) = noImpl
var type: String
open val type: String
get() = noImpl
set(value) = noImpl
var isClosed: Boolean
open val isClosed: Boolean
get() = noImpl
set(value) = noImpl
fun slice(start: Long = noImpl, end: Long = noImpl, contentType: String = noImpl): Blob = noImpl
fun close(): Unit = noImpl
}
@@ -40,12 +37,10 @@ native public open class BlobPropertyBag {
}
native public open class File(fileBits: Array<dynamic>, fileName: String, options: FilePropertyBag = noImpl) : Blob() {
var name: String
open val name: String
get() = noImpl
set(value) = noImpl
var lastModified: Long
open val lastModified: Long
get() = noImpl
set(value) = noImpl
}
native public open class FilePropertyBag {
@@ -54,23 +49,19 @@ native public open class FilePropertyBag {
}
native public interface FileList {
var length: Int
val length: Int
get() = noImpl
set(value) = noImpl
fun item(index: Int): File? = noImpl
nativeGetter fun get(index: Int): File? = noImpl
}
native public open class FileReader : EventTarget {
var readyState: Short
open val readyState: Short
get() = noImpl
set(value) = noImpl
var result: dynamic
open val result: dynamic
get() = noImpl
set(value) = noImpl
var error: dynamic
open val error: dynamic
get() = noImpl
set(value) = noImpl
var onloadstart: ((Event) -> dynamic)?
get() = noImpl
set(value) = noImpl

View File

@@ -27,42 +27,30 @@ native public open class Notification(title: String, options: NotificationOption
var onerror: ((Event) -> dynamic)?
get() = noImpl
set(value) = noImpl
var title: String
open val title: String
get() = noImpl
set(value) = noImpl
var dir: String
open val dir: String
get() = noImpl
set(value) = noImpl
var lang: String
open val lang: String
get() = noImpl
set(value) = noImpl
var body: String
open val body: String
get() = noImpl
set(value) = noImpl
var tag: String
open val tag: String
get() = noImpl
set(value) = noImpl
var icon: String
open val icon: String
get() = noImpl
set(value) = noImpl
var sound: String
open val sound: String
get() = noImpl
set(value) = noImpl
var renotify: Boolean
open val renotify: Boolean
get() = noImpl
set(value) = noImpl
var silent: Boolean
open val silent: Boolean
get() = noImpl
set(value) = noImpl
var noscreen: Boolean
open val noscreen: Boolean
get() = noImpl
set(value) = noImpl
var sticky: Boolean
open val sticky: Boolean
get() = noImpl
set(value) = noImpl
var data: Any?
open val data: Any?
get() = noImpl
set(value) = noImpl
fun close(): Unit = noImpl
companion object {
@@ -93,9 +81,8 @@ native public open class GetNotificationOptions {
}
native public open class NotificationEvent(type: String, eventInitDict: NotificationEventInit = noImpl) : ExtendableEvent(type, eventInitDict) {
var notification: Notification
open val notification: Notification
get() = noImpl
set(value) = noImpl
}
native public open class NotificationEventInit : ExtendableEventInit() {

View File

@@ -21,88 +21,63 @@ import org.w3c.workers.*
import org.w3c.xhr.*
native public interface Performance {
var timing: PerformanceTiming
val timing: PerformanceTiming
get() = noImpl
set(value) = noImpl
var navigation: PerformanceNavigation
val navigation: PerformanceNavigation
get() = noImpl
set(value) = noImpl
fun now(): Double = noImpl
}
native public interface PerformanceTiming {
var navigationStart: Long
val navigationStart: Long
get() = noImpl
set(value) = noImpl
var unloadEventStart: Long
val unloadEventStart: Long
get() = noImpl
set(value) = noImpl
var unloadEventEnd: Long
val unloadEventEnd: Long
get() = noImpl
set(value) = noImpl
var redirectStart: Long
val redirectStart: Long
get() = noImpl
set(value) = noImpl
var redirectEnd: Long
val redirectEnd: Long
get() = noImpl
set(value) = noImpl
var fetchStart: Long
val fetchStart: Long
get() = noImpl
set(value) = noImpl
var domainLookupStart: Long
val domainLookupStart: Long
get() = noImpl
set(value) = noImpl
var domainLookupEnd: Long
val domainLookupEnd: Long
get() = noImpl
set(value) = noImpl
var connectStart: Long
val connectStart: Long
get() = noImpl
set(value) = noImpl
var connectEnd: Long
val connectEnd: Long
get() = noImpl
set(value) = noImpl
var secureConnectionStart: Long
val secureConnectionStart: Long
get() = noImpl
set(value) = noImpl
var requestStart: Long
val requestStart: Long
get() = noImpl
set(value) = noImpl
var responseStart: Long
val responseStart: Long
get() = noImpl
set(value) = noImpl
var responseEnd: Long
val responseEnd: Long
get() = noImpl
set(value) = noImpl
var domLoading: Long
val domLoading: Long
get() = noImpl
set(value) = noImpl
var domInteractive: Long
val domInteractive: Long
get() = noImpl
set(value) = noImpl
var domContentLoadedEventStart: Long
val domContentLoadedEventStart: Long
get() = noImpl
set(value) = noImpl
var domContentLoadedEventEnd: Long
val domContentLoadedEventEnd: Long
get() = noImpl
set(value) = noImpl
var domComplete: Long
val domComplete: Long
get() = noImpl
set(value) = noImpl
var loadEventStart: Long
val loadEventStart: Long
get() = noImpl
set(value) = noImpl
var loadEventEnd: Long
val loadEventEnd: Long
get() = noImpl
set(value) = noImpl
}
native public interface PerformanceNavigation {
var type: Short
val type: Short
get() = noImpl
set(value) = noImpl
var redirectCount: Short
val redirectCount: Short
get() = noImpl
set(value) = noImpl
companion object {
val TYPE_NAVIGATE: Short = 0

View File

@@ -21,24 +21,19 @@ import org.w3c.performance.*
import org.w3c.xhr.*
native public interface ServiceWorkerRegistration : EventTarget {
var installing: ServiceWorker?
val installing: ServiceWorker?
get() = noImpl
set(value) = noImpl
var waiting: ServiceWorker?
val waiting: ServiceWorker?
get() = noImpl
set(value) = noImpl
var active: ServiceWorker?
val active: ServiceWorker?
get() = noImpl
set(value) = noImpl
var scope: String
val scope: String
get() = noImpl
set(value) = noImpl
var onupdatefound: ((Event) -> dynamic)?
get() = noImpl
set(value) = noImpl
var APISpace: dynamic
val APISpace: dynamic
get() = noImpl
set(value) = noImpl
fun update(): Unit = noImpl
fun unregister(): dynamic = noImpl
fun methodName(of: dynamic): dynamic = noImpl
@@ -47,12 +42,10 @@ native public interface ServiceWorkerRegistration : EventTarget {
}
native public interface ServiceWorkerGlobalScope : WorkerGlobalScope {
var clients: Clients
val clients: Clients
get() = noImpl
set(value) = noImpl
var registration: ServiceWorkerRegistration
val registration: ServiceWorkerRegistration
get() = noImpl
set(value) = noImpl
var oninstall: ((Event) -> dynamic)?
get() = noImpl
set(value) = noImpl
@@ -75,15 +68,12 @@ native public interface ServiceWorkerGlobalScope : WorkerGlobalScope {
}
native public interface ServiceWorker : EventTarget, UnionMessagePortOrServiceWorker, UnionClientOrMessagePortOrServiceWorker {
var scriptURL: String
val scriptURL: String
get() = noImpl
set(value) = noImpl
var state: String
val state: String
get() = noImpl
set(value) = noImpl
var id: String
val id: String
get() = noImpl
set(value) = noImpl
var onstatechange: ((Event) -> dynamic)?
get() = noImpl
set(value) = noImpl
@@ -94,12 +84,10 @@ native public interface ServiceWorker : EventTarget, UnionMessagePortOrServiceWo
}
native public interface ServiceWorkerContainer : EventTarget {
var controller: ServiceWorker?
val controller: ServiceWorker?
get() = noImpl
set(value) = noImpl
var ready: dynamic
val ready: dynamic
get() = noImpl
set(value) = noImpl
var oncontrollerchange: ((Event) -> dynamic)?
get() = noImpl
set(value) = noImpl
@@ -119,21 +107,16 @@ native public open class RegistrationOptions {
}
native public open class ServiceWorkerMessageEvent(type: String, eventInitDict: ServiceWorkerMessageEventInit = noImpl) : Event(type, eventInitDict) {
var data: Any?
open val data: Any?
get() = noImpl
set(value) = noImpl
var origin: String
open val origin: String
get() = noImpl
set(value) = noImpl
var lastEventId: String
open val lastEventId: String
get() = noImpl
set(value) = noImpl
var source: UnionMessagePortOrServiceWorker?
open val source: UnionMessagePortOrServiceWorker?
get() = noImpl
set(value) = noImpl
var ports: Array<MessagePort>?
open val ports: Array<MessagePort>?
get() = noImpl
set(value) = noImpl
fun initServiceWorkerMessageEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, dataArg: Any?, originArg: String, lastEventIdArg: String, sourceArg: UnionMessagePortOrServiceWorker, portsArg: Array<MessagePort>?): Unit = noImpl
}
@@ -146,25 +129,20 @@ native public open class ServiceWorkerMessageEventInit : EventInit() {
}
native public interface Client : UnionClientOrMessagePortOrServiceWorker {
var url: String
val url: String
get() = noImpl
set(value) = noImpl
var frameType: String
val frameType: String
get() = noImpl
set(value) = noImpl
var id: String
val id: String
get() = noImpl
set(value) = noImpl
fun postMessage(message: Any?, transfer: Array<Transferable> = noImpl): Unit = noImpl
}
native public interface WindowClient : Client {
var visibilityState: dynamic
val visibilityState: dynamic
get() = noImpl
set(value) = noImpl
var focused: Boolean
val focused: Boolean
get() = noImpl
set(value) = noImpl
fun focus(): dynamic = noImpl
}
@@ -187,15 +165,12 @@ native public open class ExtendableEventInit : EventInit() {
}
native public open class FetchEvent(type: String, eventInitDict: FetchEventInit = noImpl) : ExtendableEvent(type, eventInitDict) {
var request: Request
open val request: Request
get() = noImpl
set(value) = noImpl
var client: Client
open val client: Client
get() = noImpl
set(value) = noImpl
var isReload: Boolean
open val isReload: Boolean
get() = noImpl
set(value) = noImpl
fun respondWith(r: dynamic): Unit = noImpl
}
@@ -206,21 +181,16 @@ native public open class FetchEventInit : ExtendableEventInit() {
}
native public open class ExtendableMessageEvent(type: String, eventInitDict: ExtendableMessageEventInit = noImpl) : ExtendableEvent(type, eventInitDict) {
var data: Any?
open val data: Any?
get() = noImpl
set(value) = noImpl
var origin: String
open val origin: String
get() = noImpl
set(value) = noImpl
var lastEventId: String
open val lastEventId: String
get() = noImpl
set(value) = noImpl
var source: UnionClientOrMessagePortOrServiceWorker?
open val source: UnionClientOrMessagePortOrServiceWorker?
get() = noImpl
set(value) = noImpl
var ports: Array<MessagePort>?
open val ports: Array<MessagePort>?
get() = noImpl
set(value) = noImpl
fun initExtendableMessageEvent(typeArg: String, canBubbleArg: Boolean, cancelableArg: Boolean, dataArg: Any?, originArg: String, lastEventIdArg: String, sourceArg: UnionClientOrMessagePortOrServiceWorker, portsArg: Array<MessagePort>?): Unit = noImpl
}

View File

@@ -51,39 +51,31 @@ native public open class XMLHttpRequest : XMLHttpRequestEventTarget {
var onreadystatechange: ((Event) -> dynamic)?
get() = noImpl
set(value) = noImpl
var readyState: Short
open val readyState: Short
get() = noImpl
set(value) = noImpl
var timeout: Int
get() = noImpl
set(value) = noImpl
var withCredentials: Boolean
get() = noImpl
set(value) = noImpl
var upload: XMLHttpRequestUpload
open val upload: XMLHttpRequestUpload
get() = noImpl
set(value) = noImpl
var responseURL: String
open val responseURL: String
get() = noImpl
set(value) = noImpl
var status: Short
open val status: Short
get() = noImpl
set(value) = noImpl
var statusText: String
open val statusText: String
get() = noImpl
set(value) = noImpl
var responseType: String
get() = noImpl
set(value) = noImpl
var response: Any?
open val response: Any?
get() = noImpl
set(value) = noImpl
var responseText: String
open val responseText: String
get() = noImpl
set(value) = noImpl
var responseXML: Document?
open val responseXML: Document?
get() = noImpl
set(value) = noImpl
fun open(method: String, url: String): Unit = noImpl
fun open(method: String, url: String, async: Boolean, username: String? = null, password: String? = null): Unit = noImpl
fun setRequestHeader(name: String, value: String): Unit = noImpl
@@ -112,15 +104,12 @@ native public open class FormData(form: HTMLFormElement = noImpl) {
}
native public open class ProgressEvent(type: String, eventInitDict: ProgressEventInit = noImpl) : Event(type, eventInitDict) {
var lengthComputable: Boolean
open val lengthComputable: Boolean
get() = noImpl
set(value) = noImpl
var loaded: Long
open val loaded: Long
get() = noImpl
set(value) = noImpl
var total: Long
open val total: Long
get() = noImpl
set(value) = noImpl
}
native public open class ProgressEventInit : EventInit() {

View File

@@ -421,6 +421,14 @@ class DefinitionVisitor(val extendedAttributes: List<ExtendedAttribute>, val nam
return defaultResult()
}
override fun visitReadonlyMemberRest(ctx: ReadonlyMemberRestContext?): Definition? {
readOnly = true
visitChildren(ctx)
readOnly = false
return defaultResult()
}
override fun visitStaticMember(ctx: WebIDLParser.StaticMemberContext): Definition {
static = true
visitChildren(ctx)

View File

@@ -8,11 +8,12 @@ private fun <O : Appendable> O.indent(level: Int) {
}
}
private fun Appendable.renderAttributeDeclaration(arg: GenerateAttribute, override: Boolean, level: Int = 1) {
private fun Appendable.renderAttributeDeclaration(arg: GenerateAttribute, override: Boolean, open: Boolean, level: Int = 1) {
indent(level)
if (override) {
append("override ")
when {
override -> append("override ")
open -> append("open ")
}
append(if (arg.readOnly) "val" else "var")
@@ -85,6 +86,12 @@ private fun Appendable.renderFunctionDeclaration(f: GenerateFunction, override:
appendln(": ${f.returnType.render()} = noImpl")
}
private fun List<GenerateAttribute>.hasNoVars() = none { it.isVar }
private val GenerateAttribute.isVal: Boolean
get() = readOnly
private val GenerateAttribute.isVar: Boolean
get() = !readOnly
fun Appendable.render(allTypes: Map<String, GenerateTraitOrClass>, typeNamesToUnions: Map<String, List<String>>, iface: GenerateTraitOrClass, markerAnnotation: Boolean = false) {
append("native public ")
if (markerAnnotation) {
@@ -130,11 +137,15 @@ fun Appendable.render(allTypes: Map<String, GenerateTraitOrClass>, typeNamesToUn
}
val superAttributes = allSuperTypes.flatMap { it.memberAttributes }.distinct()
val superAttributesByName = superAttributes.groupBy { it.name }
val superFunctions = allSuperTypes.flatMap { it.memberFunctions }.distinct()
val superSignatures = superAttributes.map { it.signature } merge superFunctions.map { it.signature }
iface.memberAttributes.filter { it !in superAttributes && !it.static }.map { it.dynamicIfUnknownType(allTypes.keySet()) }.groupBy { it.signature }.reduceValues().values().forEach { arg ->
renderAttributeDeclaration(arg, arg.signature in superSignatures)
iface.memberAttributes
.filter { it !in superAttributes && !it.static && (it.isVar || (it.isVal && superAttributesByName[it.name]?.hasNoVars() ?: true)) }
.map { it.dynamicIfUnknownType(allTypes.keySet()) }
.groupBy { it.signature }.reduceValues().values().forEach { arg ->
renderAttributeDeclaration(arg, override = arg.signature in superSignatures, open = iface.kind == GenerateDefinitionKind.CLASS && arg.readOnly)
}
iface.memberFunctions.filter { it !in superFunctions && !it.static }.map { it.dynamicIfUnknownType(allTypes.keySet()) }.groupBy { it.signature }.reduceValues(::betterFunction).values().forEach {
renderFunctionDeclaration(it, it.signature in superSignatures)
@@ -148,10 +159,10 @@ fun Appendable.render(allTypes: Map<String, GenerateTraitOrClass>, typeNamesToUn
indent(1)
appendln("companion object {")
iface.constants.forEach {
renderAttributeDeclaration(it, override = false, level = 2)
renderAttributeDeclaration(it, override = false, open = false, level = 2)
}
staticAttributes.forEach {
renderAttributeDeclaration(it, override = false, level = 2)
renderAttributeDeclaration(it, override = false, open = false, level = 2)
}
staticFunctions.forEach {
renderFunctionDeclaration(it, override = false, level = 2)