web: add Optional type and use it
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
<script lang="ts">
|
||||
import Skeleton from "$components/misc/Skeleton.svelte";
|
||||
import type { Optional } from "$lib/types/generic";
|
||||
|
||||
export let version: string;
|
||||
export let title: string;
|
||||
export let date: string;
|
||||
export let banner: { file: string; alt: string } | undefined;
|
||||
export let banner: Optional<{ file: string; alt: string }>;
|
||||
|
||||
let bannerLoaded = false;
|
||||
|
||||
|
||||
@@ -3,15 +3,16 @@
|
||||
|
||||
import { killDialog } from "$lib/dialogs";
|
||||
import type { DialogButton, SmallDialogIcons } from "$lib/types/dialog";
|
||||
import type { MeowbaltEmotions } from "$lib/types/meowbalt";
|
||||
import type { Optional } from "$lib/types/generic";
|
||||
|
||||
import Meowbalt from "$components/misc/Meowbalt.svelte";
|
||||
import type { MeowbaltEmotions } from "$lib/types/meowbalt";
|
||||
|
||||
import IconAlertTriangle from "@tabler/icons-svelte/IconAlertTriangle.svelte";
|
||||
|
||||
export let id: string;
|
||||
export let meowbalt: MeowbaltEmotions | undefined;
|
||||
export let icon: SmallDialogIcons | undefined;
|
||||
export let meowbalt: Optional<MeowbaltEmotions>;
|
||||
export let icon: Optional<SmallDialogIcons>;
|
||||
export let title: string = "";
|
||||
export let bodyText: string = "";
|
||||
export let bodySubText: string = "";
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<script lang="ts">
|
||||
export let width: string | undefined = undefined;
|
||||
export let height: string | undefined = undefined;
|
||||
export let hidden: boolean | undefined = undefined;
|
||||
import type { Optional } from "$lib/types/generic";
|
||||
|
||||
export let width: Optional<string> = undefined;
|
||||
export let height: Optional<string> = undefined;
|
||||
export let hidden: Optional<boolean> = undefined;
|
||||
|
||||
let _class = '';
|
||||
export { _class as class };
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
import { updateSetting } from "$lib/state/settings";
|
||||
import type { DownloadModeOption } from "$lib/types/settings";
|
||||
import type { Optional } from "$lib/types/generic";
|
||||
|
||||
import IconLink from "@tabler/icons-svelte/IconLink.svelte";
|
||||
|
||||
@@ -25,7 +26,7 @@
|
||||
import IconClipboard from "$lib/icons/Clipboard.svelte";
|
||||
|
||||
let link: string = "";
|
||||
let linkInput: HTMLInputElement | undefined;
|
||||
let linkInput: Optional<HTMLInputElement>;
|
||||
let isFocused = false;
|
||||
|
||||
let isDisabled: boolean = false;
|
||||
|
||||
Reference in New Issue
Block a user