import { BeEvent, Id64String } from "@itwin/core-bentley";
import { GeometricElement3dProps, GeometryStreamProps, RelationshipProps } from "@itwin/core-common";
import { Point3d } from "@itwin/core-geometry";
import { GeometricElement3d } from "../Element";
import { IModelDb } from "../IModelDb";
import { ElementDrivesElement, ElementDrivesElementProps } from "../Relationship";
import { Schema } from "../Schema";
export declare class Graph<T> {
    private _nodes;
    private _edges;
    constructor();
    addNode(node: T): void;
    nodes(): IterableIterator<T>;
    edges(): IterableIterator<{
        from: T;
        to: T;
    }>;
    addEdge(from: T, to: T | T[]): void;
    getEdges(node: T): T[];
    clone(): Graph<T>;
    toGraphvis(accessor: NodeAccessor<T>): string;
}
export interface NodeAccessor<T> {
    getLabel: (node: T) => string;
    getId: (node: T) => string;
}
export declare class TopologicalSorter {
    private static visit;
    static sortDepthFirst<T>(graph: Graph<T>, updated?: T[], failOnCycles?: boolean): T[];
    static sortBreadthFirst<T>(graph: Graph<T>, updated?: T[], failOnCycles?: boolean): T[];
    static validate<T>(graph: Graph<T>, sorted: T[]): boolean;
}
export interface InputDrivesOutputProps extends ElementDrivesElementProps {
    prop: number;
}
export interface NodeElementProps extends GeometricElement3dProps {
    op: string;
    val: number;
}
export declare class InputDrivesOutput extends ElementDrivesElement {
    static readonly events: {
        onRootChanged: BeEvent<(props: RelationshipProps, iModel: IModelDb) => void>;
        onDeletedDependency: BeEvent<(props: RelationshipProps, iModel: IModelDb) => void>;
    };
    static get className(): string;
    protected constructor(props: InputDrivesOutputProps, iModel: IModelDb);
    static onRootChanged(props: RelationshipProps, iModel: IModelDb): void;
    static onDeletedDependency(props: RelationshipProps, iModel: IModelDb): void;
}
export declare class NodeElement extends GeometricElement3d {
    op: string;
    val: number;
    static readonly events: {
        onAllInputsHandled: BeEvent<(id: Id64String, iModel: IModelDb) => void>;
        onBeforeOutputsHandled: BeEvent<(id: Id64String, iModel: IModelDb) => void>;
    };
    static get className(): string;
    protected constructor(props: NodeElementProps, iModel: IModelDb);
    toJSON(): GeometricElement3dProps;
    protected static onAllInputsHandled(id: Id64String, iModel: IModelDb): void;
    protected static onBeforeOutputsHandled(id: Id64String, iModel: IModelDb): void;
    static generateGeometry(radius: number): GeometryStreamProps;
    static getCategory(iModelDb: IModelDb): import("../Element").Element;
}
export declare class NetworkSchema extends Schema {
    static get schemaName(): string;
    static registerSchema(): void;
    static importSchema(iModel: IModelDb): Promise<void>;
}
export declare class Engine {
    static createGraph(iModelDb: IModelDb, modelId: Id64String, graph: Graph<string>): Promise<Graph<{
        id: Id64String;
        name: string;
    }>>;
    static countNodes(iModelDb: IModelDb): number;
    static countEdges(iModelDb: IModelDb): number;
    static queryEdgesForSource(iModelDb: IModelDb, sourceId: Id64String): InputDrivesOutputProps[];
    static queryEdgesForTarget(iModelDb: IModelDb, targetId: Id64String): InputDrivesOutputProps[];
    private static createPartition;
    private static createModel;
    private static createNodeCategory;
    static initialize(iModelDb: IModelDb): Promise<{
        modelId: string;
        categoryId: string;
    }>;
    static insertNode(iModelDb: IModelDb, modelId: Id64String, name: string, op: string, val: number, location: Point3d, radius?: number): Promise<string>;
    static deleteNode(iModelDb: IModelDb, nodeId: Id64String): Promise<void>;
    static updateNodeProps(iModelDb: IModelDb, props: Partial<NodeElementProps>): Promise<void>;
    static updateNode(iModelDb: IModelDb, userLabel: string): Promise<void>;
    static deleteEdge(iModelDb: IModelDb, from: string, to: string): Promise<void>;
    static insertEdge(iModelDb: IModelDb, sourceId: Id64String, targetId: Id64String, prop: number): Promise<string>;
}
//# sourceMappingURL=ElementDrivesElement.test.d.ts.map