11import { codegenNativeComponent , codegenNativeCommands } from 'react-native' ;
22import type {
3- BubblingEventHandler ,
4- DirectEventHandler ,
5- Float ,
6- Int32 ,
7- UnsafeMixed ,
8- } from 'react-native/Libraries/Types/CodegenTypes' ;
9- import type { ColorValue , HostComponent , ViewProps } from 'react-native' ;
3+ CodegenTypes ,
4+ ColorValue ,
5+ HostComponent ,
6+ ViewProps ,
7+ } from 'react-native' ;
108import React from 'react' ;
119
1210export interface LinkNativeRegex {
@@ -129,8 +127,8 @@ export interface OnChangeStateEvent {
129127export interface OnLinkDetected {
130128 text : string ;
131129 url : string ;
132- start : Int32 ;
133- end : Int32 ;
130+ start : CodegenTypes . Int32 ;
131+ end : CodegenTypes . Int32 ;
134132}
135133
136134export interface OnMentionDetectedInternal {
@@ -147,18 +145,18 @@ export interface OnMentionDetected {
147145
148146export interface OnMentionEvent {
149147 indicator : string ;
150- text : UnsafeMixed ;
148+ text : CodegenTypes . UnsafeMixed ;
151149}
152150
153151export interface OnChangeSelectionEvent {
154- start : Int32 ;
155- end : Int32 ;
152+ start : CodegenTypes . Int32 ;
153+ end : CodegenTypes . Int32 ;
156154 text : string ;
157155}
158156
159157export interface OnRequestHtmlResultEvent {
160- requestId : Int32 ;
161- html : UnsafeMixed ;
158+ requestId : CodegenTypes . Int32 ;
159+ html : CodegenTypes . UnsafeMixed ;
162160}
163161
164162export interface OnSubmitEditing {
@@ -181,8 +179,8 @@ export interface TextShortcut {
181179export interface OnContextMenuItemPressEvent {
182180 itemText : string ;
183181 selectedText : string ;
184- selectionStart : Int32 ;
185- selectionEnd : Int32 ;
182+ selectionStart : CodegenTypes . Int32 ;
183+ selectionEnd : CodegenTypes . Int32 ;
186184 styleState : {
187185 bold : {
188186 isActive : boolean ;
@@ -284,27 +282,27 @@ export interface OnContextMenuItemPressEvent {
284282}
285283
286284interface TargetedEvent {
287- target : Int32 ;
285+ target : CodegenTypes . Int32 ;
288286}
289287
290288export interface PastedImage {
291289 uri : string ;
292290 type : string ;
293- width : Float ;
294- height : Float ;
291+ width : CodegenTypes . Float ;
292+ height : CodegenTypes . Float ;
295293}
296294
297295export interface OnPasteImagesEvent {
298296 images : {
299297 uri : string ;
300298 type : string ;
301- width : Float ;
302- height : Float ;
299+ width : CodegenTypes . Float ;
300+ height : CodegenTypes . Float ;
303301 } [ ] ;
304302}
305303
306304type Heading = {
307- fontSize ?: Float ;
305+ fontSize ?: CodegenTypes . Float ;
308306 bold ?: boolean ;
309307} ;
310308
@@ -317,13 +315,13 @@ export interface HtmlStyleInternal {
317315 h6 ?: Heading ;
318316 blockquote ?: {
319317 borderColor ?: ColorValue ;
320- borderWidth ?: Float ;
321- gapWidth ?: Float ;
318+ borderWidth ?: CodegenTypes . Float ;
319+ gapWidth ?: CodegenTypes . Float ;
322320 color ?: ColorValue ;
323321 } ;
324322 codeblock ?: {
325323 color ?: ColorValue ;
326- borderRadius ?: Float ;
324+ borderRadius ?: CodegenTypes . Float ;
327325 backgroundColor ?: ColorValue ;
328326 } ;
329327 code ?: {
@@ -336,23 +334,23 @@ export interface HtmlStyleInternal {
336334 } ;
337335 // This is a workaround for the fact that codegen does not support Records.
338336 // On native Android side this will become a ReadableMap, on native iOS we can work with a folly::dynamic object.
339- mention ?: UnsafeMixed ;
337+ mention ?: CodegenTypes . UnsafeMixed ;
340338 ol ?: {
341- gapWidth ?: Float ;
342- marginLeft ?: Float ;
339+ gapWidth ?: CodegenTypes . Float ;
340+ marginLeft ?: CodegenTypes . Float ;
343341 markerFontWeight ?: string ;
344342 markerColor ?: ColorValue ;
345343 } ;
346344 ul ?: {
347345 bulletColor ?: ColorValue ;
348- bulletSize ?: Float ;
349- marginLeft ?: Float ;
350- gapWidth ?: Float ;
346+ bulletSize ?: CodegenTypes . Float ;
347+ marginLeft ?: CodegenTypes . Float ;
348+ gapWidth ?: CodegenTypes . Float ;
351349 } ;
352350 ulCheckbox ?: {
353- gapWidth ?: Float ;
354- boxSize ?: Float ;
355- marginLeft ?: Float ;
351+ gapWidth ?: CodegenTypes . Float ;
352+ boxSize ?: CodegenTypes . Float ;
353+ marginLeft ?: CodegenTypes . Float ;
356354 boxColor ?: ColorValue ;
357355 } ;
358356}
@@ -379,26 +377,26 @@ export interface NativeProps extends ViewProps {
379377 allowFontScaling ?: boolean ;
380378
381379 // event callbacks
382- onInputFocus ?: DirectEventHandler < TargetedEvent > ;
383- onInputBlur ?: DirectEventHandler < TargetedEvent > ;
384- onChangeText ?: DirectEventHandler < OnChangeTextEvent > ;
385- onChangeHtml ?: DirectEventHandler < OnChangeHtmlEvent > ;
386- onChangeState ?: DirectEventHandler < OnChangeStateEvent > ;
387- onLinkDetected ?: DirectEventHandler < OnLinkDetected > ;
388- onMentionDetected ?: DirectEventHandler < OnMentionDetectedInternal > ;
389- onMention ?: DirectEventHandler < OnMentionEvent > ;
390- onChangeSelection ?: DirectEventHandler < OnChangeSelectionEvent > ;
391- onRequestHtmlResult ?: DirectEventHandler < OnRequestHtmlResultEvent > ;
392- onInputKeyPress ?: DirectEventHandler < OnKeyPressEvent > ;
393- onPasteImages ?: DirectEventHandler < OnPasteImagesEvent > ;
394- onContextMenuItemPress ?: DirectEventHandler < OnContextMenuItemPressEvent > ;
395- onSubmitEditing ?: BubblingEventHandler < OnSubmitEditing > ;
380+ onInputFocus ?: CodegenTypes . DirectEventHandler < TargetedEvent > ;
381+ onInputBlur ?: CodegenTypes . DirectEventHandler < TargetedEvent > ;
382+ onChangeText ?: CodegenTypes . DirectEventHandler < OnChangeTextEvent > ;
383+ onChangeHtml ?: CodegenTypes . DirectEventHandler < OnChangeHtmlEvent > ;
384+ onChangeState ?: CodegenTypes . DirectEventHandler < OnChangeStateEvent > ;
385+ onLinkDetected ?: CodegenTypes . DirectEventHandler < OnLinkDetected > ;
386+ onMentionDetected ?: CodegenTypes . DirectEventHandler < OnMentionDetectedInternal > ;
387+ onMention ?: CodegenTypes . DirectEventHandler < OnMentionEvent > ;
388+ onChangeSelection ?: CodegenTypes . DirectEventHandler < OnChangeSelectionEvent > ;
389+ onRequestHtmlResult ?: CodegenTypes . DirectEventHandler < OnRequestHtmlResultEvent > ;
390+ onInputKeyPress ?: CodegenTypes . DirectEventHandler < OnKeyPressEvent > ;
391+ onPasteImages ?: CodegenTypes . DirectEventHandler < OnPasteImagesEvent > ;
392+ onContextMenuItemPress ?: CodegenTypes . DirectEventHandler < OnContextMenuItemPressEvent > ;
393+ onSubmitEditing ?: CodegenTypes . BubblingEventHandler < OnSubmitEditing > ;
396394
397395 // Style related props - used for generating proper setters in component's manager
398396 // These should not be passed as regular props
399397 color ?: ColorValue ;
400- fontSize ?: Float ;
401- lineHeight ?: Float ;
398+ fontSize ?: CodegenTypes . Float ;
399+ lineHeight ?: CodegenTypes . Float ;
402400 fontFamily ?: string ;
403401 fontWeight ?: string ;
404402 fontStyle ?: string ;
@@ -422,8 +420,8 @@ interface NativeCommands {
422420 setValue : ( viewRef : React . ElementRef < ComponentType > , text : string ) => void ;
423421 setSelection : (
424422 viewRef : React . ElementRef < ComponentType > ,
425- start : Int32 ,
426- end : Int32
423+ start : CodegenTypes . Int32 ,
424+ end : CodegenTypes . Int32
427425 ) => void ;
428426
429427 // Text formatting commands
@@ -448,21 +446,21 @@ interface NativeCommands {
448446 ) => void ;
449447 addLink : (
450448 viewRef : React . ElementRef < ComponentType > ,
451- start : Int32 ,
452- end : Int32 ,
449+ start : CodegenTypes . Int32 ,
450+ end : CodegenTypes . Int32 ,
453451 text : string ,
454452 url : string
455453 ) => void ;
456454 removeLink : (
457455 viewRef : React . ElementRef < ComponentType > ,
458- start : Int32 ,
459- end : Int32
456+ start : CodegenTypes . Int32 ,
457+ end : CodegenTypes . Int32
460458 ) => void ;
461459 addImage : (
462460 viewRef : React . ElementRef < ComponentType > ,
463461 uri : string ,
464- width : Float ,
465- height : Float
462+ width : CodegenTypes . Float ,
463+ height : CodegenTypes . Float
466464 ) => void ;
467465 startMention : (
468466 viewRef : React . ElementRef < ComponentType > ,
@@ -476,7 +474,7 @@ interface NativeCommands {
476474 ) => void ;
477475 requestHTML : (
478476 viewRef : React . ElementRef < ComponentType > ,
479- requestId : Int32
477+ requestId : CodegenTypes . Int32
480478 ) => void ;
481479 setTextAlignment : (
482480 viewRef : React . ElementRef < ComponentType > ,
0 commit comments