import { F, N, A, S } from './baseType'; declare type ShortestPathObj = { distance: Map; predecessors: Map; }; interface Vertex { data: T; inDegree: N; outDegree: N; status: A; dTime: N; fTime: N; } interface Edge { data: A; start: Vertex; end: Vertex; weight: N; status: A; } declare type EdgeOrNull = Edge | null; interface Graph { vertexMap: Map>; adjMatrix: Map>>; adjTable: Map>>; createVertex: (v: T) => Vertex; createEdge: (a: T, b: T) => Edge; putVertex: (a: T) => void; edgeList: () => Edge[]; removeVertex: (a: T) => Vertex | undefined; bfs: (data: T, cb: F) => void; dfs: (data: T, cb: F) => void; shortestPath: (data: T) => ShortestPathObj; getPath: (from: T, to: T) => T[]; reset: (p: S) => void; } interface DirectionGraph extends Graph { putEdge: (a: T, b: T) => void; removeEdge: (a: T, b: T) => Edge | undefined; } interface UndirectionGraph extends Graph { putEdge: (a: T, b: T) => void; removeEdge: (a: T, b: T) => Edge[]; } export { Vertex, Edge, EdgeOrNull, Graph, DirectionGraph, UndirectionGraph, };