mirror of
https://github.com/tachiyomiorg/extensions-lib.git
synced 2024-11-17 08:49:18 +01:00
Add JavaScriptEngine abstraction to extensions-lib (#9)
This commit is contained in:
parent
7be52d2c4c
commit
71fe20d3b8
@ -0,0 +1,19 @@
|
|||||||
|
package eu.kanade.tachiyomi.network
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Util for evaluating JavaScript in sources.
|
||||||
|
*/
|
||||||
|
class JavaScriptEngine(context: Context) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Evaluate arbitrary JavaScript code and get the result as a primtive type
|
||||||
|
* (e.g., String, Int).
|
||||||
|
*
|
||||||
|
* @since extensions-lib 1.4
|
||||||
|
* @param script JavaScript to execute.
|
||||||
|
* @return Result of JavaScript code as a primitive type.
|
||||||
|
*/
|
||||||
|
suspend fun <T> evaluate(script: String): T = throw Exception("Stub!")
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user