Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -833,4 +846,4 @@ export default withOnyx<ComposerWithSuggestionsProps & RefAttributes<ComposerRef
},
})(memo(ComposerWithSuggestionsWithRef));

export type {ComposerWithSuggestionsProps};
export type {ComposerWithSuggestionsProps, ComposerRef};
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,9 @@ import type * as OnyxCommon from '@src/types/onyx/OnyxCommon';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import AttachmentPickerWithMenuItems from './AttachmentPickerWithMenuItems';
import ComposerWithSuggestions from './ComposerWithSuggestions';
import type {ComposerWithSuggestionsProps} from './ComposerWithSuggestions/ComposerWithSuggestions';
import type {ComposerRef, ComposerWithSuggestionsProps} from './ComposerWithSuggestions/ComposerWithSuggestions';
import SendButton from './SendButton';

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;
};

type SuggestionsRef = {
resetSuggestions: () => void;
onSelectionChange?: (event: NativeSyntheticEvent<TextInputSelectionChangeEventData>) => void;
Expand Down