Documentation
    Preparing search index...

    Interface IGraphBaseEntityNode<Id, Type, NodeProps>

    Base interface for a graph node. It defines the basic properties and methods that all graph nodes should have.

    const express: IGraphBaseEntityNode<typeof GraphTypeEnum.Express, {port: string}> = {}
    class Express implements IGraphBaseEntityNode<typeof GraphTypeEnum.Express, {port: string}> {}

    v0.1.0

    IGraphEventEntityNode for a node that can emit update events.

    interface IGraphBaseEntityNode<
        Id extends string,
        Type extends number,
        NodeProps extends Record<string, unknown>,
    > {
        nodeId: Id;
        nodeType: Type;
        getNodeProps(): NodeProps | Promise<NodeProps>;
        onInit?(): void | Promise<void>;
        onRemove?(): void | Promise<void>;
    }

    Type Parameters

    • Id extends string
    • Type extends number

      The type of the node. It should be a number.

    • NodeProps extends Record<string, unknown>

      The properties of the node. It should be an object with string keys and unknown values.

    Index

    Properties

    nodeId: Id

    The unique identifier of the node. It should be a const string for static nodes. (like UUID)

    nodeType: Type

    The type of the node. It should be a const number. (like an enum value)

    Methods