import * as i0 from '@angular/core';
import { Injector } from '@angular/core';
import * as i1 from '@acorex/platform/layout/widget-core';
import { AXPWidgetConfig, AXPValueWidgetComponent, AXPWidgetNode, AXPWidgetCoreContextChangeEvent, AXPMetaDataDefinition } from '@acorex/platform/layout/widget-core';
import { AXPEntity, AXPMenuProvider, AXPMenuProviderContext, AXPSearchCommandProvider, AXPSearchResult, AXPSettingDefinitionProvider, AXPSettingDefinitionProviderContext } from '@acorex/platform/common';
import { AXPEntityModel, AXMEntityCrudServiceImpl, AXPEntityDefinitionLoader, AXPEntityDefinitionPreloader, AXPEntityPreloadEntity, AXPEntityActionPlugin } from '@acorex/platform/layout/entity';
import { AXDataSource } from '@acorex/cdk/common';
import { AXDropListDroppedEvent } from '@acorex/cdk/drag-drop';
import { AXPFilterOperation, AXPFilterLogic, AXPExpressionEvaluatorScopeProvider, AXPExpressionEvaluatorScopeProviderContext, AXPTagProvider, AXPTag } from '@acorex/platform/core';

declare class AXMQueryEntityModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMQueryEntityModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXMQueryEntityModule, never, never, never>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXMQueryEntityModule>;
}

declare class AXMDataSourceEntityModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMDataSourceEntityModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXMDataSourceEntityModule, never, never, never>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXMDataSourceEntityModule>;
}

declare class AXMMetaDataDefinitionEntityModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMMetaDataDefinitionEntityModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXMMetaDataDefinitionEntityModule, never, never, never>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXMMetaDataDefinitionEntityModule>;
}

declare class AXMMetaDataFeatureModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMMetaDataFeatureModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXMMetaDataFeatureModule, never, [typeof i1.AXPWidgetCoreModule], never>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXMMetaDataFeatureModule>;
}

declare class AXMTagEntityModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMTagEntityModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXMTagEntityModule, never, never, never>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXMTagEntityModule>;
}

declare class AXMTagsFeatureModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMTagsFeatureModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXMTagsFeatureModule, never, never, never>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXMTagsFeatureModule>;
}

declare class AXMDataManagementModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMDataManagementModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXMDataManagementModule, never, [typeof i1.AXPWidgetCoreModule, typeof AXMQueryEntityModule, typeof AXMDataSourceEntityModule, typeof AXMMetaDataDefinitionEntityModule, typeof AXMMetaDataFeatureModule, typeof AXMTagEntityModule, typeof AXMTagsFeatureModule], never>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXMDataManagementModule>;
}

declare const RootConfig: {
    config: {
        i18n: string;
    };
    module: {
        route: string;
        name: string;
        title: string;
        icon: string;
    };
    entities: {
        query: {
            name: string;
            title: string;
            titlePlural: string;
            icon: string;
        };
        queryCategory: {
            name: string;
            title: string;
            titlePlural: string;
            icon: string;
        };
        dataSource: {
            name: string;
            title: string;
            titlePlural: string;
            icon: string;
        };
        dataSourceCategory: {
            name: string;
            title: string;
            titlePlural: string;
            icon: string;
        };
        metaDataDefinition: {
            name: string;
            title: string;
            titlePlural: string;
            icon: string;
        };
        tag: {
            name: string;
            source: string;
            title: string;
            icon: string;
        };
    };
};

declare function queryFactory(injector: Injector): Promise<AXPEntity | null>;

interface AXMDataManagementQueryEntityModel extends AXPEntityModel<string> {
    name: string;
    title: string;
    categoryIds?: string[];
    categories?: Array<{
        id: string;
        title: string;
    }>;
}
type AXMQueryEntityModel = AXMDataManagementQueryEntityModel;

declare abstract class AXMQueryService extends AXMEntityCrudServiceImpl<string, AXMDataManagementQueryEntityModel> {
}
declare class AXMQueryServiceImpl extends AXMQueryService {
    constructor();
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMQueryServiceImpl, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXMQueryServiceImpl>;
}

