Skip to content

Commit bcb46ad

Browse files
authored
Merge pull request #60635 from callstack-internal/fix/remove-unused-types
[No QA] Remove unused exported types
2 parents f2158fc + e94d871 commit bcb46ad

105 files changed

Lines changed: 117 additions & 427 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/components/AttachmentModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ function AttachmentModal({
211211
const parentReportAction = getReportAction(report?.parentReportID, report?.parentReportActionID);
212212
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
213213
const transactionID = (isMoneyRequestAction(parentReportAction) && getOriginalMessage(parentReportAction)?.IOUTransactionID) || CONST.DEFAULT_NUMBER_ID;
214-
const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`);
214+
const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {canBeMissing: false});
215215
const [currentAttachmentLink, setCurrentAttachmentLink] = useState(attachmentLink);
216216

217217
const [file, setFile] = useState<FileObject | undefined>(
@@ -703,4 +703,4 @@ AttachmentModal.displayName = 'AttachmentModal';
703703

704704
export default memo(AttachmentModal);
705705

706-
export type {Attachment, FileObject, ImagePickerResponse};
706+
export type {FileObject, ImagePickerResponse};

src/components/AttachmentPicker/launchCamera/types.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ type OptionsCommon = {
2424
presentationStyle?: 'currentContext' | 'fullScreen' | 'pageSheet' | 'formSheet' | 'popover' | 'overFullScreen' | 'overCurrentContext';
2525
};
2626

27-
type ImageLibraryOptions = OptionsCommon & {
28-
/** Specifies the maximum number of images that can be selected from the library. */
29-
selectionLimit?: number;
30-
};
31-
3227
type CameraOptions = OptionsCommon & {
3328
/** Specifies the maximum duration limit. */
3429
durationLimit?: number;
@@ -111,4 +106,4 @@ class ErrorLaunchCamera extends Error {
111106
type LaunchCamera = (options: CameraOptions, callback: Callback) => void;
112107

113108
export {ErrorLaunchCamera};
114-
export type {CameraOptions, Callback, ErrorCode, ImagePickerResponse, Asset, ImageLibraryOptions, LaunchCamera};
109+
export type {LaunchCamera};

src/components/Attachments/AttachmentCarousel/Pager/AttachmentCarouselPagerContext.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,3 @@ type AttachmentCarouselPagerContextValue = {
4949
const AttachmentCarouselPagerContext = createContext<AttachmentCarouselPagerContextValue | null>(null);
5050

5151
export default AttachmentCarouselPagerContext;
52-
export type {AttachmentCarouselPagerContextValue};

src/components/Avatar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,3 @@ function Avatar({
132132
Avatar.displayName = 'Avatar';
133133

134134
export default Avatar;
135-
export {type AvatarProps};

src/components/BulletList.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,4 @@ function BulletList({items, header}: BulletListProps) {
4848

4949
BulletList.displayName = 'BulletList';
5050

51-
export type {BulletListProps};
5251
export default BulletList;

src/components/CustomStatusBarAndBackground/CustomStatusBarAndBackgroundContext.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ type CustomStatusBarAndBackgroundContextType = {
99
const CustomStatusBarAndBackgroundContext = createContext<CustomStatusBarAndBackgroundContextType>({isRootStatusBarEnabled: true, setRootStatusBarEnabled: () => undefined});
1010

1111
export default CustomStatusBarAndBackgroundContext;
12-
export {type CustomStatusBarAndBackgroundContextType};

src/components/DraggableList/index.native.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {View} from 'react-native';
33
import {NestableDraggableFlatList, NestableScrollContainer} from 'react-native-draggable-flatlist';
44
import type {ScrollView} from 'react-native-gesture-handler';
55
import useThemeStyles from '@hooks/useThemeStyles';
6-
import type {DraggableListProps} from './types';
6+
import type DraggableListProps from './types';
77

88
function DraggableList<T>({ListFooterComponent, ...viewProps}: DraggableListProps<T>, ref: React.ForwardedRef<ScrollView>) {
99
const styles = useThemeStyles();

src/components/DraggableList/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type {ScrollView as RNScrollView} from 'react-native';
88
import ScrollView from '@components/ScrollView';
99
import useThemeStyles from '@hooks/useThemeStyles';
1010
import SortableItem from './SortableItem';
11-
import type {DraggableListProps} from './types';
11+
import type DraggableListProps from './types';
1212

1313
const minimumActivationDistance = 5; // pointer must move at least this much before starting to drag
1414

src/components/DraggableList/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ type SortableItemProps = {
2828
children: React.ReactNode | React.ReactNode[];
2929
};
3030

31-
export type {DraggableListProps, RenderItemParams, DraggableListData, SortableItemProps};
31+
export default DraggableListProps;
32+
export type {SortableItemProps};

src/components/ErrorBoundary/BaseErrorBoundary.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import GenericErrorPage from '@pages/ErrorPage/GenericErrorPage';
55
import UpdateRequiredView from '@pages/ErrorPage/UpdateRequiredView';
66
import CONST from '@src/CONST';
77
import {useSplashScreenStateContext} from '@src/SplashScreenStateContext';
8-
import type {BaseErrorBoundaryProps, LogError} from './types';
8+
import type {BaseErrorBoundaryProps} from './types';
99

1010
/**
1111
* This component captures an error in the child component tree and logs it to the server
@@ -36,5 +36,4 @@ function BaseErrorBoundary({logError = () => {}, errorMessage, children}: BaseEr
3636
}
3737

3838
BaseErrorBoundary.displayName = 'BaseErrorBoundary';
39-
export type {LogError, BaseErrorBoundaryProps};
4039
export default BaseErrorBoundary;

0 commit comments

Comments
 (0)