Skip to content

VdlPluginHandler

Import from @varavel/vdl-plugin-sdk.

type VdlPluginHandler = (input) => PluginOutput;

Function signature implemented by every VDL plugin entry point.

The handler receives the typed plugin input produced by VDL and returns the generated files and any diagnostics for the current run.

Parameters

Parameter Type Description
input PluginInput The plugin invocation context, including version, options, and IR.

Returns

PluginOutput

The files and errors produced by the plugin.

Example

const generate: VdlPluginHandler = (input) => {
  return {
    files: [{ path: "hello.txt", content: input.version }],
  };
};