diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2022-05-01 15:10:56 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2022-05-01 15:10:56 +0200 |
| commit | e8fcef96681425d431d03fa323747d7d6e61257c (patch) | |
| tree | 0646922304ac38721b2f53485d1c1106d6c300d5 /doc/modules | |
| parent | 3260d5e90a30bbf57e3e5822aa84c23cee0411be (diff) | |
Add typedoc
Diffstat (limited to 'doc/modules')
| -rw-r--r-- | doc/modules/App.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/modules/App.md b/doc/modules/App.md new file mode 100644 index 0000000..f622f15 --- /dev/null +++ b/doc/modules/App.md @@ -0,0 +1,30 @@ +[forum](../README.md) / [Exports](../modules.md) / App + +# Namespace: App + +It's possible to tell SvelteKit how to type objects inside your app by declaring the `App` namespace. By default, a new project will have a file called `src/app.d.ts` containing the following: + +```ts +/// <reference types="@sveltejs/kit" /> + +declare namespace App { + interface Locals {} + + interface Platform {} + + interface Session {} + + interface Stuff {} +} +``` + +By populating these interfaces, you will gain type safety when using `event.locals`, `event.platform`, `session` and `stuff`: + +## Table of contents + +### Interfaces + +- [Locals](../interfaces/App.Locals.md) +- [Platform](../interfaces/App.Platform.md) +- [Session](../interfaces/App.Session.md) +- [Stuff](../interfaces/App.Stuff.md) |