File tree Expand file tree Collapse file tree 2 files changed +31
-24
lines changed
src/components/TypeAnimation Expand file tree Collapse file tree 2 files changed +31
-24
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { TypeAnimationProps, Wrapper } from './index.types';
8
8
const DEFAULT_SPEED = 40 ;
9
9
const TypeAnimation = forwardRef <
10
10
HTMLElementTagNameMap [ Wrapper ] ,
11
- TypeAnimationProps & HTMLAttributes < HTMLElementTagNameMap [ Wrapper ] >
11
+ TypeAnimationProps
12
12
> (
13
13
(
14
14
{
Original file line number Diff line number Diff line change 1
- export interface TypeAnimationProps extends Props {
2
- ref ?: React . Ref < HTMLElementTagNameMap [ Wrapper ] > ;
3
- }
1
+ import { HTMLAttributes } from 'react' ;
4
2
5
3
interface Props {
6
4
sequence : Sequence ;
@@ -14,13 +12,42 @@ interface Props {
14
12
preRenderFirstString ?: boolean ;
15
13
}
16
14
15
+ export interface TypeAnimationProps
16
+ extends Props ,
17
+ Pick <
18
+ HTMLAttributes < HTMLElementTagNameMap [ Wrapper ] > ,
19
+ 'style' | 'aria-label' | 'aria-hidden' | 'role' | 'className'
20
+ > {
21
+ ref ?: React . Ref < HTMLElementTagNameMap [ Wrapper ] > ;
22
+ }
23
+
17
24
export type GranularSpeed = {
18
25
type : 'keyStrokeDelayInMs' ;
19
26
value : number ;
20
27
} ;
21
28
22
29
export type StringSplitter = ( text : string ) => ReadonlyArray < string > ;
23
30
31
+ export type Wrapper =
32
+ | 'p'
33
+ | 'div'
34
+ | 'span'
35
+ | 'strong'
36
+ | 'a'
37
+ | 'h1'
38
+ | 'h2'
39
+ | 'h3'
40
+ | 'h4'
41
+ | 'h5'
42
+ | 'h6'
43
+ | 'b' ;
44
+
45
+ export type Sequence = Array < SequenceElement > ;
46
+ export type SequenceElement =
47
+ | string
48
+ | number
49
+ | ( ( element : HTMLElement | null ) => void | Promise < void > ) ;
50
+
24
51
export type Speed =
25
52
| 1
26
53
| 2
@@ -121,23 +148,3 @@ export type Speed =
121
148
| 97
122
149
| 98
123
150
| 99 ;
124
-
125
- export type Wrapper =
126
- | 'p'
127
- | 'div'
128
- | 'span'
129
- | 'strong'
130
- | 'a'
131
- | 'h1'
132
- | 'h2'
133
- | 'h3'
134
- | 'h4'
135
- | 'h5'
136
- | 'h6'
137
- | 'b' ;
138
-
139
- export type Sequence = Array < SequenceElement > ;
140
- export type SequenceElement =
141
- | string
142
- | number
143
- | ( ( element : HTMLElement | null ) => void | Promise < void > ) ;
You can’t perform that action at this time.
0 commit comments