declare function dataSourceEntityFactory(injector: Injector): Promise<AXPEntity | null>;

declare enum AXMDataSourceOutputType {
    Table = "table",
    SingleObject = "single_object",
    Value = "value"
}
interface AXMDataSourceOutputTypeOption {
    name: AXMDataSourceOutputType;
    title: string;
}
declare enum AXMDataSourceType {
    Static = "static",
    Query = "query"
}
interface AXMDataSourceTypeOption {
    name: AXMDataSourceType;
    title: string;
}
interface AXMDataSourceFilter {
    columnName: string;
    defaultValue: any;
    isSystemFilter: boolean;
    isRequired: boolean;
}
interface AXMDataSourceEntityModel<T = string> extends AXPEntityModel<T> {
    name: string;
    title: string;
    categoryIds?: string[];
    sourceStatic: any[];
    sourceEntity: T;
    sourceType: AXMDataSourceTypeOption;
    outputType: AXMDataSourceOutputTypeOption;
    filters?: AXMDataSourceFilter[];
}

declare abstract class AXMDataSourceService<T = string> extends AXMEntityCrudServiceImpl<T, AXMDataSourceEntityModel<T>> {
}
declare class AXMDataSourceServiceImpl extends AXMEntityCrudServiceImpl<string, AXMDataSourceEntityModel> {
    constructor();
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMDataSourceServiceImpl, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXMDataSourceServiceImpl>;
}

declare const AXM_COLUMN_DEF_WIDGET: {
    type: string;
    mode: string;
    options: {
        direction: string;
    };
    children: ({
        type: string;
        mode: string;
        options: {
            colSpan: number;
        };
        children: {
            type: string;
            mode: string;
            path: string;
            options: {
                placeholder: string;
                required: boolean;
            };
        }[];
    } | {
        type: string;
        options: {
            colSpan: number;
        };
        mode: string;
        children: {
            type: string;
            mode: string;
            path: string;
            options: {
                placeholder: string;
                valueField: string;
                textField: string;
                dataSource: AXDataSource<i1.AXPWidgetConfig<any> | undefined>;
                direction: string;
                multiple: boolean;
                required: boolean;
            };
        }[];
    } | {
        type: string;
        options: {
            colSpan: number;
        };
        mode: string;
        children: {
            type: string;
            mode: string;
            path: string;
            options: {
                tooltip: string;
                label: string;
            };
            triggers: {
                event: string;
                action: string;
            }[];
        }[];
    } | {
        type: string;
        options: {
            colSpan: number;
        };
        mode: string;
        children: {
            type: string;
            mode: string;
            path: string;
            options: {
                tooltip: string;
                label: string;
            };
        }[];
    })[];
}[];

declare const AXM_FILTER_DEF_WIDGET: {
    type: string;
    mode: string;
    children: ({
        type: string;
        mode: string;
        options: {
            colSpan: number;
        };
        children: {
            type: string;
            mode: string;
            path: string;
            options: {
                columns: string;
                placeholder: string;
            };
        }[];
        triggers: {
            event: string;
            action: string;
        }[];
    } | {
        type: string;
        options: {
            colSpan: number;
        };
        mode: string;
        children: {
            type: string;
            mode: string;
            path: string;
            options: {
                label: string;
                tooltip: string;
            };
        }[];
        triggers?: undefined;
    })[];
}[];

interface AXMColumnFilterSelectorWidgetConfigType {
    columns?: Array<{
        name: string;
        title: string;
        type: string;
    }>;
}
declare const AXMColumnFilterSelectorWidget: AXPWidgetConfig<AXMColumnFilterSelectorWidgetConfigType>;

