From bfb9112bce25d33540973dafa45d17d2d82b2aa3 Mon Sep 17 00:00:00 2001 From: khanhas Date: Sun, 10 Jun 2018 21:48:02 +0700 Subject: [PATCH] Fixed props. Should be in `style` props --- types/proton-native/index.d.ts | 90 +++++++++++++++--------------- types/proton-native/test/index.tsx | 13 ++++- 2 files changed, 57 insertions(+), 46 deletions(-) diff --git a/types/proton-native/index.d.ts b/types/proton-native/index.d.ts index 0cfb0e5798..b29d0a2b3f 100644 --- a/types/proton-native/index.d.ts +++ b/types/proton-native/index.d.ts @@ -170,50 +170,52 @@ export interface AreaPathProps extends AreaBaseProps { export class AreaPath extends React.Component { } export interface AreaTextProps extends AreaBaseProps { - /** - * The background color, specified as a CSS color string. - */ - backgroundColor?: string; - /** - * The text color, specified as a CSS color string. - */ - color?: string; - /** - * The font family (only if available on the system). - */ - fontFamily?: string; - /** - * The font size (in pt). - */ - fontSize?: number; - /** - * Whether an italic font should be used. - */ - fontStyle?: 'normal' | 'oblique' | 'italic'; - /** - * Whether a bold font should be used (and the amount). - */ - fontWeight?: 'minimum' | 'thin' | 'ultraLight' | 'light' | 'book' | 'normal' | 'medium' | 'semiBold' | 'bold' | 'ultraBold' | 'heavy' | 'ultraHeavy' | 'maximum' | number; - /** - * Wheter the text should be aligned to the left, center or right. - * - * **Works only on a top level text component, not it's children!** - */ - textAlign?: 'left' | 'center' | 'right'; - /** - * How wide or narrow the characters should be. - */ - textStretch?: 'ultraCondensed' | 'extraCondensed' | 'condensed' | 'semiCondensed' | 'normal' | 'semiExpanded' | 'expanded' | 'extraExpanded' | 'ultraExpanded'; - /** - * The text underline style. - */ - textUnderline?: 'none' | 'single' | 'double' | 'suggestion'; - /** - * The text underline color. - * - * A color string | 'spelling' | 'grammar' | 'auxiliary' - */ - textUnderlineColor?: 'spelling' | 'grammar' | 'auxiliary' | string; + style?: { + /** + * The background color, specified as a CSS color string. + */ + backgroundColor?: string; + /** + * The text color, specified as a CSS color string. + */ + color?: string; + /** + * The font family (only if available on the system). + */ + fontFamily?: string; + /** + * The font size (in pt). + */ + fontSize?: number; + /** + * Whether an italic font should be used. + */ + fontStyle?: 'normal' | 'oblique' | 'italic'; + /** + * Whether a bold font should be used (and the amount). + */ + fontWeight?: 'minimum' | 'thin' | 'ultraLight' | 'light' | 'book' | 'normal' | 'medium' | 'semiBold' | 'bold' | 'ultraBold' | 'heavy' | 'ultraHeavy' | 'maximum' | number; + /** + * Wheter the text should be aligned to the left, center or right. + * + * **Works only on a top level text component, not it's children!** + */ + textAlign?: 'left' | 'center' | 'right'; + /** + * How wide or narrow the characters should be. + */ + textStretch?: 'ultraCondensed' | 'extraCondensed' | 'condensed' | 'semiCondensed' | 'normal' | 'semiExpanded' | 'expanded' | 'extraExpanded' | 'ultraExpanded'; + /** + * The text underline style. + */ + textUnderline?: 'none' | 'single' | 'double' | 'suggestion'; + /** + * The text underline color. + * + * A color string | 'spelling' | 'grammar' | 'auxiliary' + */ + textUnderlineColor?: 'spelling' | 'grammar' | 'auxiliary' | string; + }; /** * The x coordinate of the text's top left corner. (Only in a top level text component.) */ diff --git a/types/proton-native/test/index.tsx b/types/proton-native/test/index.tsx index 6b09fb0d64..49e82efc1b 100644 --- a/types/proton-native/test/index.tsx +++ b/types/proton-native/test/index.tsx @@ -131,9 +131,18 @@ class AreaTest extends React.Component { - + Parent text - Nested Text + + Nested Text + );