diff --git a/packages/element/src/mixin/logging.ts b/packages/element/src/mixin/logging.ts index 10c7ab9..6c9daad 100644 --- a/packages/element/src/mixin/logging.ts +++ b/packages/element/src/mixin/logging.ts @@ -3,13 +3,13 @@ import {createLogger, type AlwatrLogger} from '@alwatr/logger'; import type {Class} from '@alwatr/type-helper'; import type {LitElement, PropertyValues} from 'lit'; -// Global element index to uniquely identify each element instance +/** + * Global element index to uniquely identify each element instance + */ let elementIndex = /* @__PURE__ */ 0; -// Declaration of the LoggerMixinInterface class extending LitElement -export declare class LoggerMixinInterface extends LitElement { - // Logger instance for the element - protected logger_: AlwatrLogger; +export interface LoggerMixinInterface extends LitElement { + logger_: AlwatrLogger; } /** @@ -35,7 +35,7 @@ export declare class LoggerMixinInterface extends LitElement { export function LoggerMixin = Class>( superClass: T, ): Class & T { - class MixinClass extends superClass { + return class MixinClass extends superClass { // Unique index for each element instance private elementIndex__: number = ++elementIndex; @@ -105,7 +105,5 @@ export function LoggerMixin = Class>( this.logger_.logMethod?.('remove'); super.remove(); } - } - - return MixinClass as unknown as Class & T; + } as unknown as Class & T; }