From af1f05d25912342df5d5dd0559b170a590f6d45c Mon Sep 17 00:00:00 2001 From: Alexander Fedyashov Date: Sun, 20 Aug 2017 20:33:52 +0300 Subject: [PATCH] fix(Input|Button|TextArea): add `focus` method to typings (#1972) * fix(Input): add `focus` method to typings * fix(Button|TextArea): add `focus` method to typings --- src/addons/TextArea/TextArea.d.ts | 4 +++- src/elements/Button/Button.d.ts | 12 ++++++------ src/elements/Input/Input.d.ts | 4 +++- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/addons/TextArea/TextArea.d.ts b/src/addons/TextArea/TextArea.d.ts index 2bd741af70..67e23e6ba1 100644 --- a/src/addons/TextArea/TextArea.d.ts +++ b/src/addons/TextArea/TextArea.d.ts @@ -31,6 +31,8 @@ export interface TextAreaOnChangeData extends TextAreaProps { value?: string; } -declare const TextArea: React.ComponentClass; +declare class TextArea extends React.Component { + focus: () => void; +} export default TextArea; diff --git a/src/elements/Button/Button.d.ts b/src/elements/Button/Button.d.ts index 2428006005..71d028e175 100644 --- a/src/elements/Button/Button.d.ts +++ b/src/elements/Button/Button.d.ts @@ -101,12 +101,12 @@ export interface ButtonProps { toggle?: boolean; } -interface ButtonComponent extends React.ComponentClass { - Content: typeof ButtonContent; - Group: typeof ButtonGroup; - Or: typeof ButtonOr; -} +declare class Button extends React.Component { + static Content: typeof ButtonContent; + static Group: typeof ButtonGroup; + static Or: typeof ButtonOr; -declare const Button: ButtonComponent; + focus: () => void; +} export default Button; diff --git a/src/elements/Input/Input.d.ts b/src/elements/Input/Input.d.ts index 28fbe2ab5e..b4dbe9bebc 100644 --- a/src/elements/Input/Input.d.ts +++ b/src/elements/Input/Input.d.ts @@ -83,6 +83,8 @@ export interface InputOnChangeData extends InputProps { value: string; } -declare const Input: React.ComponentClass; +declare class Input extends React.Component { + focus: () => void; +} export default Input;