import { AXPEntity, AXPMenuProvider, AXPMenuProviderContext } from '@acorex/platform/common';
import { AXPEntityDefinitionLoader, AXPEntityPreloadEntity, AXPEntityModel } from '@acorex/platform/layout/entity';
import * as i0 from '@angular/core';
import { Type, InjectionToken } from '@angular/core';
import * as i1 from '@acorex/modules/calendar-management';
import * as i2 from '@acorex/platform/domain';
import { AXPActivityCategory, AXPActivityDefinition, AXPWorkflowDefinition, AXPWorkflowStatus, AXPWorkflowSubStatus, AXPWorkflowInstance, AXPActivityCategoryProvider, AXPActivityProvider } from '@acorex/platform/workflow';
import { AXPExecuteCommandResult, AXPActionMenuItem, AXPExecuteCommand, AXPCategoryEntity } from '@acorex/platform/core';
import { AXPCommand } from '@acorex/platform/runtime';
import { AXStyleColorType } from '@acorex/cdk/common';
import { AXPWidgetNode } from '@acorex/platform/layout/widget-core';
import { AXPopupSizeType } from '@acorex/components/popup';
import { AXPPageLayoutBaseComponent } from '@acorex/platform/layout/views';
import { AXPCategoryTreeDataSource, AXPCategoryTreeConfig, AXPCategoryTreeActions, AXPCategoryTreeEvents } from '@acorex/platform/layout/components';
import { AXPWorkflowTaskProvider, AXPTaskFilter, AXPTask, AXPTaskActionMenuItem, AXPExtraField, AXPTaskStatus, AXPTaskPopoverComponent } from '@acorex/modules/task-management';

declare const RootConfig: {
    config: {
        i18n: string;
        module: string;
    };
    module: {
        route: string;
        name: string;
        title: string;
        icon: string;
    };
    entities: {
        workflowDefinition: {
            name: string;
            fullName: string;
            title: string;
            titlePlural: string;
            icon: string;
        };
        workflowInstance: {
            name: string;
            fullName: string;
            title: string;
            titlePlural: string;
            icon: string;
        };
        activityDefinition: {
            name: string;
            fullName: string;
            title: string;
            titlePlural: string;
            icon: string;
        };
    };
};

declare class AXMWorkflowManagementModuleEntityProvider implements AXPEntityDefinitionLoader {
    preload(): AXPEntityPreloadEntity[];
    get(moduleName: string, entityName: string): Promise<AXPEntity | null>;
    list(): Promise<{
        name: string;
        module: string;
    }[]>;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMWorkflowManagementModuleEntityProvider, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXMWorkflowManagementModuleEntityProvider>;
}

declare class AXMMenuProvider implements AXPMenuProvider {
    private entityService;
    private sessionService;
    provide(context: AXPMenuProviderContext): Promise<void>;
}

/**
 * Workflow Plugin Module
 *
 * Registers the workflow plugin that marks entities as workflow-capable.
 */
declare class AXMWorkflowPluginModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMWorkflowPluginModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXMWorkflowPluginModule, never, never, never>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXMWorkflowPluginModule>;
}

declare class AXMWorkflowManagementModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMWorkflowManagementModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXMWorkflowManagementModule, never, [typeof i1.AXMCalendarManagementModule, typeof i2.AXPDomainModule, typeof AXMWorkflowPluginModule], never>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXMWorkflowManagementModule>;
}

interface AXMWorkflowManagementActivityCategoryEntityModel extends AXPEntityModel<string>, AXPActivityCategory {
    id: string;
}

interface AXMWorkflowManagementActivityDefinitionEntityModel extends AXPEntityModel<string>, AXPActivityDefinition {
}

/**
 * Workflow Definition Entity Model.
 *
 * Extends AXPWorkflowDefinition directly - all workflow definition fields are available.
 * System fields are managed by entity system.
 */
interface AXMWorkflowManagementWorkflowDefinitionEntityModel extends AXPEntityModel<string>, AXPWorkflowDefinition {
    /**
     * Entity ID (from AXPEntityModel) - unique ID for this workflow definition version
     */
    id: string;
    /**
     * Schema reference (system field - set automatically).
     */
    $schema?: string;
    /**
     * Tenant ID (system field - set automatically).
     */
    tenantId?: string | null;
    /**
     * Creation timestamp (from AXPEntityModel).
     */
    createdAt: string;
    /**
     * Version number (system field - managed automatically).
     */
    version: number;
    /**
     * Tool version (system field - set automatically).
     */
    toolVersion?: string | null;
    /**
     * Whether workflow is readonly (system field - set automatically).
     */
    isReadonly: boolean;
    /**
     * Whether workflow is system workflow (system field - set automatically).
     */
    isSystem: boolean;
    /**
     * Whether this is the latest version (system field - managed automatically).
     */
    isLatest: boolean;
    /**
     * Whether workflow is published (system field - managed automatically).
     */
    isPublished: boolean;
}

/**
 * Workflow Instance Entity Model.
 *
 * Extends AXPWorkflowInstance with entity-specific fields for UI.
 */
