JSONPath Tools / @jsonpath-tools/jsonpath / QueryContext
Interface: QueryContext
Context of a query evaluation.
Properties
argument
readonly argument: JSONValue;
Query argument.
filterExpressionInstrumentationCallback()?
readonly optional filterExpressionInstrumentationCallback: (filterExpression, output) => void;
Callback called every time a FilterExpression is evaluated.
Parameters
filterExpression
Filter expression.
output
Output value.
Returns
void
options
readonly options: QueryOptions;
Query options.
queryInstrumentationCallback()?
readonly optional queryInstrumentationCallback: (query, input, outputArray, outputStartIndex, outputLength) => void;
Callback called every time a SubQuery is evaluated.
Parameters
query
Query.
input
Input node.
outputArray
Output nodes array. It can also contain unrelated nodes, refer to outputStartIndex and outputLength.
outputStartIndex
number
Start index of the relevant part in outputArray.
outputLength
number
Length of the relevant part in outputArray.
Returns
void
reportDiagnosticsCallback()?
readonly optional reportDiagnosticsCallback: (diagnostics) => void;
Callback called every time a runtime diagnostics is reported.
Parameters
diagnostics
Diagnostics.
Returns
void
segmentInstrumentationCallback()?
readonly optional segmentInstrumentationCallback: (segment, input, outputArray, outputStartIndex, outputLength) => void;
Callback called every time a Segment is evaluated.
Parameters
segment
Segment.
input
Input node.
outputArray
Output nodes array. It can also contain unrelated nodes, refer to outputStartIndex and outputLength.
outputStartIndex
number
Start index of the relevant part in outputArray.
outputLength
number
Length of the relevant part in outputArray.
Returns
void
selectorInstrumentationCallback()?
readonly optional selectorInstrumentationCallback: (selector, input, outputArray, outputStartIndex, outputLength) => void;
Callback called every time a Selector is evaluated.
Parameters
selector
Selector.
input
Input node.
outputArray
Output nodes array. It can also contain unrelated nodes, refer to outputStartIndex and outputLength.
outputStartIndex
number
Start index of the relevant part in outputArray.
outputLength
number
Length of the relevant part in outputArray.
Returns
void