Skip to content

Commit 46444dd

Browse files
committed
use EventTypeAnnotation instead of defining type
1 parent 993ded9 commit 46444dd

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/react-native-codegen/src/parsers/parsers-commons.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,14 @@ import type {
2424
NativeModuleEnumMap,
2525
OptionsShape,
2626
EventTypeAnnotation,
27+
ObjectTypeAnnotation,
2728
} from '../CodegenSchema.js';
2829

2930
import type {Parser} from './parser';
3031
import type {ParserType} from './errors';
3132
import type {ParserErrorCapturer, TypeDeclarationMap, PropAST} from './utils';
3233
import type {ComponentSchemaBuilderConfig} from './schema.js';
3334

34-
type ObjectTypeAnnotationShape = {
35-
type: 'ObjectTypeAnnotation',
36-
properties: Array<NamedShape<EventTypeAnnotation>>,
37-
};
38-
3935
const {
4036
getConfigType,
4137
extractNativeModuleName,
@@ -865,7 +861,7 @@ function getEventArgument(
865861
buildPropertiesForEvent: (
866862
property: PropAST,
867863
) => NamedShape<EventTypeAnnotation>,
868-
): ObjectTypeAnnotationShape {
864+
): ObjectTypeAnnotation<EventTypeAnnotation> {
869865
return {
870866
type: 'ObjectTypeAnnotation',
871867
properties: argumentProps.map(buildPropertiesForEvent),

0 commit comments

Comments
 (0)