Documentation
    Preparing search index...

    Module @luolapeikko/graph-entity-types

    @luolapeikko/graph-entity-types

    TypeScript type definitions for the Graph Entity ecosystem. Provides core interfaces and types for graph nodes, edges, and graph management, designed for use with the @luolapeikko/graph-entity package or similar graph-based systems.

    npm install @luolapeikko/graph-entity-types
    

    or with pnpm:

    pnpm add @luolapeikko/graph-entity-types
    

    This package contains reusable TypeScript types and interfaces for building strongly-typed graph data structures and event-driven graph managers.

    • IGraphBaseEntityNode – Base interface for a graph node
    • IGraphEventEntityNode – Node interface with event support
    • GraphNodeEventMapping – Node event mapping type
    • GraphEdge – Type for graph edges
    • GraphManagerEventMapping – Event mapping for graph managers
    • GraphStructure – Recursive type for graph structure
    • GraphEdgeStructure – Recursive type for edge structure
    • IGraphManager – Interface for a graph manager
    import type { IGraphBaseEntityNode, GraphEdge } from '@luolapeikko/graph-entity-types';

    // Define a node type
    type MyNode = IGraphBaseEntityNode<1, { label: string }>;

    const nodeA: MyNode = {
    nodeType: 1,
    nodeId: 'cf9cda0d-b479-4e07-b2bd-695c161d71db',
    getNodeProps: () => ({ label: 'Node A' }),
    };

    const nodeB: MyNode = {
    nodeType: 1,
    nodeId: 'b4794e07-b2bd-695c-161d71dbcf9cda0d',
    getNodeProps: () => ({ label: 'Node B' }),
    };

    const edge: GraphEdge<MyNode> = { source: nodeA, target: nodeB };

    See more features on Package documentation

    Interfaces

    IGraphBaseEntityNode
    IGraphManager

    Type Aliases

    GraphEdge
    GraphEdgeStructure
    GraphManagerEventMapping
    GraphNodeConstructor
    GraphNodeEventMapping
    GraphStructure
    IGraphEntityNode
    IGraphEventEntityNode