From dd6e4b2deebdd4e2b0a2d1e4d42fd1449ea17069 Mon Sep 17 00:00:00 2001 From: saranshkataria Date: Mon, 11 Mar 2019 22:08:44 -0700 Subject: [PATCH 1/4] added maxFontSizeMultiplier to text ios props --- types/react-native/index.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index a96ffd41eb..786af04312 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -17,6 +17,7 @@ // Ryan Nickel // Souvik Ghosh // Cheng Gibson +// Saransh Kataria // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -808,6 +809,14 @@ export interface TextPropsIOS { * default, a gray oval highlights the text on press down. */ suppressHighlighting?: boolean; + + /** + * Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values: + * - null/undefined (default): inherit from the parent node or the global default (0) + * - 0: no max, ignore parent/global default + * - >= 1: sets the maxFontSizeMultiplier of this node to this value + */ + maxFontSizeMultiplier?: number; } export interface TextPropsAndroid { From 2e71f1e05419eb4da824aab6fbf46217d06af326 Mon Sep 17 00:00:00 2001 From: saranshkataria Date: Tue, 12 Mar 2019 07:34:45 -0700 Subject: [PATCH 2/4] added maxFontSizeMultiplier to textinput props and added null attribute --- types/react-native/index.d.ts | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 786af04312..c2a51ef882 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -809,14 +809,6 @@ export interface TextPropsIOS { * default, a gray oval highlights the text on press down. */ suppressHighlighting?: boolean; - - /** - * Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values: - * - null/undefined (default): inherit from the parent node or the global default (0) - * - 0: no max, ignore parent/global default - * - >= 1: sets the maxFontSizeMultiplier of this node to this value - */ - maxFontSizeMultiplier?: number; } export interface TextPropsAndroid { @@ -912,6 +904,14 @@ export interface TextProps extends TextPropsIOS, TextPropsAndroid, Accessibility * Used to reference react managed views from native code. */ nativeID?: string; + + /** + * Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values: + * - null/undefined (default): inherit from the parent node or the global default (0) + * - 0: no max, ignore parent/global default + * - >= 1: sets the maxFontSizeMultiplier of this node to this value + */ + maxFontSizeMultiplier?: number | null; } /** @@ -1436,6 +1436,14 @@ export interface TextInputProps extends ViewProps, TextInputIOSProps, TextInputA * or set/update maxLength to prevent unwanted edits without flicker. */ value?: string; + + /** + * Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values: + * - null/undefined (default): inherit from the parent node or the global default (0) + * - 0: no max, ignore parent/global default + * - >= 1: sets the maxFontSizeMultiplier of this node to this value + */ + maxFontSizeMultiplier?: number | null; } /** From f36136da1e77f5af731a8dfca1791719436b50e3 Mon Sep 17 00:00:00 2001 From: saranshkataria Date: Tue, 12 Mar 2019 09:07:07 -0700 Subject: [PATCH 3/4] removed trailing whitespaces --- types/react-native/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index c2a51ef882..9975858c3e 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -904,7 +904,7 @@ export interface TextProps extends TextPropsIOS, TextPropsAndroid, Accessibility * Used to reference react managed views from native code. */ nativeID?: string; - + /** * Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values: * - null/undefined (default): inherit from the parent node or the global default (0) @@ -1436,7 +1436,7 @@ export interface TextInputProps extends ViewProps, TextInputIOSProps, TextInputA * or set/update maxLength to prevent unwanted edits without flicker. */ value?: string; - + /** * Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values: * - null/undefined (default): inherit from the parent node or the global default (0) From 86c6593d92fda1bbd3178452a5a165935ba565f9 Mon Sep 17 00:00:00 2001 From: saranshkataria Date: Tue, 12 Mar 2019 16:22:58 -0700 Subject: [PATCH 4/4] added tests for maxFontSizeMultiplier --- types/react-native/test/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index 622e2b28c8..74f8b6a9b5 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -834,6 +834,8 @@ const NativeIDTest = () => ( ); +const MaxFontSizeMultiplierTest = () => Text; + const ShareTest = () => { Share.share( { title: "title", message: "message" },