fix: allow use of document root as target in typescript (#7554)

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/8425/head
Snaipe 2 years ago committed by GitHub
parent aa4d0fc264
commit d49b568019
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -164,8 +164,9 @@ export interface SvelteComponentDev {
$destroy(): void;
[accessor: string]: any;
}
export interface ComponentConstructorOptions<Props extends Record<string, any> = Record<string, any>> {
target: Element | ShadowRoot;
target: Element | Document | ShadowRoot;
anchor?: Element;
props?: Props;
context?: Map<any, any>;

Loading…
Cancel
Save