From 7f9f32d9c208c65f4a015bc08e2a6606b2b23f67 Mon Sep 17 00:00:00 2001 From: khanhas Date: Sun, 10 Jun 2018 02:39:55 +0700 Subject: [PATCH] Added Area Text --- types/proton-native/index.d.ts | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/types/proton-native/index.d.ts b/types/proton-native/index.d.ts index b49efe6014..23c980fd73 100644 --- a/types/proton-native/index.d.ts +++ b/types/proton-native/index.d.ts @@ -169,6 +169,55 @@ 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; +} + +export class AreaText extends React.Component { } + export interface MouseEvent { button: number; height: number; @@ -256,6 +305,10 @@ export class Area extends React.Component { * A rectangle to be displayed in an Area component. */ static Rectangle: typeof AreaRectangle; + /** + * A (possibly styled) text to be displayed in an Area component. Nested `Area.Text` components inheirit the parent's style. + */ + static Text: typeof AreaText; } export interface BoxProps extends GridChildrenProps, Label, Stretchy {