TypeScript Svelte
SveltePageDataProps
Type$props()
+page.svelte
Usage
sectionSveltePageLayoutProps
Type$props()
+layout.svelte
Usage
section
5.0.2
2.7.2
npm add -D @best-skn/svelte-types #or yarn add -D @best-skn/svelte-types #or pnpm add -D @best-skn/svelte-types #or bun add -D @best-skn/svelte-types
types
in the root location of your project, and create a file called svelte.d.ts
, then do thisimport "@best-skn/svelte-types";
tsconfig.json
if includes
property has **/*.ts
, **/*.tsx
, **/*.svelte
otherwise the type definition file may not workSveltePageDataProps
Type:SveltePageDataProps
inside +page.svelte
like this//* `+page.svelte` <script lang="ts"> import type { SveltePageDataProps } from "@sveltejs/kit"; import type { PageServerData } from "./$types"; let { data }: SveltePageDataProps<PageServerData> = $props(); </script>
SveltePageLayoutProps
Type:SveltePageLayoutProps
inside +layout.svelte
like this//* `+layout.svelte` <script lang="ts"> import type { SveltePageLayoutProps } from "@sveltejs/kit"; let { children, data, row }: SveltePageLayoutProps<unknown> = $props(); </script> <div> <main> {@render children()} </main> </div>
Tanjila Hasan Trina
: The long lost love of my life. The course of nature separated us from our paths and put us in separate places far away from each other. But no matter how separated we are right now, each and every moment of mine is only dedicated to you. We may not see each other in this lifetime as it seems but I will find you again in the next life. I just want to say: ไธ็ใฏๆฎ้
ทใ ใใใงใๅใๆใใ
My Parents
: The greatest treasures of my life ever.
Copyright (C) 2024 SKN Shukhan
Licensed under the MIT License