8000 feat: enable TS autocomplete for Svelte HTML element definitions by ivenuss · Pull Request #15972 · sveltejs/svelte · GitHub
[go: up one dir, main page]

Skip to content

feat: enable TS autocomplete for Svelte HTML element definitions #15972

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

Merged
merged 2 commits into from
May 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/svelte/elements.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,7 @@ export interface SvelteHTMLElements {
failed?: import('svelte').Snippet<[error: unknown, reset: () => void]>;
};

[name: string]: { [name: string]: any };
[name: string & {}]: { [name: string]: any };
}

export type ClassValue = string | import('clsx').ClassArray | import('clsx').ClassDictionary;
4 changes: 2 additions & 2 deletions packages/svelte/svelte-html.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import * as svelteElements from './elements.js';
/**
* @internal do not use
*/
type HTMLProps<Property extends string, Override> = Omit<
type HTMLProps<Property extends keyof svelteElements.SvelteHTMLElements, Override> = Omit<
import('./elements.js').SvelteHTMLElements[Property],
keyof Override
> &
Expand Down Expand Up @@ -250,7 +250,7 @@ declare global {
};
// don't type svelte:options, it would override the types in svelte/elements and it isn't extendable anyway

[name: string]: { [name: string]: any };
[name: string & {}]: { [name: string]: any };
}
}
}
0