Skip to content

Commit 2c76368

Browse files
committed
docs: update onTypingDone section
1 parent ffd956d commit 2c76368

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
Create typewriter effect by setting up a component's children directly.
44

5-
## Caveat ⚠
6-
7-
This package is not production-ready, Use it with caution.
8-
95
## Install
106

117
```bash
@@ -43,16 +39,18 @@ const MyComponent = () => {
4339
### `Typist`
4440

4541
```ts
46-
type TypistProps = {
42+
export type Delay = number | (() => number);
43+
export type Splitter = (str: string) => string[];
44+
export type TypistProps = {
4745
children: React.ReactNode;
48-
typingDelay?: number | (() => number);
49-
backspaceDelay?: number | (() => number);
46+
typingDelay?: Delay;
47+
backspaceDelay?: Delay;
5048
loop?: boolean;
5149
pause?: boolean;
5250
startDelay?: number;
5351
finishDelay?: number;
5452
onTypingDone?: () => void;
55-
splitter?: (s: string) => string[];
53+
splitter?: Splitter;
5654
cursor?: string | React.ReactElement;
5755
disabled?: boolean;
5856
restartKey?: any;
@@ -119,9 +117,7 @@ Set to `true` if you want to pause the typing animation.
119117

120118
#### `onTypingDone`
121119

122-
**Default**: `() => {return}`
123-
124-
This function will be called when the typing animation finishes. It will be called before `finishDelay`.
120+
This function will be called when the typing animation finishes. It will be called before waiting for the timeout with `finishDelay`.
125121

126122
#### `splitter`
127123

0 commit comments

Comments
 (0)