Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions docs/the-new-architecture/cxx-custom-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,10 @@ This works - but is quite complex.
[**Codegen**](pillars-codegen.md) for C++ Turbo Native Modules does support struct generators, so you can simplify the code above in `NativeSampleModule.h` to:

```cpp
using CustomType = NativeSampleModuleBaseCustomType<std::string, bool, std::optional<int32_t>>;
using CustomType = NativeSampleModuleCustomType<std::string, bool, std::optional<int32_t>>;
template <>
struct Bridging<CustomType>
: NativeSampleModuleBaseCustomTypeBridging<std::string, bool, std::optional<int32_t>> {};
: NativeSampleModuleCustomTypeBridging<CustomType> {};
```

With `using CustomType` you declare a name for your concrete struct.
Expand All @@ -276,10 +276,9 @@ Without any custom conversion functions:

#### Base class

`NativeSampleModuleBaseCustomType` is an auto-generated template in your `AppSpecsJSI.h` which name is generated by:
`NativeSampleModuleCustomType` is an auto-generated template in your `AppSpecsJSI.h` which name is generated by:

- `NativeSampleModule` (name of C++ Turbo Native Module in the JavaScript spec) +
- `Base` (constant) +
- `CustomType` (name of type in the JavaScript spec)

The same naming schema applies to the necessary `Bridging` struct which is defined via `struct Bridging<CustomType>`.