import { LitElement } from 'lit'; import { Subscription, ReplaySubject } from 'rxjs'; import type { Observable } from 'rxjs'; import type { EventBus } from '../../events'; import { Localized } from '../../utils/i18n'; import { Labels, LocalizedComponent } from '../localized-components'; export declare type Listener = (eventBus: EventBus, kickoff: Observable<0>) => Subscription; export declare type Bootstrapper = (eventBus: EventBus) => void; /** * @superclass * @description BackOffice library base superclass for Lit-based webcomponents */ export declare class BkBase extends LitElement implements LocalizedComponent { /** * @description a window that might support sandboxed logic/methods */ proxyWindow: Window & typeof globalThis; /** * @description [micro-lc-element-composer](https://microlc.io/documentation/docs/micro-lc/core_plugins#microlc-element-composer) * default prop representing the authenticated user. It's context can be configured via micro-lc backend config files. * @see {@link https://microlc.io/documentation/docs/micro-lc/authentication} */ currentUser: Record; /** * @description [micro-lc-element-composer](https://microlc.io/documentation/docs/micro-lc/core_plugins#microlc-element-composer) * default prop representing the `eventBus` default channel unless overridden by `busDiscriminator` prop. */ get eventBus(): EventBus | undefined; /** * When an eventBus is set: * 1. check if there are subscriptions and if any pop them while removing the tead down logic * 2. if the eventBus is defined register all listeners with the subscription * 3. if the eventBus is defined then bootstrap * 4. set the eventBus */ set eventBus(e: EventBus | undefined); set customLocale(l: Localized); private _currentBusSubscriptions; private _eventBus?; private _listeners; private _bootstrap; private _subscription; protected _timeout$: ReplaySubject<0>; protected get subscription(): Subscription; /** * When new subscription is set: * 1. unsubscribe all previous subscriptions * 2. clean the array of current subscription * 3. if an eventBus is present, register all listeners updating newly injected subscription and current subscription array * 4. set subscription */ protected set subscription(s: Subscription); protected defaultLocale?: L | undefined; protected _locale?: L; set locale(l: L | undefined); get locale(): L | undefined; constructor(listeners?: Listener | Listener[], bootstrap?: Bootstrapper | Bootstrapper[]); connectedCallback(): void; disconnectedCallback(): void; }