import * as i0 from '@angular/core';
import { InjectionToken } from '@angular/core';
import * as i1 from '@acorex/platform/layout/widgets';
import * as i3 from '@acorex/platform/layout/widget-core';
import { AXPValueWidgetComponent, AXPWidgetNode, AXPWidgetConfig, AXPWidgetCategory } from '@acorex/platform/layout/widget-core';
import * as i4 from '@acorex/platform/workflow';
import { AXPWorkflow } from '@acorex/platform/workflow';
import { AXPEntityCreateDto, AXPEntityDetailDto, AXPEntityListItemDto, AXPEntityUpdateDto, AXMEntityCrudServiceImpl } from '@acorex/platform/layout/entity';
import { AXPDesignerConnector, AXPDesignerContent, AXPDesignerWidgetComponent } from '@acorex/platform/layout/designer';
import { AXMenuItem } from '@acorex/components/menu';
import { AXPQueryRequest } from '@acorex/platform/core';

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

declare class AXMFormTemplateManagementModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMFormTemplateManagementModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXMFormTemplateManagementModule, never, [typeof i1.AXPWidgetsModule, typeof AXMFormTemplateManagementTemplateEntityModule, typeof i3.AXPWidgetCoreModule, typeof i4.AXPWorkflowModule], never>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXMFormTemplateManagementModule>;
}

interface AXMCreateFormTemplateDto extends AXPEntityCreateDto {
    code: string;
    title: string;
    description?: string;
    template?: string | null;
    typeId: number;
    categoryIds: string[];
}
interface AXMUpdateFormTemplateDto extends AXPEntityUpdateDto<string> {
    title: string;
    description?: string;
    typeId: number;
    template?: string;
    categoryIds: string[];
}
interface AXMFormTemplateDetailDto extends AXPEntityDetailDto<string> {
    title: string;
    description?: string;
    typeId: number;
    type: number;
    template: string | null;
    categoryIds: string[];
    categories: {
        id: string;
        title: string;
    }[];
}
interface AXMFormTemplateListItemDto extends AXPEntityListItemDto<string> {
    title: string;
    description?: string;
    typeId: number;
    type: number;
    categoryIds: string[];
    categories: {
        id: string;
        title: string;
    }[];
}
declare const AXMFormTemplateTypes: {
    Form: {
        id: number;
        title: string;
    };
    Widget: {
        id: number;
        title: string;
    };
    Report: {
        id: number;
        title: string;
    };
};

declare abstract class AXMFormTemplateManagementTemplateEntityService extends AXMEntityCrudServiceImpl<string, AXMFormTemplateDetailDto, AXMFormTemplateListItemDto, AXMCreateFormTemplateDto, AXMUpdateFormTemplateDto> {
}
declare class AXMFormTemplateManagementTemplateEntityServiceImpl extends AXMFormTemplateManagementTemplateEntityService {
    constructor();
    static ɵfac: i0.ɵɵFactoryDeclaration<AXMFormTemplateManagementTemplateEntityServiceImpl, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXMFormTemplateManagementTemplateEntityServiceImpl>;
}

declare const AXPFormTemplateManagementMenuKeys: {
    readonly Root: "FormTemplateManagement:Menu";
    readonly Templates: "FormTemplateManagement:Menu:Templates";
};

declare const AXPFormTemplateManagementPermissionKeys: {
    readonly FormTemplate: {
        readonly Templates: {
            readonly Management: "FormTemplateManagement:Permission:Template.Management";
            readonly View: "FormTemplateManagement:Permission:Template.View";
            readonly Edit: "FormTemplateManagement:Permission:Template.Edit";
            readonly Delete: "FormTemplateManagement:Permission:Template.Delete";
            readonly Create: "FormTemplateManagement:Permission:Template.Create";
        };
    };
};

declare const RootConfig: {
    config: {
        i18n: string;
        module: string;
    };
    module: {
        route: string;
        name: string;
        title: string;
        icon: string;
    };
    entities: {
        template: {
            name: string;
            title: string;
            source: string;
            icon: string;
        };
    };
};

declare class AXPDesignerConnectorImpl extends AXPDesignerConnector {
    private workflow;
    private entityService;
    private templateEntityService;
    private categoryEntityDataAccessor;
    save(id: string, content: AXPDesignerContent): Promise<boolean>;
    saveAs(content: AXPDesignerContent): Promise<boolean>;
    load(id: string): Promise<string | null>;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPDesignerConnectorImpl, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXPDesignerConnectorImpl>;
}

declare const AXMCreateFormTemplateWorkflow: AXPWorkflow;

