Skip to content

Commit 8d3cd3f

Browse files
author
Ryan Marx
committed
Define type
1 parent 3885105 commit 8d3cd3f

2 files changed

Lines changed: 15 additions & 19 deletions

File tree

src/components/About.svelte

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
<script lang="ts">
2-
import WorkItem from "./WorkItem.svelte";
2+
import WorkItem, { type WorkItem as WorkItemType } from "./WorkItem.svelte";
33
4-
type WorkItem = {
5-
start: number;
6-
end: string | number;
7-
org: string;
8-
orgLink: string;
9-
role: string;
10-
description: string;
11-
};
12-
13-
const work: WorkItem[] = [
4+
const work: WorkItemType[] = [
145
{
156
start: 2023,
167
end: "present",

src/components/WorkItem.svelte

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
<script lang="ts">
2-
import { marked } from "marked";
3-
4-
interface Props {
5-
org: string;
1+
<script lang="ts" module>
2+
export type WorkItem = {
63
start: number;
7-
end: number | string;
4+
end: string | number;
5+
org: string;
6+
orgLink: string;
87
role: string;
98
description: string;
10-
orgLink: string;
9+
};
10+
</script>
11+
12+
<script lang="ts">
13+
import { marked } from "marked";
14+
15+
type Props = WorkItem & {
1116
open?: boolean;
12-
}
17+
};
1318
1419
const { org, start, end, role, description, orgLink, open = false }: Props = $props();
1520
const rand = Math.random();

0 commit comments

Comments
 (0)