Skip to content

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

Function: StringEnum()

StringEnum(options, config?): PropertyDecorator

Defined in: packages/chaingraph-types/src/decorator/enum.decorator.ts:58

StringEnum decorator creates an enum port from a list of string options. Automatically sets the port type to "enum" and constructs options using the provided string array.

Usage example: @StringEnum(['Red', 'Green', 'Blue'], { defaultValue: 'Red' }) public colorEnum: string;

Parameters

options

string[]

Array of string options for the enum port.

config?

Omit<EnumPortConfig, "options" | "type">

Optional additional configuration for the enum port (excluding type).

Returns

PropertyDecorator

Licensed under BUSL-1.1