concentric-sheet 0.0.2

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.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/NitroConcentricSheet.podspec +31 -0
  3. package/README.md +118 -0
  4. package/ios/Bridge.h +8 -0
  5. package/ios/SheetModalController.swift +912 -0
  6. package/lib/NativeSheetModal.d.ts +10 -0
  7. package/lib/NativeSheetModal.js +243 -0
  8. package/lib/index.d.ts +3 -0
  9. package/lib/index.js +1 -0
  10. package/lib/specs/SheetModalController.nitro.d.ts +46 -0
  11. package/lib/specs/SheetModalController.nitro.js +1 -0
  12. package/nitro.json +23 -0
  13. package/nitrogen/generated/.gitattributes +1 -0
  14. package/nitrogen/generated/ios/NitroConcentricSheet+autolinking.rb +60 -0
  15. package/nitrogen/generated/ios/NitroConcentricSheet-Swift-Cxx-Bridge.cpp +33 -0
  16. package/nitrogen/generated/ios/NitroConcentricSheet-Swift-Cxx-Bridge.hpp +269 -0
  17. package/nitrogen/generated/ios/NitroConcentricSheet-Swift-Cxx-Umbrella.hpp +69 -0
  18. package/nitrogen/generated/ios/NitroConcentricSheetAutolinking.mm +33 -0
  19. package/nitrogen/generated/ios/NitroConcentricSheetAutolinking.swift +26 -0
  20. package/nitrogen/generated/ios/c++/HybridSheetModalControllerSpecSwift.cpp +11 -0
  21. package/nitrogen/generated/ios/c++/HybridSheetModalControllerSpecSwift.hpp +130 -0
  22. package/nitrogen/generated/ios/swift/HybridSheetModalControllerSpec.swift +58 -0
  23. package/nitrogen/generated/ios/swift/HybridSheetModalControllerSpec_cxx.swift +181 -0
  24. package/nitrogen/generated/ios/swift/ModalCornerConfiguration.swift +83 -0
  25. package/nitrogen/generated/ios/swift/ModalCornerConfigurationType.swift +48 -0
  26. package/nitrogen/generated/ios/swift/ModalViewBackground.swift +40 -0
  27. package/nitrogen/generated/ios/swift/PresentedModalConfig.swift +129 -0
  28. package/nitrogen/generated/ios/swift/PresentedModalDetent.swift +71 -0
  29. package/nitrogen/generated/ios/swift/SheetDetentIdentifier.swift +40 -0
  30. package/nitrogen/generated/ios/swift/SheetPresentationConfig.swift +238 -0
  31. package/nitrogen/generated/ios/swift/Variant_NullType_PresentedModalDetent.swift +18 -0
  32. package/nitrogen/generated/shared/c++/HybridSheetModalControllerSpec.cpp +24 -0
  33. package/nitrogen/generated/shared/c++/HybridSheetModalControllerSpec.hpp +71 -0
  34. package/nitrogen/generated/shared/c++/ModalCornerConfiguration.hpp +97 -0
  35. package/nitrogen/generated/shared/c++/ModalCornerConfigurationType.hpp +84 -0
  36. package/nitrogen/generated/shared/c++/ModalViewBackground.hpp +76 -0
  37. package/nitrogen/generated/shared/c++/PresentedModalConfig.hpp +115 -0
  38. package/nitrogen/generated/shared/c++/PresentedModalDetent.hpp +94 -0
  39. package/nitrogen/generated/shared/c++/SheetDetentIdentifier.hpp +76 -0
  40. package/nitrogen/generated/shared/c++/SheetPresentationConfig.hpp +130 -0
  41. package/package.json +103 -0
  42. package/react-native.config.js +13 -0
  43. package/src/NativeSheetModal.tsx +343 -0
  44. package/src/index.ts +16 -0
  45. package/src/specs/SheetModalController.nitro.ts +54 -0
