2020-02-10 18:36:06 +00:00
|
|
|
// Type definitions for react-typing-animation 1.6
|
2020-02-13 00:17:05 +00:00
|
|
|
// Project: https://github.com/notadamking/react-typing-animation#readme
|
2020-02-10 18:36:06 +00:00
|
|
|
// Definitions by: Haseeb Majid <https://github.com/hmajid2301>
|
|
|
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
|
// TypeScript Version: 2.8
|
|
|
|
|
|
|
|
|
|
import { Component } from 'react';
|
|
|
|
|
|
|
|
|
|
export interface TypingProps {
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
className?: string;
|
|
|
|
|
cursorClassName?: string;
|
|
|
|
|
cursor?: React.ReactNode;
|
2020-02-13 00:17:05 +00:00
|
|
|
hideCursor?: boolean;
|
2020-02-10 18:36:06 +00:00
|
|
|
speed?: number;
|
|
|
|
|
startDelay?: number;
|
|
|
|
|
loop?: boolean;
|
2020-02-25 00:17:02 +00:00
|
|
|
onStartedTyping?: () => void;
|
|
|
|
|
onBeforeType?: () => void;
|
|
|
|
|
onAfterType?: () => void;
|
|
|
|
|
onFinishedTyping?: () => void;
|
2020-02-10 18:36:06 +00:00
|
|
|
}
|
|
|
|
|
|
2020-02-13 00:17:05 +00:00
|
|
|
declare namespace Typing {
|
|
|
|
|
interface BackspaceProperties {
|
|
|
|
|
count?: number;
|
|
|
|
|
delay?: number;
|
|
|
|
|
speed?: number;
|
|
|
|
|
}
|
|
|
|
|
class Backspace extends Component<BackspaceProperties> {}
|
|
|
|
|
|
|
|
|
|
interface DelayProperties {
|
|
|
|
|
ms: number;
|
|
|
|
|
}
|
|
|
|
|
class Delay extends Component<DelayProperties> {}
|
|
|
|
|
|
|
|
|
|
interface SpeedProperties {
|
|
|
|
|
ms: number;
|
|
|
|
|
}
|
|
|
|
|
class Speed extends Component<SpeedProperties> {}
|
|
|
|
|
|
|
|
|
|
interface ResetProperties {
|
|
|
|
|
count?: number;
|
|
|
|
|
delay?: number;
|
|
|
|
|
speed?: number;
|
|
|
|
|
}
|
|
|
|
|
class Reset extends Component<ResetProperties> {}
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-10 18:36:06 +00:00
|
|
|
declare class Typing extends Component<TypingProps> {}
|
|
|
|
|
|
|
|
|
|
export default Typing;
|