interface AXMWorkflowManagementWorkflowInstanceEntityModel extends AXPEntityModel<string> {
    /**
     * Workflow definition ID (logical ID, same across versions)
     */
    definitionId: string;
    /**
     * Workflow definition version ID
     */
    definitionVersionId: string;
    /**
     * Workflow definition version number
     */
    version: number;
    /**
     * Workflow status
     */
    status: AXPWorkflowStatus;
    /**
     * Workflow sub-status
     */
    subStatus: AXPWorkflowSubStatus;
    /**
     * Correlation ID (for tracking related workflows)
     */
    correlationId?: string;
    /**
     * Instance name
     */
    name?: string;
    /**
     * Incident count (errors/faults)
     */
    incidentCount: number;
    /**
     * Parent workflow instance ID (for child workflows)
     */
    parentWorkflowInstanceId?: string;
    /**
     * Creation timestamp
     */
    createdAt: string;
    /**
     * Last update timestamp
     */
    updatedAt: string;
    /**
     * Finished timestamp (null if still running)
     */
    finishedAt?: string;
    /**
     * Full workflow instance (stored as JSON)
     */
    workflowInstance?: AXPWorkflowInstance;
    /**
     * Entity reference type
     */
    entityRefType?: string;
    /**
     * Entity reference ID
     */
    entityRefId?: string;
}

/**
 * Provider for activity categories.
 * Reads categories from entity service (mock data).
 */
declare class AXCCategoryProvider implements AXPActivityCategoryProvider {
    private readonly entityService;
    /** Category entity is provided by category plugin (ActivityDefinition → ActivityDefinitionCategory). */
    private categoryService;
    getList(parentId?: string): Promise<AXPActivityCategory[]>;
    getById(id: string): Promise<AXPActivityCategory | undefined>;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXCCategoryProvider, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXCCategoryProvider>;
}

/**
 * Input for ExecuteQuery activity.
 */
interface ExecuteQueryInput {
    /**
     * Query key to execute (e.g., "User:CheckEmailExists")
     */
    queryKey: string;
    /**
     * Query parameters
     */
    parameters?: Record<string, any>;
}
/**
 * Output for ExecuteQuery activity.
 */
interface ExecuteQueryOutput {
    /**
     * Query result data
     */
    data: any;
    /**
     * Whether query executed successfully
     */
    success: boolean;
    /**
     * Error message if query failed
     */
    error?: string;
}
/**
 * ExecuteQuery Activity (Backend)
 *
 * Executes a query operation.
 * This is a mock implementation that simulates common queries.
 *
 * Execution Mode: backend
 * Activity Type: workflow-activity:execute-query
 *
 * Outcomes:
 * - Done: Query executed successfully
 * - Valid: Data is valid (for validation queries)
 * - Exists: Data exists (for existence checks)
 * - NotFound: Data not found
 * - Failed: Query execution failed
 */
declare class ExecuteQueryActivity implements AXPCommand<ExecuteQueryInput, {
    output: ExecuteQueryOutput;
    outcomes: Record<string, any>;
}> {
    private readonly storageService;
    execute(input: ExecuteQueryInput): Promise<AXPExecuteCommandResult<{
        output: ExecuteQueryOutput;
        outcomes: Record<string, any>;
    }>>;
    /**
     * Routes query to appropriate handler based on queryKey.
     */
    private routeQuery;
    /**
     * Checks if email already exists in database.
     */
    private checkEmailExists;
    /**
     * Validates data structure and content.
     */
    private validateData;
    static ɵfac: i0.ɵɵFactoryDeclaration<ExecuteQueryActivity, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ExecuteQueryActivity>;
}

/**
 * Input for ExecuteCommand activity.
 */
interface ExecuteCommandInput {
    /**
     * Command key to execute (e.g., "User:Create")
     */
    commandKey: string;
    /**
     * Command input data
     */
    input?: Record<string, any>;
}
/**
 * Output for ExecuteCommand activity.
 */
interface ExecuteCommandOutput {
    /**
     * Command result data
     */
    result: any;
    /**
     * Whether command executed successfully
     */
    success: boolean;
    /**
     * Error message if command failed
     */
    error?: string;
    /**
     * Created/Updated entity ID (if applicable)
     */
    entityId?: string;
}
/**
 * ExecuteCommand Activity (Backend)
 *
 * Executes a command operation.
 * This is a mock implementation that simulates common commands.
 *
 * Execution Mode: backend
 * Activity Type: workflow-activity:execute-command
 *
 * Outcomes:
 * - Done: Command executed successfully
 * - Failed: Command execution failed
 */
declare class ExecuteCommandActivity implements AXPCommand<ExecuteCommandInput, {
    output: ExecuteCommandOutput;
    outcomes: Record<string, any>;
}> {
    execute(input: ExecuteCommandInput): Promise<AXPExecuteCommandResult<{
        output: ExecuteCommandOutput;
        outcomes: Record<string, any>;
    }>>;
    /**
     * Routes command to appropriate handler based on commandKey.
     */
    private routeCommand;
    /**
     * Creates a new user in the system.
     */
    private createUser;
    /**
     * Processes data according to business rules.
     */
    private processData;
    static ɵfac: i0.ɵɵFactoryDeclaration<ExecuteCommandActivity, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ExecuteCommandActivity>;
}

