-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
97 additions
and
0 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
8 changes: 8 additions & 0 deletions
8
packages/nitrogen/src/views/kotlin/KotlinHybridViewManager.ts
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 @@ | ||
import type { SourceFile } from '../../syntax/SourceFile.js' | ||
import type { HybridObjectSpec } from '../../syntax/HybridObjectSpec.js' | ||
|
||
export function createKotlinHybridViewManager( | ||
_: HybridObjectSpec | ||
): SourceFile[] { | ||
return [] | ||
} |
48 changes: 48 additions & 0 deletions
48
packages/nitrogen/src/views/swift/SwiftHybridViewManager.ts
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,48 @@ | ||
import type { SourceFile } from '../../syntax/SourceFile.js' | ||
import type { HybridObjectSpec } from '../../syntax/HybridObjectSpec.js' | ||
import { getHybridObjectName } from '../../syntax/getHybridObjectName.js' | ||
import { createFileMetadataString } from '../../syntax/helpers.js' | ||
import { NitroConfig } from '../../config/NitroConfig.js' | ||
|
||
export function createSwiftHybridViewManager( | ||
spec: HybridObjectSpec | ||
): SourceFile[] { | ||
const name = getHybridObjectName(spec.name) | ||
const propsClassName = `${name.HybridT}Props` | ||
const namespace = NitroConfig.getCxxNamespace('c++') | ||
|
||
const propsCode = ` | ||
${createFileMetadataString(`${name.HybridT}ViewProps.hpp`)} | ||
#pragma once | ||
#import <react/renderer/core/PropsParserContext.h> | ||
#import <react/renderer/components/view/ViewProps.h> | ||
namespace ${namespace} { | ||
using namespace facebook; | ||
class ${propsClassName}: public react::ViewProps { | ||
public: | ||
explicit ${propsClassName}() = default; | ||
${propsClassName}(const react::PropsParserContext& context, | ||
const ${propsClassName}& sourceProps, | ||
const react::RawProps& rawProps) { | ||
throw std::runtime_error("not yet implemented!"); | ||
} | ||
}; | ||
} // namespace ${namespace} | ||
`.trim() | ||
|
||
return [ | ||
{ | ||
name: `${propsClassName}.hpp`, | ||
content: propsCode, | ||
language: 'c++', | ||
platform: 'ios', | ||
subdirectory: [], | ||
}, | ||
] | ||
} |
27 changes: 27 additions & 0 deletions
27
packages/react-native-nitro-image/nitrogen/generated/ios/c++/HybridTestViewProps.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,27 @@ | ||
/// | ||
/// HybridTestViewViewProps.hpp | ||
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. | ||
/// https://github.com/mrousavy/nitro | ||
/// Copyright © 2025 Marc Rousavy @ Margelo | ||
/// | ||
|
||
#pragma once | ||
|
||
#import <react/renderer/core/PropsParserContext.h> | ||
#import <react/renderer/components/view/ViewProps.h> | ||
|
||
namespace margelo::nitro::image { | ||
|
||
using namespace facebook; | ||
|
||
class HybridTestViewProps: public react::ViewProps { | ||
public: | ||
explicit HybridTestViewProps() = default; | ||
HybridTestViewProps(const react::PropsParserContext& context, | ||
const HybridTestViewProps& sourceProps, | ||
const react::RawProps& rawProps) { | ||
throw std::runtime_error("not yet implemented!"); | ||
} | ||
}; | ||
|
||
} // namespace margelo::nitro::image |