import { AfterContentInit, AfterViewInit, Injector, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
import { EventManager } from '@angular/platform-browser';
import { App } from '@wm/core';
import { ChangeListener, IWidgetConfig } from '../../framework/types';
import * as i0 from "@angular/core";
export declare abstract class BaseComponent implements OnDestroy, OnInit, AfterViewInit, AfterContentInit {
    protected inj: Injector;
    /**
     * unique identifier for the widget
     */
    readonly widgetId: any;
    isDestroyed: boolean;
    isAttached: boolean;
    /**
     * jQuery nativeElement reference of the component root
     */
    get $element(): any;
    /**
     * DOM node reference of the component root
     */
    readonly nativeElement: HTMLElement;
    /**
     * Type of the component
     */
    protected readonly widgetType: string;
    /**
     * Most of the cases it is same as widgetType
     * for specific widgets like charts widgetType can be wm-chart where as the subtype can be wm-bar-chart
     */
    protected readonly widgetSubType: string;
    /**
     * Proxy for the component instance.
     */
    protected widget: any;
    /**
     * View parent component
     * eg, Page, Partial, Prefab
     */
    protected readonly viewParent: any;
    /**
     * EventManger to add/remove events
     */
    protected readonly eventManager: EventManager;
    /**
     * App Locale
     */
    readonly appLocale: any;
    /**
     * Style change subject and observable
     */
    private readonly styleChange;
    /**
     * Property change subject and observable
     */
    private readonly propertyChange;
    /**
     * On Ready State change subject and observable
     */
    private readonly readyState;
    /**
     * Component destroy subject and observable
     */
    private readonly destroy;
    /**
     * Map of event handler callbacks
     */
    private eventHandlers;
    /**
     * context of the widget
     * when the widget is preset inside a repeater this context will have the repeater related properties
     */
    context: any;
    /**
     * Initial state of the widget.
     * Will be undefined once the initial properties are set on to the component
     */
    private initState;
    /**
     * Internal flag to determine whether to wait for the widget initialization or not
     * If the initPromise is provided in the construction wait till the promise is resolved
     * If the initPromise is not provided proceed with the initialization, which is the default behavior.
     */
    private readonly delayedInit;
    /**
     * Display type of the component. eg, block(Default), inline-block, inline etc
     */
    private readonly displayType;
    /**
     * Holds the event registration functions.
     * these functions needs to be executed after onViewInit
     */
    private toBeSetupEventsQueue;
    __cloneable__: boolean;
    widgetProps: Map<string, any>;
    private $attrs;
    private isMuted;
    viewContainerRef: ViewContainerRef;
    viewParentApp: App;
    /**
     * To avoid re-rendering of widget, passing unique id as contextKey to createCustomInjector
     * (for List, Dynamic Tabs, Accordion, Nav, Carousel)
     */
    trackId: string;
    protected constructor(inj: Injector, config: IWidgetConfig, explicitContext: any, initPromise?: Promise<any>);
    getNativeElement(): HTMLElement;
    getWidgetType(): string;
    getWidgetSubType(): string;
    getWidget(): any;
    setProperty(propName: any, propValue: any): void;
    getViewParent(): any;
    notifyStyleChange(key: string, nv: any, ov: any): void;
    notifyPropertyChange(key: string, nv: any, ov: any): void;
    registerStyleChangeListener(fn: ChangeListener, ctx?: any): void;
    registerReadyStateListener(fn: Function, ctx?: any): void;
    registerPropertyChangeListener(fn: ChangeListener, ctx?: any): void;
    registerDestroyListener(fn: Function, ctx?: any): void;
    getDisplayType(): string;
    protected createProxy(): any;
    protected initContext(): void;
    /**
     * set the value on the proxy object ie, widget
     * setting the property on the proxy will invoke the change listeners
     * @param {string} key
     * @param value
     */
    setWidgetProperty(key: string, value: any): void;
    getAttr(attrName: string): string;
    /**
     * returns app instance
     * @returns {App}
     */
    getAppInstance(): App;
    /**
     * Generates a unique id
     * Default pattern is `widget-id-${id}`
     * Components can override this method to generate a different id eg, bar-chart-1
     */
    protected generateWidgetId(): string;
    /**
     * Handles the common functionality across the components
     * eg,
     *  1. value of the class property will be applied on the host element
     *  2. based on the value of show property component is shown/hidden
     *
     * @param {string} key
     * @param nv
     * @param ov
     */
    protected onPropertyChange(key: string, nv: any, ov?: any): void;
    /**
     * Default style change handler
     */
    protected onStyleChange(k: string, nv: any, ov?: any): void;
    /**
     * Register the widget with the widgetRegistry
     */
    protected registerWidget(widgetName: string): void;
    /**
     * override the
     */
    protected getMappedEventName(eventName: any): any;
    /**
     * invoke the event handler
     * Components can override this method to execute custom logic before invoking the user callback
     */
    protected handleEvent(node: HTMLElement, eventName: string, eventCallback: Function, locals: any, meta?: string): void;
    /**
     * parse the event expression and save reference to the function inside eventHandlers map
     * If the component provides a override for an event through @Event decorator invoke that
     * else invoke the resolved function
     *
     * @param {string} eventName
     * @param {string} expr
     */
    protected processEventAttr(eventName: string, expr: string, meta?: string): void;
    /**
     * Process the bound property
     * Register a watch on the bound expression
     */
    protected processBindAttr(propName: string, expr: string): void;
    /**
     * Remove watch on the bound property
     */
    protected removePropertyBinding(propName: string): void;
    /**
     * invoke the event callback method
     * @param {string} eventName
     * @param extraLocals
     */
    invokeEventCallback(eventName: string, extraLocals?: any): any;
    /**
     * Process the attribute
     * If the attribute is an event expression, generate a functional representation of the expression
     *      and keep in eventHandlers
     * If the attribute is a bound expression, register a watch on the expression
     */
    protected processAttr(attrName: string, attrValue: string): void;
    /**
     * This is required as the native element attributes are case insensitive(camelcase) like customExpressions becomes customexpression
     * and our logic to check like these changes will fail. Before IVY changes, angular maintains a separate object with these attributes
     * as it is like in the camelcase. With IVY all those are gone. So need to maintain a separate list with the camelcasing of attributes
     * @private
     * _tNode.attrs attributes are stored in array(even index: key, odd index: value)
     */
    private getAttributes;
    /**
     * Process the attributes
     */
    private processAttrs;
    /**
     * Update the initState with the default property values and the values provided in the markup
     * Process the attributes
     * Register the widget
     */
    protected initWidget(): void;
    /**
     * Update the default properties and the properties provided in the markup in component
     * Invoking this method will result in invocation of propertyChange handlers on the component for the first time
     */
    protected setInitProps(): void;
    /**
     * Returns true, if a listener registered for the given event on this widget markup.
     * @param eventName
     * @returns {boolean}
     */
    protected hasEventCallback(eventName: any): boolean;
    /**
     * Sets the focus on the widget
     */
    protected focus(): void;
    protected execute(operation: any, options: any): any;
    mute(): void;
    unmute(): void;
    private customInjectorMap;
    /**
     * After the Angular 17 upgrade, Angular is no longer sending ngTemplateContext to components in ng-template.
     * Wavemaker widgets inside ng-template require context to evaluate bind expressions.
     * So we're creating an injectionToken that returns the context as a value.
     * We are passing the injectionToken to the ngTemplateOutletInjector.
     * This injects the context into each widget in the ng-template.
     * In the widget component constructor we are getting the injectionToken using dependency injection.
     * If injectionToken is present, we extend the component context with the value of injectionToken.
     * @param contextKey
     * @param context
     * @returns injector
     */
    createCustomInjector(contextKey: string, context: any): any;
    /**
     * After the host page is attached from cache, this function is called.
     */
    ngOnAttach(): void;
    /**
     * Before the host page is detached from dom and stored in cache,  this function is called.
     */
    ngOnDetach(): void;
    /**
     * nativeElement will be available by this time
     * if the delayInit is false, properties meta will be available by this time
     * Invoke the setInitProps if the delayInit is false
     */
    ngOnInit(): void;
    /**
     * Register the events
     */
    ngAfterViewInit(): void;
    ngAfterContentInit(): void;
    ngOnDestroy(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<BaseComponent, [null, null, { optional: true; }, null]>;
    static ɵprov: i0.ɵɵInjectableDeclaration<BaseComponent>;
}
