Skip to content

@Delegate

Forwards selected methods to a field (v0.4.0 scope: explicit method names).

KindCodegen
Backendslegacy, stage3
Requires generateYes

Example

ts
import { Delegate } from 'lombok-typescript/legacy';

interface Engine {
  start(): void;
  stop(): void;
}

class Car {
  @Delegate('start', 'stop')
  engine!: Engine;
}

Codegen emits start() and stop() on Car that delegate to this.engine.

Released under the MIT License.