forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ityped] Update definitions entirely, adapting to v 1.0.x (Definitely…
…Typed#49754) * Update definitions of init & Configuration to v1.0.x * Add test to pass Element as first argument * Add maintainer of 'ityped' modules * Change return type of onFinished to void Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com> Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
- Loading branch information
1 parent
7ebf0c1
commit 9fb6c8d
Showing
3 changed files
with
23 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
// Type definitions for ityped 0.0 | ||
// Type definitions for ityped 1.0 | ||
// Project: https://github.com/luisvinicius167/ityped | ||
// Definitions by: Daniel Rosenwasser <https://github.com/DanielRosenwasser> | ||
// MaySoMusician <https://github.com/MaySoMusician> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
|
||
export interface Configuration { | ||
strings?: string[]; | ||
typeSpeed?: number; | ||
pause?: number; | ||
backSpeed?: number; | ||
backDelay?: number; | ||
startDelay?: number; | ||
cursorChar?: string; | ||
placeholder?: boolean; | ||
showCursor?: boolean; | ||
disableBackTyping?: boolean; | ||
onFinished?: () => void; | ||
loop?: boolean; | ||
} | ||
|
||
export function init(element: string, config: Configuration): void; | ||
export function init(element: string | Element, config: Configuration): void; | ||
|
||
export as namespace ityped; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
import { init } from "ityped"; | ||
import { init } from 'ityped'; | ||
|
||
const config = { | ||
strings: [ | ||
"Strings!", | ||
], | ||
strings: ['Strings!'], | ||
typeSpeed: 120, | ||
pause: 500, | ||
loop: true | ||
loop: true, | ||
}; | ||
|
||
init("#selector", config); | ||
init('#selector', config); | ||
|
||
init("#anotherSelector", { | ||
loop: false | ||
init('#anotherSelector', { | ||
loop: false, | ||
}); | ||
|
||
init("#anotherOne", {}); | ||
init('#anotherOne', {}); | ||
|
||
const element = document.createElement('span'); | ||
init(element, {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters