fix type errors

This commit is contained in:
Lhcfl 2024-04-11 00:48:35 +08:00
parent f275fc9cdf
commit 3ddd68097a
6 changed files with 10 additions and 7 deletions

View File

@ -48,7 +48,7 @@ const toggle = () => {
};
function focus() {
el.value.focus();
el.value?.focus();
}
defineExpose({

View File

@ -26,7 +26,7 @@ const props = withDefaults(
},
);
let intervalId;
let intervalId: number;
const hh = ref("");
const mm = ref("");
const ss = ref("");

View File

@ -29,7 +29,7 @@
<MkButton
v-if="instance.donationLink"
gradate
@click="openExternal(instance.donationLink)"
@click="openExternal(instance.donationLink!)"
>{{
i18n.t("_aboutFirefish.donateHost", {
host: hostname,
@ -73,7 +73,8 @@ const emit = defineEmits<{
(ev: "closed"): void;
}>();
const hostname = instance.name?.length < 38 ? instance.name : host;
const hostname =
instance.name?.length && instance.name?.length < 38 ? instance.name : host;
const zIndex = os.claimZIndex("low");
@ -97,7 +98,7 @@ function neverShow() {
close();
}
function openExternal(link) {
function openExternal(link: string) {
window.open(link, "_blank");
}
</script>

View File

@ -47,6 +47,7 @@ import * as os from "@/os";
import { i18n } from "@/i18n";
import { me } from "@/me";
import icon from "@/scripts/icon";
import type { MenuItem } from "@/types/menu";
const props = withDefaults(
defineProps<{
@ -72,7 +73,7 @@ const title = computed(
() => `${props.file.name}\n${props.file.type} ${bytes(props.file.size)}`,
);
function getMenu() {
function getMenu(): MenuItem[] {
return [
{
text: i18n.ts.rename,

View File

@ -14,7 +14,7 @@
class="_button"
@click.stop="
applyUnicodeSkinTone(
props.skinTones.indexOf(skinTone) + 1,
props.skinTones!.indexOf(skinTone) + 1,
)
"
>

View File

@ -329,6 +329,7 @@ export type LiteInstanceMetadata = {
name: string | null;
uri: string;
description: string | null;
donationLink?: string;
tosUrl: string | null;
disableRegistration: boolean;
disableLocalTimeline: boolean;