From ad17e3389fd2f8f4a77d28deb39797eb2285e088 Mon Sep 17 00:00:00 2001 From: Pieter Vanderwerff Date: Mon, 10 Jun 2024 14:49:11 -0700 Subject: [PATCH] Cleanup imports and types Summary: Clean up: * type imports to be consistent * Remove long since deprecated `{| ... |}` exact object style. Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D58381905 --- .../Libraries/Text/TextNativeComponent.js | 9 +++++---- packages/react-native/Libraries/Text/TextProps.js | 12 ++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/react-native/Libraries/Text/TextNativeComponent.js b/packages/react-native/Libraries/Text/TextNativeComponent.js index 0d5990455b5be0..7ab0e270e99d53 100644 --- a/packages/react-native/Libraries/Text/TextNativeComponent.js +++ b/packages/react-native/Libraries/Text/TextNativeComponent.js @@ -8,13 +8,14 @@ * @format */ +import type {HostComponent} from '../Renderer/shims/ReactNativeTypes'; +import type {ProcessedColorValue} from '../StyleSheet/processColor'; +import type {PressEvent} from '../Types/CoreEventTypes'; +import type {TextProps} from './TextProps'; + import {createViewConfig} from '../NativeComponent/ViewConfig'; import UIManager from '../ReactNative/UIManager'; import createReactNativeComponentClass from '../Renderer/shims/createReactNativeComponentClass'; -import {type HostComponent} from '../Renderer/shims/ReactNativeTypes'; -import {type ProcessedColorValue} from '../StyleSheet/processColor'; -import {type PressEvent} from '../Types/CoreEventTypes'; -import {type TextProps} from './TextProps'; type NativeTextProps = $ReadOnly<{ ...TextProps, diff --git a/packages/react-native/Libraries/Text/TextProps.js b/packages/react-native/Libraries/Text/TextProps.js index bb9348f6a55e4f..d3f8b33fcbb9cd 100644 --- a/packages/react-native/Libraries/Text/TextProps.js +++ b/packages/react-native/Libraries/Text/TextProps.js @@ -26,23 +26,23 @@ import type { } from '../Types/CoreEventTypes'; import type {Node} from 'react'; -export type PressRetentionOffset = $ReadOnly<{| +export type PressRetentionOffset = $ReadOnly<{ top: number, left: number, bottom: number, right: number, -|}>; +}>; -type PointerEventProps = $ReadOnly<{| +type PointerEventProps = $ReadOnly<{ onPointerEnter?: (event: PointerEvent) => void, onPointerLeave?: (event: PointerEvent) => void, onPointerMove?: (event: PointerEvent) => void, -|}>; +}>; /** * @see https://reactnative.dev/docs/text#reference */ -export type TextProps = $ReadOnly<{| +export type TextProps = $ReadOnly<{ ...PointerEventProps, /** @@ -265,4 +265,4 @@ export type TextProps = $ReadOnly<{| * See https://reactnative.dev/docs/text.html#linebreakstrategyios */ lineBreakStrategyIOS?: ?('none' | 'standard' | 'hangul-word' | 'push-out'), -|}>; +}>;