Skip to content

ChainGraph API Documentation / @badaitech/chaingraph-types / NodeRegistry

Class: NodeRegistry ​

Defined in: packages/chaingraph-types/src/decorator/registry.ts:18

Registry for managing node types

Constructors ​

Constructor ​

new NodeRegistry(): NodeRegistry

Defined in: packages/chaingraph-types/src/decorator/registry.ts:23

Returns ​

NodeRegistry

Methods ​

clear() ​

clear(): void

Defined in: packages/chaingraph-types/src/decorator/registry.ts:126

Returns ​

void


copyFrom() ​

copyFrom(other): void

Defined in: packages/chaingraph-types/src/decorator/registry.ts:40

Copy and append nodes and object schemas from another registry

Parameters ​

other ​

NodeRegistry

NodeRegistry instance to copy from

Returns ​

void


createNode() ​

createNode(type, ...args): INode

Defined in: packages/chaingraph-types/src/decorator/registry.ts:85

Create a node instance by type

Parameters ​

type ​

string

Node type identifier

args ​

...any[]

Arguments to pass to the node constructor

Returns ​

INode


getNodeTypes() ​

getNodeTypes(): string[]

Defined in: packages/chaingraph-types/src/decorator/registry.ts:96

Get all registered node types

Returns ​

string[]


getObjectSchema() ​

getObjectSchema(id): IObjectSchema<Record<string, IPortConfig>> | undefined

Defined in: packages/chaingraph-types/src/decorator/registry.ts:115

Get the object schema

Parameters ​

id ​

string

Object schema identifier

Returns ​

IObjectSchema<Record<string, IPortConfig>> | undefined


getObjectSchemas() ​

getObjectSchemas(): Map<string, IObjectSchema<Record<string, IPortConfig>>>

Defined in: packages/chaingraph-types/src/decorator/registry.ts:122

Get all registered object schemas

Returns ​

Map<string, IObjectSchema<Record<string, IPortConfig>>>


registerNode() ​

registerNode(nodeClass): void

Defined in: packages/chaingraph-types/src/decorator/registry.ts:60

Register a node class with its type identifier.

Parameters ​

nodeClass ​

NodeConstructor

Constructor of the node

Returns ​

void


registerObjectSchema() ​

registerObjectSchema(id, schema): void

Defined in: packages/chaingraph-types/src/decorator/registry.ts:105

Register an object schema

Parameters ​

id ​

string

Object schema identifier

schema ​

IObjectSchema

Object schema

Returns ​

void


updateNode() ​

updateNode(nodeClass, metadata): void

Defined in: packages/chaingraph-types/src/decorator/registry.ts:74

Update a node class with metadata

Parameters ​

nodeClass ​

NodeConstructor

Constructor

metadata ​

any

Metadata to update

Returns ​

void


getInstance() ​

static getInstance(): NodeRegistry

Defined in: packages/chaingraph-types/src/decorator/registry.ts:25

Returns ​

NodeRegistry


setInstance() ​

static setInstance(instance): void

Defined in: packages/chaingraph-types/src/decorator/registry.ts:32

Parameters ​

instance ​

NodeRegistry

Returns ​

void

Licensed under BUSL-1.1