import { Generic } from "cmf.core/src/core"; import { ActionButton } from "./actionButton"; import { ActionButtonGroup } from "./actionButtonGroup"; import { ActionGroup } from "./actionGroup"; import { ActionBar } from "./actionBar"; import { ActionButtonGroupButton } from "./actionButtonGroupButton"; export interface SimplifiedTreeNode { id: string; name: string; type: string; children?: SimplifiedTreeNode[]; } /** * Action Tree Service */ export declare class ActionTreeService extends Generic { /** * Singleton generic instance used to get access to the framework in a static context. */ private static genericInstance; /** * Either returns the static generic instance if it was already instantiated * or instantiates it and then returns it. */ private static readonly generic; /** * All the existing action bars */ private static _actionBars; /** * All the elements for all the action bars */ private static _actionBarElements; /** * Public version of the 'startParentDiscoveryProcess' function, with a 500ms debounce. */ static startDiscoveryProcess: () => void; /** * Self */ private _instance; /** * Parent */ private _parent; /** * Children */ private _children; /** * On button changes * @event onButtonChanges */ private onButtonChanges; /** * Starts the parent discovery process by calling the discoverParent function for each action bar element, if it implements one. */ private static startParentDiscoveryProcess; /** * Adds the action bar to the action bars array. * @param instance ActionBar instance */ static addActionBar(instance: ActionBar): void; /** * Adds the element to the action bar elements array * @param instance ActionBar element */ static addActionBarElement(instance: any): void; private onParentDiscoverEventHandler; /** * Instance Id */ readonly instanceId: string; /** * Self parent */ readonly parent: ActionTreeService; /** * Self instance */ readonly instance: ActionButton | ActionBar | ActionButtonGroup | ActionGroup | ActionButtonGroupButton; /** * children */ readonly children: ActionTreeService[]; /** * Constructor */ constructor(); /** * Find Child */ private findChild; /** * Set instance */ setInstance(parent: ActionTreeService, instance: ActionBar | ActionButton | ActionButtonGroup | ActionGroup | ActionButtonGroupButton): void; /** * Get simplified tree (for debug purposes) */ getSimplifiedTree(): SimplifiedTreeNode; /** * On button changes */ subscribeTreeChanges(callback: any): any; /** * Emit tree changes */ emitTreeChanges(treeStructureUpdated: boolean): void; discoverParent(instance: ActionBar | ActionButton | ActionButtonGroup | ActionGroup | ActionButtonGroupButton): void; registerParent(instance: ActionBar | ActionButton | ActionButtonGroup | ActionGroup | ActionButtonGroupButton): void; /** * Destroy instance */ destroyInstance(): void; /** * Add child */ protected addChild(item: ActionTreeService): void; /** * Remove child */ protected removeChild(item: ActionTreeService): void; }