[fix] allow use of document root as target in typescript

It is not possible to use typescript when using `target: document`
during component initialization, because target can only be of type
Element or ShadowRoot. This means that it is not possible to hydrate
the entire document when managing the <html> element as a Svelte
component.

This commit fixes this by allowing documents to be targets.
pull/7554/head
Franklin "Snaipe" Mathieu 4 years ago
parent a4fa98c532
commit bcd822f77d

@ -129,7 +129,7 @@ export interface SvelteComponentDev {
[accessor: string]: any; [accessor: string]: any;
} }
interface IComponentOptions<Props extends Record<string, any> = Record<string, any>> { interface IComponentOptions<Props extends Record<string, any> = Record<string, any>> {
target: Element | ShadowRoot; target: Element | Document | ShadowRoot;
anchor?: Element; anchor?: Element;
props?: Props; props?: Props;
context?: Map<any, any>; context?: Map<any, any>;

Loading…
Cancel
Save