|
|
@ -7,7 +7,8 @@ import {
|
|
|
|
mount,
|
|
|
|
mount,
|
|
|
|
hydrate,
|
|
|
|
hydrate,
|
|
|
|
type Component,
|
|
|
|
type Component,
|
|
|
|
type ComponentInternals
|
|
|
|
type ComponentInternals,
|
|
|
|
|
|
|
|
type ComponentExports
|
|
|
|
} from 'svelte';
|
|
|
|
} from 'svelte';
|
|
|
|
import { render } from 'svelte/server';
|
|
|
|
import { render } from 'svelte/server';
|
|
|
|
|
|
|
|
|
|
|
@ -180,6 +181,16 @@ render(NewComponent, {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const newComponentExports: ComponentExports<typeof NewComponent> = {
|
|
|
|
|
|
|
|
anExport: '',
|
|
|
|
|
|
|
|
$$events_def: null as any,
|
|
|
|
|
|
|
|
$$prop_def: null as any,
|
|
|
|
|
|
|
|
$$slot_def: null as any,
|
|
|
|
|
|
|
|
$set: null as any,
|
|
|
|
|
|
|
|
$destroy: null as any,
|
|
|
|
|
|
|
|
$on: null as any
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------- interop
|
|
|
|
// --------------------------------------------------------------------------- interop
|
|
|
|
|
|
|
|
|
|
|
|
const AsLegacyComponent = asClassComponent(newComponent);
|
|
|
|
const AsLegacyComponent = asClassComponent(newComponent);
|
|
|
@ -337,6 +348,19 @@ render(functionComponent, {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const functionComponentExports: ComponentExports<typeof functionComponent> = {
|
|
|
|
|
|
|
|
foo: 'bar',
|
|
|
|
|
|
|
|
// @ts-expect-error
|
|
|
|
|
|
|
|
x: ''
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type AdhocFunctionComponent = (a: unknown, b: { a: true }) => { foo: string };
|
|
|
|
|
|
|
|
const adhocFunctionComponentExport: ComponentExports<AdhocFunctionComponent> = {
|
|
|
|
|
|
|
|
foo: 'bar',
|
|
|
|
|
|
|
|
// @ts-expect-error
|
|
|
|
|
|
|
|
x: ''
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------- *.svelte components
|
|
|
|
// --------------------------------------------------------------------------- *.svelte components
|
|
|
|
|
|
|
|
|
|
|
|
// import from a nonexistent file to trigger the declare module '*.svelte' in ambient.d.ts
|
|
|
|
// import from a nonexistent file to trigger the declare module '*.svelte' in ambient.d.ts
|
|
|
|