/**
 * Input for ShowConfirmPopup activity.
 */
interface ShowConfirmPopupInput {
    /**
     * Title of the confirmation dialog
     */
    title: string;
    /**
     * Message/content of the confirmation dialog
     */
    message: string;
    /**
     * Dialog type/color (e.g., 'warning', 'danger', 'info', 'success')
     */
    type?: AXStyleColorType;
    /**
     * Button layout direction ('horizontal' or 'vertical')
     */
    direction?: 'horizontal' | 'vertical';
    /**
     * Whether dialog is closable
     */
    closable?: boolean;
    /**
     * Default action button ('confirm' or 'cancel')
     */
    defaultAction?: 'confirm' | 'cancel';
}
/**
 * Output for ShowConfirmPopup activity.
 * Outcome is determined by the outcomes object (ok or cancel).
 */
interface ShowConfirmPopupOutput {
}
/**
 * ShowConfirmPopup Activity (Frontend)
 *
 * Shows a confirmation popup dialog with OK and Cancel buttons.
 * This activity runs on the frontend and requires user interaction.
 *
 * Execution Mode: frontend
 * Activity Type: workflow-activity:show-confirm-popup
 *
 * Outcomes:
 * - ok: User clicked OK button
 * - cancel: User clicked Cancel button or closed the dialog
 */
declare class ShowConfirmPopupActivity implements AXPCommand<ShowConfirmPopupInput, {
    output: ShowConfirmPopupOutput;
    outcomes: Record<string, any>;
}> {
    private readonly dialogService;
    private readonly translationService;
    execute(input: ShowConfirmPopupInput): Promise<AXPExecuteCommandResult<{
        output: ShowConfirmPopupOutput;
        outcomes: Record<string, any>;
    }>>;
    static ɵfac: i0.ɵɵFactoryDeclaration<ShowConfirmPopupActivity, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ShowConfirmPopupActivity>;
}

/**
 * Input for ShowLayoutPopup activity.
 */
interface ShowLayoutPopupInput {
    /**
     * Layout definition as JSON string or AXPWidgetNode object
     */
    layout: string | AXPWidgetNode;
    /**
     * Dialog title
     */
    title?: string;
    /**
     * Dialog size
     */
    size?: AXPopupSizeType;
    /**
     * Whether to show close button
     */
    closeButton?: boolean;
    /**
     * Initial context data for the form
     */
    context?: Record<string, any>;
    /**
     * Dialog actions (buttons) to display in footer
     * Each action will create a corresponding outcome
     */
    actions?: {
        prefix?: AXPActionMenuItem[];
        suffix?: AXPActionMenuItem[];
    };
}
/**
 * Output for ShowLayoutPopup activity.
 */
interface ShowLayoutPopupOutput {
    /**
     * Result data from the dialog (form values)
     */
    result: Record<string, any>;
    /**
     * Action that was clicked (e.g., 'submit', 'cancel', or custom action name)
     */
    action: string;
}
/**
 * ShowLayoutPopup Activity (Frontend)
 *
 * Shows a popup dialog with a custom layout built using layout builder.
 * The layout can be provided as JSON string or AXPWidgetNode object.
 *
 * Execution Mode: frontend
 * Activity Type: workflow-activity:show-layout-popup
 *
 * Outcomes:
 * Outcomes are dynamically generated based on the actions provided in the input.
 * Each action creates a corresponding outcome with the action name (from command.name or action.name).
 * If no actions are provided, default actions (cancel, submit) are used.
 *
 * Examples:
 * - If action has command.name = 'save', outcome will be { save: true }
 * - If action has name = 'delete', outcome will be { delete: true }
 * - Default outcomes: { cancel: true } or { submit: true }
 */
declare class ShowLayoutPopupActivity implements AXPCommand<ShowLayoutPopupInput, {
    output: ShowLayoutPopupOutput;
    outcomes: Record<string, any>;
}> {
    private readonly popupService;
    execute(input: ShowLayoutPopupInput): Promise<AXPExecuteCommandResult<{
        output: ShowLayoutPopupOutput;
        outcomes: Record<string, any>;
    }>>;
    static ɵfac: i0.ɵɵFactoryDeclaration<ShowLayoutPopupActivity, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ShowLayoutPopupActivity>;
}

/**
 * Input for Human Task activity.
 */
interface HumanTaskInput {
    /**
     * Task title
     */
    title?: string;
    /**
     * Task description
     */
    description?: string;
    /**
     * Assigned user IDs (direct assignment)
     */
    assignedUserIds?: string[];
    /**
     * Candidate user IDs (users who can claim the task)
     */
    candidateUserIds?: string[];
    /**
     * Candidate role IDs (roles whose members can claim the task)
     */
    candidateRoleIds?: string[];
    /**
     * Task priority
     */
    priority?: 'Low' | 'Normal' | 'High' | 'Urgent';
    /**
     * Task due date (ISO date string or Date)
     */
    dueDate?: string | Date;
    /**
     * Initial context data for the form
     */
    context?: Record<string, any>;
    /**
     * Actions (buttons) for this task. Format: { prefix?: Array<Action>, suffix?: Array<Action> } (or JSON string).
     * Each action name becomes an outcome when the task is completed.
     */
    actions?: {
        prefix?: Array<{
            name?: string;
            command?: {
                name?: string;
            };
        }>;
        suffix?: Array<{
            name?: string;
            command?: {
                name?: string;
            };
        }>;
    } | string;
}
/**
 * Output for Human Task activity.
 */
