/**
 * Copyright 2023 Impulse Innovations Limited
 *
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import type { LayoutMapping, XYPosition } from 'graphology-layout/utils';
import type { DirectionType, GraphTiers, SerializedSimulationGraph, SimulationGraph } from '../../types';
import type { LayoutWorker } from './worker/client';
export declare abstract class GraphLayoutBuilder<T> {
    _nodeSize: number;
    _nodeFontSize: number;
    /**
     * Sets node size and returns the builder
     *
     * @param size node size
     */
    nodeSize(size: number): this;
    /**
     * Sets node font size and returns the builder
     *
     * @param size node font size
     */
    nodeFontSize(size: number): this;
    abstract build(): T;
}
export interface BaseLayoutParams {
    layoutName: string;
    nodeSize: number;
    nodeFontSize: number;
}
export interface SerializableLayoutComputationResult {
    layout: LayoutMapping<XYPosition>;
    edgePoints?: LayoutMapping<XYPosition[]>;
}
export interface LayoutComputationCallbacks {
    onAddEdge?: () => void | Promise<void>;
    onAddNode?: (graphData: SerializedSimulationGraph) => void | Promise<void>;
    onCleanup?: () => void | Promise<void>;
    onEndDrag?: () => void | Promise<void>;
    onMove?: (nodeId: string, x: number, y: number) => void | Promise<void>;
    onStartDrag?: () => void | Promise<void>;
}
export type LayoutComputationResult = SerializableLayoutComputationResult & LayoutComputationCallbacks;
/**
 * Defines necessary properties that need to be implemented by graph layouts
 */
export declare abstract class GraphLayout<TLayoutParams extends BaseLayoutParams = BaseLayoutParams> {
    nodeSize: number;
    nodeFontSize: number;
    /**
     * Worker function that can be be called to compute a layout
     */
    worker: LayoutWorker;
    constructor(builder: GraphLayoutBuilder<unknown>);
    /**
     * Get the name of the layout.
     * This must be defined for each rather than using something like this.constructor.name
     * because the class name is mangled by minifiers.
     */
    get name(): string;
    get supportsDrag(): boolean;
    get requiresPosition(): boolean;
    /**
     * Apply a layout to a given graph data.
     *
     * Returns a computed layout.
     *
     * @param graphData graph data to apply the layout to
     * @param forceUpdate callback to call to update the layout
     */
    applyLayout(graph: SimulationGraph, forceUpdate?: (layout: LayoutMapping<XYPosition>, edgePoints?: LayoutMapping<XYPosition[]>) => void): Promise<LayoutComputationResult>;
    /**
     * Convert the layout object to a serializable params object.
     * This representation is used to send the layout to the worker.
     */
    toLayoutParams(): TLayoutParams;
}
export interface GraphLayoutWithTiers extends GraphLayout {
    orientation: DirectionType;
    tiers: GraphTiers;
}
export interface GraphLayoutWithGrouping extends GraphLayout {
    group: string;
}
//# sourceMappingURL=common.d.ts.map