/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */
import _ from 'lodash';
import type FlowModelRepository from '../../repository';
type FlowSurfaceApprovalBlueprintBindingResource = 'workflows' | 'flow_nodes';
type ApprovalBlueprintServiceDeps = {
    contractGuard: {
        validateNodeTreeAgainstContract: (node: Record<string, any>) => void;
    };
    db: {
        getRepository: (resourceName: string) => {
            findOne: (options: Record<string, any>) => Promise<any>;
            update: (options: Record<string, any>) => Promise<any>;
        };
    };
    hasDataSource: (dataSourceKey: string) => boolean;
    repository: Pick<FlowModelRepository, 'findModelById' | 'findModelByParentId' | 'insertModel' | 'upsertModel' | 'patch'>;
    setNodeAsyncFlag: (uid: string, asyncFlag: boolean, transaction?: any) => Promise<void>;
    removeNodeTreeWithBindings: (uid: string, transaction?: any) => Promise<void>;
    surfaceContext: {
        resolveGridNode: (uid: string, transaction?: any) => Promise<any>;
    };
    compose: (values: Record<string, any>, options: {
        transaction?: any;
    }) => Promise<any>;
    addField: (values: Record<string, any>, options: {
        transaction?: any;
    }) => Promise<any>;
    setLayout: (values: Record<string, any>, options: {
        transaction?: any;
    }) => Promise<any>;
    get: (values: Record<string, any>, options: {
        transaction?: any;
    }) => Promise<any>;
    buildComposeLayoutPayload: (input: {
        layout: any;
        createdByKey: Record<string, {
            uid: string;
        }>;
        finalItems: any[];
    }) => Record<string, any>;
    syncApprovalRuntimeConfigForSurfaceRoot: (root: any, transaction?: any) => Promise<void>;
};
export declare class FlowSurfaceApprovalBlueprintService {
    private readonly deps;
    constructor(deps: ApprovalBlueprintServiceDeps);
    private parseApprovalBlueprintCollection;
    private resolveApprovalBlueprintBindingContext;
    private buildApprovalBlueprintSurfaceRootTree;
    private buildApprovalBlueprintPageSurfaceRootTree;
    private getApprovalBlueprintExpectedTabUse;
    private getApprovalBlueprintExpectedGridUse;
    private findApprovalBlueprintSurfaceRoot;
    private createApprovalBlueprintSurfaceRoot;
    private ensureApprovalBlueprintPageSurfaceStructure;
    private ensureApprovalBlueprintTaskCardSurfaceStructure;
    private syncApprovalBlueprintSurfaceAsyncShape;
    private syncApprovalBlueprintSurfaceRoot;
    private ensureApprovalBlueprintSurfaceRoot;
    private persistApprovalBlueprintBinding;
    private applyApprovalBlueprintPageSurface;
    private applyApprovalBlueprintTaskCardSurface;
    applyApprovalBlueprint(values: Record<string, any>, options?: {
        transaction?: any;
    }): Promise<{
        version: string;
        mode: "replace";
        surfaceType: "initiator" | "approver" | "taskCard";
        target: _.Dictionary<any>;
        binding: {
            resourceName: FlowSurfaceApprovalBlueprintBindingResource;
            filterByTk: string | number;
            configPath: string;
        };
        surface: any;
    }>;
}
export {};
