diff --git a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts index 0e2e7b31176..62f52a7db03 100644 --- a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts +++ b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts @@ -330,9 +330,9 @@ export type FilterFunction = | {opacity: number | string} | {saturate: number | string} | {sepia: number | string} - | {dropShadow: DropShadowPrimitive | string}; + | {dropShadow: DropShadowValue | string}; -export type DropShadowPrimitive = { +export type DropShadowValue = { offsetX: number | string; offsetY: number | string; standardDeviation?: number | string | undefined; diff --git a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js index 219755edd01..4be9ae684ba 100644 --- a/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js +++ b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js @@ -700,9 +700,9 @@ export type FilterFunction = | {opacity: number | string} | {saturate: number | string} | {sepia: number | string} - | {dropShadow: DropShadowPrimitive | string}; + | {dropShadow: DropShadowValue | string}; -export type DropShadowPrimitive = { +export type DropShadowValue = { offsetX: number | string, offsetY: number | string, standardDeviation?: number | string, diff --git a/packages/react-native/Libraries/StyleSheet/processFilter.js b/packages/react-native/Libraries/StyleSheet/processFilter.js index 1e72cb206da..f91ddc0994a 100644 --- a/packages/react-native/Libraries/StyleSheet/processFilter.js +++ b/packages/react-native/Libraries/StyleSheet/processFilter.js @@ -12,7 +12,7 @@ 'use strict'; import type {ColorValue} from './StyleSheet'; -import type {DropShadowPrimitive, FilterFunction} from './StyleSheetTypes'; +import type {DropShadowValue, FilterFunction} from './StyleSheetTypes'; import processColor from './processColor'; @@ -179,7 +179,7 @@ function _getFilterAmount(filterName: string, filterArgs: mixed): ?number { } function parseDropShadow( - rawDropShadow: string | DropShadowPrimitive, + rawDropShadow: string | DropShadowValue, ): ?ParsedDropShadow { const dropShadow = typeof rawDropShadow === 'string' @@ -248,8 +248,8 @@ function parseDropShadow( return parsedDropShadow; } -function parseDropShadowString(rawDropShadow: string): ?DropShadowPrimitive { - const dropShadow: DropShadowPrimitive = { +function parseDropShadowString(rawDropShadow: string): ?DropShadowValue { + const dropShadow: DropShadowValue = { offsetX: 0, offsetY: 0, }; diff --git a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap index f0ad6b1351b..d2e35fcce82 100644 --- a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap +++ b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap @@ -8284,8 +8284,8 @@ export type FilterFunction = | { opacity: number | string } | { saturate: number | string } | { sepia: number | string } - | { dropShadow: DropShadowPrimitive | string }; -export type DropShadowPrimitive = { + | { dropShadow: DropShadowValue | string }; +export type DropShadowValue = { offsetX: number | string, offsetY: number | string, standardDeviation?: number | string,