interface HumanTaskOutput {
    /**
     * Result data from task completion (form values)
     */
    result: Record<string, any>;
    /**
     * Action that was clicked (e.g., 'approve', 'reject', 'cancel')
     */
    action: string;
}
/**
 * Human Task Activity (Frontend)
 *
 * Generic human task activity that suspends workflow and waits for user interaction.
 * Supports assignment and actions (displayed inline). For dialog-style flow, use a follow-up activity.
 *
 * Execution Mode: frontend
 * Task Type: human-task
 * Activity Type: workflow-activity:human-task
 *
 * Outcomes:
 * Outcomes are dynamically generated based on the actions provided in the input.
 * Each action creates a corresponding outcome with the action name (from command.name or action.name).
 * If no actions are provided, default actions (cancel, submit) are used.
 *
 * Examples:
 * - If action has command.name = 'approve', outcome will be { approve: true }
 * - If action has name = 'reject', outcome will be { reject: true }
 * - Default outcomes: { cancel: true } or { submit: true }
 *
 * Assignment:
 * - assignedUserIds: Direct assignment to specific users
 * - candidateUserIds: Users who can claim the task
 * - candidateRoleIds: Roles whose members can claim the task
 *
 * Display Modes:
 * - 'dialog': Traditional modal dialog (default)
 * - 'inline': Actions displayed directly on page before resume
 */
declare class HumanTaskActivity implements AXPCommand<HumanTaskInput, {
    output: HumanTaskOutput;
    outcomes: Record<string, any>;
}> {
    /**
     * Execute human task activity.
     *
     * This method doesn't actually show UI - it just validates input and returns success.
     * The workflow engine will suspend at this activity and create a bookmark.
     * The Generic Task Provider will handle displaying the task UI inline.
     */
    execute(input: HumanTaskInput): Promise<AXPExecuteCommandResult<{
        output: HumanTaskOutput;
        outcomes: Record<string, any>;
    }>>;
    static ɵfac: i0.ɵɵFactoryDeclaration<HumanTaskActivity, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<HumanTaskActivity>;
}

/**
 * Input for ShowToast activity.
 */
interface ShowToastInput {
    /**
     * Message/content of the toast
     */
    message: string;
    /**
     * Toast type/color (e.g., 'success', 'danger', 'info', 'warning')
     */
    type?: AXStyleColorType;
    /**
     * Toast title (optional)
     */
    title?: string;
    /**
     * Whether to show close button
     */
    closeButton?: boolean;
    /**
     * Timeout in milliseconds (0 = no timeout)
     */
    timeOut?: number;
    /**
     * Whether to show timeout progress
     */
    timeOutProgress?: boolean;
}
/**
 * Output for ShowToast activity.
 */
interface ShowToastOutput {
}
/**
 * ShowToast Activity (Frontend)
 *
 * Shows a toast notification message to the user.
 * This activity runs on the frontend and displays a temporary notification.
 *
 * Execution Mode: frontend
 * Activity Type: workflow-activity:show-toast
 *
 * Outcomes:
 * - done: Toast was displayed successfully
 */
declare class ShowToastActivity implements AXPCommand<ShowToastInput, {
    output: ShowToastOutput;
    outcomes: Record<string, any>;
}> {
    private readonly toastService;
    private readonly translationService;
    execute(input: ShowToastInput): Promise<AXPExecuteCommandResult<{
        output: ShowToastOutput;
        outcomes: Record<string, any>;
    }>>;
    static ɵfac: i0.ɵɵFactoryDeclaration<ShowToastActivity, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ShowToastActivity>;
}

/**
 * Input for CollectSignature activity.
 */
interface CollectSignatureInput {
    /**
     * Signature request ID
     */
    signatureRequestId: string;
    /**
     * ID of the signer
     */
    signerId: string;
    /**
     * Reference ID of the entity record
     */
    refId: string;
    /**
     * Reference type (module.entity format)
     */
    refType: string;
    /**
     * Message to display to the signer
     */
    message?: string;
}
/**
 * Output for CollectSignature activity.
 */
interface CollectSignatureOutput {
    /**
     * Signature data (base64 encoded image or text)
     */
    signature: string;
    /**
     * Optional note from the signer
     */
    note?: string;
    /**
     * Timestamp when signature was collected
     */
    signedAt: string;
}
/**
 * CollectSignature Activity (Frontend)
 *
 * Collects a signature from a user through a dialog.
 * This activity runs on the frontend and requires user interaction.
 *
 * Execution Mode: frontend
 * Activity Type: workflow-activity:collect-signature
 *
 * Outcomes:
 * - Signed: User provided signature successfully
 * - Cancelled: User cancelled the signature dialog
 */