interface ColumnFilterValue {
    columnName?: string;
    value?: any;
}
declare class AXMColumnFilterSelectorWidgetEditComponent extends AXPValueWidgetComponent<ColumnFilterValue> {
    #private;
    protected disabled: i0.Signal<boolean>;
    protected columns: i0.Signal<{
        name: string;
        title: string;
        type: string;
    }[]>;
    protected columnsDataSource: i0.Signal<AXDataSource<{
        name: string;
        title: string;
        type: string;
    }>>;
    protected selectedColumn: i0.Signal<{
        name: string;
        title: string;
        type: string;
    } | null | undefined>;
    protected filterWidgetNode: i0.Signal<AXPWidgetNode | null>;
    protected handleColumnChange(event: any): void;
    protected handleWidgetValueChange(event: AXPWidgetCoreContextChangeEvent): void;
    protected getWidgetTypeForColumn(columnType: string): string;
    private get __hostClass();
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMColumnFilterSelectorWidgetEditComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXMColumnFilterSelectorWidgetEditComponent, "axm-column-filter-selector-widget-edit", never, {}, {}, never, never, true, never>;
}

declare class AXMColumnFilterSelectorWidgetViewComponent extends AXPValueWidgetComponent<ColumnFilterValue> {
    protected currentValue: i0.Signal<ColumnFilterValue>;
    protected displayValue: i0.Signal<string>;
    private get __hostClass();
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMColumnFilterSelectorWidgetViewComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXMColumnFilterSelectorWidgetViewComponent, "axm-column-filter-selector-widget-view", never, {}, {}, never, never, true, never>;
}

declare class AXMColumnFilterSelectorWidgetColumnComponent extends AXPValueWidgetComponent<ColumnFilterValue> {
    protected currentValue: i0.Signal<ColumnFilterValue>;
    protected displayValue: i0.Signal<string>;
    private get __hostClass();
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMColumnFilterSelectorWidgetColumnComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXMColumnFilterSelectorWidgetColumnComponent, "axm-column-filter-selector-widget-column", never, {}, {}, never, never, true, never>;
}

declare class AXMColumnFilterSelectorWidgetFilterComponent extends AXPValueWidgetComponent<ColumnFilterValue> {
    protected handleValueChange(event: any): void;
    private get __hostClass();
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMColumnFilterSelectorWidgetFilterComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXMColumnFilterSelectorWidgetFilterComponent, "axm-column-filter-selector-widget-filter", never, {}, {}, never, never, true, never>;
}

declare class AXMColumnFilterSelectorWidgetPrintComponent extends AXPValueWidgetComponent<ColumnFilterValue> {
    protected currentValue: i0.Signal<ColumnFilterValue>;
    protected displayValue: i0.Signal<string>;
    private get __hostClass();
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMColumnFilterSelectorWidgetPrintComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXMColumnFilterSelectorWidgetPrintComponent, "axm-column-filter-selector-widget-print", never, {}, {}, never, never, true, never>;
}

declare function metaDataDefinitionFactory(injector: Injector): Promise<AXPEntity | null>;

interface AXMMetaDataDefinitionEntityModel<T = string> extends AXPEntityModel<T>, AXPMetaDataDefinition {
}

declare abstract class AXMMetaDataDefinitionService<T = string> extends AXMEntityCrudServiceImpl<T, AXMMetaDataDefinitionEntityModel<T>> {
}
declare class AXMPMetaDataDefinitionServiceImpl extends AXMMetaDataDefinitionService<string> {
    constructor();
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMPMetaDataDefinitionServiceImpl, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXMPMetaDataDefinitionServiceImpl>;
}

declare function factory(injector: Injector): Promise<AXPEntity | null>;

declare class AXMTagEntityService extends AXMEntityCrudServiceImpl<any, any> {
    constructor();
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMTagEntityService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXMTagEntityService>;
}

/**
 * Tag entity model
 */
interface AXMTag {
    id: string;
    text: string;
    color: string;
    icon?: string;
    description?: string;
    scope: 'system' | 'tenant' | 'user';
    isReadonly?: boolean;
    createdBy?: string;
    createdAt?: Date;
    updatedAt?: Date;
}

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

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

declare const AXPDataManagementMenuKeys: {
    readonly Root: "data-management:menu";
    readonly Queries: "data-management:menu:queries";
    readonly DataSources: "data-management:menu:data-sources";
    readonly MetaDataDefinitions: "data-management:menu:metadata-definitions";
    readonly Tags: "data-management:menu:tags";
};

