// Generated from "jsproperties/Main.java"
@file:Suppress(
 "ALWAYS_NULL",
 "PARAMETER_NAME_CHANGED_ON_OVERRIDE",
 "SENSELESS_COMPARISON",
 "UNCHECKED_CAST",
 "UNNECESSARY_LATEINIT",
 "UNNECESSARY_NOT_NULL_ASSERTION",
 "UNREACHABLE_CODE",
 "UNUSED_ANONYMOUS_PARAMETER",
 "UNUSED_PARAMETER",
 "UNUSED_VARIABLE",
 "USELESS_CAST",
 "VARIABLE_IN_SINGLETON_WITHOUT_THREAD_LOCAL",
 "VARIABLE_WITH_REDUNDANT_INITIALIZER",
 "REDUNDANT_ELSE_IN_WHEN")

package jsproperties

import javaemul.lang.*
import jsinterop.annotations.JsPackage
import jsinterop.annotations.JsProperty
import kotlin.Any
import kotlin.Double
import kotlin.Int
import kotlin.Suppress
import kotlin.jvm.JvmStatic

open class Foo internal constructor() {
 companion object {
  private var f: Int = 0

  @JvmStatic
  @JsProperty
  fun getA(): Int {
   return Foo.f + 1
  }

  @JvmStatic
  @JsProperty
  fun setA(x: Int) {
   Foo.f = x + 2
  }

  @JvmStatic
  @JsProperty(name = "abc")
  fun getB(): Int {
   return Foo.f + 3
  }

  @JvmStatic
  @JsProperty(name = "abc")
  fun setB(x: Int) {
   Foo.f = x + 4
  }
 }
}

open class Bar internal constructor() {
 private var f: Int = 0

 @JsProperty
 private var privateField: Int = - 1

 @JsProperty
 open fun getA(): Int {
  return this.f + 1
 }

 @JsProperty
 open fun setA(x: Int) {
  this.f = x + 2
 }

 @JsProperty(name = "abc")
 open fun getB(): Int {
  return this.f + 3
 }

 @JsProperty(name = "abc")
 open fun setB(x: Int) {
  this.f = x + 4
 }
}

open class NativeFoo internal constructor() {
 @JsProperty(name = "hasOwnProperty")
 external open fun getA(): Any?

 companion object {
  @JvmStatic
  @JsProperty(name = "Math.PI", namespace = JsPackage.GLOBAL)
  external fun getB(): Double
 }
}

interface InterfaceWithDefaultJsProperties {
 @JsProperty
 fun getM(): Int {
  return 3
 }

 @JsProperty
 fun setM(value: Int) {}
}

open class ImplementsInterfaceWithDefaultJsProperties internal constructor(): InterfaceWithDefaultJsProperties

open class Main {
 open fun testNativeJsProperty() {
  NativeFoo().getA()
  NativeFoo.getB()
 }

 open fun testStaticJsProperty() {
  Foo.getA()
  Foo.setA(10)
  Foo.getB()
  Foo.setB(10)
 }

 open fun testInstanceJsProperty() {
  val bar: Bar = Bar()
  bar.getA()
  bar.setA(10)
  bar.getB()
  bar.setB(10)
 }
}
