-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
34 lines (29 loc) · 766 Bytes
/
types.ts
File metadata and controls
34 lines (29 loc) · 766 Bytes
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
export type SortingState = "Sort" | "Sorting" | "Sorted"
export type ActiveBar = { element: HTMLElement; height: number }
export type SortingAlgorithms = "Selection" | "Insertion" | "Bubble" | "Merge"
export interface BarColorPalette {
compare: string
correctOrder: string
idle: string
swap: string
wrongOrder: string
}
export interface SortingSpeeds {
slow: number
normal: number
fast: number
}
export interface AnimateFunctionParams {
barHeights: number[]
bars: HTMLElement[]
palette: BarColorPalette
sortingSpeed: number
callback?: () => void
}
type TwoNumberTuple = [number, number]
export interface AnimationStep {
compare?: TwoNumberTuple
correctOrder?: TwoNumberTuple
swap?: TwoNumberTuple
wrongOrder?: TwoNumberTuple
}