UNPKG

gramoloss

Version:

Graph theory package for edition and computation

59 lines (58 loc) 2.37 kB
import { Area } from "./area"; import { Vect } from "./coord"; import { BasicGraph, Graph } from "./graph"; import { Rectangle } from "./rectangle"; import { Representation } from "./representations/representation"; import { Stroke } from "./stroke"; import { TextZone } from "./text_zone"; import { BasicLinkData, BasicVertexData } from "./traits"; export declare class Board<V extends BasicVertexData, L extends BasicLinkData, S extends Stroke, A extends Area, T extends TextZone, R extends Representation, Rect extends Rectangle> { graph: BasicGraph<V, L>; text_zones: Map<number, T>; representations: Map<number, R>; strokes: Map<number, S>; areas: Map<number, A>; rectangles: Map<number, Rect>; constructor(); /** * @param n * @returns n available stroke indices * * It does not start from the max of the current stroke indices. */ getNextNAvailableStrokeIndices(n: number): Array<number>; /** * @param n * @returns n available stroke indices * * It does not start from the max of the current stroke indices. */ getNextNAvailableRectangleIndices(n: number): Array<number>; /** * @param n * @returns n available stroke indices * * It does not start from the max of the current stroke indices. */ getNextNAvailableTextZoneIndices(n: number): Array<number>; get_next_available_index_representation(): number; get_next_available_index_text_zone(): number; get_next_available_index_strokes(): number; get_next_available_index_area(): number; get_next_available_index_rectangle(): number; /** * Return an element of a certain kind and index. * @warning for vertices and links it returns data of these elements not all the data * @todo an error should be triggered if kind does not exists or index */ getElement(kind: string, index: number): undefined | V | L | S | T | A | Rect; /** * Return the value of a param of an element of a certain kind and index. * @todo return type should exist */ get_value(kind: string, index: number, param: string): undefined | any; delete_stroke(stroke_index: number): void; delete_area(area_index: number): void; translate_areas(indices: Set<number>, shift: Vect): void; get_subgraph_from_area(area_index: number): Graph<V, L>; }