-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.ts
59 lines (53 loc) · 1.31 KB
/
main.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
import { applyPatches, calculatePatch, diff } from "./src";
import TypeIt from "typeit";
let inputEl: HTMLTextAreaElement = document.getElementById('input') as HTMLTextAreaElement
let outputEl: HTMLTextAreaElement = document.getElementById('output') as HTMLTextAreaElement
let input = `import { describe, expect, it } from 'vitest'
import { one } from '../src'
describe('should', () => {
it('exported', () => {
expect(1).toEqual(1)
})
})
`;
let output = `import { describe, expect, it } from 'vitest'
describe('should', () => {
it('one', () => {
expect(one).toEqual(1)
expect(two).toEqual(2)
})
})
`
inputEl.value = input
outputEl.value = output
inputEl.addEventListener('input', () => {
input = inputEl.value
})
outputEl.addEventListener('input', () => {
output = outputEl.value
})
function starter() {
// @ts-expect-error ok
new TypeIt("#typing", {
speed: 50,
waitUntilVisible: true,
})
.type("Nvver", { delay: 300 })
.move(-3)
.delete(1)
.type("e")
.move(null, { to: "END" })
.type(" let yees")
.pause(300)
.delete(2)
.type("sterday use up to muc")
.move(-4)
.type("o")
.move(null, { to: "END" })
.type("h of today.")
.pause(500)
.break({ delay: 500 })
.break({ delay: 500 })
.type("<em>- Will Rogers</em>")
.go();
}