/**
* 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
* ///
*
* declare namespace App {
* interface Locals {}
*
* interface PageData {}
*
* interface Platform {}
* }
* ```
*
* By populating these interfaces, you will gain type safety when using `event.locals`, `event.platform`, and `data` from `load` functions.
*
* Note that since it's an ambient declaration file, you have to be careful when using `import` statements. Once you add an `import`
* at the top level, the declaration file is no longer considered ambient and you lose access to these typings in other files.
* To avoid this, either use the `import(...)` function:
*
* ```ts
* interface Locals {
* user: import('$lib/types').User;
* }
* ```
* Or wrap the namespace with `declare global`:
* ```ts
* import { User } from '$lib/types';
*
* declare global {
* namespace App {
* interface Locals {
* user: User;
* }
* // ...
* }
* }
* ```
*
*/
declare namespace App {
/**
* The interface that defines `event.locals`, which can be accessed in [hooks](https://kit.svelte.dev/docs/hooks) (`handle`, and `handleError`), server-only `load` functions, and `+server.js` files.
*/
export interface Locals {}
/**
* Defines the common shape of the [$page.data store](https://kit.svelte.dev/docs/modules#$app-stores-page) - that is, the data that is shared between all pages.
* The `Load` and `ServerLoad` functions in `./$types` will be narrowed accordingly.
* Use optional properties for data that is only present on specific pages. Do not add an index signature (`[key: string]: any`).
*/
export interface PageData {}
/**
* If your adapter provides [platform-specific context](https://kit.svelte.dev/docs/adapters#supported-environments-platform-specific-context) via `event.platform`, you can specify it here.
*/
export interface Platform {}
/**
* Defines the common shape of expected and unexpected errors. Expected errors are thrown using the `error` function. Unexpected errors are handled by the `handleError` hooks which should return this shape.
*/
export interface PageError {
message: string;
}
}
/**
* ```ts
* import { browser, dev, prerendering } from '$app/environment';
* ```
*/
declare module '$app/environment' {
/**
* `true` if the app is running in the browser.
*/
export const browser: boolean;
/**
* Whether the dev server is running. This is not guaranteed to correspond to `NODE_ENV` or `MODE`.
*/
export const dev: boolean;
/**
* `true` when prerendering, `false` otherwise.
*/
export const prerendering: boolean;
}
/**
* ```ts
* import { enhance, applyAction } from '$app/forms';
* ```
*/
declare module '$app/forms' {
import type { ActionResult } from '@sveltejs/kit';
export type SubmitFunction<
Success extends Record | undefined = Record,
Invalid extends Record | undefined = Record
> = (input: {
action: URL;
data: FormData;
form: HTMLFormElement;
controller: AbortController;
cancel: () => void;
}) =>
| void
| ((opts: {
form: HTMLFormElement;
action: URL;
result: ActionResult;
}) => void);
/**
* This action enhances a `