add type annotations

This commit is contained in:
Johann150 2022-10-08 20:59:21 +02:00
parent 3f59b7f705
commit 60e49a4196
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -23,9 +23,9 @@ const props = withDefaults(defineProps<{
reverse: false, reverse: false,
}); });
let contentEl = $ref(); let contentEl: HTMLElement = $ref();
function calc() { function calc(): void {
const eachLength = contentEl.offsetWidth / props.repeat; const eachLength = contentEl.offsetWidth / props.repeat;
const factor = 3000; const factor = 3000;
const duration = props.duration / ((1 / eachLength) * factor); const duration = props.duration / ((1 / eachLength) * factor);