declare class CollectSignatureActivity implements AXPCommand<CollectSignatureInput, {
    output: CollectSignatureOutput;
    outcomes: Record<string, any>;
}> {
    private readonly layoutBuilder;
    private readonly translationService;
    execute(input: CollectSignatureInput): Promise<AXPExecuteCommandResult<{
        output: CollectSignatureOutput;
        outcomes: Record<string, any>;
    }>>;
    /**
     * Shows a dialog to collect signature from the user.
     */
    private showSignatureDialog;
    static ɵfac: i0.ɵɵFactoryDeclaration<CollectSignatureActivity, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<CollectSignatureActivity>;
}

/**
 * Workflow Activities Definition Provider
 *
 * Provides activity definitions (metadata only).
 * Activity definitions contain metadata for UI and tooling.
 * The `name` property is used as the command key for execution.
 * Reads from entity service (mock data).
 */
declare class AXMWorkflowActivitiesDefinitionProvider implements AXPActivityProvider {
    private readonly entityService;
    private activityDefinitionService;
    getList(categoryId: string): Promise<AXPActivityDefinition[]>;
    getById(name: string): Promise<AXPActivityDefinition | undefined>;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMWorkflowActivitiesDefinitionProvider, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXMWorkflowActivitiesDefinitionProvider>;
}

interface CreateEnityInput {
    module: string;
    entity: string;
}
interface CreateEnityOutput {
    id: string;
}
declare class AXPCreateEntityActivity implements AXPCommand<CreateEnityInput, {
    output: CreateEnityOutput;
    outcomes: Record<string, any>;
}> {
    private entityForm;
    private entityService;
    private translationService;
    protected context: {};
    execute(input: CreateEnityInput): Promise<AXPExecuteCommandResult<{
        output: CreateEnityOutput;
        outcomes: Record<string, any>;
    }>>;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPCreateEntityActivity, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXPCreateEntityActivity>;
}

interface PropertySchema {
    name: string;
    type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'select' | 'any';
    required: boolean;
    description?: string;
    defaultValue?: any;
    options?: Array<{
        value: any;
        label: string;
    }>;
}
interface ActivityInfo {
    type: string;
    name: string;
    description: string;
    icon: string;
    properties: PropertySchema[];
    defaultProperties?: Record<string, any>;
}
interface ExecutionLog {
    timestamp: Date;
    level: 'info' | 'success' | 'warning' | 'error';
    message: string;
    data?: any;
    expanded?: boolean;
}
/**
 * Represents a connection from one outcome to a target node.
 */
