Skip to content

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

Function: createEnumPortConfig()

createEnumPortConfig(config): EnumPortConfig

Defined in: packages/chaingraph-types/src/port/instances/EnumPort.ts:154

Helper function to create an EnumPortConfig. This function helps ensure that the configuration object is constructed with proper type inference.

Example: const config = createEnumPortConfig({ type: 'enum', options: [ { type: 'string', id: 'opt1', name: 'Option 1' }, { type: 'number', id: 'opt2', name: 'Option 2' }, ], })

Parameters

config

EnumPortConfig

The enum port configuration.

Returns

EnumPortConfig

The same configuration object.

Licensed under BUSL-1.1