From 028c46f833ffbbb0328a28ae6177923998fcf0cc Mon Sep 17 00:00:00 2001 From: Haseeb Majid Date: Thu, 13 Feb 2020 00:17:05 +0000 Subject: [PATCH] Update react-typing-animation (#42322) * Added React Native Share Extension * Fixed Linting Issues Fixed linting issues, added tests. * Fixed other linting issues Data returns a promise. * Removed Public from state Removed public from state. * Added react-typing-animation Added react-typing-animation. * Updated react-typing-animation Updated the react-typing-animation definitions with the extra components such as delay, backspace. --- types/react-typing-animation/index.d.ts | 30 +++++++++++++++-- .../react-typing-animation-tests.tsx | 33 +++++++++++++++++++ 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/types/react-typing-animation/index.d.ts b/types/react-typing-animation/index.d.ts index 6b03225abe..999578e3db 100644 --- a/types/react-typing-animation/index.d.ts +++ b/types/react-typing-animation/index.d.ts @@ -1,5 +1,5 @@ // Type definitions for react-typing-animation 1.6 -// Project: https://adamjking3.github.io/react-typing-animation-example/ +// Project: https://github.com/notadamking/react-typing-animation#readme // Definitions by: Haseeb Majid // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -11,7 +11,7 @@ export interface TypingProps { className?: string; cursorClassName?: string; cursor?: React.ReactNode; - hideCurson?: boolean; + hideCursor?: boolean; speed?: number; startDelay?: number; loop?: boolean; @@ -21,6 +21,32 @@ export interface TypingProps { onFinishedType?: () => {}; } +declare namespace Typing { + interface BackspaceProperties { + count?: number; + delay?: number; + speed?: number; + } + class Backspace extends Component {} + + interface DelayProperties { + ms: number; + } + class Delay extends Component {} + + interface SpeedProperties { + ms: number; + } + class Speed extends Component {} + + interface ResetProperties { + count?: number; + delay?: number; + speed?: number; + } + class Reset extends Component {} +} + declare class Typing extends Component {} export default Typing; diff --git a/types/react-typing-animation/react-typing-animation-tests.tsx b/types/react-typing-animation/react-typing-animation-tests.tsx index 1892272e68..2e2e91a84c 100644 --- a/types/react-typing-animation/react-typing-animation-tests.tsx +++ b/types/react-typing-animation/react-typing-animation-tests.tsx @@ -7,3 +7,36 @@ const AnimatedTypingComponent = () => ( This span will get typed. ); + +const AnimatedBackspaceComponent = () => ( + + This span will get typed, then erased. + + +); + +const AnimatedDelayComponent = () => ( + +
+ There will be a 1000ms delay here, + + then this will be typed. +
+
+); + +const AnimatedSpeedComponent = () => ( + + This line will be typed at 50ms/character, + + then this will be typed at 200ms/character. + +); + +const AnimatedResetComponent = () => ( + + This line will stay. + This line will get instantly removed after a 500 ms delay + + +);