Files
DefinitelyTyped/types/typed.js/typed.js-tests.ts
2018-04-09 13:48:34 -07:00

30 lines
608 B
TypeScript

import { Typed, TypedJsOptions } from 'typed.js';
// Create instance
const typed = new Typed(".element", {
strings: ["<i>First</i> sentence.", "&amp; a second sentence."],
typeSpeed: 100,
startDelay: 0,
backSpeed: 50,
smartBackspace: true,
shuffle: true,
backDelay: 150,
loop: true,
showCursor: true,
autoInsertCss: true,
contentType: "html",
onComplete: (self: Typed) => {
// Complete!!
},
onDestroy: (self: Typed) => {
// End!!
},
});
// Methods
typed.reset(false);
typed.destroy();
typed.start();
typed.stop();
typed.toggle();