declare class AXMSearchCommandProvider extends AXPSearchCommandProvider {
    commands: AXPSearchResult[];
}

declare class AXMSettingProvider implements AXPSettingDefinitionProvider {
    provide(context: AXPSettingDefinitionProviderContext): Promise<void>;
}

declare const AXPQueryBuilderWidget: AXPWidgetConfig<AXPQueryBuilderWidgetConfigType>;
type AXPQueryBuilderWidgetConfigType = {
    type: 'editor';
};

type SelectedField = {
    id: string;
    field: string;
    operator: AXPFilterOperation['type'];
    value: any;
};

interface QueryBuilderCondition$2 {
    id: string;
    type: 'condition';
    title: string;
    field: string;
    value?: any;
    operator: AXPFilterOperation;
    widget: {
        type: string;
    };
}
interface QueryBuilderGroup$2 {
    id: string;
    type: 'group';
    logic: AXPFilterLogic;
    filters: (QueryBuilderCondition$2 | QueryBuilderGroup$2)[];
}
interface QueryBuilderData$2 extends QueryBuilderGroup$2 {
}
declare class AXPQueryBuilderWidgetEditComponent extends AXPValueWidgetComponent<QueryBuilderData$2> {
    protected queryData: i0.WritableSignal<QueryBuilderData$2>;
    protected selectedDataSource: i0.WritableSignal<any>;
    protected readonly logicalOperators: {
        value: string;
        text: string;
    }[];
    protected readonly availableDataSources: i0.Signal<any>;
    protected readonly availableFields: i0.Signal<any>;
    constructor();
    private initializeFromValue;
    private generateId;
    private updateValue;
    private findItemById;
    private findGroupById;
    addCondition(): void;
    addGroup(): void;
    addConditionToGroup(groupId: string): void;
    addGroupToGroup(parentGroupId: string): void;
    removeItem(id: string): void;
    updateCondition(condition: SelectedField): void;
    updateRootLogicalOperator(operator: AXPFilterLogic): void;
    updateGroupLogicalOperator(groupId: string, operator: AXPFilterLogic): void;
    clearAll(): void;
    getTotalItemsCount(): number;
    reorderRootItems(event: AXDropListDroppedEvent): void;
    reorderGroupItems(groupId: string, previousIndex: number, currentIndex: number): void;
    reorderGroupItemsEvent(groupId: string, event: AXDropListDroppedEvent): void;
    moveItemUp(index: number, parentId: string): void;
    moveItemDown(index: number, parentId: string): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPQueryBuilderWidgetEditComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXPQueryBuilderWidgetEditComponent, "axp-query-builder-widget-edit", never, {}, {}, never, never, true, never>;
}

interface QueryBuilderCondition$1 {
    id: string;
    type: 'condition';
    title: string;
    field: string;
    value?: any;
    operator: AXPFilterOperation;
    widget: {
        type: string;
        options?: any;
    };
    filterType: {
        advance: boolean;
        inline: boolean;
    };
}
interface QueryBuilderGroup$1 {
    id: string;
    type: 'group';
    logic: AXPFilterLogic;
    filters: (QueryBuilderCondition$1 | QueryBuilderGroup$1)[];
}
interface QueryBuilderData$1 extends QueryBuilderGroup$1 {
}
declare class AXPQueryBuilderWidgetViewComponent extends AXPValueWidgetComponent<QueryBuilderData$1> {
    protected queryData: i0.Signal<QueryBuilderData$1>;
    getTotalItemsCount(): number;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPQueryBuilderWidgetViewComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXPQueryBuilderWidgetViewComponent, "axp-query-builder-widget-view", never, {}, {}, never, never, true, never>;
}

