Skip to content

@Proxy

Runtime method interception via Proxy around each instance.

KindHybrid (runtime)
Backendslegacy, stage3
Requires generateNo

Example

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

@Proxy({
  before: (method, args) => console.log(method, args),
  after: (method, result) => console.log(method, '→', result),
})
class Service {
  compute(x: number) {
    return x * 2;
  }
}

Hooks receive (methodName, args) and (methodName, result). Field access is not intercepted.

Released under the MIT License.