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
2 changes: 1 addition & 1 deletion src/components/DebugContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import { Platform, StyleProp, ViewStyle, type ViewProps } from 'react-native';
// @ts-expect-error importing private component

import AppContainer from 'react-native/Libraries/ReactNative/AppContainer';

Check warning on line 5 in src/components/DebugContainer.tsx

View workflow job for this annotation

GitHub Actions / lint-js

'react-native/Libraries/ReactNative/AppContainer' React Native deep imports are deprecated. Please use the top level import instead
import ScreenContentWrapper from './ScreenContentWrapper';
import { StackPresentationTypes } from '../types';

type ContainerProps = ViewProps & {
contentStyle?: StyleProp<ViewStyle>;
contentStyle?: StyleProp<ViewStyle> | undefined;
stackPresentation: StackPresentationTypes;
children: React.ReactNode;
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/FullWindowOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
style: StyleProp<ViewStyle>;
}> &
NativeProps
> = FullWindowOverlayNativeComponent as any;

Check warning on line 20 in src/components/FullWindowOverlay.tsx

View workflow job for this annotation

GitHub Actions / lint-js

Unexpected any. Specify a different type

type FullWindowOverlayProps = {
children: ReactNode;
unstable_accessibilityContainerViewIsModal?: boolean;
unstable_accessibilityContainerViewIsModal?: boolean | undefined;
};

function FullWindowOverlay(props: FullWindowOverlayProps) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ScreenFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function ScreenFooter(props: ViewProps) {
}

type FooterProps = {
children?: React.ReactNode;
children?: React.ReactNode | undefined;
};

export function FooterComponent({ children }: FooterProps) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ScreenStackHeaderConfig.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ export const ScreenStackHeaderConfig = (
): React.JSX.Element => <View {...props} />;

export const ScreenStackHeaderSubview: React.ComponentType<
ViewProps & { type?: HeaderSubviewTypes }
ViewProps & { type?: HeaderSubviewTypes | undefined }
> = View;
6 changes: 3 additions & 3 deletions src/components/ScreenStackItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ type Props = Omit<
'enabled' | 'isNativeStack' | 'hasLargeHeader'
> & {
screenId: string;
headerConfig?: ScreenStackHeaderConfigProps;
contentStyle?: StyleProp<ViewStyle>;
headerConfig?: ScreenStackHeaderConfigProps | undefined;
contentStyle?: StyleProp<ViewStyle> | undefined;
};

