Declarative hook configuration object.
Pass this to the TransformationHookManager constructor to register one or more hooks in a single expression:
const manager = new TransformationHookManager({ beforeTransform: [(ctx) => console.log('start', ctx.name)], afterTransform: [(ctx) => console.log('done', ctx.durationMs + 'ms')], onError: [(ctx) => console.error(ctx.error)], });
All three arrays are optional. An empty config object is equivalent to no hooks at all.
optional
beforeTransform: BeforeTransformHook[]
Hooks fired before each transformation — can contain multiple callbacks
optional
afterTransform: AfterTransformHook[]
Hooks fired after each transformation completes — can contain multiple callbacks
optional
onError: TransformErrorHook[]
Hooks fired when a transformation throws — can contain multiple callbacks