interface OutcomeConnection {
    outcome: string;
    targetNodeId: string;
}
interface VisualNode {
    id: string;
    type: string;
    name: string;
    icon: string;
    properties: Record<string, any>;
    position: {
        x: number;
        y: number;
    };
    /**
     * @deprecated Use outcomeConnections instead
     * Simple list of connections (for backward compatibility)
     */
    connections: string[];
    /**
     * Outcome-based connections.
     * Each outcome can connect to a different target.
     */
    outcomeConnections?: OutcomeConnection[];
    /**
     * Available outcomes for this node.
     * Computed from activity descriptor.
     */
    outcomes?: string[];
}
type EditorTab = 'json' | 'visual';
type SettingsTab = 'general' | 'inputs' | 'outputs' | 'variables' | 'advanced';
interface WorkflowSettings {
    definitionId: string;
    name: string;
    description: string;
    inputs: WorkflowInput[];
    outputs: WorkflowOutput[];
    variables: WorkflowVariable[];
    outcomes: string[];
    usableAsActivity: boolean;
    autoUpdateConsumingWorkflows: boolean;
    version: number;
    isLatest: boolean;
    isPublished: boolean;
    toolVersion: string;
    providerName: string;
}
interface WorkflowInput {
    name: string;
    title: string;
    description?: string;
    schema: {
        dataType: string;
        nullable?: boolean;
        readonly?: boolean;
        hidden?: boolean | string;
        defaultValue?: any | string | ((context: any | null) => any);
    };
    validations?: Array<{
        rule: string;
        message?: string;
        options?: any;
    }>;
}
interface WorkflowOutput {
    name: string;
    title: string;
    description?: string;
    schema: {
        dataType: string;
    };
}
interface WorkflowVariable {
    name: string;
    typeName: string;
    value?: any;
    description?: string;
}
declare class WorkflowStudioComponent extends AXPPageLayoutBaseComponent {
    private readonly workflowManager;
    private readonly activityDefinitionService;
    private readonly entityService;
    private readonly translationService;
    private readonly activatedRoute;
    private readonly router;
    private readonly workflowDefinitionService;
    activeTab: i0.WritableSignal<EditorTab>;
    selectedCategory: i0.WritableSignal<AXPActivityCategory | null>;
    selectedActivity: i0.WritableSignal<AXPActivityDefinition | null>;
    workflowJson: i0.WritableSignal<string>;
    visualNodes: i0.WritableSignal<VisualNode[]>;
    selectedNode: i0.WritableSignal<VisualNode | null>;
    isExecuting: i0.WritableSignal<boolean>;
    executionLogs: i0.WritableSignal<ExecutionLog[]>;
    showExecutionDialog: i0.WritableSignal<boolean>;
    workflowInstanceState: i0.WritableSignal<any>;
    showPropertiesPanel: i0.WritableSignal<boolean>;
    showWorkflowSettings: i0.WritableSignal<boolean>;
    activeSettingsTab: i0.WritableSignal<SettingsTab>;
    workflowSettings: i0.WritableSignal<WorkflowSettings>;
    canvasOffset: {
        x: number;
        y: number;
    };
    isDraggingCanvas: boolean;
    dragStartPos: {
        x: number;
        y: number;
    };
    draggedActivity: ActivityInfo | null;
    draggedNode: VisualNode | null;
    nodeDragOffset: {
        x: number;
        y: number;
    };
    connectionSource: {
        node: VisualNode;
        type: 'in' | 'out';
        outcome?: string;
    } | null;
    ngOnInit(): Promise<void>;
    /**
     * Load workflow from route query parameter
     */
    private loadWorkflowFromRoute;
    /**
     * Load workflow by name
     */
    private loadWorkflowByName;
    /**
     * Convert workflow definition to studio JSON format
     */
    private convertWorkflowDefinitionToStudioJson;
    getPageTitle(): Promise<string>;
    getPageDescription(): Promise<string | null>;
    getPrimaryMenuItems(): Promise<AXPActionMenuItem[]>;
    getSecondaryMenuItems(): Promise<AXPActionMenuItem[]>;
    execute(command: AXPExecuteCommand): Promise<void>;
    /**
     * Handle category selection from tree
     */
    onCategoryClick(category: AXPActivityCategory): void;
    /**
     * Handle activity selection from tree
     */
    onActivityClick(activity: AXPActivityDefinition): void;
    /**
     * Convert AXPActivityDefinition to ActivityInfo
     */
    private convertActivityDefinitionToInfo;
    /**
     * Get property type from schema
     */
    private getPropertyTypeFromSchema;
    /**
     * Get category color
     */
    private getCategoryColor;
    /**
     * Get empty workflow JSON
     */
    private getEmptyWorkflow;
    /**
     * Sync visualizer with JSON changes
     */
    syncVisualizerWithJson(): void;
    /**
     * Open execution dialog
     */
    openExecutionDialog(): void;
    /**
     * Close execution dialog
     */
    closeExecutionDialog(): void;
    /**
     * Start workflow execution
     */
    startWorkflowExecution(): Promise<void>;
    /**
     * اجرای workflow
     */
    runWorkflow(): Promise<void>;
    /**
     * اضافه کردن لاگ
     */
    addLog(level: 'info' | 'success' | 'warning' | 'error', message: string, data?: any): void;
    /**
     * کپی کردن نمونه activity
     */
    copyActivityTemplate(activity: ActivityInfo): void;
    /**
     * فرمت کردن JSON
     */
    formatJson(): void;
    /**
     * باز کردن تنظیمات workflow
     */
    openWorkflowSettings(): void;
    /**
     * بستن تنظیمات workflow
     */
    closeWorkflowSettings(): void;
    /**
     * ذخیره تنظیمات workflow
     */
    saveWorkflowSettings(): void;
    /**
     * Export workflow به فرمت Elsa Workflow Definition v3.0.0
     * https://elsaworkflows.io/schemas/workflow-definition/v3.0.0/schema.json
     */
    exportWorkflowDefinition(): any;
    /**
     * دانلود WorkflowDefinition به صورت JSON file
     */
    downloadWorkflowDefinition(): void;
    private generateId;
    /**
     * تغییر تب settings
     */
    switchSettingsTab(tab: SettingsTab): void;
    addWorkflowInput(): void;
    removeWorkflowInput(index: number): void;
    updateWorkflowInput(index: number, field: string, value: any): void;
    updateWorkflowInputSchema(index: number, schemaField: string, value: any): void;
    updateWorkflowInputValidation(index: number, isRequired: boolean): void;
    getInputIsRequired(input: WorkflowInput): boolean;
    addWorkflowOutput(): void;
    removeWorkflowOutput(index: number): void;
    updateWorkflowOutput(index: number, field: string, value: any): void;
    updateWorkflowOutputSchema(index: number, schemaField: string, value: any): void;
    addWorkflowVariable(): void;
    removeWorkflowVariable(index: number): void;
    updateWorkflowVariable(index: number, field: keyof WorkflowVariable, value: any): void;
    /**
     * به‌روزرسانی outcomes از string
     */
    updateOutcomes(outcomesString: string): void;
    /**
     * پاک کردن لاگ‌ها
     */
    clearLogs(): void;
    /**
     * تغییر تب
     */
    switchTab(tab: EditorTab): void;
    /**
     * انتخاب Node
     */
    selectNodeById(node: VisualNode): void;
    /**
     * حذف Node
     */
    deleteNode(nodeId: string): void;
    /**
     * اتصال دو Node با outcome مشخص
     */
    connectNodes(fromId: string, toId: string, outcome?: string): void;
    /**
     * قطع اتصال (با یا بدون outcome)
     */
    disconnectNodes(fromId: string, toId: string, outcome?: string): void;
    /**
     * تبدیل JSON به Visual
     */
    jsonToVisual(): void;
    /**
     * پردازش Activity به Node (recursive)
     */
    private processActivityToNode;
    /**
     * تبدیل Visual به JSON
     */
    visualToJson(): void;
    /**
     * پیدا کردن Root Node
     */
    private findRootNode;
    /**
     * تبدیل Node به Activity (recursive)
     */
    private nodeToActivity;
    /**
     * دریافت آیکون برای نوع Activity
     */
    private getIconForActivityType;
    /**
     * به‌روزرسانی property نود
     */
    updateNodeProperty(nodeId: string, propertyName: string, value: any): void;
    /**
     * پیدا کردن activity info بر اساس type
     */
    private findActivityInfo;
    /**
     * پاک کردن همه نودها
     */
    clearCanvas(): void;
    /**
     * شروع drag از activity list
     */
    onActivityDragStart(event: DragEvent, activity: ActivityInfo): void;
    /**
     * پایان drag از activity list
     */
    onActivityDragEnd(event: DragEvent): void;
    /**
     * drag over روی Canvas
     */
    onCanvasDragOver(event: DragEvent): void;
    /**
     * drag leave از Canvas
     */
    onCanvasDragLeave(event: DragEvent): void;
    /**
     * محاسبه outcomes برای یک activity
     */
    computeOutcomes(activityInfo: ActivityInfo, properties: Record<string, any>): string[];
    /**
     * drop روی Canvas - اضافه کردن activity جدید
     */
    onCanvasDrop(event: DragEvent): void;
    /**
     * شروع drag نود
     */
    onNodeDragStart(event: DragEvent, node: VisualNode): void;
    /**
     * در حال drag نود
     */
    onNodeDrag(event: DragEvent, node: VisualNode): void;
    /**
     * پایان drag نود
     */
    onNodeDragEnd(event: DragEvent, node: VisualNode): void;
    /**
     * کلیک روی کانکتور - برای ایجاد اتصال (برای activities با یک outcome)
     */
    onConnectorClick(event: Event, node: VisualNode, type: 'in' | 'out'): void;
    /**
     * کلیک روی outcome connector - برای activities با چند outcome
     */
    onOutcomeConnectorClick(event: Event, node: VisualNode, outcome: string): void;
    /**
     * تغییر وضعیت نمایش Properties Panel
     */
    togglePropertiesPanel(): void;
    /**
     * پیدا کردن Node با ID
     */
    findNodeById(nodeId: string): VisualNode | undefined;
    /**
     * بررسی اینکه آیا properties خالی است یا نه
     */
    hasProperties(properties: Record<string, any>): boolean;
    /**
     * دسترسی به Object برای استفاده در template
     */
    protected readonly Object: ObjectConstructor;
    /**
     * دسترسی به typeof برای استفاده در template
     */
    protected readonly typeof: (value: any) => "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
    /**
     * دسترسی به JSON برای استفاده در template
     */
    protected readonly JSON: JSON;
    /**
     * دریافت رنگ بر اساس outcome
     */
    protected getOutcomeColor(outcome: string): string;
    /**
     * دریافت نام رنگ برای marker ID
     */
    protected getOutcomeColorName(outcome: string): string;
    /**
     * به‌روزرسانی property با parse کردن JSON
     */
    updateNodePropertyJSON(nodeId: string, propertyName: string, jsonString: string): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<WorkflowStudioComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<WorkflowStudioComponent, "app-workflow-studio", never, {}, {}, never, never, true, never>;
}

