Skip to content

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

Function: PortString() ​

PortString(config?): PropertyDecorator

Defined in: packages/chaingraph-types/src/decorator/scalar.decorator.ts:30

String decorator to specify a port configuration for type "string". This decorator automatically sets the port type to "string", so that you do not have to specify it. Optional configuration properties (such as defaultValue, minLength, maxLength, etc.) can be passed.

Usage examples:

  // Using default configuration:
  @PortString()
  public myPort: string = '';

  // With custom configuration:
  @PortString({ defaultValue: 'hello', minLength: 1, maxLength: 100 })
  public myPort?: string;

Parameters ​

config? ​

Omit<StringPortConfig, "type">

Optional configuration object for additional options.

Returns ​

PropertyDecorator

Licensed under BUSL-1.1