interface QueryBuilderCondition {
    id: string;
    type: 'condition';
    title: string;
    field: string;
    value?: any;
    operator: AXPFilterOperation;
    widget: {
        type: string;
        options?: any;
    };
    filterType: {
        advance: boolean;
        inline: boolean;
    };
}
interface QueryBuilderGroup {
    id: string;
    type: 'group';
    logic: AXPFilterLogic;
    filters: (QueryBuilderCondition | QueryBuilderGroup)[];
}
interface QueryBuilderData extends QueryBuilderGroup {
}
declare class AXPQueryBuilderWidgetColumnComponent extends AXPValueWidgetComponent<QueryBuilderData> {
    protected queryData: i0.Signal<QueryBuilderData>;
    getTotalItemsCount(): number;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPQueryBuilderWidgetColumnComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXPQueryBuilderWidgetColumnComponent, "axp-query-builder-widget-column", never, {}, {}, never, never, true, never>;
}

declare class AXPQueryBuilderWidgetDesignerComponent extends AXPValueWidgetComponent<any> {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPQueryBuilderWidgetDesignerComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXPQueryBuilderWidgetDesignerComponent, "axp-query-builder-widget-designer", never, {}, {}, never, never, true, never>;
}

/**
 * Metadata Evaluator Scope Provider
 *
 * Provides expression evaluation capabilities for metadata operations:
 * - Get category IDs from context/expressions
 * - Retrieve metadata by category IDs
 * - Access category metadata inheritance
 */
declare class AXMMetadataEvaluatorScopeProvider implements AXPExpressionEvaluatorScopeProvider {
    private readonly queryService;
    private readonly entityDefinitionRegistryService;
    private readonly injector;
    provide(context: AXPExpressionEvaluatorScopeProviderContext): Promise<void>;
}

declare const META_DATA_SELECTOR_FIELD = "metaDataList";
declare const META_DATA_FORM_FIELD = "metaDataForm";

/**
 * Default system tag provider
 * Provides readonly system-level tags
 */
declare class AXPSystemTagProvider extends AXPTagProvider {
    name: string;
    /**
     * Provide default system tags
     */
    provide(): Promise<AXPTag[]>;
}

declare const tagsPlugin: AXPEntityActionPlugin;

export { AXMColumnFilterSelectorWidget, AXMColumnFilterSelectorWidgetColumnComponent, AXMColumnFilterSelectorWidgetEditComponent, AXMColumnFilterSelectorWidgetFilterComponent, AXMColumnFilterSelectorWidgetPrintComponent, AXMColumnFilterSelectorWidgetViewComponent, AXMDataManagementModule, AXMDataSourceEntityModule, AXMDataSourceOutputType, AXMDataSourceService, AXMDataSourceServiceImpl, AXMDataSourceType, AXMEntityProvider, AXMMenuProvider, AXMMetaDataDefinitionEntityModule, AXMMetaDataDefinitionService, AXMMetaDataFeatureModule, AXMMetadataEvaluatorScopeProvider, AXMPMetaDataDefinitionServiceImpl, AXMQueryEntityModule, AXMQueryService, AXMQueryServiceImpl, AXMSearchCommandProvider, AXMSettingProvider, AXMTagEntityModule, AXMTagEntityService, AXMTagsFeatureModule, AXM_COLUMN_DEF_WIDGET, AXM_FILTER_DEF_WIDGET, AXPDataManagementMenuKeys, AXPQueryBuilderWidget, AXPQueryBuilderWidgetColumnComponent, AXPQueryBuilderWidgetDesignerComponent, AXPQueryBuilderWidgetEditComponent, AXPQueryBuilderWidgetViewComponent, AXPSystemTagProvider, META_DATA_FORM_FIELD, META_DATA_SELECTOR_FIELD, RootConfig, dataSourceEntityFactory, factory, metaDataDefinitionFactory, queryFactory, tagsPlugin };
export type { AXMColumnFilterSelectorWidgetConfigType, AXMDataManagementQueryEntityModel, AXMDataSourceEntityModel, AXMDataSourceFilter, AXMDataSourceOutputTypeOption, AXMDataSourceTypeOption, AXMMetaDataDefinitionEntityModel, AXMQueryEntityModel, AXMTag, AXPQueryBuilderWidgetConfigType, ColumnFilterValue, QueryBuilderCondition$2 as QueryBuilderCondition };
