import { ChangeDetectorRef, EventEmitter, OnChanges, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
import { WorkflowPrompt } from '../classes';
import { AbstractBaseGroup } from '../classes/nodes';
import { BuilderService, ElementService, NodeService } from '../classes/services';
import { LocalizedStringKeys, NodeTypes } from '../enum';
import { ActionAddition, ActionWithInput, AllowedValues, AllowedValuesMap, ElementsWithInput, EventAddition, EventWithInput, InputChanged, NodeWithInput, RecordOfAnyType, Select, StateMap, WorkflowNode } from '../types';
import { LocalizationProviderService } from '../services/localization-provider.service';
import * as i0 from "@angular/core";
export declare class BuilderComponent<E> implements OnInit, OnChanges {
    private readonly builder;
    private readonly nodes;
    private readonly elements;
    private readonly cdr;
    private readonly localizationSvc;
    constructor(builder: BuilderService<E, RecordOfAnyType>, nodes: NodeService<E>, elements: ElementService<E>, cdr: ChangeDetectorRef, localizationSvc: LocalizationProviderService);
    private _state;
    get state(): StateMap<RecordOfAnyType>;
    set state(value: StateMap<RecordOfAnyType>);
    private _localizedStringMap;
    get localizedStringMap(): RecordOfAnyType;
    set localizedStringMap(value: RecordOfAnyType);
    diagram: string;
    private _templateMap;
    get templateMap(): {
        [key: string]: TemplateRef<RecordOfAnyType>;
    };
    set templateMap(value: {
        [key: string]: TemplateRef<RecordOfAnyType>;
    });
    private _allColumns;
    set allColumns(value: Select[]);
    get allColumns(): Select[];
    stateChange: EventEmitter<StateMap<RecordOfAnyType>>;
    diagramChange: EventEmitter<Object>;
    eventAdded: EventEmitter<EventAddition<E>>;
    actionAdded: EventEmitter<ActionAddition<E>>;
    itemChanged: EventEmitter<InputChanged<E>>;
    selectedElseActions: ActionWithInput<E>[];
    selectedEvents: EventWithInput<E>[];
    selectedActions: ActionWithInput<E>[];
    eventGroups: AbstractBaseGroup<E>[];
    actionGroups: AbstractBaseGroup<E>[];
    elseActionGroups: AbstractBaseGroup<E>[];
    nodeList: AbstractBaseGroup<E>[];
    processId: string;
    elseBlockHidden: boolean;
    elseBlockRemoved: boolean;
    types: typeof NodeTypes;
    localizedStringKeys: typeof LocalizedStringKeys;
    /**
     * We're getting all the groups from the node service, and then we're adding them to the list of groups
     */
    ngOnInit(): void;
    initiateNode(): void;
    /**
     * > If the diagram and state have changed, restore the diagram and state from the builder
     * @param {SimpleChanges} changes - SimpleChanges - the changes that have occurred in the component
     */
    ngOnChanges(changes: SimpleChanges): Promise<void>;
    /**
     * If the group is an event, add it to the eventGroups array, otherwise if it's an action, add it to
     * the actionGroups array
     * @param group - AbstractBaseGroup<E>
     */
    onGroupAdd(group: AbstractBaseGroup<E>): void;
    /**
     * The function takes in an index number, and then removes the event group at that index from the
     * eventGroups array
     * @param {number} index - The index of the group to remove.
     */
    onGroupRemove(index: number): void;
    removeElseBlock(): void;
    /**
     * The function is called when an event is added to the workflow. It emits an eventAdded event,
     * updates the diagram, updates the state, and shows the else block
     * @param event - ElementsWithInput<E>
     */
    onEventAdded(event: ElementsWithInput<E>): void;
    /**
     * The function is called when an event is removed from the workflow.
     * Hides the else block when it is not needed.
     */
    onEventRemoved(): void;
    /**
     * When an action is added, emit an event with the name of the action and the action itself, update
     * the diagram, and update the state of the action
     * @param action - ElementsWithInput<E>
     */
    onActionAdded(action: ElementsWithInput<E>): void;
    /**
     * The function is called when an item is changed in the UI. It emits an event to the parent
     * component, updates the state of the item, and updates the diagram
     * @param {RecordOfAnyType} item - RecordOfAnyType
     */
    onItemChanged(item: RecordOfAnyType): void;
    /**
     * "If the type is a group, then get the groups, otherwise throw an error."
     *
     * The above function is a good example of how to use the enum
     * @param {NodeTypes} type - The type of node to be added.
     */
    openPopup(type: NodeTypes): void;
    /**
     * It takes a state object, merges it with the current state, and then loops through the state object
     * and adds the values to the inputs
     * @param state - StateMap<RecordOfAnyType>
     */
    private restoreState;
    /**
     * It takes a node, an input, a value, and a boolean, and if the boolean is true and the input is a
     * select input, it sets the node's state to the value's listNameField, emits an event, sets the
     * value to the value's listValueField, and then calls the handleSubsequentInputs function, emits
     * another event, calls the updateState function, and calls the updateDiagram function
     * @param element - NodeWithInput<E> - this is the node that the user is currently editing.
     * @param {WorkflowPrompt} input - WorkflowPrompt - this is the input that was changed
     * @param {AllowedValues | AllowedValuesMap} value - AllowedValues | AllowedValuesMap
     * @param [select=false] - boolean - if true, the value is a map of values, and the value to be set
     * is the value of the listValueField
     */
    addValue(element: NodeWithInput<E>, input: WorkflowPrompt, value: AllowedValues | AllowedValuesMap, select?: boolean): void;
    /**
     * It takes the state of the workflow and creates a new statement from it
     * @returns A function that takes a state and returns a boolean.
     */
    build(): Promise<string>;
    /**
     * It builds a new diagram, emits the new diagram, and then tells Angular to update the view
     */
    updateDiagram(): Promise<void>;
    /**
     * It updates the state of the workflow
     * @param node - WorkflowNode<E> - The node that is being updated.
     * @param {WorkflowPrompt[]} inputs - WorkflowPrompt[]
     * @param [remove=false] - boolean - if true, the state for the node will be removed
     */
    updateState(node: WorkflowNode<E>, inputs: WorkflowPrompt[], remove?: boolean): void;
    /**
     * > If the user has already entered data for a subsequent input, remove it
     * @param element - NodeWithInput<E>
     * @param {WorkflowPrompt} input - WorkflowPrompt - this is the input that was just changed
     */
    private handleSubsequentInputs;
    /**
     * It takes two objects, and merges the second object into the first object
     * @param stateA - The state that is currently in the store.
     * @param stateB - The state that you want to merge into stateA.
     * @returns The state of the store.
     */
    private mergeState;
    static ɵfac: i0.ɵɵFactoryDeclaration<BuilderComponent<any>, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<BuilderComponent<any>, "workflow-builder", never, { "state": "state"; "localizedStringMap": "localizedStringMap"; "diagram": "diagram"; "templateMap": "templateMap"; "allColumns": "allColumns"; }, { "stateChange": "stateChange"; "diagramChange": "diagramChange"; "eventAdded": "eventAdded"; "actionAdded": "actionAdded"; "itemChanged": "itemChanged"; }, never, never>;
}
