import { BpmnType, DeleteProcessInstanceQuery, ProcessDefinition, ProcessInstanceList, ProcessInstanceQuery, ProcessInstanceSortSettings, ProcessModel, Identity as PublicIdentity } from '@5minds/processcube_engine_sdk';
import { InternalIdentity as Identity } from '../../Contracts/InternalDataModels/index';
import { CoreAccessService } from '../../Core/index';
import { ProxyConfiguration } from '../../Setups/EngineRouter';
import { ProcessInstanceDatabaseAdapter } from '../../Tools/DatabaseAdaptersSequelize';
import { IamService, IdentityService } from '../../Tools/Iam/index';
import { ProcessDefinitionMediator } from '../../Tools/ProcessDefinitionMediator';
export declare class ProcessInstanceService {
    private readonly coreAccess;
    private readonly iamService;
    private readonly identityService;
    private readonly logger;
    private readonly processDefinitionMediator;
    private readonly processInstanceDatabaseAdapter;
    private readonly config;
    constructor(coreAccess: CoreAccessService, iamService: IamService, identityService: IdentityService, processDefinitionMediator: ProcessDefinitionMediator, processInstanceDatabaseAdapter: ProcessInstanceDatabaseAdapter);
    query(identity: Identity, query: ProcessInstanceQuery, offset?: number, limit?: number, sortSettings?: ProcessInstanceSortSettings, includeXml?: boolean, includeCount?: boolean): Promise<ProcessInstanceList>;
    getChildProcessInstanceIds(identity: Identity, processInstanceId: string, parentFlowNodeType?: BpmnType.subProcess | BpmnType.callActivity, includeNested?: boolean): Promise<Array<string>>;
    getAncestorProcessInstanceIds(identity: Identity, processInstanceId: string, onlyForEmbeddedProcesses?: boolean): Promise<Array<string>>;
    getProcessDefinition(identity: Identity, processInstanceId: string, includeXml?: boolean): Promise<ProcessDefinition>;
    getProcessModel(identity: Identity, processInstanceId: string): Promise<ProcessModel>;
    transferOwnership(identity: Identity, processInstanceId: string, newOwner: PublicIdentity): Promise<void>;
    terminateProcessInstance(identity: Identity, processInstanceId: string): Promise<void>;
    private ensureUserIsAllowedToTerminateProcessInstance;
    retryProcessInstance(identity: Identity, processInstanceId: string, flowNodeInstanceId?: string, newStartToken?: any, updateProcessModel?: boolean): Promise<void>;
    deleteProcessInstances(identity: Identity, processInstanceQuery: DeleteProcessInstanceQuery, deleteAllRelatedData?: boolean): Promise<void>;
    private getAuthorizationQueryForIdentity;
    private getProcessInstanceById;
    private getRootProcessOfProcessInstanceTree;
    private ensureProcessInstanceSetCanBeDeleted;
    private processInstanceBelongsToDifferentUser;
    private sanitizeProcessInstance;
    private ensureHasClaim;
}
export interface ProcessInstanceServiceProxy {
    query(identity: Identity, query: ProcessInstanceQuery, offset?: number, limit?: number, sortSettings?: ProcessInstanceSortSettings, includeXml?: boolean, includeCount?: boolean): Promise<ProcessInstanceList>;
    getProcessDefinition(identity: Identity, processInstanceId: string, includeXml?: boolean): Promise<ProcessDefinition>;
    getProcessModel(identity: Identity, processInstanceId: string): Promise<ProcessModel>;
    getChildProcessInstanceIds(identity: Identity, processInstanceId: string, parentFlowNodeType?: BpmnType.subProcess | BpmnType.callActivity, includeNested?: boolean): Promise<Array<string>>;
    getAncestorProcessInstanceIds(identity: Identity, processInstanceId: string, onlyForEmbeddedProcesses?: boolean): Promise<Array<string>>;
    terminateProcessInstance(identity: Identity, processInstanceId: string): Promise<void>;
    transferOwnership(identity: Identity, processInstanceId: string, newOwner: PublicIdentity): Promise<void>;
    retryProcessInstance(identity: Identity, processInstanceId: string, flowNodeInstanceId?: string, newStartToken?: any, updateProcessModel?: boolean): Promise<void>;
    deleteProcessInstances(identity: Identity, processInstanceQuery: DeleteProcessInstanceQuery, deleteAllRelatedData?: boolean): Promise<void>;
}
export declare const ProcessInstanceServiceProxyConfiguration: ProxyConfiguration;
