-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Don't expose header, fix cycle
- Loading branch information
Showing
12 changed files
with
115 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
packages/react-native-nitro-modules/cpp/utils/DoesClassExist.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// DoesClassExist.hpp | ||
// Pods | ||
// | ||
// Created by Marc Rousavy on 17.07.24. | ||
// | ||
|
||
#pragma once | ||
|
||
#include <type_traits> | ||
|
||
namespace margelo { | ||
|
||
// By default, it is false (class does not exist) | ||
template<typename T, typename = std::void_t<>> | ||
struct does_class_exist : std::false_type {}; | ||
|
||
// If sizeof(T) can be a type (number), the type exists - so it is true | ||
template<typename T> | ||
struct does_class_exist<T, std::void_t<decltype(sizeof(T))>> : std::true_type {}; | ||
|
||
// Direct value accessor for does_class_exist | ||
template<typename T> | ||
inline constexpr bool does_class_exist_v = does_class_exist<T>::value; | ||
|
||
} // namespace margelo |
49 changes: 0 additions & 49 deletions
49
packages/react-native-nitro-modules/ios/core/HybridSwiftObject.hpp
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
packages/react-native-nitro-modules/ios/core/SwiftHybridObject.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// SwiftHybridObject.cpp | ||
// NitroModules | ||
// | ||
// Created by Marc Rousavy on 17.07.24. | ||
// | ||
|
||
#include "SwiftHybridObject.hpp" |
16 changes: 16 additions & 0 deletions
16
packages/react-native-nitro-modules/ios/core/SwiftHybridObject.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// SwiftHybridObject.hpp | ||
// NitroModules | ||
// | ||
// Created by Marc Rousavy on 17.07.24. | ||
// | ||
|
||
#pragma once | ||
|
||
#include "HybridObject.hpp" | ||
|
||
namespace margelo { | ||
|
||
|
||
|
||
} // namespace margelo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
packages/react-native-nitro-modules/ios/test-object/SwiftTestHybridObject.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// SwiftTestHybridObjectSwift.swift | ||
// NitroModules | ||
// | ||
// Created by Marc Rousavy on 23.06.24. | ||
// | ||
|
||
import Foundation | ||
|
||
public enum SomeError: Error { | ||
case error | ||
} | ||
|
||
// Implemented by the user | ||
public class SwiftTestHybridObject: SwiftTestHybridObjectSpec { | ||
public func throwError() throws { | ||
throw SomeError.error | ||
} | ||
|
||
public var hybridContext = margelo.HybridContext() | ||
|
||
private var _int: Int = 5 | ||
public var int: Int { | ||
get { | ||
return _int | ||
} | ||
set { | ||
_int = newValue | ||
} | ||
} | ||
|
||
public init() { | ||
print("Initialized a new SwiftTestHybridObject!") | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/react-native-nitro-modules/ios/test-object/SwiftTestHybridObjectSpec.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// TestHybridObjectSpec.swift | ||
// NitroModules | ||
// | ||
// Created by Marc Rousavy on 17.07.24. | ||
// | ||
|
||
import Foundation | ||
|
||
// Generated by Nitrogen (Swift protocol spec) | ||
public protocol SwiftTestHybridObjectSpec { | ||
var hybridContext: margelo.HybridContext { get set } | ||
|
||
var int: Int { get set } | ||
|
||
func throwError() throws | ||
} |
35 changes: 0 additions & 35 deletions
35
packages/react-native-nitro-modules/ios/test-object/SwiftTestHybridObjectSwift.swift
This file was deleted.
Oops, something went wrong.