]> git.r.bdr.sh - rbdr/forum/blobdiff - src/lib/components/post/post.svelte
Add typedoc
[rbdr/forum] / src / lib / components / post / post.svelte
index 4e6c28ff70b0b3e9a325325103c0e669139007be..535f7ace32c94cd29bfb58b906bbc1e582ae73d4 100644 (file)
@@ -1,12 +1,14 @@
 <script lang="ts">
 <script lang="ts">
-       export let post;
+       import type { Post } from '$lib/data/types';
+
+       export let post: Post;
        export let index = 0;
        export let count = 1;
 
        import { _ } from 'svelte-i18n';
        import Glyph from '$lib/components/glyph/glyph.svelte';
 
        export let index = 0;
        export let count = 1;
 
        import { _ } from 'svelte-i18n';
        import Glyph from '$lib/components/glyph/glyph.svelte';
 
-       const timestampToISO = (timestamp) => new Date(timestamp).toISOString();
+       const timestampToISO = (timestamp: number) => new Date(timestamp).toISOString();
 </script>
 
 <aside
 </script>
 
 <aside
                        {timestampToISO(post.created_at)}
                </a>
        </time>
                        {timestampToISO(post.created_at)}
                </a>
        </time>
-  {#if post.topic}
-  <span>
-    ({$_('post.topic_location')} <a href="/t/{post.topic.id}">{post.topic.title}</a>.)
-  </span>
-  {/if}
+       {#if post.topic}
+               <span>
+                       ({$_('post.topic_location')} <a href="/t/{post.topic.id}">{post.topic.title}</a>.)
+               </span>
+       {/if}
 </aside>
 <article
        class="e-content"
 </aside>
 <article
        class="e-content"