feat: type for supported data (only primitives)

This commit is contained in:
Ayo 2023-07-16 21:31:44 +02:00
parent 0eb4f3c636
commit 0c9d64c28c
2 changed files with 5 additions and 3 deletions

View file

@ -1,7 +1,8 @@
--- ---
type Primitive = string | number | boolean | null | undefined;
export interface Props { export interface Props {
id: string; id: string;
data: Object; data: Record<string, Primitive>;
} }
const {id, data} = Astro.props; const {id, data} = Astro.props;
--- ---

View file

@ -1,8 +1,9 @@
--- ---
import Resumable from '../Resumable.astro'; import Resumable from '../Resumable.astro';
const data = { const data = {
hello: 'world' name: 'John Doe',
}; isOkay: true,
}
export type Data = typeof data; export type Data = typeof data;
--- ---