function ScreenStackItem(
Expand Down Expand Up @@ -261,7 +261,7 @@ function getPositioningStyle(

type SplitStyleResult = {
screenStyles: {
backgroundColor?: ViewStyle['backgroundColor'];
backgroundColor?: ViewStyle['backgroundColor'] | undefined;
};
contentWrapperStyles: StyleProp<ViewStyle>;
};
Expand Down
4 changes: 3 additions & 1 deletion src/components/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import SearchBarNativeComponent, {
import type { CodegenTypes as CT } from 'react-native';

const NativeSearchBar: React.ComponentType<
SearchBarNativeProps & { ref?: React.RefObject<SearchBarCommands | null> }
SearchBarNativeProps & {
ref?: React.RefObject<SearchBarCommands | null> | undefined;
}
> &
typeof NativeSearchBarCommands =
SearchBarNativeComponent as unknown as React.ComponentType<SearchBarNativeProps> &
Expand Down
18 changes: 10 additions & 8 deletions src/components/gamma/scroll-view-marker/ScrollViewMarker.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { ViewProps } from 'react-native';
import type { ScrollEdgeEffect } from '../../shared/types';

export interface ScrollViewMarkerProps {
children: ViewProps['children'];
style?: ViewProps['style'];
children: NonNullable<ViewProps['children']>;
style?: ViewProps['style'] | undefined;

/**
* Configures the scroll edge effect for the _content ScrollView_ (the ScrollView resolved in direct subtree of the ScrollViewMarker).
Expand Down Expand Up @@ -31,10 +31,12 @@ export interface ScrollViewMarkerProps {
*
* @supported iOS 26 or higher
*/
scrollEdgeEffects?: {
bottom?: ScrollEdgeEffect;
left?: ScrollEdgeEffect;
right?: ScrollEdgeEffect;
top?: ScrollEdgeEffect;
};
scrollEdgeEffects?:
| {
bottom?: ScrollEdgeEffect | undefined;
left?: ScrollEdgeEffect | undefined;
right?: ScrollEdgeEffect | undefined;
top?: ScrollEdgeEffect | undefined;
}
| undefined;
}
64 changes: 34 additions & 30 deletions src/components/gamma/split/SplitHost.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,77 +34,77 @@ export interface SplitColumnMetrics {
*
* Specifies the minimum width for the primary column in the Split layout, typically representing the leftmost sidebar.
*/
minimumPrimaryColumnWidth?: number;
minimumPrimaryColumnWidth?: number | undefined;
/**
* @summary Maximum width for the primary sidebar.
*
* Specifies the maximum width (in points) for the primary column in the Split layout, typically representing the leftmost sidebar.
*/
maximumPrimaryColumnWidth?: number;
maximumPrimaryColumnWidth?: number | undefined;
/**
* @summary Preferred width for the primary sidebar.
*
* Specifies the preferred width (in points or as a fraction for percentage width support) for the primary column in the Split layout, typically representing the leftmost sidebar.
*/
preferredPrimaryColumnWidthOrFraction?: number;
preferredPrimaryColumnWidthOrFraction?: number | undefined;
/**
* @summary Minimum width for the intermediate sidebar.
*
* Specifies the minimum width (in points) for the supplementary column in the Split layout, typically representing the intermediate sidebar.
*/
minimumSupplementaryColumnWidth?: number;
minimumSupplementaryColumnWidth?: number | undefined;
/**
* @summary Maximum width for the intermediate sidebar.
*
* Specifies the maximum width (in points) for the supplementary column in the Split layout, typically representing the intermediate sidebar.
*/
maximumSupplementaryColumnWidth?: number;
maximumSupplementaryColumnWidth?: number | undefined;
/**
* @summary Preferred width for the intermediate sidebar.
*
* Specifies the preferred width (in points or as a fraction for percentage width support) for the supplementary column in the Split layout, typically representing the intermediate sidebar.
*/
preferredSupplementaryColumnWidthOrFraction?: number;
preferredSupplementaryColumnWidthOrFraction?: number | undefined;
/**
* @summary Minimum width for the secondary component.
*
* Specifies the minimum width (in points) for the secondary column in the Split layout, typically for the view with the main content.
*
* @supported iOS 26 or higher
*/
minimumSecondaryColumnWidth?: number;
minimumSecondaryColumnWidth?: number | undefined;
/**
* @summary Preferred width for the secondary component.
*
* Specifies the preferred width (in points or as a fraction for percentage width support) for the secondary column in the Split layout, typically for the view with the main content.
*
* @supported iOS 26 or higher
*/
preferredSecondaryColumnWidthOrFraction?: number;
preferredSecondaryColumnWidthOrFraction?: number | undefined;
/**
* @summary Minimum width for the inspector component.
*
* Specifies the minimum width (in points) for the inspector column in the Split layout, typically the view which is providing additional data about the secondary column.
*
* @supported iOS 26 or higher
*/
minimumInspectorColumnWidth?: number;
minimumInspectorColumnWidth?: number | undefined;
/**
* @summary Maximum width for the inspector component.
*
* Specifies the maximum width (in points) for the inspector column in the Split layout, typically the view which is providing additional data about the secondary column.
*
* @supported iOS 26 or higher
*/
maximumInspectorColumnWidth?: number;
maximumInspectorColumnWidth?: number | undefined;
/**
* @summary Preferred width for the inspector component.
*
* Specifies the preferred width (in points or as a fraction for percentage width support) for the inspector column in the Split layout, typically the view which is providing additional data about the secondary column.
*
* @supported iOS 26 or higher
*/
preferredInspectorColumnWidthOrFraction?: number;
preferredInspectorColumnWidthOrFraction?: number | undefined;
}
export type SplitNavigableColumn = 'primary' | 'supplementary' | 'secondary';

Expand All @@ -113,8 +113,8 @@ export type SplitHostCommands = {
};

export interface SplitHostProps extends ViewProps {
children?: React.ReactNode;
ref?: React.Ref<SplitHostCommands>;
children?: React.ReactNode | undefined;
ref?: React.Ref<SplitHostCommands> | undefined;

/**
* @summary An object describing bounds for column widths.
Expand All @@ -129,7 +129,7 @@ export interface SplitHostProps extends ViewProps {
* - `secondary` - the view with the main content
* - `inspector` - the view which is providing additional data about the secondary column
*/
columnMetrics?: SplitColumnMetrics;
columnMetrics?: SplitColumnMetrics | undefined;
/**
* @summary Determines whether the button for changing the Split display mode is visible on the screen.
*
Expand All @@ -144,32 +144,36 @@ export interface SplitHostProps extends ViewProps {
*
* @default automatic
*/
displayModeButtonVisibility?: SplitDisplayModeButtonVisibility;
displayModeButtonVisibility?: SplitDisplayModeButtonVisibility | undefined;
/**
* @summary A callback that gets invoked when the Split was collapsed to a single column.
*/
onCollapse?: (e: NativeSyntheticEvent<GenericEmptyEvent>) => void;
onCollapse?:
| ((e: NativeSyntheticEvent<GenericEmptyEvent>) => void)
| undefined;
/**
* @summary A callback that gets invoked when the Split displayMode has changed.
*
* The purpose of this callback is tracking displayMode updates on host from the JS side.
* These updates might be a consequence of some native interactions, like pressing native button or performing swipe gesture.
*/
onDisplayModeWillChange?: (
e: NativeSyntheticEvent<DisplayModeWillChangeEvent>,
) => void;
onDisplayModeWillChange?:
| ((e: NativeSyntheticEvent<DisplayModeWillChangeEvent>) => void)
| undefined;
/**
* @summary A callback that gets invoked when the Split was expanded to multiple columns.
*/
onExpand?: (e: NativeSyntheticEvent<GenericEmptyEvent>) => void;
onExpand?: ((e: NativeSyntheticEvent<GenericEmptyEvent>) => void) | undefined;
/**
* @summary A callback that gets invoked when the Split inspector is either programmatically hidden (in column presentation) or dismissed (in modal presentation).
*
* The purpose of this callback depends on whether the Split is collapsed or expanded.
*
* @supported iOS 26 or higher
*/
onInspectorHide?: (e: NativeSyntheticEvent<GenericEmptyEvent>) => void;
onInspectorHide?:
| ((e: NativeSyntheticEvent<GenericEmptyEvent>) => void)
| undefined;
/**
* @summary Specifies supported orientations for the tab screen.
*
Expand Down Expand Up @@ -212,11 +216,11 @@ export interface SplitHostProps extends ViewProps {
*
* @platform ios
*/
orientation?: SplitHostOrientation;
orientation?: SplitHostOrientation | undefined;
/**
* @summary Determines whether gestures are enabled to change the display mode.
*/
presentsWithGesture?: boolean;
presentsWithGesture?: boolean | undefined;
/**
* @summary Specifies the display mode which will be preferred to use, if the layout requirements are met.
*
Expand All @@ -237,7 +241,7 @@ export interface SplitHostProps extends ViewProps {
*
* @default automatic
*/
preferredDisplayMode?: SplitDisplayMode;
preferredDisplayMode?: SplitDisplayMode | undefined;
/**
* @summary Specifies the split behavior which will be preferred to use, if the layout requirements are met.
*
Expand All @@ -255,7 +259,7 @@ export interface SplitHostProps extends ViewProps {
*
* @default automatic
*/
preferredSplitBehavior?: SplitBehavior;
preferredSplitBehavior?: SplitBehavior | undefined;
/**
* @summary Specifies the background style of the primary view controller.
*
Expand All @@ -277,7 +281,7 @@ export interface SplitHostProps extends ViewProps {
* @remarks
* According to the documentation, this property shouldn't have any effect on iOS. However, on iOS 26 the support for this prop was added.
*/
primaryBackgroundStyle?: SplitPrimaryBackgroundStyle;
primaryBackgroundStyle?: SplitPrimaryBackgroundStyle | undefined;
/**
* @summary Indicates on which side primary sidebar is placed, affecting the split view layout.
*
Expand All @@ -291,7 +295,7 @@ export interface SplitHostProps extends ViewProps {
*
* @default leading
*/
primaryEdge?: SplitPrimaryEdge;
primaryEdge?: SplitPrimaryEdge | undefined;
/**
* @summary Determines whether inspector column should be displayed.
*
Expand All @@ -300,11 +304,11 @@ export interface SplitHostProps extends ViewProps {
*
* @supported iOS 26 or higher
*/
showInspector?: boolean;
showInspector?: boolean | undefined;
/**
* @summary Determines whether a button to toggle to and from secondaryOnly display mode is visible.
*/
showSecondaryToggleButton?: boolean;
showSecondaryToggleButton?: boolean | undefined;
/**
* @summary Specifies which column should be shown when the split view collapses to a single column.
*
Expand All @@ -319,5 +323,5 @@ export interface SplitHostProps extends ViewProps {
* - `supplementary` - the supplementary sidebar is shown
* - `secondary` - the secondary (main content) column is shown
*/
topColumnForCollapsing?: SplitNavigableColumn;
topColumnForCollapsing?: SplitNavigableColumn | undefined;
}
18 changes: 13 additions & 5 deletions src/components/gamma/split/SplitScreen.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,37 @@ type GenericEmptyEvent = Readonly<{}>;
export type SplitScreenColumnType = 'column' | 'inspector';

export interface SplitScreenProps extends ViewProps {
children?: React.ReactNode;
children?: React.ReactNode | undefined;
/**
* @summary A callback that gets invoked when the current SplitScreen did appear.
*
* This is called as soon as the transition ends.
*/
onDidAppear?: (e: NativeSyntheticEvent<GenericEmptyEvent>) => void;
onDidAppear?:
| ((e: NativeSyntheticEvent<GenericEmptyEvent>) => void)
| undefined;
/**
* @summary A callback that gets invoked when the current SplitScreen did disappear.
*
* This is called as soon as the transition ends.
*/
onDidDisappear?: (e: NativeSyntheticEvent<GenericEmptyEvent>) => void;
onDidDisappear?:
| ((e: NativeSyntheticEvent<GenericEmptyEvent>) => void)
| undefined;
/**
* @summary A callback that gets invoked when the current SplitScreen will appear.
*
* This is called as soon as the transition begins.
*/
onWillAppear?: (e: NativeSyntheticEvent<GenericEmptyEvent>) => void;
onWillAppear?:
| ((e: NativeSyntheticEvent<GenericEmptyEvent>) => void)
| undefined;
/**
* @summary A callback that gets invoked when the current SplitScreen will disappear.
*
* This is called as soon as the transition begins.
*/
onWillDisappear?: (e: NativeSyntheticEvent<GenericEmptyEvent>) => void;
onWillDisappear?:
| ((e: NativeSyntheticEvent<GenericEmptyEvent>) => void)
| undefined;
}
9 changes: 6 additions & 3 deletions src/components/gamma/stack/StackHost.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { type NativeProps } from '../../../fabric/gamma/stack/StackHostNativeCom

export type StackHostProps = {
children: ViewProps['children'];
ref?: React.RefObject<
(React.Component<NativeProps> & ReactNativeElement) | null
>; // TODO: Work on these types
// TODO: Work on these types
ref?:
| React.RefObject<
(React.Component<NativeProps> & ReactNativeElement) | null
>
| undefined;
};
Loading
Loading