UNPKG

@react-jsonr/plugin-event-handlers

Version:

Event handler mapping plugin for React-JSONR

23 lines (20 loc) 692 B
import { TransformVisitor } from 'react-jsonr'; interface EventHandlerPluginOptions { /** * Map of event handler names to functions */ handlers: Record<string, Function>; /** * Custom prefix for event handlers (default: 'on') */ prefix?: string; /** * Whether to warn when an event handler is not found (default: true) */ warnOnMissing?: boolean; } /** * Creates a transform visitor that maps string event handlers to functions */ declare function createEventHandlerPlugin(options: EventHandlerPluginOptions): TransformVisitor; export { type EventHandlerPluginOptions, createEventHandlerPlugin, createEventHandlerPlugin as default };