From 0451ba0f9e17536aca207e80d30ed491847b10b0 Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Mon, 9 Sep 2024 17:15:48 +0200 Subject: [PATCH] fix: group composer type ref with its implementation --- .../ComposerWithSuggestions.tsx | 17 +++++++++++++++-- .../ReportActionCompose/ReportActionCompose.tsx | 15 +-------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx index 21521396f3478..f306c39534699 100644 --- a/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx +++ b/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx @@ -46,7 +46,7 @@ import updateMultilineInputRange from '@libs/updateMultilineInputRange'; import willBlurTextInputOnTapOutsideFunc from '@libs/willBlurTextInputOnTapOutside'; import getCursorPosition from '@pages/home/report/ReportActionCompose/getCursorPosition'; import getScrollPosition from '@pages/home/report/ReportActionCompose/getScrollPosition'; -import type {ComposerRef, SuggestionsRef} from '@pages/home/report/ReportActionCompose/ReportActionCompose'; +import type {SuggestionsRef} from '@pages/home/report/ReportActionCompose/ReportActionCompose'; import SilentCommentUpdater from '@pages/home/report/ReportActionCompose/SilentCommentUpdater'; import Suggestions from '@pages/home/report/ReportActionCompose/Suggestions'; import * as EmojiPickerActions from '@userActions/EmojiPickerAction'; @@ -178,6 +178,19 @@ type SwitchToCurrentReportProps = { callback: () => void; }; +type ComposerRef = { + blur: () => void; + focus: (shouldDelay?: boolean) => void; + replaceSelectionWithText: EmojiPickerActions.OnEmojiSelected; + getCurrentText: () => string; + isFocused: () => boolean; + /** + * Calling clear will immediately clear the input on the UI thread (its a worklet). + * Once the composer ahs cleared onCleared will be called with the value that was cleared. + */ + clear: () => void; +}; + const {RNTextInputReset} = NativeModules; const isIOSNative = getPlatform() === CONST.PLATFORM.IOS; @@ -833,4 +846,4 @@ export default withOnyx void; - focus: (shouldDelay?: boolean) => void; - replaceSelectionWithText: EmojiPickerActions.OnEmojiSelected; - getCurrentText: () => string; - isFocused: () => boolean; - /** - * Calling clear will immediately clear the input on the UI thread (its a worklet). - * Once the composer ahs cleared onCleared will be called with the value that was cleared. - */ - clear: () => void; -}; - type SuggestionsRef = { resetSuggestions: () => void; onSelectionChange?: (event: NativeSyntheticEvent) => void;