Adding a community index view with Svelte (WIP)

This commit is contained in:
Pieter Vander Vennet 2023-01-29 13:10:57 +01:00
parent ad13444883
commit d30ed22673
10 changed files with 487 additions and 101 deletions

View file

@ -1,13 +1,26 @@
import BaseUIElement from "../BaseUIElement"
import { SvelteComponentTyped } from "svelte"
/**
* The SvelteUIComponent serves as a translating class which which wraps a SvelteElement into the BaseUIElement framework.
*/
export default class SvelteUIElement extends BaseUIElement {
private readonly _svelteComponent
private readonly _props: Record<string, any>
export default class SvelteUIElement<
Props extends Record<string, any> = any,
Events extends Record<string, any> = any,
Slots extends Record<string, any> = any
> extends BaseUIElement {
private readonly _svelteComponent: {
new (args: {
target: HTMLElement
props: Props
events?: Events
slots?: Slots
}): SvelteComponentTyped<Props, Events, Slots>
}
private readonly _props: Props
constructor(svelteElement, props: Record<string, any>) {
constructor(svelteElement, props: Props) {
super()
this._svelteComponent = svelteElement
this._props = props