nitro-web-browser 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +27 -0
- package/Package.swift +126 -0
- package/README.md +169 -2
- package/android/build.gradle +4 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/BrowserProxyActivity.kt +83 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/BrowserRedirectActivity.kt +22 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/CustomTabsActivitiesHelper.kt +94 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/CustomTabsConnectionHelper.kt +268 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/CustomTabsIntentFactory.kt +46 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/DeferredClientActionsQueue.kt +38 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/HybridWebBrowser.kt +250 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/WebBrowserActivityInitializer.kt +18 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/WebBrowserAndroidRuntime.kt +31 -0
- package/android/src/main/java/com/margelo/nitro/webbrowser/WebBrowserErrors.kt +17 -0
- package/ios/HybridWebBrowser.swift +230 -0
- package/ios/SceneGeometry.swift +35 -0
- package/ios/WebAuthSession.swift +113 -0
- package/ios/WebBrowserOptions.swift +58 -0
- package/ios/WebBrowserSession.swift +85 -0
- package/nitro.json +21 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroWebBrowser+autolinking.cmake +42 -0
- package/nitrogen/generated/android/NitroWebBrowser+autolinking.gradle +10 -0
- package/nitrogen/generated/android/NitroWebBrowserOnLoad.cpp +24 -0
- package/nitrogen/generated/android/c++/JCallback_void.cpp +54 -0
- package/nitrogen/generated/android/c++/JCallback_void_NativeAppStateStatus.cpp +55 -0
- package/nitrogen/generated/android/c++/JCallback_void_NativeRedirectEvent.cpp +55 -0
- package/nitrogen/generated/android/c++/JHybridWebBrowserSpec.cpp +168 -0
- package/nitrogen/generated/android/c++/JListenerSubscription.cpp +34 -0
- package/nitrogen/generated/android/c++/JNativeAppStateStatus.cpp +61 -0
- package/nitrogen/generated/android/c++/JNativeRedirectEvent.cpp +34 -0
- package/nitrogen/generated/android/c++/JNativeServiceActionResult.cpp +36 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserAuthSessionResult.cpp +39 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserAuthSessionResultType.cpp +55 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserCustomTabsResults.cpp +41 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserDismissButtonStyle.cpp +55 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserOpenOptions.cpp +57 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserPresentationStyle.cpp +70 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserResult.cpp +33 -0
- package/nitrogen/generated/android/c++/JNativeWebBrowserResultType.cpp +58 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JCallback_void.hpp +53 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JCallback_void_NativeAppStateStatus.hpp +54 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JCallback_void_NativeRedirectEvent.hpp +54 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JHybridWebBrowserSpec.hpp +111 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JHybridWebBrowserSpecJavaPart.hpp +26 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JListenerSubscription.hpp +49 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeAppStateStatus.hpp +87 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeRedirectEvent.hpp +49 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeServiceActionResult.hpp +51 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserAuthSessionResult.hpp +62 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserAuthSessionResultType.hpp +77 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserCustomTabsResults.hpp +68 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserDismissButtonStyle.hpp +77 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserOpenOptions.hpp +132 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserPresentationStyle.hpp +102 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserResult.hpp +48 -0
- package/nitrogen/generated/android/c++/include/NitroWebBrowser/private/JNativeWebBrowserResultType.hpp +82 -0
- package/nitrogen/generated/android/include/NitroWebBrowser/private/NitroWebBrowserOnLoad.hpp +13 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/Callback_void.kt +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/Callback_void_NativeAppStateStatus.kt +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/Callback_void_NativeRedirectEvent.kt +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/HybridWebBrowserSpec.kt +191 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/ListenerSubscription.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeAppStateStatus.kt +55 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeRedirectEvent.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeServiceActionResult.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserAuthSessionResult.kt +57 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserAuthSessionResultType.kt +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserCustomTabsResults.kt +62 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserDismissButtonStyle.kt +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserOpenOptions.kt +122 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserPresentationStyle.kt +64 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserResult.kt +46 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserResultType.kt +52 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NitroWebBrowserOnLoad.kt +22 -0
- package/nitrogen/generated/apple/NitroWebBrowser-Swift-Cxx-Bridge.cpp +182 -0
- package/nitrogen/generated/apple/NitroWebBrowserAppleCxx/NitroWebBrowserAppleCxx.cpp +9 -0
- package/nitrogen/generated/apple/NitroWebBrowserAppleCxx/include/NitroWebBrowserAppleCxx/NitroWebBrowserAppleCxx.h +103 -0
- package/nitrogen/generated/apple/NitroWebBrowserAutolinking.cpp +20 -0
- package/nitrogen/generated/apple/NitroWebBrowserAutolinking.mm +24 -0
- package/nitrogen/generated/apple/c++/HybridWebBrowserSpecSwift.cpp +173 -0
- package/nitrogen/generated/apple/c++/HybridWebBrowserSpec_cxx-Swift.cpp +28 -0
- package/nitrogen/generated/apple/c++/ListenerSubscription-Swift.cpp +37 -0
- package/nitrogen/generated/apple/c++/NativeAppStateStatus-Swift.cpp +55 -0
- package/nitrogen/generated/apple/c++/NativeRedirectEvent-Swift.cpp +32 -0
- package/nitrogen/generated/apple/c++/NativeServiceActionResult-Swift.cpp +32 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserAuthSessionResult-Swift.cpp +34 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserAuthSessionResultType-Swift.cpp +49 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserCustomTabsResults-Swift.cpp +35 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserDismissButtonStyle-Swift.cpp +49 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserOpenOptions-Swift.cpp +47 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserPresentationStyle-Swift.cpp +64 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserResult-Swift.cpp +32 -0
- package/nitrogen/generated/apple/c++/NativeWebBrowserResultType-Swift.cpp +52 -0
- package/nitrogen/generated/apple/c++/Record_swift__String_swift__String-Swift.cpp +26 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/NitroWebBrowserAutolinking.hpp +13 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/HybridWebBrowserSpecSwift.hpp +84 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/HybridWebBrowserSpec_cxx-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/ListenerSubscription-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeAppStateStatus-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeRedirectEvent-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeServiceActionResult-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserAuthSessionResult-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserAuthSessionResultType-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserCustomTabsResults-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserDismissButtonStyle-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserOpenOptions-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserPresentationStyle-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserResult-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NativeWebBrowserResultType-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/NitroWebBrowser-Swift-Cxx-Umbrella.hpp +50 -0
- package/nitrogen/generated/apple/c++/include/NitroWebBrowser/private/Record_swift__String_swift__String-Swift.hpp +23 -0
- package/nitrogen/generated/apple/c++/include/module.modulemap +12 -0
- package/nitrogen/generated/apple/swift/Callback_void.swift +60 -0
- package/nitrogen/generated/apple/swift/Callback_void___NitroWebBrowser__NativeAppStateStatus.swift +66 -0
- package/nitrogen/generated/apple/swift/Callback_void___NitroWebBrowser__NativeRedirectEvent.swift +66 -0
- package/nitrogen/generated/apple/swift/HybridWebBrowserSpec.swift +77 -0
- package/nitrogen/generated/apple/swift/HybridWebBrowserSpec_cxx.swift +268 -0
- package/nitrogen/generated/apple/swift/ListenerSubscription.swift +29 -0
- package/nitrogen/generated/apple/swift/NativeAppStateStatus.swift +69 -0
- package/nitrogen/generated/apple/swift/NativeRedirectEvent.swift +28 -0
- package/nitrogen/generated/apple/swift/NativeServiceActionResult.swift +28 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserAuthSessionResult.swift +42 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserAuthSessionResultType.swift +59 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserCustomTabsResults.swift +49 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserDismissButtonStyle.swift +59 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserOpenOptions.swift +133 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserPresentationStyle.swift +84 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserResult.swift +28 -0
- package/nitrogen/generated/apple/swift/NativeWebBrowserResultType.swift +64 -0
- package/nitrogen/generated/apple/swift/Promise___NitroWebBrowser__NativeServiceActionResult.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroWebBrowser__NativeWebBrowserAuthSessionResult.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroWebBrowser__NativeWebBrowserCustomTabsResults.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise___NitroWebBrowser__NativeWebBrowserResult.swift +102 -0
- package/nitrogen/generated/apple/swift/Promise_void.swift +100 -0
- package/nitrogen/generated/apple/swift/Record_swift__String_swift__String.swift +48 -0
- package/nitrogen/generated/hybrid-classes.json +19 -0
- package/nitrogen/generated/shared/c++/NitroWebBrowserCxxModule.cpp +2 -0
- package/nitrogen/generated/shared/c++/include/NitroWebBrowser/NitroWebBrowserCxxModule.hpp +2 -0
- package/nitrogen/generated/shared/javascript/WebBrowser.cjs +19 -0
- package/nitrogen/generated/shared/javascript/WebBrowser.d.cts +9 -0
- package/package.json +44 -4
- package/src/ListenerSubscription.ts +3 -0
- package/src/WebBrowser.ts +279 -0
- package/src/WebBrowser.types.ts +284 -0
- package/src/index.ts +27 -0
- package/src/native.ts +9 -0
- package/src/platform/AppState.ts +22 -0
- package/src/platform/Linking.ts +17 -0
- package/src/specs/WebBrowser.nitro.ts +87 -0
package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/ListenerSubscription.kt
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ListenerSubscription.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.webbrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import com.margelo.nitro.core.Callback
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "ListenerSubscription".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class ListenerSubscription(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val remove: Callback<() -> Unit>
|
|
23
|
+
) {
|
|
24
|
+
override fun equals(other: Any?): Boolean {
|
|
25
|
+
if (this === other) return true
|
|
26
|
+
if (other !is ListenerSubscription) return false
|
|
27
|
+
return this.remove == other.remove
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
override fun hashCode(): Int {
|
|
31
|
+
return this.remove.hashCode()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
companion object {
|
|
35
|
+
/**
|
|
36
|
+
* Constructor called from C++
|
|
37
|
+
*/
|
|
38
|
+
@DoNotStrip
|
|
39
|
+
@Keep
|
|
40
|
+
@Suppress("unused")
|
|
41
|
+
@JvmStatic
|
|
42
|
+
private fun fromCpp(remove: Callback<() -> Unit>): ListenerSubscription {
|
|
43
|
+
return ListenerSubscription(remove)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeAppStateStatus.kt
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NativeAppStateStatus.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.webbrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "NativeAppStateStatus".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class NativeAppStateStatus(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
ACTIVE(0),
|
|
20
|
+
BACKGROUND(1),
|
|
21
|
+
INACTIVE(2),
|
|
22
|
+
UNKNOWN(3),
|
|
23
|
+
EXTENSION(4);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Get the String value this NativeAppStateStatus represents.
|
|
27
|
+
*/
|
|
28
|
+
val stringValue: String
|
|
29
|
+
get() =
|
|
30
|
+
when (this) {
|
|
31
|
+
ACTIVE -> "active"
|
|
32
|
+
BACKGROUND -> "background"
|
|
33
|
+
INACTIVE -> "inactive"
|
|
34
|
+
UNKNOWN -> "unknown"
|
|
35
|
+
EXTENSION -> "extension"
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
override fun toString(): String = stringValue
|
|
39
|
+
|
|
40
|
+
companion object {
|
|
41
|
+
/**
|
|
42
|
+
* Get a NativeAppStateStatus for the given String value, or
|
|
43
|
+
* return `null` if the given value was invalid/unknown.
|
|
44
|
+
*/
|
|
45
|
+
fun fromString(value: String): NativeAppStateStatus? =
|
|
46
|
+
when (value) {
|
|
47
|
+
"active" -> ACTIVE
|
|
48
|
+
"background" -> BACKGROUND
|
|
49
|
+
"inactive" -> INACTIVE
|
|
50
|
+
"unknown" -> UNKNOWN
|
|
51
|
+
"extension" -> EXTENSION
|
|
52
|
+
else -> null
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NativeRedirectEvent.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.webbrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "NativeRedirectEvent".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class NativeRedirectEvent(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val url: String
|
|
23
|
+
) {
|
|
24
|
+
override fun equals(other: Any?): Boolean {
|
|
25
|
+
if (this === other) return true
|
|
26
|
+
if (other !is NativeRedirectEvent) return false
|
|
27
|
+
return this.url == other.url
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
override fun hashCode(): Int {
|
|
31
|
+
return this.url.hashCode()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
companion object {
|
|
35
|
+
/**
|
|
36
|
+
* Constructor called from C++
|
|
37
|
+
*/
|
|
38
|
+
@DoNotStrip
|
|
39
|
+
@Keep
|
|
40
|
+
@Suppress("unused")
|
|
41
|
+
@JvmStatic
|
|
42
|
+
private fun fromCpp(url: String): NativeRedirectEvent {
|
|
43
|
+
return NativeRedirectEvent(url)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeServiceActionResult.kt
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NativeServiceActionResult.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.webbrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "NativeServiceActionResult".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class NativeServiceActionResult(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val servicePackage: String?
|
|
23
|
+
) {
|
|
24
|
+
override fun equals(other: Any?): Boolean {
|
|
25
|
+
if (this === other) return true
|
|
26
|
+
if (other !is NativeServiceActionResult) return false
|
|
27
|
+
return (this.servicePackage == null && other.servicePackage == null || this.servicePackage != null && other.servicePackage != null && this.servicePackage == other.servicePackage)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
override fun hashCode(): Int {
|
|
31
|
+
return (if (this.servicePackage != null) this.servicePackage.hashCode() else 0)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
companion object {
|
|
35
|
+
/**
|
|
36
|
+
* Constructor called from C++
|
|
37
|
+
*/
|
|
38
|
+
@DoNotStrip
|
|
39
|
+
@Keep
|
|
40
|
+
@Suppress("unused")
|
|
41
|
+
@JvmStatic
|
|
42
|
+
private fun fromCpp(servicePackage: String?): NativeServiceActionResult {
|
|
43
|
+
return NativeServiceActionResult(servicePackage)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NativeWebBrowserAuthSessionResult.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.webbrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "NativeWebBrowserAuthSessionResult".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class NativeWebBrowserAuthSessionResult(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val type: NativeWebBrowserAuthSessionResultType,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val url: String?,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val error: String?
|
|
29
|
+
) {
|
|
30
|
+
override fun equals(other: Any?): Boolean {
|
|
31
|
+
if (this === other) return true
|
|
32
|
+
if (other !is NativeWebBrowserAuthSessionResult) return false
|
|
33
|
+
return this.type == other.type
|
|
34
|
+
&& (this.url == null && other.url == null || this.url != null && other.url != null && this.url == other.url)
|
|
35
|
+
&& (this.error == null && other.error == null || this.error != null && other.error != null && this.error == other.error)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
override fun hashCode(): Int {
|
|
39
|
+
var result = this.type.hashCode()
|
|
40
|
+
result = 31 * result + (if (this.url != null) this.url.hashCode() else 0)
|
|
41
|
+
result = 31 * result + (if (this.error != null) this.error.hashCode() else 0)
|
|
42
|
+
return result
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
companion object {
|
|
46
|
+
/**
|
|
47
|
+
* Constructor called from C++
|
|
48
|
+
*/
|
|
49
|
+
@DoNotStrip
|
|
50
|
+
@Keep
|
|
51
|
+
@Suppress("unused")
|
|
52
|
+
@JvmStatic
|
|
53
|
+
private fun fromCpp(type: NativeWebBrowserAuthSessionResultType, url: String?, error: String?): NativeWebBrowserAuthSessionResult {
|
|
54
|
+
return NativeWebBrowserAuthSessionResult(type, url, error)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NativeWebBrowserAuthSessionResultType.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.webbrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "NativeWebBrowserAuthSessionResultType".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class NativeWebBrowserAuthSessionResultType(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
CANCEL(0),
|
|
20
|
+
DISMISS(1),
|
|
21
|
+
SUCCESS(2);
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get the String value this NativeWebBrowserAuthSessionResultType represents.
|
|
25
|
+
*/
|
|
26
|
+
val stringValue: String
|
|
27
|
+
get() =
|
|
28
|
+
when (this) {
|
|
29
|
+
CANCEL -> "cancel"
|
|
30
|
+
DISMISS -> "dismiss"
|
|
31
|
+
SUCCESS -> "success"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
override fun toString(): String = stringValue
|
|
35
|
+
|
|
36
|
+
companion object {
|
|
37
|
+
/**
|
|
38
|
+
* Get a NativeWebBrowserAuthSessionResultType for the given String value, or
|
|
39
|
+
* return `null` if the given value was invalid/unknown.
|
|
40
|
+
*/
|
|
41
|
+
fun fromString(value: String): NativeWebBrowserAuthSessionResultType? =
|
|
42
|
+
when (value) {
|
|
43
|
+
"cancel" -> CANCEL
|
|
44
|
+
"dismiss" -> DISMISS
|
|
45
|
+
"success" -> SUCCESS
|
|
46
|
+
else -> null
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NativeWebBrowserCustomTabsResults.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.webbrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "NativeWebBrowserCustomTabsResults".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class NativeWebBrowserCustomTabsResults(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val defaultBrowserPackage: String?,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val preferredBrowserPackage: String?,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val browserPackages: Array<String>,
|
|
29
|
+
@DoNotStrip
|
|
30
|
+
@Keep
|
|
31
|
+
val servicePackages: Array<String>
|
|
32
|
+
) {
|
|
33
|
+
override fun equals(other: Any?): Boolean {
|
|
34
|
+
if (this === other) return true
|
|
35
|
+
if (other !is NativeWebBrowserCustomTabsResults) return false
|
|
36
|
+
return (this.defaultBrowserPackage == null && other.defaultBrowserPackage == null || this.defaultBrowserPackage != null && other.defaultBrowserPackage != null && this.defaultBrowserPackage == other.defaultBrowserPackage)
|
|
37
|
+
&& (this.preferredBrowserPackage == null && other.preferredBrowserPackage == null || this.preferredBrowserPackage != null && other.preferredBrowserPackage != null && this.preferredBrowserPackage == other.preferredBrowserPackage)
|
|
38
|
+
&& this.browserPackages.contentDeepEquals(other.browserPackages)
|
|
39
|
+
&& this.servicePackages.contentDeepEquals(other.servicePackages)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
override fun hashCode(): Int {
|
|
43
|
+
var result = (if (this.defaultBrowserPackage != null) this.defaultBrowserPackage.hashCode() else 0)
|
|
44
|
+
result = 31 * result + (if (this.preferredBrowserPackage != null) this.preferredBrowserPackage.hashCode() else 0)
|
|
45
|
+
result = 31 * result + this.browserPackages.contentDeepHashCode()
|
|
46
|
+
result = 31 * result + this.servicePackages.contentDeepHashCode()
|
|
47
|
+
return result
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
companion object {
|
|
51
|
+
/**
|
|
52
|
+
* Constructor called from C++
|
|
53
|
+
*/
|
|
54
|
+
@DoNotStrip
|
|
55
|
+
@Keep
|
|
56
|
+
@Suppress("unused")
|
|
57
|
+
@JvmStatic
|
|
58
|
+
private fun fromCpp(defaultBrowserPackage: String?, preferredBrowserPackage: String?, browserPackages: Array<String>, servicePackages: Array<String>): NativeWebBrowserCustomTabsResults {
|
|
59
|
+
return NativeWebBrowserCustomTabsResults(defaultBrowserPackage, preferredBrowserPackage, browserPackages, servicePackages)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NativeWebBrowserDismissButtonStyle.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.webbrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "NativeWebBrowserDismissButtonStyle".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class NativeWebBrowserDismissButtonStyle(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
CANCEL(0),
|
|
20
|
+
DONE(1),
|
|
21
|
+
CLOSE(2);
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get the String value this NativeWebBrowserDismissButtonStyle represents.
|
|
25
|
+
*/
|
|
26
|
+
val stringValue: String
|
|
27
|
+
get() =
|
|
28
|
+
when (this) {
|
|
29
|
+
CANCEL -> "cancel"
|
|
30
|
+
DONE -> "done"
|
|
31
|
+
CLOSE -> "close"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
override fun toString(): String = stringValue
|
|
35
|
+
|
|
36
|
+
companion object {
|
|
37
|
+
/**
|
|
38
|
+
* Get a NativeWebBrowserDismissButtonStyle for the given String value, or
|
|
39
|
+
* return `null` if the given value was invalid/unknown.
|
|
40
|
+
*/
|
|
41
|
+
fun fromString(value: String): NativeWebBrowserDismissButtonStyle? =
|
|
42
|
+
when (value) {
|
|
43
|
+
"cancel" -> CANCEL
|
|
44
|
+
"done" -> DONE
|
|
45
|
+
"close" -> CLOSE
|
|
46
|
+
else -> null
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NativeWebBrowserOpenOptions.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.webbrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "NativeWebBrowserOpenOptions".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class NativeWebBrowserOpenOptions(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val additionalHeaderFields: Map<String, String>?,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val toolbarColor: Double?,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val secondaryToolbarColor: Double?,
|
|
29
|
+
@DoNotStrip
|
|
30
|
+
@Keep
|
|
31
|
+
val browserPackage: String?,
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
@Keep
|
|
34
|
+
val showTitle: Boolean?,
|
|
35
|
+
@DoNotStrip
|
|
36
|
+
@Keep
|
|
37
|
+
val enableDefaultShareMenuItem: Boolean?,
|
|
38
|
+
@DoNotStrip
|
|
39
|
+
@Keep
|
|
40
|
+
val enableBarCollapsing: Boolean?,
|
|
41
|
+
@DoNotStrip
|
|
42
|
+
@Keep
|
|
43
|
+
val showInRecents: Boolean?,
|
|
44
|
+
@DoNotStrip
|
|
45
|
+
@Keep
|
|
46
|
+
val createTask: Boolean?,
|
|
47
|
+
@DoNotStrip
|
|
48
|
+
@Keep
|
|
49
|
+
val useProxyActivity: Boolean?,
|
|
50
|
+
@DoNotStrip
|
|
51
|
+
@Keep
|
|
52
|
+
val controlsColor: Double?,
|
|
53
|
+
@DoNotStrip
|
|
54
|
+
@Keep
|
|
55
|
+
val dismissButtonStyle: NativeWebBrowserDismissButtonStyle?,
|
|
56
|
+
@DoNotStrip
|
|
57
|
+
@Keep
|
|
58
|
+
val readerMode: Boolean?,
|
|
59
|
+
@DoNotStrip
|
|
60
|
+
@Keep
|
|
61
|
+
val presentationStyle: NativeWebBrowserPresentationStyle?,
|
|
62
|
+
@DoNotStrip
|
|
63
|
+
@Keep
|
|
64
|
+
val preferEphemeralSession: Boolean?,
|
|
65
|
+
@DoNotStrip
|
|
66
|
+
@Keep
|
|
67
|
+
val preferUniversalLinks: Boolean?
|
|
68
|
+
) {
|
|
69
|
+
override fun equals(other: Any?): Boolean {
|
|
70
|
+
if (this === other) return true
|
|
71
|
+
if (other !is NativeWebBrowserOpenOptions) return false
|
|
72
|
+
return (this.additionalHeaderFields == null && other.additionalHeaderFields == null || this.additionalHeaderFields != null && other.additionalHeaderFields != null && this.additionalHeaderFields == other.additionalHeaderFields)
|
|
73
|
+
&& (this.toolbarColor == null && other.toolbarColor == null || this.toolbarColor != null && other.toolbarColor != null && this.toolbarColor.toBits() == other.toolbarColor.toBits())
|
|
74
|
+
&& (this.secondaryToolbarColor == null && other.secondaryToolbarColor == null || this.secondaryToolbarColor != null && other.secondaryToolbarColor != null && this.secondaryToolbarColor.toBits() == other.secondaryToolbarColor.toBits())
|
|
75
|
+
&& (this.browserPackage == null && other.browserPackage == null || this.browserPackage != null && other.browserPackage != null && this.browserPackage == other.browserPackage)
|
|
76
|
+
&& (this.showTitle == null && other.showTitle == null || this.showTitle != null && other.showTitle != null && this.showTitle == other.showTitle)
|
|
77
|
+
&& (this.enableDefaultShareMenuItem == null && other.enableDefaultShareMenuItem == null || this.enableDefaultShareMenuItem != null && other.enableDefaultShareMenuItem != null && this.enableDefaultShareMenuItem == other.enableDefaultShareMenuItem)
|
|
78
|
+
&& (this.enableBarCollapsing == null && other.enableBarCollapsing == null || this.enableBarCollapsing != null && other.enableBarCollapsing != null && this.enableBarCollapsing == other.enableBarCollapsing)
|
|
79
|
+
&& (this.showInRecents == null && other.showInRecents == null || this.showInRecents != null && other.showInRecents != null && this.showInRecents == other.showInRecents)
|
|
80
|
+
&& (this.createTask == null && other.createTask == null || this.createTask != null && other.createTask != null && this.createTask == other.createTask)
|
|
81
|
+
&& (this.useProxyActivity == null && other.useProxyActivity == null || this.useProxyActivity != null && other.useProxyActivity != null && this.useProxyActivity == other.useProxyActivity)
|
|
82
|
+
&& (this.controlsColor == null && other.controlsColor == null || this.controlsColor != null && other.controlsColor != null && this.controlsColor.toBits() == other.controlsColor.toBits())
|
|
83
|
+
&& (this.dismissButtonStyle == null && other.dismissButtonStyle == null || this.dismissButtonStyle != null && other.dismissButtonStyle != null && this.dismissButtonStyle == other.dismissButtonStyle)
|
|
84
|
+
&& (this.readerMode == null && other.readerMode == null || this.readerMode != null && other.readerMode != null && this.readerMode == other.readerMode)
|
|
85
|
+
&& (this.presentationStyle == null && other.presentationStyle == null || this.presentationStyle != null && other.presentationStyle != null && this.presentationStyle == other.presentationStyle)
|
|
86
|
+
&& (this.preferEphemeralSession == null && other.preferEphemeralSession == null || this.preferEphemeralSession != null && other.preferEphemeralSession != null && this.preferEphemeralSession == other.preferEphemeralSession)
|
|
87
|
+
&& (this.preferUniversalLinks == null && other.preferUniversalLinks == null || this.preferUniversalLinks != null && other.preferUniversalLinks != null && this.preferUniversalLinks == other.preferUniversalLinks)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
override fun hashCode(): Int {
|
|
91
|
+
var result = (if (this.additionalHeaderFields != null) this.additionalHeaderFields.hashCode() else 0)
|
|
92
|
+
result = 31 * result + (if (this.toolbarColor != null) this.toolbarColor.hashCode() else 0)
|
|
93
|
+
result = 31 * result + (if (this.secondaryToolbarColor != null) this.secondaryToolbarColor.hashCode() else 0)
|
|
94
|
+
result = 31 * result + (if (this.browserPackage != null) this.browserPackage.hashCode() else 0)
|
|
95
|
+
result = 31 * result + (if (this.showTitle != null) this.showTitle.hashCode() else 0)
|
|
96
|
+
result = 31 * result + (if (this.enableDefaultShareMenuItem != null) this.enableDefaultShareMenuItem.hashCode() else 0)
|
|
97
|
+
result = 31 * result + (if (this.enableBarCollapsing != null) this.enableBarCollapsing.hashCode() else 0)
|
|
98
|
+
result = 31 * result + (if (this.showInRecents != null) this.showInRecents.hashCode() else 0)
|
|
99
|
+
result = 31 * result + (if (this.createTask != null) this.createTask.hashCode() else 0)
|
|
100
|
+
result = 31 * result + (if (this.useProxyActivity != null) this.useProxyActivity.hashCode() else 0)
|
|
101
|
+
result = 31 * result + (if (this.controlsColor != null) this.controlsColor.hashCode() else 0)
|
|
102
|
+
result = 31 * result + (if (this.dismissButtonStyle != null) this.dismissButtonStyle.hashCode() else 0)
|
|
103
|
+
result = 31 * result + (if (this.readerMode != null) this.readerMode.hashCode() else 0)
|
|
104
|
+
result = 31 * result + (if (this.presentationStyle != null) this.presentationStyle.hashCode() else 0)
|
|
105
|
+
result = 31 * result + (if (this.preferEphemeralSession != null) this.preferEphemeralSession.hashCode() else 0)
|
|
106
|
+
result = 31 * result + (if (this.preferUniversalLinks != null) this.preferUniversalLinks.hashCode() else 0)
|
|
107
|
+
return result
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
companion object {
|
|
111
|
+
/**
|
|
112
|
+
* Constructor called from C++
|
|
113
|
+
*/
|
|
114
|
+
@DoNotStrip
|
|
115
|
+
@Keep
|
|
116
|
+
@Suppress("unused")
|
|
117
|
+
@JvmStatic
|
|
118
|
+
private fun fromCpp(additionalHeaderFields: Map<String, String>?, toolbarColor: Double?, secondaryToolbarColor: Double?, browserPackage: String?, showTitle: Boolean?, enableDefaultShareMenuItem: Boolean?, enableBarCollapsing: Boolean?, showInRecents: Boolean?, createTask: Boolean?, useProxyActivity: Boolean?, controlsColor: Double?, dismissButtonStyle: NativeWebBrowserDismissButtonStyle?, readerMode: Boolean?, presentationStyle: NativeWebBrowserPresentationStyle?, preferEphemeralSession: Boolean?, preferUniversalLinks: Boolean?): NativeWebBrowserOpenOptions {
|
|
119
|
+
return NativeWebBrowserOpenOptions(additionalHeaderFields, toolbarColor, secondaryToolbarColor, browserPackage, showTitle, enableDefaultShareMenuItem, enableBarCollapsing, showInRecents, createTask, useProxyActivity, controlsColor, dismissButtonStyle, readerMode, presentationStyle, preferEphemeralSession, preferUniversalLinks)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NativeWebBrowserPresentationStyle.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.webbrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the JavaScript enum/union "NativeWebBrowserPresentationStyle".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class NativeWebBrowserPresentationStyle(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
FULLSCREEN(0),
|
|
20
|
+
PAGESHEET(1),
|
|
21
|
+
FORMSHEET(2),
|
|
22
|
+
CURRENTCONTEXT(3),
|
|
23
|
+
OVERFULLSCREEN(4),
|
|
24
|
+
OVERCURRENTCONTEXT(5),
|
|
25
|
+
POPOVER(6),
|
|
26
|
+
AUTOMATIC(7);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get the String value this NativeWebBrowserPresentationStyle represents.
|
|
30
|
+
*/
|
|
31
|
+
val stringValue: String
|
|
32
|
+
get() =
|
|
33
|
+
when (this) {
|
|
34
|
+
FULLSCREEN -> "fullScreen"
|
|
35
|
+
PAGESHEET -> "pageSheet"
|
|
36
|
+
FORMSHEET -> "formSheet"
|
|
37
|
+
CURRENTCONTEXT -> "currentContext"
|
|
38
|
+
OVERFULLSCREEN -> "overFullScreen"
|
|
39
|
+
OVERCURRENTCONTEXT -> "overCurrentContext"
|
|
40
|
+
POPOVER -> "popover"
|
|
41
|
+
AUTOMATIC -> "automatic"
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
override fun toString(): String = stringValue
|
|
45
|
+
|
|
46
|
+
companion object {
|
|
47
|
+
/**
|
|
48
|
+
* Get a NativeWebBrowserPresentationStyle for the given String value, or
|
|
49
|
+
* return `null` if the given value was invalid/unknown.
|
|
50
|
+
*/
|
|
51
|
+
fun fromString(value: String): NativeWebBrowserPresentationStyle? =
|
|
52
|
+
when (value) {
|
|
53
|
+
"fullScreen" -> FULLSCREEN
|
|
54
|
+
"pageSheet" -> PAGESHEET
|
|
55
|
+
"formSheet" -> FORMSHEET
|
|
56
|
+
"currentContext" -> CURRENTCONTEXT
|
|
57
|
+
"overFullScreen" -> OVERFULLSCREEN
|
|
58
|
+
"overCurrentContext" -> OVERCURRENTCONTEXT
|
|
59
|
+
"popover" -> POPOVER
|
|
60
|
+
"automatic" -> AUTOMATIC
|
|
61
|
+
else -> null
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/webbrowser/NativeWebBrowserResult.kt
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// NativeWebBrowserResult.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/margelo/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.webbrowser
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "NativeWebBrowserResult".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class NativeWebBrowserResult(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val type: NativeWebBrowserResultType
|
|
23
|
+
) {
|
|
24
|
+
override fun equals(other: Any?): Boolean {
|
|
25
|
+
if (this === other) return true
|
|
26
|
+
if (other !is NativeWebBrowserResult) return false
|
|
27
|
+
return this.type == other.type
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
override fun hashCode(): Int {
|
|
31
|
+
return this.type.hashCode()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
companion object {
|
|
35
|
+
/**
|
|
36
|
+
* Constructor called from C++
|
|
37
|
+
*/
|
|
38
|
+
@DoNotStrip
|
|
39
|
+
@Keep
|
|
40
|
+
@Suppress("unused")
|
|
41
|
+
@JvmStatic
|
|
42
|
+
private fun fromCpp(type: NativeWebBrowserResultType): NativeWebBrowserResult {
|
|
43
|
+
return NativeWebBrowserResult(type)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|