UNPKG

metagraph

Version:

A framework for building higher-order graph data structures

21 lines 1.02 kB
import { PatternSpec, PatternDefinition, Graph } from './types.js'; /** * Creates a reusable graph pattern that can generate graph instances from data. * Patterns define the structure and behavior of graphs through dataflow and interface specifications. * * @param spec - Pattern specification containing dataflow computation and interface definition * @param flowspecs - Optional additional flowspecs for composed patterns * @returns A pattern graph that can create instances via the 'create' method * * @example * ```typescript * const graphPattern = pattern(graph_pattern()); * const instance = graphPattern.node('Graph').value().create({ * nodes: [{key: 'a'}, {key: 'b'}], * edges: [{key: 'e', value: {source: 'a', target: 'b'}}] * }); * ``` */ export declare const pattern: (spec: PatternSpec, flowspecs?: Record<string, Graph>) => Graph; export declare const define_dataflow: (flowspec: Graph, defn: PatternDefinition) => import("./types.js").Dataflow; //# sourceMappingURL=pattern.d.ts.map