Skip to content

Commit 32a000f

Browse files
Add note about ambient dts files to App types (#4825)
* add note about ambient dts files * changeset * Revert "changeset" This reverts commit 85b47a5. * move line * tweaks * try this * minor change to try and wake turbo up * gah of COURSE Co-authored-by: Rich Harris <[email protected]>
1 parent 70f830c commit 32a000f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

packages/kit/types/ambient.d.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@
1515
* }
1616
* ```
1717
*
18-
* By populating these interfaces, you will gain type safety when using `event.locals`, `event.platform`, `session` and `stuff`:
18+
* By populating these interfaces, you will gain type safety when using `event.locals`, `event.platform`, `session` and `stuff`.
19+
*
20+
* Note that since it's an ambient declaration file, you can't use `import` statements — instead, use the `import(...)` function:
21+
*
22+
* ```ts
23+
* interface Locals {
24+
* user: import('$lib/types').User;
25+
* }
26+
* ```
1927
*/
2028
declare namespace App {
2129
/**

turbo.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"pipeline": {
44
"@sveltejs/kit#build": {
55
"dependsOn": ["^build"],
6-
"inputs": ["src/**", "scripts/**"],
6+
"inputs": ["src/**", "scripts/**", "types/**"],
77
"outputs": ["dist/**", "docs/**", "assets/**"]
88
},
99
"kit.svelte.dev#build": {
1010
"dependsOn": ["^build", "$VERCEL"],
11-
"inputs": ["src/**", "../../documentation/**"],
11+
"inputs": ["src/**", "../../packages/kit/docs/**", "../../documentation/**"],
1212
"outputs": [".vercel_build_output/**"]
1313
},
1414
"build": {

0 commit comments

Comments
 (0)