diff --git a/.changeset/curvy-chefs-design.md b/.changeset/curvy-chefs-design.md new file mode 100644 index 000000000000..4a4d97743d03 --- /dev/null +++ b/.changeset/curvy-chefs-design.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +docs: explain how to add ambient typings diff --git a/packages/kit/types/ambient.d.ts b/packages/kit/types/ambient.d.ts index f781c274dcaa..d4ed8951b6b4 100644 --- a/packages/kit/types/ambient.d.ts +++ b/packages/kit/types/ambient.d.ts @@ -11,9 +11,12 @@ * } * } * - * export default undefined; + * export {}; * ``` * + * The `export {}` line exists because without it, the file would be treated as an _ambient module_ which prevents you from adding `import` declarations. + * If you need to add ambient `declare module` declarations, do so in a separate file like `src/ambient.d.ts`. + * * By populating these interfaces, you will gain type safety when using `event.locals`, `event.platform`, and `data` from `load` functions. */ declare namespace App {