@lumina-study/blocks-graph
Version:
Framework-agnostic Web Component for visualizing Lumina Study block schemas
31 lines • 1.42 kB
TypeScript
import type { Block } from '../types/block.js';
import type { BlockGraph } from '../types/block-graph.js';
export declare class HorizontalRelationships {
private readonly prerequisites;
private readonly postrequisites;
private readonly transitivePrereqsCache;
private readonly transitivePostreqsCache;
constructor();
static fromBlocks(blocks: Block[]): HorizontalRelationships;
static fromGraph(graph: BlockGraph): HorizontalRelationships;
ensureBlockExists(blockId: string): void;
addRelationship(from: string, to: string): void;
removeRelationship(from: string, to: string): void;
removeBlock(blockId: string): void;
getPrerequisites(blockId: string): ReadonlySet<string>;
getPostrequisites(blockId: string): ReadonlySet<string>;
hasPrerequisite(blockId: string, prerequisiteId: string): boolean;
hasPostrequisite(blockId: string, postrequisiteId: string): boolean;
getAllPrerequisites(blockId: string): ReadonlySet<string>;
getAllPostrequisites(blockId: string): ReadonlySet<string>;
hasPath(from: string, to: string): boolean;
detectCycles(): string[][] | null;
getTopologicalOrder(): string[] | null;
getAllBlocks(): ReadonlySet<string>;
getBlockCount(): number;
getRelationshipCount(): number;
clear(): void;
private clearCaches;
toString(): string;
}
//# sourceMappingURL=horizontal-relationships.d.ts.map