Code0 LogoCodeZero

@Parameter

Adds a parameter definition to a function

Adds a parameter definition to a Function or RuntimeFunction. Apply multiple times for multiple parameters — they are collected in declaration order.

import { Parameter } from '@code0-tech/hercules';

Signature

@Parameter(parameter: FunctionParameterProps): ClassDecorator

See FunctionParameterProps for the full interface.

Example

@Parameter({
  runtimeName: 'n',
  name: [{ code: 'en-US', content: 'Input Number' }],
  description: [{ code: 'en-US', content: 'The position in the Fibonacci sequence' }],
  defaultValue: 10,
})
@Parameter({
  runtimeName: 'offset',
  optional: true,
  defaultValue: 0,
})
export class FibonacciFunction extends FibonacciRuntimeFunction {}

Applies to

Function, RuntimeFunction

On this page