Documentation / @einvoice-ts/validator / Hit
Interface: Hit<N, P> ​
Defined in: packages/validator/src/engine/rule.ts:53
One node a rule's context selected: the node, where it is, and (when it is not the root) the aggregate that contains it.
Example ​
import type { Hit, UncheckedTaxSubtotal } from '@einvoice-ts/validator';
const hit: Hit<UncheckedTaxSubtotal> = {
node: subtotal,
parent: taxTotal,
path: ['taxTotal', 0, 'taxSubtotal', 0],
};Type Parameters ​
N ​
N = unknown
P ​
P = unknown
Properties ​
node ​
readonlynode:N
Defined in: packages/validator/src/engine/rule.ts:55
The selected node.
parent? ​
readonlyoptionalparent?:P
Defined in: packages/validator/src/engine/rule.ts:57
The aggregate the node sits in, when the node is not the document root.
path ​
readonlypath:ModelPath
Defined in: packages/validator/src/engine/rule.ts:59
Model path of the node, from the document root.
xpath? ​
readonlyoptionalxpath?:string
Defined in: packages/validator/src/engine/rule.ts:64
XPath of the node, when its model path cannot name it: an element the parser dropped, whose path is the one the model would have given it. The issue's xpath and contextXPath use it.