diff --git a/packages/widget-element/index.ts b/packages/widget-element/index.ts index b88c66f..7f982d9 100644 --- a/packages/widget-element/index.ts +++ b/packages/widget-element/index.ts @@ -1,5 +1,10 @@ /* eslint-disable import/no-unused-modules */ +type NonFunctionProperties = { + // eslint-disable-next-line @typescript-eslint/ban-types + [K in keyof T as T[K] extends Function ? never : K]: T[K] +} + /** * Custom Element that helps you to create widgets. * @@ -68,9 +73,7 @@ * * ``` */ -export class WidgetElement< - T extends Record = Record -> extends HTMLElement { +export class WidgetElement extends HTMLElement { #fallback!: HTMLElement #shadowRoot?: ShadowRoot @@ -83,7 +86,7 @@ export class WidgetElement< } /** Widget custom element constructor */ - constructor(properties?: T) { + constructor(properties?: NonFunctionProperties) { super() const {observedAttributes} = this.constructor as any