Convert the whole filesystem UI to Typescript
This commit is contained in:
@@ -1,16 +1,31 @@
|
||||
<script>
|
||||
<script lang="ts" context="module">
|
||||
export type TorrentInfo = {
|
||||
trackers: string[]
|
||||
comment: string,
|
||||
created_by: string,
|
||||
created_at: string,
|
||||
info_hash: string,
|
||||
files: TorrentFile
|
||||
};
|
||||
export type TorrentFile = {
|
||||
size: number,
|
||||
children?: {[index: string]: TorrentFile}
|
||||
};
|
||||
</script>
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import Magnet from "icons/Magnet.svelte";
|
||||
import { formatDate } from "util/Formatting.svelte"
|
||||
import { formatDate } from "util/Formatting"
|
||||
import TorrentItem from "./TorrentItem.svelte"
|
||||
import IconBlock from "layout/IconBlock.svelte";
|
||||
import TextBlock from "layout/TextBlock.svelte"
|
||||
import { fs_node_icon, fs_path_url } from "filesystem/FilesystemAPI.mjs";
|
||||
import { fs_node_icon, fs_path_url } from "filesystem/FilesystemAPI";
|
||||
import CopyButton from "layout/CopyButton.svelte";
|
||||
import type { FSNavigator } from "filesystem/FSNavigator";
|
||||
|
||||
let dispatch = createEventDispatcher()
|
||||
|
||||
export let nav
|
||||
export let nav: FSNavigator
|
||||
|
||||
let status = "loading"
|
||||
|
||||
@@ -48,15 +63,7 @@ export const update = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
let torrent = {
|
||||
trackers: [],
|
||||
comment: "",
|
||||
created_by: "",
|
||||
created_at: "",
|
||||
info_hash: "",
|
||||
files: null,
|
||||
}
|
||||
|
||||
let torrent: TorrentInfo = {} as TorrentInfo
|
||||
let magnet = ""
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user