fontoxpath
Advanced tools
Comparing version 3.17.4 to 3.18.0-0
@@ -55,2 +55,16 @@ /// <reference lib="dom" /> | ||
/** | ||
* Compile a given query to JavaScript code. For executing compiled code, see | ||
* {@link executeJavaScriptCompiledXPath}. | ||
* | ||
* @beta | ||
* | ||
* @param selector - The selector to compile. @param returnType - One of the return types indicating the value to be returned when executing the query. | ||
* @param returnType - Type compiled code should return. | ||
* @param options - Extra options for compiling this XPath. | ||
* | ||
* @returns A string JavaScript code representing the given selector. | ||
*/ | ||
export declare function compileXPathToJavaScript(selector: string, returnType?: ReturnType_2, options?: Options | null): JavaScriptCompiledXPathResult; | ||
/** | ||
* Creates a factory to convert values into a specific type. | ||
@@ -408,2 +422,17 @@ * | ||
/** | ||
* Execute XPath compiled to JavaScript that is evaluated to a function. For | ||
* compiling XPath to JavaScript, see {@link compileXPathToJavaScript}. | ||
* | ||
* @beta | ||
* | ||
* @param compiledJavaScriptFunction - A function containing compiled XPath in | ||
* its body. | ||
* @param contextItem - The node from which to run the XPath. | ||
* @param domFacade - The domFacade (or DomFacade like interface) for retrieving relation. | ||
* | ||
* @returns The result of executing this XPath. | ||
*/ | ||
export declare const executeJavaScriptCompiledXPath: <TNode extends Node, TReturnType extends import("../parsing/convertXDMReturnValue").ReturnType>(compiledJavaScriptFunction: any, contextItem?: any, domFacade?: IDomFacade) => IReturnTypes<TNode>[TReturnType]; | ||
/** | ||
* @public | ||
@@ -454,2 +483,20 @@ * | ||
/** | ||
* Successfully JavaScript compiled XPath. | ||
* @beta | ||
*/ | ||
export declare interface IAstAccepted { | ||
code: string; | ||
isAstAccepted: true; | ||
} | ||
/** | ||
* Result for failing to compile XPath to JavaScript. | ||
* @beta | ||
*/ | ||
export declare interface IAstRejected { | ||
isAstAccepted: false; | ||
reason: string; | ||
} | ||
/** | ||
* @public | ||
@@ -587,2 +634,8 @@ */ | ||
/** | ||
* Result for compiling XPath to JavaScript | ||
* @beta | ||
*/ | ||
export declare type JavaScriptCompiledXPathResult = IAstAccepted | IAstRejected; | ||
/** | ||
* Specifies which language to use. | ||
@@ -589,0 +642,0 @@ * |
{ | ||
"name": "fontoxpath", | ||
"version": "3.17.4", | ||
"version": "3.18.0-0", | ||
"description": "A minimalistic XPath 3.1 engine in JavaScript", | ||
@@ -30,3 +30,3 @@ "main": "dist/fontoxpath.js", | ||
"lint": "tslint \"./src/**/*.ts\" --project . && prettier \"./src/**/*.ts\" --list-different", | ||
"fuzzer": "ts-node -P fuzzers/tsconfig.json -r tsconfig-paths/register fuzzers/fuzzer.ts" | ||
"fuzzer": "ts-node -P fuzzers/tsconfig.json -r tsconfig-paths/register fuzzers/index.ts" | ||
}, | ||
@@ -33,0 +33,0 @@ "repository": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
800295
4177
2