[]previous and next page

VisitorEntry

Enter and leave callbacks for one node type.

Enter and leave callbacks for one node type.

Import#

ts
import type { VisitorEntry } from "@shadow-js/compiler";

Signature#

ts
interface VisitorEntry<N> {
  /** Called before the children of the node. Return `false` to skip them. */
  enter?: Visit<N>;
  /** Called after the children of the node (also when `enter` skipped them). */
  leave?: (node: N, parent: PluginNode | null) => void;
}

Members#

Name Type Description
N N
enter? enter?: Visit<N> Called before the children of the node. Return false to skip them.
leave? leave?: (node: N, parent: PluginNode | null) => void Called after the children of the node (also when enter skipped them).