declare class AXMActivityCategoriesTreeComponent {
    private readonly activityDefinitionService;
    /**
     * Emitted when a category node is clicked
     */
    categoryClick: i0.OutputEmitterRef<AXPActivityCategory>;
    /**
     * Emitted when an activity node is clicked
     */
    activityClick: i0.OutputEmitterRef<AXPActivityDefinition>;
    /**
     * Category tree data source
     */
    protected readonly categoryTreeDataSource: AXPCategoryTreeDataSource;
    /**
     * Category tree configuration
     */
    protected readonly categoryTreeConfig: i0.Signal<AXPCategoryTreeConfig>;
    /**
     * Category tree actions (disabled CRUD operations)
     */
    protected readonly categoryTreeActions: i0.Signal<AXPCategoryTreeActions>;
    /**
     * Category tree events
     */
    protected readonly categoryTreeEvents: i0.Signal<AXPCategoryTreeEvents>;
    /**
     * Handle category tree node click events
     */
    protected handleNodeClick(entity: AXPCategoryEntity): void;
    /**
     * Map activity categories to category entities
     */
    private mapCategoriesToEntities;
    /**
     * Map activity definitions to category entities
     */
    private mapActivitiesToEntities;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMActivityCategoriesTreeComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXMActivityCategoriesTreeComponent, "axp-activity-categories-tree", never, {}, { "categoryClick": "categoryClick"; "activityClick": "activityClick"; }, never, never, true, never>;
}

/**
 * Configuration for a workflow-specific task provider.
 * One provider per workflow definition – pass definitionId to scope tasks to that definition only.
 */
