forked from mattboldt/typed.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
134 lines (132 loc) · 2.82 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/**
* Declaration for typed.js
* Typed.js version: v2.0.12
*/
declare module 'typed.js' {
export interface TypedOptions {
/**
* strings to be typed
*/
strings?: string[];
/**
* ID or instance of HTML element of element containing string children
*/
stringsElement?: string | Element;
/**
* type speed in milliseconds
*/
typeSpeed?: number;
/**
* time before typing starts in milliseconds
*/
startDelay?: number;
/**
* backspacing speed in milliseconds
*/
backSpeed?: number;
/**
* only backspace what doesn't match the previous string
*/
smartBackspace?: boolean;
/**
* shuffle the strings
*/
shuffle?: boolean;
/**
* time before backspacing in milliseconds
*/
backDelay?: number;
/**
* Fade out instead of backspace
*/
fadeOut?: boolean;
/**
* css class for fade animation
*/
fadeOutClass?: string;
/**
* Fade out delay in milliseconds
*/
fadeOutDelay?: number;
/**
* loop strings
*/
loop?: boolean;
/**
* amount of loops
*/
loopCount?: number;
/**
* show cursor
*/
showCursor?: boolean;
/**
* character for cursor
*/
cursorChar?: string;
/**
* insert CSS for cursor and fadeOut into HTML
*/
autoInsertCss?: boolean;
/**
* attribute for typing Ex: input placeholder, value, or just HTML text
*/
attr?: string;
/**
* bind to focus and blur if el is text input
*/
bindInputFocusEvents?: boolean;
/**
* 'html' or 'null' for plaintext
*/
contentType?: string;
/**
* All typing is complete
*/
onComplete?(self: Typed): void;
/**
* Before each string is typed
*/
preStringTyped?(arrayPos: number, self: Typed): void;
/**
* After each string is typed
*/
onStringTyped?(arrayPos: number, self: Typed): void;
/**
* During looping, after last string is typed
*/
onLastStringBackspaced?(self: Typed): void;
/**
* Typing has been stopped
*/
onTypingPaused?(arrayPos: number, self: Typed): void;
/**
* Typing has been started after being stopped
*/
onTypingResumed?(arrayPos: number, self: Typed): void;
/**
* After reset
*/
onReset?(self: Typed): void;
/**
* After stop
*/
onStop?(arrayPos: number, self: Typed): void;
/**
* After start
*/
onStart?(arrayPos: number, self: Typed): void;
/**
* After destroy
*/
onDestroy?(self: Typed): void;
}
export default class Typed {
constructor(elementId: string | Element, options: TypedOptions);
toggle(): void;
stop(): void;
start(): void;
destroy(): void;
reset(restart?: boolean): void;
}
}