From 0c9d64c28cb812521aee3c6d42228e6592a9f3f8 Mon Sep 17 00:00:00 2001 From: Ayo Date: Sun, 16 Jul 2023 21:31:44 +0200 Subject: [PATCH] feat: type for supported data (only primitives) --- src/Resumable.astro | 3 ++- src/pages/index.astro | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Resumable.astro b/src/Resumable.astro index 008cda1..b68c505 100644 --- a/src/Resumable.astro +++ b/src/Resumable.astro @@ -1,7 +1,8 @@ --- +type Primitive = string | number | boolean | null | undefined; export interface Props { id: string; - data: Object; + data: Record; } const {id, data} = Astro.props; --- diff --git a/src/pages/index.astro b/src/pages/index.astro index 45b3608..2d091c1 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,8 +1,9 @@ --- import Resumable from '../Resumable.astro'; const data = { - hello: 'world' -}; + name: 'John Doe', + isOkay: true, +} export type Data = typeof data; ---