interface AXPGenericWorkflowTaskProviderConfig {
    /** Unique provider name (e.g. 'leave-request-workflow-tasks', 'document-review-workflow-tasks'). */
    name: string;
    /** Display title in task board type selector. */
    title: string;
    /** Optional icon (default: 'fa-light fa-diagram-project'). */
    icon?: string;
    /**
     * When set, only workflow instances for this definition are shown.
     * One provider = one definition. Omit to show all suspended workflow tasks (single generic provider).
     */
    definitionId?: string;
}
/**
 * Injection token for provider config. Use when registering via DI (provide token + useFactory with deps).
 * When creating via useFactory: () => new AXPGenericWorkflowTaskProvider({ ... }), config is passed in the closure.
 */
declare const AXP_GENERIC_WORKFLOW_TASK_PROVIDER_CONFIG: InjectionToken<AXPGenericWorkflowTaskProviderConfig>;
/**
 * Generic Workflow Task Provider
 *
 * Provides tasks from Workflow Instances directly (no Work Items).
 * Queries suspended workflow instances and extracts tasks from bookmarks.
 *
 * Create one provider per workflow definition by passing a config (name, title, definitionId).
 * E.g. leave request: { name: 'leave-request-workflow-tasks', title: 'Leave Request', definitionId: 'LeaveRequestWorkflow' }
 *
 * Architecture:
 * - Queries Workflow Instances with subStatus = 'Suspended'
 * - Filters by config.definitionId when set (one provider = one definition)
 * - Extracts active bookmarks for each instance
 * - Parses bookmark payload for assignment/actions
 * - Maps to task board format
 */
declare class AXPGenericWorkflowTaskProvider extends AXPWorkflowTaskProvider<Record<string, any>> {
    private readonly config;
    private readonly entityService;
    private readonly workflowInstanceData;
    private readonly translationService;
    private readonly workflowManager;
    constructor(config: AXPGenericWorkflowTaskProviderConfig);
    get name(): string;
    get title(): string;
    get icon(): string;
    /**
     * Get tasks from suspended workflow instances.
     *
     * Queries workflow instances filtered by:
     * - subStatus = 'Suspended'
     * - entityRefType (if provided in filter)
     * - definitionId (if provided in filter)
     * - assignee/claimant (if filter provided)
     *
     * Then extracts active bookmarks and maps to task board format.
     */
    getTasks(options: AXPTaskFilter): Promise<{
        items: AXPTask<Record<string, any>>[];
        total: number;
    }>;
    /**
     * Get active (non-consumed) bookmarks from workflow instance entity.
     * Reads from instance.workflowInstance?.bookmarks — no direct DB access.
     */
    private getActiveBookmarksFromInstance;
    /**
     * Map bookmark to task board task format.
     */
    private mapBookmarkToTask;
    /**
     * Map priority to task board priority.
     */
    private mapPriorityToTaskPriority;
    /**
     * Update tasks (not applicable for workflow instances - they are read-only from task provider perspective).
     */
    updateTasks(tasksToUpdate: AXPTask<Record<string, any>>[]): Promise<AXPTask<Record<string, any>>[]>;
    /**
     * Execute commands on tasks.
     *
     * Supports:
     * - Workflow resume commands (Complete, Cancel)
     */
    executeCommand(command: AXPExecuteCommand): Promise<AXPExecuteCommandResult>;
    /**
     * Get available actions for a task.
     *
     * Extracts actions from bookmark payload.
     */
    getActions(task?: AXPTask<Record<string, any>>): Promise<AXPTaskActionMenuItem[]>;
    getExtraFields(): Promise<AXPExtraField[]>;
    getStatuses(): Promise<AXPTaskStatus[]>;
    getComponent(): (() => Promise<Type<AXPTaskPopoverComponent>>) | Type<AXPTaskPopoverComponent> | null;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPGenericWorkflowTaskProvider, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXPGenericWorkflowTaskProvider>;
}

export { AXCCategoryProvider, AXMActivityCategoriesTreeComponent, AXMMenuProvider, AXMWorkflowActivitiesDefinitionProvider, AXMWorkflowManagementModule, AXMWorkflowManagementModuleEntityProvider, AXPCreateEntityActivity, AXPGenericWorkflowTaskProvider, AXP_GENERIC_WORKFLOW_TASK_PROVIDER_CONFIG, CollectSignatureActivity, ExecuteCommandActivity, ExecuteQueryActivity, HumanTaskActivity, RootConfig, ShowConfirmPopupActivity, ShowLayoutPopupActivity, ShowToastActivity, WorkflowStudioComponent };
export type { AXMWorkflowManagementActivityCategoryEntityModel, AXMWorkflowManagementActivityDefinitionEntityModel, AXMWorkflowManagementWorkflowDefinitionEntityModel, AXMWorkflowManagementWorkflowInstanceEntityModel, AXPGenericWorkflowTaskProviderConfig, CollectSignatureInput, CollectSignatureOutput, CreateEnityInput, CreateEnityOutput, ExecuteCommandInput, ExecuteCommandOutput, ExecuteQueryInput, ExecuteQueryOutput, HumanTaskInput, HumanTaskOutput, ShowConfirmPopupInput, ShowConfirmPopupOutput, ShowLayoutPopupInput, ShowLayoutPopupOutput, ShowToastInput, ShowToastOutput };
