-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix: specify return type in DTS declarations #14054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
If we specify the return type in the JSDoc for `getRequestEvent`, the DTS emit corrects itself and no longer pulls in a missing symbol. Maybe this means we don't need the generate hack?
|
FYI i think this is entirely because we ts-ignore the symbol being imported: kit/packages/kit/src/exports/public.d.ts Lines 21 to 26 in 1164ffa
if this resolved, tsc might have emit the right thing without specifying the return type isn't it possible we can use declaration merging to provide a "base" // base declaration
declare module '$app/types' {
export interface LayoutParams {
}
}
// user declaration
declare module '$app/types' {
export interface LayoutParams {
foo: 303;
}
} |
Mhhhm yeah this might work! |
We're mostly dealing with types rather than interfaces, which IIUC can't be merged |
Scratch 'mostly' — everything exported from |
yup i see i suppose at least this JSDoc fixes the emit to no longer have a non-existent type but it does seem we can't do much about |
Yeah — @eltigerchino noticed that there's a TypeScript feature called Unfortunately |
If we specify the return type in the JSDoc for
getRequestEvent
, the DTS emit corrects itself and no longer pulls in a missing symbol.Maybe this means we don't need the generate hack?
Draft for now in case this doesn't fully solve the problem for a reason i'm not aware of.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits