import { EntityUpdateContext, IFunctionStartContext, IFunctionStopContext } from './context.js';
import { FunctionInstanceObj, ProcessInstanceObj } from './objects.js';
import { Prettify } from './types.js';
export type IEntity = IObj | ICnx;
export interface EntityEventsPayload {
    events: EntityEvent[];
    refreshState?: boolean;
}
export interface DiagramCellEndpoint {
    cellId: string;
    port?: string;
}
export interface DiagramCellPortItem {
    id: string;
    group?: string;
    args?: Record<string, unknown>;
}
export interface DiagramCellPorts {
    groups?: Record<string, unknown>;
    items?: DiagramCellPortItem[];
}
export interface DiagramCellLabel {
    position?: number;
    attrs?: Record<string, unknown>;
}
export interface DiagramCell {
    id: string;
    cellType: 'obj' | 'cnx' | 'text';
    entityId?: string;
    position?: {
        x: number;
        y: number;
    };
    size?: {
        width: number;
        height: number;
    };
    angle?: number;
    z?: number;
    source?: DiagramCellEndpoint;
    target?: DiagramCellEndpoint;
    vertices?: Array<{
        x: number;
        y: number;
    }>;
    text?: string;
    name?: string;
    type?: string;
    attrs?: Record<string, unknown>;
    ports?: DiagramCellPorts;
    connector?: Record<string, unknown>;
    labels?: DiagramCellLabel[];
}
interface IEntityBase {
    entityType: 'obj' | 'cnx';
    id: string;
    key: string;
    typeOf: string;
    name?: string;
    instanceOf?: string;
    instanceOfId: string | undefined;
    childOf?: string;
    description?: string;
    data?: Record<string, unknown>;
    tags: {
        [key: string]: string;
    };
    attributes: {
        [key: string]: string | number | boolean | object;
    };
    createdBy?: string;
    createdAt: number;
    updatedBy?: string;
    updatedAt?: number;
    displayName: string;
}
export interface IObj extends IEntityBase {
    entityType: 'obj';
}
export interface ICnx extends IEntityBase {
    entityType: 'cnx';
    fromObjId: string;
    fromObjKey: string;
    fromObjTypeOf: string;
    fromObjInstanceOf?: string;
    toObjId: string;
    toObjKey: string;
    toObjTypeOf: string;
    toObjInstanceOf?: string;
}
declare abstract class Entity implements IEntityBase {
    abstract readonly entityType: 'obj' | 'cnx';
    readonly id: string;
    readonly key: string;
    readonly typeOf: string;
    instanceOf?: string;
    name?: string;
    childOf?: string;
    description?: string;
    data?: Record<string, unknown>;
    tags: {
        [key: string]: string;
    };
    attributes: {
        [key: string]: string | number | boolean | object;
    };
    createdBy?: string;
    createdAt: number;
    updatedBy?: string;
    updatedAt?: number;
    get displayName(): string;
    get instanceOfId(): string | undefined;
    constructor(entityOpts: Prettify<Partial<IEntityBase> & {
        id: string;
        key: string;
        typeOf: string;
    }>);
}
export declare abstract class Obj<T extends string = string> extends Entity implements IObj {
    readonly entityType: "obj";
    abstract readonly typeOf: T;
    constructor(objOpts: Prettify<Partial<IObj> & {
        typeOf: string;
    }>);
}
export declare class Cnx extends Entity implements ICnx {
    readonly entityType = "cnx";
    readonly typeOf: string;
    fromObjId: string;
    fromObjKey: string;
    fromObjTypeOf: string;
    fromObjInstanceOf?: string;
    toObjId: string;
    toObjKey: string;
    toObjTypeOf: string;
    toObjInstanceOf?: string;
    constructor(cnxOpts: Prettify<(Partial<ICnx> & {
        id: string;
    }) | (Partial<ICnx> & {
        typeOf: string;
    })>);
}
export type EangEventTypes = (typeof EangEventType)[keyof typeof EangEventType];
export declare const EangEventType: {
    readonly create: "create";
    readonly update: "update";
    readonly delete: "delete";
    readonly start: "start";
    readonly stop: "stop";
};
export interface EntityEventOptions {
    tenant: string;
    organizationalUnit: string;
    user: string;
}
export declare class EntityEvent {
    entity: Obj | Cnx;
    eventType: EangEventTypes;
    context?: any;
    tenant?: string;
    organizationalUnit?: string;
    user?: string;
    private constructor();
    static parse(entity: Obj | Cnx, eventType: EangEventTypes, context?: any, options?: EntityEventOptions): EntityEvent;
    static create<T extends IEntity>(entity: T, options?: EntityEventOptions): EntityEvent;
    static update<T extends IEntity>(entity: T, context?: EntityUpdateContext, options?: EntityEventOptions): EntityEvent;
    static delete<T extends IEntity>(entity: T, options?: EntityEventOptions): EntityEvent;
    static start(entity: FunctionInstanceObj | ProcessInstanceObj, context?: IFunctionStartContext, options?: EntityEventOptions): EntityEvent;
    static stop(entity: ProcessInstanceObj | FunctionInstanceObj, context?: IFunctionStopContext, options?: EntityEventOptions): EntityEvent;
}
export declare function parseCombinedId(id: string): {
    typeOf: string;
    key: string;
};
/**
 * Converts an entity (Obj or Cnx) to ArangoDB document format
 * @param entity The entity to convert
 * @returns ArangoDB document with proper _key, _from, _to fields
 */
export declare function toArangoDoc(entity: Obj | Cnx): Record<string, unknown>;
export {};