declare const AXMDesignFormTemplateWorkflow: AXPWorkflow;

declare class AXPTemplateWidgetViewComponent extends AXPValueWidgetComponent {
    private metaKey;
    private templateProvider;
    protected templateId: i0.Signal<string>;
    protected nodes: i0.WritableSignal<AXPWidgetNode[]>;
    constructor();
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPTemplateWidgetViewComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXPTemplateWidgetViewComponent, "axp-template-widget-view", never, {}, {}, never, never, true, never>;
}

declare const AXP_DESIGNER_TEMPLATE_WIDGET_CHOOSE_MENU: AXMenuItem;
declare class AXPTemplateWidgetDesignerComponent extends AXPValueWidgetComponent<any> implements AXPDesignerWidgetComponent {
    private templateProvider;
    private designerService;
    protected templateId: i0.Signal<string>;
    protected nodes: i0.WritableSignal<AXPWidgetNode[]>;
    protected title: i0.WritableSignal<string | null>;
    constructor();
    handleChooseWidget(): Promise<void>;
    private get __class();
    onContextMenu(context: {
        items: AXMenuItem[];
    }): void;
    executeCommand(command: {
        name: string;
        data?: any;
        handled: boolean;
    }): Promise<void>;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPTemplateWidgetDesignerComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXPTemplateWidgetDesignerComponent, "axp-template-widget-designer", never, {}, {}, never, never, true, never>;
}

declare const AXPTemplateWidget: AXPWidgetConfig<AXPBlockWidgetConfigType>;
type AXPBlockWidgetConfigType = {
    type: 'container';
};

interface AXPTemplateWidgetListItem {
    id: string;
    title: string;
    description?: string;
    icon?: string;
    group: AXPWidgetCategory;
}
interface AXPTemplateWidgetItem {
    id: string;
    title: string;
    nodes: AXPWidgetNode[];
}
interface AXPTemplateWidgetProvider {
    items(query?: AXPQueryRequest): Promise<AXPTemplateWidgetListItem[]>;
    get(id: string): Promise<AXPTemplateWidgetItem | null>;
}
declare const AXP_TEMPLATE_WIDGET_PROVIDER: InjectionToken<AXPTemplateWidgetProvider[]>;
declare class AXPTemplateWidgetProviderService implements AXPTemplateWidgetProvider {
    private popupService;
    private translate;
    private providers;
    items(query?: AXPQueryRequest): Promise<AXPTemplateWidgetListItem[]>;
    get(id: string): Promise<AXPTemplateWidgetItem | null>;
    chooseTemplate(): Promise<AXPTemplateWidgetListItem | null>;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPTemplateWidgetProviderService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AXPTemplateWidgetProviderService>;
}

declare class AXPTemplateDesignerWidgetViewComponent extends AXPValueWidgetComponent<any> {
    private workflow;
    protected embedded: i0.Signal<string | null>;
    protected handleClick(): Promise<void>;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXPTemplateDesignerWidgetViewComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXPTemplateDesignerWidgetViewComponent, "ng-component", never, {}, {}, never, never, true, never>;
}

declare const AXPTemplateDesignerWidget: AXPWidgetConfig;
declare module '@acorex/platform/layout/widget-core' {
    interface AXPWidgetTypesMap {
        templateDesigner: 'template-designer';
    }
}

export { AXMCreateFormTemplateWorkflow, AXMDesignFormTemplateWorkflow, AXMFormTemplateManagementModule, AXMFormTemplateManagementTemplateEntityModule, AXMFormTemplateManagementTemplateEntityService, AXMFormTemplateManagementTemplateEntityServiceImpl, AXMFormTemplateTypes, AXPDesignerConnectorImpl, AXPFormTemplateManagementMenuKeys, AXPFormTemplateManagementPermissionKeys, AXPTemplateDesignerWidget, AXPTemplateDesignerWidgetViewComponent, AXPTemplateWidget, AXPTemplateWidgetDesignerComponent, AXPTemplateWidgetProviderService, AXPTemplateWidgetViewComponent, AXP_DESIGNER_TEMPLATE_WIDGET_CHOOSE_MENU, AXP_TEMPLATE_WIDGET_PROVIDER, RootConfig };
export type { AXMCreateFormTemplateDto, AXMFormTemplateDetailDto, AXMFormTemplateListItemDto, AXMUpdateFormTemplateDto, AXPBlockWidgetConfigType, AXPTemplateWidgetItem, AXPTemplateWidgetListItem, AXPTemplateWidgetProvider };
