Skip to content

Commit

Permalink
Merge pull request #48790 from margelo/fix/46499-group-types-with-imp…
Browse files Browse the repository at this point in the history
…lementation

[NoQA] fix: group composer type ref with its implementation
  • Loading branch information
puneetlath authored Sep 11, 2024
2 parents 6a9ed7a + 0451ba0 commit 51ec6aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
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

0 comments on commit 51ec6aa

Please sign in to comment.