/// /// HybridTorchSpec.kt /// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. /// https://github.com/mrousavy/nitro /// Copyright © 2025 Marc Rousavy @ Margelo /// package com.margelo.nitro.nitrotorch import androidx.annotation.Keep import com.facebook.jni.HybridData import com.facebook.proguard.annotations.DoNotStrip import com.margelo.nitro.core.Promise import com.margelo.nitro.core.HybridObject /** * A Kotlin class representing the Torch HybridObject. * Implement this abstract class to create Kotlin-based instances of Torch. */ @DoNotStrip @Keep @Suppress( "KotlinJniMissingFunction", "unused", "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" ) abstract class HybridTorchSpec: HybridObject() { @DoNotStrip private var mHybridData: HybridData = initHybrid() init { super.updateNative(mHybridData) } override fun updateNative(hybridData: HybridData) { mHybridData = hybridData super.updateNative(hybridData) } // Properties abstract var onStateChanged: ((state: Boolean) -> Unit)? private var onStateChanged_cxx: Func_void_bool? @Keep @DoNotStrip get() { return onStateChanged?.let { Func_void_bool_java(it) } } @Keep @DoNotStrip set(value) { onStateChanged = value?.let { it } } abstract var onLevelChanged: ((level: Double?) -> Unit)? private var onLevelChanged_cxx: Func_void_std__optional_double_? @Keep @DoNotStrip get() { return onLevelChanged?.let { Func_void_std__optional_double__java(it) } } @Keep @DoNotStrip set(value) { onLevelChanged = value?.let { it } } // Methods @DoNotStrip @Keep abstract fun on(): Promise @DoNotStrip @Keep abstract fun off(): Promise @DoNotStrip @Keep abstract fun toggle(): Promise @DoNotStrip @Keep abstract fun setLevel(level: Double): Promise @DoNotStrip @Keep abstract fun getMaxLevel(dynamic: Boolean?): Double? private external fun initHybrid(): HybridData companion object { protected const val TAG = "HybridTorchSpec" } }