Code0 LogoCodeZero

@Signature

Sets the TypeScript-like signature string

Sets the TypeScript-like signature string that describes the inputs and outputs of a function or event. Used by the platform to understand the shape of data flowing through a node.

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

Signature

@Signature(signature: string): ClassDecorator

Example

@Signature('(n: number): number')
export class FibonacciRuntimeFunction {
  run(context: FunctionContext, n: number): number { ... }
}
@Signature('(userId: number): void')
export class UserCreatedRuntimeEvent {}

Applies to

Function, RuntimeFunction, Event, RuntimeEvent

On this page