mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-06-17 03:38:35 +08:00
Add indent for event emitter header generation of codegen (#24445)
Summary: Part of #24438, add indent foe event emitter header codegen. cc. cpojer rickhanlonii. [General] [Fixed] - Add indent for event emitter header generation of codegen Pull Request resolved: https://github.com/facebook/react-native/pull/24445 Differential Revision: D14930352 Pulled By: cpojer fbshipit-source-id: 8bd03b8e12ccf9bd06546acdb744541fcb92eea1
This commit is contained in:
committed by
Facebook Github Bot
parent
2a4a9f86d4
commit
b60651dd09
@@ -108,7 +108,7 @@ function generateStruct(
|
||||
structNameParts,
|
||||
)} ${property.name};`;
|
||||
})
|
||||
.join('\n');
|
||||
.join('\n' + ' ');
|
||||
|
||||
properties.forEach((property: ObjectPropertyType) => {
|
||||
const name = property.name;
|
||||
@@ -165,7 +165,7 @@ function generateEvent(componentName: string, event: EventTypeShape): string {
|
||||
function generateEvents(componentName: string, component): string {
|
||||
return component.events
|
||||
.map(event => generateEvent(componentName, event))
|
||||
.join('\n\n');
|
||||
.join('\n\n' + ' ');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -118,8 +118,8 @@ struct EventsNestedObjectNativeComponentOnChangeLocationSourceStruct {
|
||||
|
||||
struct EventsNestedObjectNativeComponentOnChangeLocationStruct {
|
||||
EventsNestedObjectNativeComponentOnChangeLocationSourceStruct source;
|
||||
int x;
|
||||
int y;
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
struct EventsNestedObjectNativeComponentOnChangeStruct {
|
||||
@@ -157,9 +157,9 @@ namespace react {
|
||||
|
||||
struct EventsNativeComponentOnChangeStruct {
|
||||
bool value;
|
||||
std::string source;
|
||||
int progress;
|
||||
Float scale;
|
||||
std::string source;
|
||||
int progress;
|
||||
Float scale;
|
||||
};
|
||||
|
||||
struct EventsNativeComponentOnEventDirectStruct {
|
||||
@@ -172,7 +172,7 @@ class EventsNativeComponentEventEmitter : public ViewEventEmitter {
|
||||
|
||||
void onChange(EventsNativeComponentOnChangeStruct value) const;
|
||||
|
||||
void onEventDirect(EventsNativeComponentOnEventDirectStruct value) const;
|
||||
void onEventDirect(EventsNativeComponentOnEventDirectStruct value) const;
|
||||
};
|
||||
|
||||
} // namespace react
|
||||
|
||||
Reference in New Issue
Block a user