@@ -0,0 +1,181 @@
1
+ ///
2
+ /// HybridSheetModalControllerSpec_cxx.swift
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
+ import NitroModules
9
+
10
+ /**
11
+ * A class implementation that bridges HybridSheetModalControllerSpec over to C++.
12
+ * In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
13
+ *
14
+ * Also, some Swift types need to be bridged with special handling:
15
+ * - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
16
+ * - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
17
+ * - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
18
+ */
19
+ open class HybridSheetModalControllerSpec_cxx {
20
+ /**
21
+ * The Swift <> C++ bridge's namespace (`margelo::nitro::concentricsheet::bridge::swift`)
22
+ * from `NitroConcentricSheet-Swift-Cxx-Bridge.hpp`.
23
+ * This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
24
+ */
25
+ public typealias bridge = margelo.nitro.concentricsheet.bridge.swift
26
+
27
+ /**
28
+ * Holds an instance of the `HybridSheetModalControllerSpec` Swift protocol.
29
+ */
30
+ private var __implementation: any HybridSheetModalControllerSpec
31
+
32
+ /**
33
+ * Holds a weak pointer to the C++ class that wraps the Swift class.
34
+ */
35
+ private var __cxxPart: bridge.std__weak_ptr_HybridSheetModalControllerSpec_
36
+
37
+ /**
38
+ * Create a new `HybridSheetModalControllerSpec_cxx` that wraps the given `HybridSheetModalControllerSpec`.
39
+ * All properties and methods bridge to C++ types.
40
+ */
41
+ public init(_ implementation: any HybridSheetModalControllerSpec) {
42
+ self.__implementation = implementation
43
+ self.__cxxPart = .init()
44
+ /* no base class */
45
+ }
46
+
47
+ /**
48
+ * Get the actual `HybridSheetModalControllerSpec` instance this class wraps.
49
+ */
50
+ @inline(__always)
51
+ public func getHybridSheetModalControllerSpec() -> any HybridSheetModalControllerSpec {
52
+ return __implementation
53
+ }
54
+
55
+ /**
56
+ * Casts this instance to a retained unsafe raw pointer.
57
+ * This acquires one additional strong reference on the object!
58
+ */
59
+ public func toUnsafe() -> UnsafeMutableRawPointer {
60
+ return Unmanaged.passRetained(self).toOpaque()
61
+ }
62
+
63
+ /**
64
+ * Casts an unsafe pointer to a `HybridSheetModalControllerSpec_cxx`.
65
+ * The pointer has to be a retained opaque `Unmanaged<HybridSheetModalControllerSpec_cxx>`.
66
+ * This removes one strong reference from the object!
67
+ */
68
+ public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridSheetModalControllerSpec_cxx {
69
+ return Unmanaged<HybridSheetModalControllerSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
70
+ }
71
+
72
+ /**
73
+ * Gets (or creates) the C++ part of this Hybrid Object.
74
+ * The C++ part is a `std::shared_ptr<HybridSheetModalControllerSpec>`.
75
+ */
76
+ public func getCxxPart() -> bridge.std__shared_ptr_HybridSheetModalControllerSpec_ {
77
+ let cachedCxxPart = self.__cxxPart.lock()
78
+ if Bool(fromCxx: cachedCxxPart) {
79
+ return cachedCxxPart
80
+ } else {
81
+ let newCxxPart = bridge.create_std__shared_ptr_HybridSheetModalControllerSpec_(self.toUnsafe())
82
+ __cxxPart = bridge.weakify_std__shared_ptr_HybridSheetModalControllerSpec_(newCxxPart)
83
+ return newCxxPart
84
+ }
85
+ }
86
+
87
+
88
+
89
+ /**
90
+ * Get the memory size of the Swift class (plus size of any other allocations)
91
+ * so the JS VM can properly track it and garbage-collect the JS object if needed.
92
+ */
93
+ @inline(__always)
94
+ public var memorySize: Int {
95
+ return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
96
+ }
97
+
98
+ /**
99
+ * Compares this object with the given [other] object for reference equality.
100
+ */
101
+ @inline(__always)
102
+ public func equals(other: HybridSheetModalControllerSpec_cxx) -> Bool {
103
+ return self.__implementation === other.__implementation
104
+ }
105
+
106
+ /**
107
+ * Call dispose() on the Swift class.
108
+ * This _may_ be called manually from JS.
109
+ */
110
+ @inline(__always)
111
+ public func dispose() {
112
+ self.__implementation.dispose()
113
+ }
114
+
115
+ /**
116
+ * Call toString() on the Swift class.
117
+ */
118
+ @inline(__always)
119
+ public func toString() -> String {
120
+ return self.__implementation.toString()
121
+ }
122
+
123
+ // Properties
124
+
125
+
126
+ // Methods
127
+ @inline(__always)
128
+ public final func cachePresentedModalConfig(config: PresentedModalConfig) -> bridge.Result_bool_ {
129
+ do {
130
+ let __result = try self.__implementation.cachePresentedModalConfig(config: config)
131
+ let __resultCpp = __result
132
+ return bridge.create_Result_bool_(__resultCpp)
133
+ } catch (let __error) {
134
+ let __exceptionPtr = __error.toCpp()
135
+ return bridge.create_Result_bool_(__exceptionPtr)
136
+ }
137
+ }
138
+
139
+ @inline(__always)
140
+ public final func applyPresentedModalConfig(config: PresentedModalConfig) -> bridge.Result_bool_ {
141
+ do {
142
+ let __result = try self.__implementation.applyPresentedModalConfig(config: config)
143
+ let __resultCpp = __result
144
+ return bridge.create_Result_bool_(__resultCpp)
145
+ } catch (let __error) {
146
+ let __exceptionPtr = __error.toCpp()
147
+ return bridge.create_Result_bool_(__exceptionPtr)
148
+ }
149
+ }
150
+
151
+ @inline(__always)
152
+ public final func getPresentedModalDetent(modalInstanceId: Double) -> bridge.Result_std__variant_nitro__NullType__PresentedModalDetent__ {
153
+ do {
154
+ let __result = try self.__implementation.getPresentedModalDetent(modalInstanceId: modalInstanceId)
155
+ let __resultCpp = { () -> bridge.std__variant_nitro__NullType__PresentedModalDetent_ in
156
+ switch __result {
157
+ case .first(let __value):
158
+ return bridge.create_std__variant_nitro__NullType__PresentedModalDetent_(margelo.nitro.NullType.null)
159
+ case .second(let __value):
160
+ return bridge.create_std__variant_nitro__NullType__PresentedModalDetent_(__value)
161
+ }
162
+ }().variant
163
+ return bridge.create_Result_std__variant_nitro__NullType__PresentedModalDetent__(__resultCpp)
164
+ } catch (let __error) {
165
+ let __exceptionPtr = __error.toCpp()
166
+ return bridge.create_Result_std__variant_nitro__NullType__PresentedModalDetent__(__exceptionPtr)
167
+ }
168
+ }
169
+
170
+ @inline(__always)
171
+ public final func dismissPresentedModal(animated: Bool) -> bridge.Result_bool_ {
172
+ do {
173
+ let __result = try self.__implementation.dismissPresentedModal(animated: animated)
174
+ let __resultCpp = __result
175
+ return bridge.create_Result_bool_(__resultCpp)
176
+ } catch (let __error) {
177
+ let __exceptionPtr = __error.toCpp()
178
+ return bridge.create_Result_bool_(__exceptionPtr)
179
+ }
180
+ }
181
+ }
@@ -0,0 +1,83 @@
1
+ ///
2
+ /// ModalCornerConfiguration.swift
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
+ import NitroModules
9
+
10
+ /**
11
+ * Represents an instance of `ModalCornerConfiguration`, backed by a C++ struct.
12
+ */
13
+ public typealias ModalCornerConfiguration = margelo.nitro.concentricsheet.ModalCornerConfiguration
14
+
15
+ public extension ModalCornerConfiguration {
16
+ private typealias bridge = margelo.nitro.concentricsheet.bridge.swift
17
+
18
+ /**
19
+ * Create a new instance of `ModalCornerConfiguration`.
20
+ */
21
+ init(type: ModalCornerConfigurationType, radius: Double?, minimumRadius: Double?, maximumRadius: Double?) {
22
+ self.init(type, { () -> bridge.std__optional_double_ in
23
+ if let __unwrappedValue = radius {
24
+ return bridge.create_std__optional_double_(__unwrappedValue)
25
+ } else {
26
+ return .init()
27
+ }
28
+ }(), { () -> bridge.std__optional_double_ in
29
+ if let __unwrappedValue = minimumRadius {
30
+ return bridge.create_std__optional_double_(__unwrappedValue)
31
+ } else {
32
+ return .init()
33
+ }
34
+ }(), { () -> bridge.std__optional_double_ in
35
+ if let __unwrappedValue = maximumRadius {
36
+ return bridge.create_std__optional_double_(__unwrappedValue)
37
+ } else {
38
+ return .init()
39
+ }
40
+ }())
41
+ }
42
+
43
+ @inline(__always)
44
+ var type: ModalCornerConfigurationType {
45
+ return self.__type
46
+ }
47
+
48
+ @inline(__always)
49
+ var radius: Double? {
50
+ return { () -> Double? in
51
+ if bridge.has_value_std__optional_double_(self.__radius) {
52
+ let __unwrapped = bridge.get_std__optional_double_(self.__radius)
53
+ return __unwrapped
54
+ } else {
55
+ return nil
56
+ }
57
+ }()
58
+ }
59
+
60
+ @inline(__always)
61
+ var minimumRadius: Double? {
62
+ return { () -> Double? in
63
+ if bridge.has_value_std__optional_double_(self.__minimumRadius) {
64
+ let __unwrapped = bridge.get_std__optional_double_(self.__minimumRadius)
65
+ return __unwrapped
66
+ } else {
67
+ return nil
68
+ }
69
+ }()
70
+ }
71
+
72
+ @inline(__always)
73
+ var maximumRadius: Double? {
74
+ return { () -> Double? in
75
+ if bridge.has_value_std__optional_double_(self.__maximumRadius) {
76
+ let __unwrapped = bridge.get_std__optional_double_(self.__maximumRadius)
77
+ return __unwrapped
78
+ } else {
79
+ return nil
80
+ }
81
+ }()
82
+ }
83
+ }
@@ -0,0 +1,48 @@
1
+ ///
2
+ /// ModalCornerConfigurationType.swift
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
+ /**
9
+ * Represents the JS union `ModalCornerConfigurationType`, backed by a C++ enum.
10
+ */
11
+ public typealias ModalCornerConfigurationType = margelo.nitro.concentricsheet.ModalCornerConfigurationType
12
+
13
+ public extension ModalCornerConfigurationType {
14
+ /**
15
+ * Get a ModalCornerConfigurationType for the given String value, or
16
+ * return `nil` if the given value was invalid/unknown.
17
+ */
18
+ init?(fromString string: String) {
19
+ switch string {
20
+ case "none":
21
+ self = .none
22
+ case "fixed":
23
+ self = .fixed
24
+ case "containerConcentric":
25
+ self = .containerconcentric
26
+ case "capsule":
27
+ self = .capsule
28
+ default:
29
+ return nil
30
+ }
31
+ }
32
+
33
+ /**
34
+ * Get the String value this ModalCornerConfigurationType represents.
35
+ */
36
+ var stringValue: String {
37
+ switch self {
38
+ case .none:
39
+ return "none"
40
+ case .fixed:
41
+ return "fixed"
42
+ case .containerconcentric:
43
+ return "containerConcentric"
44
+ case .capsule:
45
+ return "capsule"
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,40 @@
1
+ ///
2
+ /// ModalViewBackground.swift
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
+ /**
9
+ * Represents the JS union `ModalViewBackground`, backed by a C++ enum.
10
+ */
11
+ public typealias ModalViewBackground = margelo.nitro.concentricsheet.ModalViewBackground
12
+
13
+ public extension ModalViewBackground {
14
+ /**
15
+ * Get a ModalViewBackground for the given String value, or
16
+ * return `nil` if the given value was invalid/unknown.
17
+ */
18
+ init?(fromString string: String) {
19
+ switch string {
20
+ case "clear":
21
+ self = .clear
22
+ case "systemBackground":
23
+ self = .systembackground
24
+ default:
25
+ return nil
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Get the String value this ModalViewBackground represents.
31
+ */
32
+ var stringValue: String {
33
+ switch self {
34
+ case .clear:
35
+ return "clear"
36
+ case .systembackground:
37
+ return "systemBackground"
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,129 @@
1
+ ///
2
+ /// PresentedModalConfig.swift
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
+ import NitroModules
9
+
10
+ /**
11
+ * Represents an instance of `PresentedModalConfig`, backed by a C++ struct.
12
+ */
13
+ public typealias PresentedModalConfig = margelo.nitro.concentricsheet.PresentedModalConfig
14
+
15
+ public extension PresentedModalConfig {
16
+ private typealias bridge = margelo.nitro.concentricsheet.bridge.swift
17
+
18
+ /**
19
+ * Create a new instance of `PresentedModalConfig`.
20
+ */
21
+ init(modalInstanceId: Double?, isModalInPresentation: Bool?, preferredContentWidth: Double?, preferredContentHeight: Double?, modalViewBackground: ModalViewBackground?, cornerConfiguration: ModalCornerConfiguration?, sheet: SheetPresentationConfig?) {
22
+ self.init({ () -> bridge.std__optional_double_ in
23
+ if let __unwrappedValue = modalInstanceId {
24
+ return bridge.create_std__optional_double_(__unwrappedValue)
25
+ } else {
26
+ return .init()
27
+ }
28
+ }(), { () -> bridge.std__optional_bool_ in
29
+ if let __unwrappedValue = isModalInPresentation {
30
+ return bridge.create_std__optional_bool_(__unwrappedValue)
31
+ } else {
32
+ return .init()
33
+ }
34
+ }(), { () -> bridge.std__optional_double_ in
35
+ if let __unwrappedValue = preferredContentWidth {
36
+ return bridge.create_std__optional_double_(__unwrappedValue)
37
+ } else {
38
+ return .init()
39
+ }
40
+ }(), { () -> bridge.std__optional_double_ in
41
+ if let __unwrappedValue = preferredContentHeight {
42
+ return bridge.create_std__optional_double_(__unwrappedValue)
43
+ } else {
44
+ return .init()
45
+ }
46
+ }(), { () -> bridge.std__optional_ModalViewBackground_ in
47
+ if let __unwrappedValue = modalViewBackground {
48
+ return bridge.create_std__optional_ModalViewBackground_(__unwrappedValue)
49
+ } else {
50
+ return .init()
51
+ }
52
+ }(), { () -> bridge.std__optional_ModalCornerConfiguration_ in
53
+ if let __unwrappedValue = cornerConfiguration {
54
+ return bridge.create_std__optional_ModalCornerConfiguration_(__unwrappedValue)
55
+ } else {
56
+ return .init()
57
+ }
58
+ }(), { () -> bridge.std__optional_SheetPresentationConfig_ in
59
+ if let __unwrappedValue = sheet {
60
+ return bridge.create_std__optional_SheetPresentationConfig_(__unwrappedValue)
61
+ } else {
62
+ return .init()
63
+ }
64
+ }())
65
+ }
66
+
67
+ @inline(__always)
68
+ var modalInstanceId: Double? {
69
+ return { () -> Double? in
70
+ if bridge.has_value_std__optional_double_(self.__modalInstanceId) {
71
+ let __unwrapped = bridge.get_std__optional_double_(self.__modalInstanceId)
72
+ return __unwrapped
73
+ } else {
74
+ return nil
75
+ }
76
+ }()
77
+ }
78
+
79
+ @inline(__always)
80
+ var isModalInPresentation: Bool? {
81
+ return { () -> Bool? in
82
+ if bridge.has_value_std__optional_bool_(self.__isModalInPresentation) {
83
+ let __unwrapped = bridge.get_std__optional_bool_(self.__isModalInPresentation)
84
+ return __unwrapped
85
+ } else {
86
+ return nil
87
+ }
88
+ }()
89
+ }
90
+
91
+ @inline(__always)
92
+ var preferredContentWidth: Double? {
93
+ return { () -> Double? in
94
+ if bridge.has_value_std__optional_double_(self.__preferredContentWidth) {
95
+ let __unwrapped = bridge.get_std__optional_double_(self.__preferredContentWidth)
96
+ return __unwrapped
97
+ } else {
98
+ return nil
99
+ }
100
+ }()
101
+ }
102
+
103
+ @inline(__always)
104
+ var preferredContentHeight: Double? {
105
+ return { () -> Double? in
106
+ if bridge.has_value_std__optional_double_(self.__preferredContentHeight) {
107
+ let __unwrapped = bridge.get_std__optional_double_(self.__preferredContentHeight)
108
+ return __unwrapped
109
+ } else {
110
+ return nil
111
+ }
112
+ }()
113
+ }
114
+
115
+ @inline(__always)
116
+ var modalViewBackground: ModalViewBackground? {
117
+ return self.__modalViewBackground.value
118
+ }
119
+
120
+ @inline(__always)
121
+ var cornerConfiguration: ModalCornerConfiguration? {
122
+ return self.__cornerConfiguration.value
123
+ }
124
+
125
+ @inline(__always)
126
+ var sheet: SheetPresentationConfig? {
127
+ return self.__sheet.value
128
+ }
129
+ }
@@ -0,0 +1,71 @@
1
+ ///
2
+ /// PresentedModalDetent.swift
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
+ import NitroModules
9
+
10
+ /**
11
+ * Represents an instance of `PresentedModalDetent`, backed by a C++ struct.
12
+ */
13
+ public typealias PresentedModalDetent = margelo.nitro.concentricsheet.PresentedModalDetent
14
+
15
+ public extension PresentedModalDetent {
16
+ private typealias bridge = margelo.nitro.concentricsheet.bridge.swift
17
+
18
+ /**
19
+ * Create a new instance of `PresentedModalDetent`.
20
+ */
21
+ init(detentIdentifier: SheetDetentIdentifier?, customDetentHeight: Double?, rawDetentIdentifier: String?) {
22
+ self.init({ () -> bridge.std__optional_SheetDetentIdentifier_ in
23
+ if let __unwrappedValue = detentIdentifier {
24
+ return bridge.create_std__optional_SheetDetentIdentifier_(__unwrappedValue)
25
+ } else {
26
+ return .init()
27
+ }
28
+ }(), { () -> bridge.std__optional_double_ in
29
+ if let __unwrappedValue = customDetentHeight {
30
+ return bridge.create_std__optional_double_(__unwrappedValue)
31
+ } else {
32
+ return .init()
33
+ }
34
+ }(), { () -> bridge.std__optional_std__string_ in
35
+ if let __unwrappedValue = rawDetentIdentifier {
36
+ return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
37
+ } else {
38
+ return .init()
39
+ }
40
+ }())
41
+ }
42
+
43
+ @inline(__always)
44
+ var detentIdentifier: SheetDetentIdentifier? {
45
+ return self.__detentIdentifier.value
46
+ }
47
+
48
+ @inline(__always)
49
+ var customDetentHeight: Double? {
50
+ return { () -> Double? in
51
+ if bridge.has_value_std__optional_double_(self.__customDetentHeight) {
52
+ let __unwrapped = bridge.get_std__optional_double_(self.__customDetentHeight)
53
+ return __unwrapped
54
+ } else {
55
+ return nil
56
+ }
57
+ }()
58
+ }
59
+
60
+ @inline(__always)
61
+ var rawDetentIdentifier: String? {
62
+ return { () -> String? in
63
+ if bridge.has_value_std__optional_std__string_(self.__rawDetentIdentifier) {
64
+ let __unwrapped = bridge.get_std__optional_std__string_(self.__rawDetentIdentifier)
65
+ return String(__unwrapped)
66
+ } else {
67
+ return nil
68
+ }
69
+ }()
70
+ }
71
+ }
@@ -0,0 +1,40 @@
1
+ ///
2
+ /// SheetDetentIdentifier.swift
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
+ /**
9
+ * Represents the JS union `SheetDetentIdentifier`, backed by a C++ enum.
10
+ */
11
+ public typealias SheetDetentIdentifier = margelo.nitro.concentricsheet.SheetDetentIdentifier
12
+
13
+ public extension SheetDetentIdentifier {
14
+ /**
15
+ * Get a SheetDetentIdentifier for the given String value, or
16
+ * return `nil` if the given value was invalid/unknown.
17
+ */
18
+ init?(fromString string: String) {
19
+ switch string {
20
+ case "medium":
21
+ self = .medium
22
+ case "large":
23
+ self = .large
24
+ default:
25
+ return nil
26
+ }
27
+ }
28
+
29
+ /**
30
+ * Get the String value this SheetDetentIdentifier represents.
31
+ */
32
+ var stringValue: String {
33
+ switch self {
34
+ case .medium:
35
+ return "medium"
36
+ case .large:
37
+ return "large"
38
+ }
39
+ }
40
+ }