react-native-audio-browser 0.2.0-next.12 → 0.2.0-next.14
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/README.md +10 -0
- package/android/build.gradle +20 -1
- package/android/src/main/java/com/audiobrowser/AudioBrowser.kt +8 -1
- package/android/src/main/java/com/audiobrowser/browser/BrowserManager.kt +52 -0
- package/android/src/main/java/com/audiobrowser/browser/InertStyleDiagnostic.kt +267 -0
- package/android/src/main/java/com/audiobrowser/browser/JsonModels.kt +27 -11
- package/android/src/main/java/com/audiobrowser/browser/SectionScope.kt +1 -1
- package/android/src/main/java/com/audiobrowser/browser/StyleResolver.kt +11 -0
- package/android/src/main/java/com/audiobrowser/extension/ResolvedTrackExt.kt +11 -1
- package/android/src/main/java/com/audiobrowser/model/PlayerUpdateOptions.kt +1 -1
- package/android/src/main/java/com/audiobrowser/player/MediaSessionCallback.kt +21 -22
- package/android/src/main/java/com/audiobrowser/player/PlaybackStateStore.kt +17 -2
- package/android/src/main/java/com/audiobrowser/player/Player.kt +3 -0
- package/android/src/main/java/com/audiobrowser/player/ShuffleOrderLedBy.kt +30 -0
- package/android/src/main/java/com/audiobrowser/util/StyleWire.kt +73 -0
- package/android/src/main/java/com/audiobrowser/util/TrackFactory.kt +16 -6
- package/android/src/main/res/values/strings.xml +37 -2
- package/android/src/test/java/com/audiobrowser/TestFixtures.kt +50 -5
- package/android/src/test/java/com/audiobrowser/browser/BrowserManagerLayerResolutionTest.kt +9 -0
- package/android/src/test/java/com/audiobrowser/browser/BrowserManagerTest.kt +3 -2
- package/android/src/test/java/com/audiobrowser/browser/InertStyleDiagnosticTest.kt +277 -0
- package/android/src/test/java/com/audiobrowser/browser/JsonStyleTest.kt +56 -0
- package/android/src/test/java/com/audiobrowser/browser/SectionScopeTest.kt +4 -4
- package/android/src/test/java/com/audiobrowser/browser/StyleResolverTest.kt +77 -10
- package/android/src/test/java/com/audiobrowser/player/PlaybackStateStoreTrackJsonTest.kt +2 -2
- package/android/src/test/java/com/audiobrowser/player/ShuffleOrderLedByTest.kt +79 -0
- package/android/src/test/java/com/audiobrowser/util/MediaExtrasBuilderTest.kt +10 -9
- package/ios/Browser/BrowserManager.swift +106 -45
- package/ios/Browser/InertStyleDiagnostic.swift +279 -0
- package/ios/Browser/JsonModels.swift +81 -15
- package/ios/Browser/SectionPresentation.swift +30 -0
- package/ios/Browser/StyleResolver.swift +11 -0
- package/ios/Browser/TabBarEntries.swift +7 -1
- package/ios/CarPlay/CarPlayController.swift +139 -35
- package/ios/CarPlay/CarPlayListItemFactory.swift +99 -27
- package/ios/Extension/Section+Copying.swift +1 -3
- package/ios/Extension/UIApplication+ActiveScene.swift +27 -0
- package/ios/Http/HttpClient.swift +8 -2
- package/ios/HybridAudioBrowser.swift +56 -12
- package/ios/Model/NitroTypeStubs.swift +60 -1
- package/ios/Player/MediaIntentCriteria.swift +13 -5
- package/ios/Player/MediaLoader.swift +33 -9
- package/ios/Player/NowPlayingUpdater.swift +53 -5
- package/ios/Player/PlaybackCoordinator.swift +11 -4
- package/ios/Player/PlaybackTimer.swift +8 -2
- package/ios/Player/QueueManager.swift +36 -10
- package/ios/Player/ShuffleOrder.swift +23 -0
- package/ios/Player/SleepTimerHandling.swift +13 -0
- package/ios/RemoteCommand/RemoteCommandController.swift +53 -18
- package/ios/Tests/InertStyleDiagnosticTests.swift +200 -0
- package/ios/Tests/JsonModelsTests.swift +76 -1
- package/ios/Tests/QueueManagerTests.swift +72 -6
- package/ios/Tests/RemoteCommandControllerTests.swift +16 -0
- package/ios/Tests/ResolvedTrackCopyingTests.swift +2 -2
- package/ios/Tests/SectionPresentationTests.swift +29 -0
- package/ios/Tests/StyleResolverTests.swift +60 -0
- package/ios/Tests/Support/TestTypes.swift +7 -0
- package/ios/TrackPlayer.swift +57 -34
- package/ios/Util/NetworkMonitor.swift +43 -26
- package/ios/Util/SFSymbolRenderer.swift +24 -2
- package/ios/Util/SVGProcessor.swift +9 -2
- package/lib/commonjs/features/browser-config.js +1 -0
- package/lib/commonjs/features/browser-config.js.map +1 -1
- package/lib/commonjs/features/playback/progress.js +2 -1
- package/lib/commonjs/features/playback/progress.js.map +1 -1
- package/lib/commonjs/features/playback/rate.js +8 -1
- package/lib/commonjs/features/playback/rate.js.map +1 -1
- package/lib/commonjs/web/TrackPlayer/QueueManager.js +14 -0
- package/lib/commonjs/web/TrackPlayer/QueueManager.js.map +1 -1
- package/lib/module/features/browser-config.js +1 -0
- package/lib/module/features/browser-config.js.map +1 -1
- package/lib/module/features/playback/progress.js +2 -1
- package/lib/module/features/playback/progress.js.map +1 -1
- package/lib/module/features/playback/rate.js +8 -1
- package/lib/module/features/playback/rate.js.map +1 -1
- package/lib/module/web/TrackPlayer/QueueManager.js +14 -0
- package/lib/module/web/TrackPlayer/QueueManager.js.map +1 -1
- package/lib/typescript/src/features/browser-config.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/progress.d.ts.map +1 -1
- package/lib/typescript/src/features/playback/rate.d.ts +8 -1
- package/lib/typescript/src/features/playback/rate.d.ts.map +1 -1
- package/lib/typescript/src/types/browser-native.d.ts +2 -1
- package/lib/typescript/src/types/browser-native.d.ts.map +1 -1
- package/lib/typescript/src/types/browser-nodes.d.ts +116 -9
- package/lib/typescript/src/types/browser-nodes.d.ts.map +1 -1
- package/lib/typescript/src/types/browser.d.ts +36 -0
- package/lib/typescript/src/types/browser.d.ts.map +1 -1
- package/nitrogen/generated/android/AudioBrowserOnLoad.cpp +2 -0
- package/nitrogen/generated/android/c++/JArtworkRequestConfig.hpp +4 -0
- package/nitrogen/generated/android/c++/JBrowseResult.hpp +6 -0
- package/nitrogen/generated/android/c++/JCardImage.hpp +58 -0
- package/nitrogen/generated/android/c++/JFavoriteChangedEvent.hpp +4 -0
- package/nitrogen/generated/android/c++/JFormatNowPlayingParams.hpp +4 -0
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_RequestConfig___Track.hpp +4 -0
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__optional_NowPlayingUpdate____FormatNowPlayingParams.hpp +4 -0
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__optional_std__string____Track.hpp +4 -0
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_RequestConfig_____Track.hpp +4 -0
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_std__vector_Track______SearchParams.hpp +4 -0
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_void_____TrackLoadEvent.hpp +4 -0
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__string__.hpp +102 -0
- package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__variant_ResolvedTrack__BrowseError__std__shared_ptr_Promise_std__variant_ResolvedTrack__BrowseError_______BrowserSourceCallbackParam.hpp +6 -0
- package/nitrogen/generated/android/c++/JFunc_void_FavoriteChangedEvent.hpp +4 -0
- package/nitrogen/generated/android/c++/JFunc_void_PlaybackActiveTrackChangedEvent.hpp +4 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__optional_ResolvedTrack_.hpp +6 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__vector_Track_.hpp +4 -0
- package/nitrogen/generated/android/c++/JGridTile.hpp +61 -0
- package/nitrogen/generated/android/c++/JHybridAudioBrowserSpec.cpp +13 -0
- package/nitrogen/generated/android/c++/JImageShape.hpp +58 -0
- package/nitrogen/generated/android/c++/JMediaRequestConfig.hpp +4 -0
- package/nitrogen/generated/android/c++/JNativeBrowserConfiguration.hpp +20 -1
- package/nitrogen/generated/android/c++/JNativeRouteEntry.hpp +6 -0
- package/nitrogen/generated/android/c++/JNativeSetupPlayerOptions.hpp +4 -0
- package/nitrogen/generated/android/c++/JPlaybackActiveTrackChangedEvent.hpp +4 -0
- package/nitrogen/generated/android/c++/JResolvedTrack.hpp +6 -0
- package/nitrogen/generated/android/c++/JSection.hpp +7 -5
- package/nitrogen/generated/android/c++/JSectionStyle.hpp +30 -3
- package/nitrogen/generated/android/c++/JTrack.hpp +4 -0
- package/nitrogen/generated/android/c++/JTrackLoadEvent.hpp +4 -0
- package/nitrogen/generated/android/c++/JTrackStyle.hpp +24 -3
- package/nitrogen/generated/android/c++/JVariant_ResolvedTrack_BrowseError_Promise_BrowseResult_.hpp +6 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/CardImage.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/Func_std__shared_ptr_Promise_std__string__.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/GridTile.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/ImageShape.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/NativeBrowserConfiguration.kt +7 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/Section.kt +2 -5
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/SectionStyle.kt +18 -3
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/audiobrowser/TrackStyle.kt +15 -3
- package/nitrogen/generated/ios/AudioBrowser-Swift-Cxx-Bridge.cpp +9 -0
- package/nitrogen/generated/ios/AudioBrowser-Swift-Cxx-Bridge.hpp +104 -0
- package/nitrogen/generated/ios/AudioBrowser-Swift-Cxx-Umbrella.hpp +9 -0
- package/nitrogen/generated/ios/c++/HybridAudioBrowserSpecSwift.hpp +9 -0
- package/nitrogen/generated/ios/swift/CardImage.swift +40 -0
- package/nitrogen/generated/ios/swift/Func_std__shared_ptr_Promise_std__string__.swift +54 -0
- package/nitrogen/generated/ios/swift/GridTile.swift +44 -0
- package/nitrogen/generated/ios/swift/ImageShape.swift +40 -0
- package/nitrogen/generated/ios/swift/NativeBrowserConfiguration.swift +48 -1
- package/nitrogen/generated/ios/swift/Section.swift +1 -19
- package/nitrogen/generated/ios/swift/SectionStyle.swift +70 -1
- package/nitrogen/generated/ios/swift/TrackStyle.swift +59 -1
- package/nitrogen/generated/shared/c++/CardImage.hpp +76 -0
- package/nitrogen/generated/shared/c++/GridTile.hpp +80 -0
- package/nitrogen/generated/shared/c++/ImageShape.hpp +76 -0
- package/nitrogen/generated/shared/c++/NativeBrowserConfiguration.hpp +6 -2
- package/nitrogen/generated/shared/c++/Section.hpp +1 -5
- package/nitrogen/generated/shared/c++/SectionStyle.hpp +32 -2
- package/nitrogen/generated/shared/c++/TrackStyle.hpp +25 -2
- package/package.json +7 -2
- package/src/features/browser-config.ts +1 -0
- package/src/features/playback/progress.ts +2 -1
- package/src/features/playback/rate.ts +8 -1
- package/src/style-resolution.test.ts +72 -1
- package/src/types/browser-native.ts +5 -1
- package/src/types/browser-nodes.ts +124 -9
- package/src/types/browser.ts +38 -0
- package/src/web/TrackPlayer/QueueManager.test.ts +29 -0
- package/src/web/TrackPlayer/QueueManager.ts +14 -0
- package/website/guide/android-auto.md +114 -0
- package/website/guide/android-certificates.md +409 -0
- package/website/guide/artwork.md +255 -0
- package/website/guide/audio-output.md +135 -0
- package/website/guide/automotive.md +86 -0
- package/website/guide/basic-usage.md +151 -0
- package/website/guide/battery.md +115 -0
- package/website/guide/browser.md +581 -0
- package/website/guide/carplay.md +620 -0
- package/website/guide/configuration.md +173 -0
- package/website/guide/equalizer.md +231 -0
- package/website/guide/errors.md +310 -0
- package/website/guide/favorites.md +154 -0
- package/website/guide/gate.md +143 -0
- package/website/guide/getting-started.md +46 -0
- package/website/guide/hooks.md +238 -0
- package/website/guide/live-streams.md +125 -0
- package/website/guide/metadata.md +239 -0
- package/website/guide/migrating-from-track-player.md +244 -0
- package/website/guide/native-callback-fetch.md +127 -0
- package/website/guide/network.md +86 -0
- package/website/guide/now-playing.md +175 -0
- package/website/guide/playback.md +328 -0
- package/website/guide/queue.md +300 -0
- package/website/guide/remote-controls.md +256 -0
- package/website/guide/search.md +255 -0
- package/website/guide/sleep-timer.md +268 -0
- package/website/guide/track.md +246 -0
|
@@ -18,13 +18,19 @@ public extension SectionStyle {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `SectionStyle`.
|
|
20
20
|
*/
|
|
21
|
-
init(gridWrap: Bool?, display: StyleDisplay?, artworkRendering: ArtworkRendering?) {
|
|
21
|
+
init(gridWrap: Bool?, gridTile: GridTile?, display: StyleDisplay?, artworkRendering: ArtworkRendering?, imageShape: ImageShape?, accessorySymbol: String?, cardTint: String?, cardImage: CardImage?) {
|
|
22
22
|
self.init({ () -> bridge.std__optional_bool_ in
|
|
23
23
|
if let __unwrappedValue = gridWrap {
|
|
24
24
|
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
25
25
|
} else {
|
|
26
26
|
return .init()
|
|
27
27
|
}
|
|
28
|
+
}(), { () -> bridge.std__optional_GridTile_ in
|
|
29
|
+
if let __unwrappedValue = gridTile {
|
|
30
|
+
return bridge.create_std__optional_GridTile_(__unwrappedValue)
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
28
34
|
}(), { () -> bridge.std__optional_StyleDisplay_ in
|
|
29
35
|
if let __unwrappedValue = display {
|
|
30
36
|
return bridge.create_std__optional_StyleDisplay_(__unwrappedValue)
|
|
@@ -37,6 +43,30 @@ public extension SectionStyle {
|
|
|
37
43
|
} else {
|
|
38
44
|
return .init()
|
|
39
45
|
}
|
|
46
|
+
}(), { () -> bridge.std__optional_ImageShape_ in
|
|
47
|
+
if let __unwrappedValue = imageShape {
|
|
48
|
+
return bridge.create_std__optional_ImageShape_(__unwrappedValue)
|
|
49
|
+
} else {
|
|
50
|
+
return .init()
|
|
51
|
+
}
|
|
52
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
53
|
+
if let __unwrappedValue = accessorySymbol {
|
|
54
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
55
|
+
} else {
|
|
56
|
+
return .init()
|
|
57
|
+
}
|
|
58
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
59
|
+
if let __unwrappedValue = cardTint {
|
|
60
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
61
|
+
} else {
|
|
62
|
+
return .init()
|
|
63
|
+
}
|
|
64
|
+
}(), { () -> bridge.std__optional_CardImage_ in
|
|
65
|
+
if let __unwrappedValue = cardImage {
|
|
66
|
+
return bridge.create_std__optional_CardImage_(__unwrappedValue)
|
|
67
|
+
} else {
|
|
68
|
+
return .init()
|
|
69
|
+
}
|
|
40
70
|
}())
|
|
41
71
|
}
|
|
42
72
|
|
|
@@ -52,6 +82,11 @@ public extension SectionStyle {
|
|
|
52
82
|
}()
|
|
53
83
|
}
|
|
54
84
|
|
|
85
|
+
@inline(__always)
|
|
86
|
+
var gridTile: GridTile? {
|
|
87
|
+
return self.__gridTile.value
|
|
88
|
+
}
|
|
89
|
+
|
|
55
90
|
@inline(__always)
|
|
56
91
|
var display: StyleDisplay? {
|
|
57
92
|
return self.__display.value
|
|
@@ -61,4 +96,38 @@ public extension SectionStyle {
|
|
|
61
96
|
var artworkRendering: ArtworkRendering? {
|
|
62
97
|
return self.__artworkRendering.value
|
|
63
98
|
}
|
|
99
|
+
|
|
100
|
+
@inline(__always)
|
|
101
|
+
var imageShape: ImageShape? {
|
|
102
|
+
return self.__imageShape.value
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@inline(__always)
|
|
106
|
+
var accessorySymbol: String? {
|
|
107
|
+
return { () -> String? in
|
|
108
|
+
if bridge.has_value_std__optional_std__string_(self.__accessorySymbol) {
|
|
109
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__accessorySymbol)
|
|
110
|
+
return String(__unwrapped)
|
|
111
|
+
} else {
|
|
112
|
+
return nil
|
|
113
|
+
}
|
|
114
|
+
}()
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
@inline(__always)
|
|
118
|
+
var cardTint: String? {
|
|
119
|
+
return { () -> String? in
|
|
120
|
+
if bridge.has_value_std__optional_std__string_(self.__cardTint) {
|
|
121
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__cardTint)
|
|
122
|
+
return String(__unwrapped)
|
|
123
|
+
} else {
|
|
124
|
+
return nil
|
|
125
|
+
}
|
|
126
|
+
}()
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@inline(__always)
|
|
130
|
+
var cardImage: CardImage? {
|
|
131
|
+
return self.__cardImage.value
|
|
132
|
+
}
|
|
64
133
|
}
|
|
@@ -18,7 +18,7 @@ public extension TrackStyle {
|
|
|
18
18
|
/**
|
|
19
19
|
* Create a new instance of `TrackStyle`.
|
|
20
20
|
*/
|
|
21
|
-
init(display: StyleDisplay?, artworkRendering: ArtworkRendering?) {
|
|
21
|
+
init(display: StyleDisplay?, artworkRendering: ArtworkRendering?, imageShape: ImageShape?, accessorySymbol: String?, cardTint: String?, cardImage: CardImage?) {
|
|
22
22
|
self.init({ () -> bridge.std__optional_StyleDisplay_ in
|
|
23
23
|
if let __unwrappedValue = display {
|
|
24
24
|
return bridge.create_std__optional_StyleDisplay_(__unwrappedValue)
|
|
@@ -31,6 +31,30 @@ public extension TrackStyle {
|
|
|
31
31
|
} else {
|
|
32
32
|
return .init()
|
|
33
33
|
}
|
|
34
|
+
}(), { () -> bridge.std__optional_ImageShape_ in
|
|
35
|
+
if let __unwrappedValue = imageShape {
|
|
36
|
+
return bridge.create_std__optional_ImageShape_(__unwrappedValue)
|
|
37
|
+
} else {
|
|
38
|
+
return .init()
|
|
39
|
+
}
|
|
40
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
41
|
+
if let __unwrappedValue = accessorySymbol {
|
|
42
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
43
|
+
} else {
|
|
44
|
+
return .init()
|
|
45
|
+
}
|
|
46
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
47
|
+
if let __unwrappedValue = cardTint {
|
|
48
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
49
|
+
} else {
|
|
50
|
+
return .init()
|
|
51
|
+
}
|
|
52
|
+
}(), { () -> bridge.std__optional_CardImage_ in
|
|
53
|
+
if let __unwrappedValue = cardImage {
|
|
54
|
+
return bridge.create_std__optional_CardImage_(__unwrappedValue)
|
|
55
|
+
} else {
|
|
56
|
+
return .init()
|
|
57
|
+
}
|
|
34
58
|
}())
|
|
35
59
|
}
|
|
36
60
|
|
|
@@ -43,4 +67,38 @@ public extension TrackStyle {
|
|
|
43
67
|
var artworkRendering: ArtworkRendering? {
|
|
44
68
|
return self.__artworkRendering.value
|
|
45
69
|
}
|
|
70
|
+
|
|
71
|
+
@inline(__always)
|
|
72
|
+
var imageShape: ImageShape? {
|
|
73
|
+
return self.__imageShape.value
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@inline(__always)
|
|
77
|
+
var accessorySymbol: String? {
|
|
78
|
+
return { () -> String? in
|
|
79
|
+
if bridge.has_value_std__optional_std__string_(self.__accessorySymbol) {
|
|
80
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__accessorySymbol)
|
|
81
|
+
return String(__unwrapped)
|
|
82
|
+
} else {
|
|
83
|
+
return nil
|
|
84
|
+
}
|
|
85
|
+
}()
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@inline(__always)
|
|
89
|
+
var cardTint: String? {
|
|
90
|
+
return { () -> String? in
|
|
91
|
+
if bridge.has_value_std__optional_std__string_(self.__cardTint) {
|
|
92
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__cardTint)
|
|
93
|
+
return String(__unwrapped)
|
|
94
|
+
} else {
|
|
95
|
+
return nil
|
|
96
|
+
}
|
|
97
|
+
}()
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@inline(__always)
|
|
101
|
+
var cardImage: CardImage? {
|
|
102
|
+
return self.__cardImage.value
|
|
103
|
+
}
|
|
46
104
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CardImage.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::audiobrowser {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (CardImage).
|
|
30
|
+
*/
|
|
31
|
+
enum class CardImage {
|
|
32
|
+
NORMAL SWIFT_NAME(normal) = 0,
|
|
33
|
+
BACKGROUND SWIFT_NAME(background) = 1,
|
|
34
|
+
} CLOSED_ENUM;
|
|
35
|
+
|
|
36
|
+
} // namespace margelo::nitro::audiobrowser
|
|
37
|
+
|
|
38
|
+
namespace margelo::nitro {
|
|
39
|
+
|
|
40
|
+
// C++ CardImage <> JS CardImage (union)
|
|
41
|
+
template <>
|
|
42
|
+
struct JSIConverter<margelo::nitro::audiobrowser::CardImage> final {
|
|
43
|
+
static inline margelo::nitro::audiobrowser::CardImage fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
44
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
45
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
46
|
+
case hashString("normal"): return margelo::nitro::audiobrowser::CardImage::NORMAL;
|
|
47
|
+
case hashString("background"): return margelo::nitro::audiobrowser::CardImage::BACKGROUND;
|
|
48
|
+
default: [[unlikely]]
|
|
49
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum CardImage - invalid value!");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::audiobrowser::CardImage arg) {
|
|
53
|
+
switch (arg) {
|
|
54
|
+
case margelo::nitro::audiobrowser::CardImage::NORMAL: return JSIConverter<std::string>::toJSI(runtime, "normal");
|
|
55
|
+
case margelo::nitro::audiobrowser::CardImage::BACKGROUND: return JSIConverter<std::string>::toJSI(runtime, "background");
|
|
56
|
+
default: [[unlikely]]
|
|
57
|
+
throw std::invalid_argument("Cannot convert CardImage to JS - invalid value: "
|
|
58
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
62
|
+
if (!value.isString()) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
66
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
67
|
+
case hashString("normal"):
|
|
68
|
+
case hashString("background"):
|
|
69
|
+
return true;
|
|
70
|
+
default:
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// GridTile.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::audiobrowser {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (GridTile).
|
|
30
|
+
*/
|
|
31
|
+
enum class GridTile {
|
|
32
|
+
PLAIN SWIFT_NAME(plain) = 0,
|
|
33
|
+
CARD SWIFT_NAME(card) = 1,
|
|
34
|
+
CONDENSED SWIFT_NAME(condensed) = 2,
|
|
35
|
+
} CLOSED_ENUM;
|
|
36
|
+
|
|
37
|
+
} // namespace margelo::nitro::audiobrowser
|
|
38
|
+
|
|
39
|
+
namespace margelo::nitro {
|
|
40
|
+
|
|
41
|
+
// C++ GridTile <> JS GridTile (union)
|
|
42
|
+
template <>
|
|
43
|
+
struct JSIConverter<margelo::nitro::audiobrowser::GridTile> final {
|
|
44
|
+
static inline margelo::nitro::audiobrowser::GridTile fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
45
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
46
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
47
|
+
case hashString("plain"): return margelo::nitro::audiobrowser::GridTile::PLAIN;
|
|
48
|
+
case hashString("card"): return margelo::nitro::audiobrowser::GridTile::CARD;
|
|
49
|
+
case hashString("condensed"): return margelo::nitro::audiobrowser::GridTile::CONDENSED;
|
|
50
|
+
default: [[unlikely]]
|
|
51
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum GridTile - invalid value!");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::audiobrowser::GridTile arg) {
|
|
55
|
+
switch (arg) {
|
|
56
|
+
case margelo::nitro::audiobrowser::GridTile::PLAIN: return JSIConverter<std::string>::toJSI(runtime, "plain");
|
|
57
|
+
case margelo::nitro::audiobrowser::GridTile::CARD: return JSIConverter<std::string>::toJSI(runtime, "card");
|
|
58
|
+
case margelo::nitro::audiobrowser::GridTile::CONDENSED: return JSIConverter<std::string>::toJSI(runtime, "condensed");
|
|
59
|
+
default: [[unlikely]]
|
|
60
|
+
throw std::invalid_argument("Cannot convert GridTile to JS - invalid value: "
|
|
61
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
65
|
+
if (!value.isString()) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
69
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
70
|
+
case hashString("plain"):
|
|
71
|
+
case hashString("card"):
|
|
72
|
+
case hashString("condensed"):
|
|
73
|
+
return true;
|
|
74
|
+
default:
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ImageShape.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::audiobrowser {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (ImageShape).
|
|
30
|
+
*/
|
|
31
|
+
enum class ImageShape {
|
|
32
|
+
CIRCULAR SWIFT_NAME(circular) = 0,
|
|
33
|
+
ROUNDED_RECTANGLE SWIFT_NAME(roundedRectangle) = 1,
|
|
34
|
+
} CLOSED_ENUM;
|
|
35
|
+
|
|
36
|
+
} // namespace margelo::nitro::audiobrowser
|
|
37
|
+
|
|
38
|
+
namespace margelo::nitro {
|
|
39
|
+
|
|
40
|
+
// C++ ImageShape <> JS ImageShape (union)
|
|
41
|
+
template <>
|
|
42
|
+
struct JSIConverter<margelo::nitro::audiobrowser::ImageShape> final {
|
|
43
|
+
static inline margelo::nitro::audiobrowser::ImageShape fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
44
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
45
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
46
|
+
case hashString("circular"): return margelo::nitro::audiobrowser::ImageShape::CIRCULAR;
|
|
47
|
+
case hashString("rounded-rectangle"): return margelo::nitro::audiobrowser::ImageShape::ROUNDED_RECTANGLE;
|
|
48
|
+
default: [[unlikely]]
|
|
49
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum ImageShape - invalid value!");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::audiobrowser::ImageShape arg) {
|
|
53
|
+
switch (arg) {
|
|
54
|
+
case margelo::nitro::audiobrowser::ImageShape::CIRCULAR: return JSIConverter<std::string>::toJSI(runtime, "circular");
|
|
55
|
+
case margelo::nitro::audiobrowser::ImageShape::ROUNDED_RECTANGLE: return JSIConverter<std::string>::toJSI(runtime, "rounded-rectangle");
|
|
56
|
+
default: [[unlikely]]
|
|
57
|
+
throw std::invalid_argument("Cannot convert ImageShape to JS - invalid value: "
|
|
58
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
62
|
+
if (!value.isString()) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
66
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
67
|
+
case hashString("circular"):
|
|
68
|
+
case hashString("rounded-rectangle"):
|
|
69
|
+
return true;
|
|
70
|
+
default:
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace margelo::nitro
|
|
@@ -78,16 +78,17 @@ namespace margelo::nitro::audiobrowser {
|
|
|
78
78
|
std::optional<bool> singleTrack SWIFT_PRIVATE;
|
|
79
79
|
std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<void>>>>(const TrackLoadEvent& /* event */)>> handleTrackLoad SWIFT_PRIVATE;
|
|
80
80
|
std::optional<bool> androidControllerOfflineError SWIFT_PRIVATE;
|
|
81
|
+
std::optional<std::function<std::shared_ptr<Promise<std::string>>()>> viewMoreTitle SWIFT_PRIVATE;
|
|
81
82
|
std::optional<std::string> carPlayLoadingTitle SWIFT_PRIVATE;
|
|
82
83
|
std::optional<std::function<std::shared_ptr<Promise<std::optional<std::string>>>(const Track& /* track */)>> resolveAlbumPath SWIFT_PRIVATE;
|
|
83
84
|
std::optional<std::function<std::shared_ptr<Promise<std::optional<FormattedNavigationError>>>(const FormatNavigationErrorParams& /* params */)>> formatNavigationError SWIFT_PRIVATE;
|
|
84
85
|
|
|
85
86
|
public:
|
|
86
87
|
NativeBrowserConfiguration() = default;
|
|
87
|
-
explicit NativeBrowserConfiguration(std::optional<std::string> path, std::optional<TransformableRequestConfig> request, std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<TransformableRequestConfig>>>>()>> requestResolver, std::optional<TransformableRequestConfig> browse, std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<TransformableRequestConfig>>>>()>> browseResolver, std::optional<MediaRequestConfig> media, std::optional<ArtworkRequestConfig> artwork, std::optional<ArtworkRequestConfig> nowPlayingArtwork, std::optional<std::vector<NativeRouteEntry>> routes, std::optional<bool> singleTrack, std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<void>>>>(const TrackLoadEvent& /* event */)>> handleTrackLoad, std::optional<bool> androidControllerOfflineError, std::optional<std::string> carPlayLoadingTitle, std::optional<std::function<std::shared_ptr<Promise<std::optional<std::string>>>(const Track& /* track */)>> resolveAlbumPath, std::optional<std::function<std::shared_ptr<Promise<std::optional<FormattedNavigationError>>>(const FormatNavigationErrorParams& /* params */)>> formatNavigationError): path(path), request(request), requestResolver(requestResolver), browse(browse), browseResolver(browseResolver), media(media), artwork(artwork), nowPlayingArtwork(nowPlayingArtwork), routes(routes), singleTrack(singleTrack), handleTrackLoad(handleTrackLoad), androidControllerOfflineError(androidControllerOfflineError), carPlayLoadingTitle(carPlayLoadingTitle), resolveAlbumPath(resolveAlbumPath), formatNavigationError(formatNavigationError) {}
|
|
88
|
+
explicit NativeBrowserConfiguration(std::optional<std::string> path, std::optional<TransformableRequestConfig> request, std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<TransformableRequestConfig>>>>()>> requestResolver, std::optional<TransformableRequestConfig> browse, std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<TransformableRequestConfig>>>>()>> browseResolver, std::optional<MediaRequestConfig> media, std::optional<ArtworkRequestConfig> artwork, std::optional<ArtworkRequestConfig> nowPlayingArtwork, std::optional<std::vector<NativeRouteEntry>> routes, std::optional<bool> singleTrack, std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<void>>>>(const TrackLoadEvent& /* event */)>> handleTrackLoad, std::optional<bool> androidControllerOfflineError, std::optional<std::function<std::shared_ptr<Promise<std::string>>()>> viewMoreTitle, std::optional<std::string> carPlayLoadingTitle, std::optional<std::function<std::shared_ptr<Promise<std::optional<std::string>>>(const Track& /* track */)>> resolveAlbumPath, std::optional<std::function<std::shared_ptr<Promise<std::optional<FormattedNavigationError>>>(const FormatNavigationErrorParams& /* params */)>> formatNavigationError): path(path), request(request), requestResolver(requestResolver), browse(browse), browseResolver(browseResolver), media(media), artwork(artwork), nowPlayingArtwork(nowPlayingArtwork), routes(routes), singleTrack(singleTrack), handleTrackLoad(handleTrackLoad), androidControllerOfflineError(androidControllerOfflineError), viewMoreTitle(viewMoreTitle), carPlayLoadingTitle(carPlayLoadingTitle), resolveAlbumPath(resolveAlbumPath), formatNavigationError(formatNavigationError) {}
|
|
88
89
|
|
|
89
90
|
public:
|
|
90
|
-
// NativeBrowserConfiguration is not equatable because these properties are not equatable: request, requestResolver, browse, browseResolver, media, artwork, nowPlayingArtwork, routes, handleTrackLoad, resolveAlbumPath, formatNavigationError
|
|
91
|
+
// NativeBrowserConfiguration is not equatable because these properties are not equatable: request, requestResolver, browse, browseResolver, media, artwork, nowPlayingArtwork, routes, handleTrackLoad, viewMoreTitle, resolveAlbumPath, formatNavigationError
|
|
91
92
|
};
|
|
92
93
|
|
|
93
94
|
} // namespace margelo::nitro::audiobrowser
|
|
@@ -112,6 +113,7 @@ namespace margelo::nitro {
|
|
|
112
113
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "singleTrack"))),
|
|
113
114
|
JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<void>>>>(const margelo::nitro::audiobrowser::TrackLoadEvent&)>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "handleTrackLoad"))),
|
|
114
115
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "androidControllerOfflineError"))),
|
|
116
|
+
JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::string>>()>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "viewMoreTitle"))),
|
|
115
117
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "carPlayLoadingTitle"))),
|
|
116
118
|
JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::optional<std::string>>>(const margelo::nitro::audiobrowser::Track&)>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "resolveAlbumPath"))),
|
|
117
119
|
JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::optional<margelo::nitro::audiobrowser::FormattedNavigationError>>>(const margelo::nitro::audiobrowser::FormatNavigationErrorParams&)>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "formatNavigationError")))
|
|
@@ -131,6 +133,7 @@ namespace margelo::nitro {
|
|
|
131
133
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "singleTrack"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.singleTrack));
|
|
132
134
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "handleTrackLoad"), JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<void>>>>(const margelo::nitro::audiobrowser::TrackLoadEvent&)>>>::toJSI(runtime, arg.handleTrackLoad));
|
|
133
135
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "androidControllerOfflineError"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.androidControllerOfflineError));
|
|
136
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "viewMoreTitle"), JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::string>>()>>>::toJSI(runtime, arg.viewMoreTitle));
|
|
134
137
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "carPlayLoadingTitle"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.carPlayLoadingTitle));
|
|
135
138
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "resolveAlbumPath"), JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::optional<std::string>>>(const margelo::nitro::audiobrowser::Track&)>>>::toJSI(runtime, arg.resolveAlbumPath));
|
|
136
139
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "formatNavigationError"), JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::optional<margelo::nitro::audiobrowser::FormattedNavigationError>>>(const margelo::nitro::audiobrowser::FormatNavigationErrorParams&)>>>::toJSI(runtime, arg.formatNavigationError));
|
|
@@ -156,6 +159,7 @@ namespace margelo::nitro {
|
|
|
156
159
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "singleTrack")))) return false;
|
|
157
160
|
if (!JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::shared_ptr<Promise<void>>>>(const margelo::nitro::audiobrowser::TrackLoadEvent&)>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "handleTrackLoad")))) return false;
|
|
158
161
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "androidControllerOfflineError")))) return false;
|
|
162
|
+
if (!JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::string>>()>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "viewMoreTitle")))) return false;
|
|
159
163
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "carPlayLoadingTitle")))) return false;
|
|
160
164
|
if (!JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::optional<std::string>>>(const margelo::nitro::audiobrowser::Track&)>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "resolveAlbumPath")))) return false;
|
|
161
165
|
if (!JSIConverter<std::optional<std::function<std::shared_ptr<Promise<std::optional<margelo::nitro::audiobrowser::FormattedNavigationError>>>(const margelo::nitro::audiobrowser::FormatNavigationErrorParams&)>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "formatNavigationError")))) return false;
|
|
@@ -47,14 +47,13 @@ namespace margelo::nitro::audiobrowser {
|
|
|
47
47
|
struct Section final {
|
|
48
48
|
public:
|
|
49
49
|
std::optional<std::string> title SWIFT_PRIVATE;
|
|
50
|
-
std::optional<std::string> subtitle SWIFT_PRIVATE;
|
|
51
50
|
std::optional<SectionStyle> style SWIFT_PRIVATE;
|
|
52
51
|
std::optional<std::string> path SWIFT_PRIVATE;
|
|
53
52
|
std::vector<Track> children SWIFT_PRIVATE;
|
|
54
53
|
|
|
55
54
|
public:
|
|
56
55
|
Section() = default;
|
|
57
|
-
explicit Section(std::optional<std::string> title, std::optional<
|
|
56
|
+
explicit Section(std::optional<std::string> title, std::optional<SectionStyle> style, std::optional<std::string> path, std::vector<Track> children): title(title), style(style), path(path), children(children) {}
|
|
58
57
|
|
|
59
58
|
public:
|
|
60
59
|
friend bool operator==(const Section& lhs, const Section& rhs) = default;
|
|
@@ -71,7 +70,6 @@ namespace margelo::nitro {
|
|
|
71
70
|
jsi::Object obj = arg.asObject(runtime);
|
|
72
71
|
return margelo::nitro::audiobrowser::Section(
|
|
73
72
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title"))),
|
|
74
|
-
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subtitle"))),
|
|
75
73
|
JSIConverter<std::optional<margelo::nitro::audiobrowser::SectionStyle>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "style"))),
|
|
76
74
|
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "path"))),
|
|
77
75
|
JSIConverter<std::vector<margelo::nitro::audiobrowser::Track>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "children")))
|
|
@@ -80,7 +78,6 @@ namespace margelo::nitro {
|
|
|
80
78
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::audiobrowser::Section& arg) {
|
|
81
79
|
jsi::Object obj(runtime);
|
|
82
80
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "title"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.title));
|
|
83
|
-
obj.setProperty(runtime, PropNameIDCache::get(runtime, "subtitle"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.subtitle));
|
|
84
81
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "style"), JSIConverter<std::optional<margelo::nitro::audiobrowser::SectionStyle>>::toJSI(runtime, arg.style));
|
|
85
82
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "path"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.path));
|
|
86
83
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "children"), JSIConverter<std::vector<margelo::nitro::audiobrowser::Track>>::toJSI(runtime, arg.children));
|
|
@@ -95,7 +92,6 @@ namespace margelo::nitro {
|
|
|
95
92
|
return false;
|
|
96
93
|
}
|
|
97
94
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "title")))) return false;
|
|
98
|
-
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "subtitle")))) return false;
|
|
99
95
|
if (!JSIConverter<std::optional<margelo::nitro::audiobrowser::SectionStyle>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "style")))) return false;
|
|
100
96
|
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "path")))) return false;
|
|
101
97
|
if (!JSIConverter<std::vector<margelo::nitro::audiobrowser::Track>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "children")))) return false;
|
|
@@ -28,14 +28,24 @@
|
|
|
28
28
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
29
|
#endif
|
|
30
30
|
|
|
31
|
+
// Forward declaration of `GridTile` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::audiobrowser { enum class GridTile; }
|
|
31
33
|
// Forward declaration of `StyleDisplay` to properly resolve imports.
|
|
32
34
|
namespace margelo::nitro::audiobrowser { enum class StyleDisplay; }
|
|
33
35
|
// Forward declaration of `ArtworkRendering` to properly resolve imports.
|
|
34
36
|
namespace margelo::nitro::audiobrowser { enum class ArtworkRendering; }
|
|
37
|
+
// Forward declaration of `ImageShape` to properly resolve imports.
|
|
38
|
+
namespace margelo::nitro::audiobrowser { enum class ImageShape; }
|
|
39
|
+
// Forward declaration of `CardImage` to properly resolve imports.
|
|
40
|
+
namespace margelo::nitro::audiobrowser { enum class CardImage; }
|
|
35
41
|
|
|
36
42
|
#include <optional>
|
|
43
|
+
#include "GridTile.hpp"
|
|
37
44
|
#include "StyleDisplay.hpp"
|
|
38
45
|
#include "ArtworkRendering.hpp"
|
|
46
|
+
#include "ImageShape.hpp"
|
|
47
|
+
#include <string>
|
|
48
|
+
#include "CardImage.hpp"
|
|
39
49
|
|
|
40
50
|
namespace margelo::nitro::audiobrowser {
|
|
41
51
|
|
|
@@ -45,12 +55,17 @@ namespace margelo::nitro::audiobrowser {
|
|
|
45
55
|
struct SectionStyle final {
|
|
46
56
|
public:
|
|
47
57
|
std::optional<bool> gridWrap SWIFT_PRIVATE;
|
|
58
|
+
std::optional<GridTile> gridTile SWIFT_PRIVATE;
|
|
48
59
|
std::optional<StyleDisplay> display SWIFT_PRIVATE;
|
|
49
60
|
std::optional<ArtworkRendering> artworkRendering SWIFT_PRIVATE;
|
|
61
|
+
std::optional<ImageShape> imageShape SWIFT_PRIVATE;
|
|
62
|
+
std::optional<std::string> accessorySymbol SWIFT_PRIVATE;
|
|
63
|
+
std::optional<std::string> cardTint SWIFT_PRIVATE;
|
|
64
|
+
std::optional<CardImage> cardImage SWIFT_PRIVATE;
|
|
50
65
|
|
|
51
66
|
public:
|
|
52
67
|
SectionStyle() = default;
|
|
53
|
-
explicit SectionStyle(std::optional<bool> gridWrap, std::optional<StyleDisplay> display, std::optional<ArtworkRendering> artworkRendering): gridWrap(gridWrap), display(display), artworkRendering(artworkRendering) {}
|
|
68
|
+
explicit SectionStyle(std::optional<bool> gridWrap, std::optional<GridTile> gridTile, std::optional<StyleDisplay> display, std::optional<ArtworkRendering> artworkRendering, std::optional<ImageShape> imageShape, std::optional<std::string> accessorySymbol, std::optional<std::string> cardTint, std::optional<CardImage> cardImage): gridWrap(gridWrap), gridTile(gridTile), display(display), artworkRendering(artworkRendering), imageShape(imageShape), accessorySymbol(accessorySymbol), cardTint(cardTint), cardImage(cardImage) {}
|
|
54
69
|
|
|
55
70
|
public:
|
|
56
71
|
friend bool operator==(const SectionStyle& lhs, const SectionStyle& rhs) = default;
|
|
@@ -67,15 +82,25 @@ namespace margelo::nitro {
|
|
|
67
82
|
jsi::Object obj = arg.asObject(runtime);
|
|
68
83
|
return margelo::nitro::audiobrowser::SectionStyle(
|
|
69
84
|
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "gridWrap"))),
|
|
85
|
+
JSIConverter<std::optional<margelo::nitro::audiobrowser::GridTile>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "gridTile"))),
|
|
70
86
|
JSIConverter<std::optional<margelo::nitro::audiobrowser::StyleDisplay>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "display"))),
|
|
71
|
-
JSIConverter<std::optional<margelo::nitro::audiobrowser::ArtworkRendering>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "artworkRendering")))
|
|
87
|
+
JSIConverter<std::optional<margelo::nitro::audiobrowser::ArtworkRendering>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "artworkRendering"))),
|
|
88
|
+
JSIConverter<std::optional<margelo::nitro::audiobrowser::ImageShape>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "imageShape"))),
|
|
89
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "accessorySymbol"))),
|
|
90
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "cardTint"))),
|
|
91
|
+
JSIConverter<std::optional<margelo::nitro::audiobrowser::CardImage>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "cardImage")))
|
|
72
92
|
);
|
|
73
93
|
}
|
|
74
94
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::audiobrowser::SectionStyle& arg) {
|
|
75
95
|
jsi::Object obj(runtime);
|
|
76
96
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "gridWrap"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.gridWrap));
|
|
97
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "gridTile"), JSIConverter<std::optional<margelo::nitro::audiobrowser::GridTile>>::toJSI(runtime, arg.gridTile));
|
|
77
98
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "display"), JSIConverter<std::optional<margelo::nitro::audiobrowser::StyleDisplay>>::toJSI(runtime, arg.display));
|
|
78
99
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "artworkRendering"), JSIConverter<std::optional<margelo::nitro::audiobrowser::ArtworkRendering>>::toJSI(runtime, arg.artworkRendering));
|
|
100
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "imageShape"), JSIConverter<std::optional<margelo::nitro::audiobrowser::ImageShape>>::toJSI(runtime, arg.imageShape));
|
|
101
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "accessorySymbol"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.accessorySymbol));
|
|
102
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "cardTint"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.cardTint));
|
|
103
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "cardImage"), JSIConverter<std::optional<margelo::nitro::audiobrowser::CardImage>>::toJSI(runtime, arg.cardImage));
|
|
79
104
|
return obj;
|
|
80
105
|
}
|
|
81
106
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -87,8 +112,13 @@ namespace margelo::nitro {
|
|
|
87
112
|
return false;
|
|
88
113
|
}
|
|
89
114
|
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "gridWrap")))) return false;
|
|
115
|
+
if (!JSIConverter<std::optional<margelo::nitro::audiobrowser::GridTile>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "gridTile")))) return false;
|
|
90
116
|
if (!JSIConverter<std::optional<margelo::nitro::audiobrowser::StyleDisplay>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "display")))) return false;
|
|
91
117
|
if (!JSIConverter<std::optional<margelo::nitro::audiobrowser::ArtworkRendering>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "artworkRendering")))) return false;
|
|
118
|
+
if (!JSIConverter<std::optional<margelo::nitro::audiobrowser::ImageShape>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "imageShape")))) return false;
|
|
119
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "accessorySymbol")))) return false;
|
|
120
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "cardTint")))) return false;
|
|
121
|
+
if (!JSIConverter<std::optional<margelo::nitro::audiobrowser::CardImage>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "cardImage")))) return false;
|
|
92
122
|
return true;
|
|
93
123
|
}
|
|
94
124
|
};
|