Skip to content

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

Function: NumberEnum()

NumberEnum(options, config?): PropertyDecorator

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

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

Usage example: @NumberEnum([1, 2, 3], { defaultValue: '1' }) public numberEnum: number;

Parameters

options

number[]

Array of number options for the enum port.

config?

Omit<EnumPortConfig, "type">

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

Returns

PropertyDecorator

Licensed under BUSL-1.1