From 8fca1c58542a560d99adaf1408733ef95cc17797 Mon Sep 17 00:00:00 2001 From: ankit-tailor Date: Wed, 31 Jan 2024 03:13:18 -0800 Subject: [PATCH] fix: font variant typings (#42760) Summary: This PR fixes the typings for `fontVariant` style prop. Flow file has below typings but they were missing in typescript file. ``` fontVariant?: | 'small-caps' | 'oldstyle-nums' | 'lining-nums' | 'tabular-nums' | 'common-ligatures' | 'no-common-ligatures' | 'discretionary-ligatures' | 'no-discretionary-ligatures' | 'historical-ligatures' | 'no-historical-ligatures' | 'contextual' | 'no-contextual' | 'proportional-nums' | 'stylistic-one' | 'stylistic-two' | 'stylistic-three' | 'stylistic-four' | 'stylistic-five' | 'stylistic-six' | 'stylistic-seven' | 'stylistic-eight' | 'stylistic-nine' | 'stylistic-ten' | 'stylistic-eleven' | 'stylistic-twelve' | 'stylistic-thirteen' | 'stylistic-fourteen' | 'stylistic-fifteen' | 'stylistic-sixteen' | 'stylistic-seventeen' | 'stylistic-eighteen' | 'stylistic-nineteen' | 'stylistic-twenty'; ``` ## Changelog: [GENERAL] [ADDED] - Added missing typings for fontVariant style prop. Pull Request resolved: https://github.com/facebook/react-native/pull/42760 Test Plan: Tested manually. Reviewed By: cortinico Differential Revision: D53263569 Pulled By: javache fbshipit-source-id: b127e0377cf9ceb50d094294d188f87a23038e5b --- .../Libraries/StyleSheet/StyleSheetTypes.d.ts | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts index d104d679ea7..5a9121be117 100644 --- a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts +++ b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts @@ -281,7 +281,6 @@ export type FontVariant = | 'oldstyle-nums' | 'lining-nums' | 'tabular-nums' - | 'proportional-nums' | 'common-ligatures' | 'no-common-ligatures' | 'discretionary-ligatures' @@ -289,7 +288,28 @@ export type FontVariant = | 'historical-ligatures' | 'no-historical-ligatures' | 'contextual' - | 'no-contextual'; + | 'no-contextual' + | 'proportional-nums' + | 'stylistic-one' + | 'stylistic-two' + | 'stylistic-three' + | 'stylistic-four' + | 'stylistic-five' + | 'stylistic-six' + | 'stylistic-seven' + | 'stylistic-eight' + | 'stylistic-nine' + | 'stylistic-ten' + | 'stylistic-eleven' + | 'stylistic-twelve' + | 'stylistic-thirteen' + | 'stylistic-fourteen' + | 'stylistic-fifteen' + | 'stylistic-sixteen' + | 'stylistic-seventeen' + | 'stylistic-eighteen' + | 'stylistic-nineteen' + | 'stylistic-twenty'; export interface TextStyleIOS extends ViewStyle { fontVariant?: FontVariant[] | undefined; textDecorationColor?: ColorValue | undefined;