ChainGraph API Documentation / @badaitech/chaingraph-types / createStreamPortConfig
Function: createStreamPortConfig()
createStreamPortConfig<
Item>(config):StreamPortConfig<Item>
Defined in: packages/chaingraph-types/src/port/instances/StreamPort.ts:186
Helper function to create a StreamPortConfig.
This function helps ensure that the configuration object is constructed with proper type inference – you do not need to explicitly specify generic parameters.
Example:
const config = createStreamPortConfig<StringPortConfig>({ type: 'stream', itemConfig: { type: 'string', minLength: 2 }, })
Type Parameters
Item
Item extends IPortConfig
Parameters
config
StreamPortConfig<Item>
The stream port configuration.
Returns
StreamPortConfig<Item>
The same configuration object.