Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript import issue #5

Open
tonn opened this issue Oct 9, 2021 · 0 comments
Open

Typescript import issue #5

tonn opened this issue Oct 9, 2021 · 0 comments

Comments

@tonn
Copy link

tonn commented Oct 9, 2021

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

I had an issue with import library in my typescript project. It said that there is no declarations for 'xpather' module.
Here is the diff that solved my problem:

diff --git a/node_modules/xpather/built/condition.d.ts b/node_modules/xpather/built/condition.d.ts
new file mode 100644
index 0000000..1fc03c2
--- /dev/null
+++ b/node_modules/xpather/built/condition.d.ts
@@ -0,0 +1,7 @@
+export declare class Condition {
+    private readonly condition;
+    constructor(condition: string);
+    or(...conditions: Condition[]): Condition;
+    and(...conditions: Condition[]): Condition;
+    toString(): string;
+}
diff --git a/node_modules/xpather/built/index.d.ts b/node_modules/xpather/built/index.d.ts
new file mode 100644
index 0000000..850fa34
--- /dev/null
+++ b/node_modules/xpather/built/index.d.ts
@@ -0,0 +1,5 @@
+import { Xpath } from './xpath';
+export { With } from './with';
+export declare const x: typeof Xpath.x;
+export declare const xpath: typeof Xpath.x;
+export declare const root: Xpath;
diff --git a/node_modules/xpather/built/with.d.ts b/node_modules/xpather/built/with.d.ts
new file mode 100644
index 0000000..81a898c
--- /dev/null
+++ b/node_modules/xpather/built/with.d.ts
@@ -0,0 +1,16 @@
+import { Condition } from './condition';
+export declare namespace With {
+    function text(text: string): Condition;
+    function exactText(exactText: string): Condition;
+    function attribute(attributeName: string, attributeValue?: string): Condition;
+    function exactAttribute(attributeName: string, attributeValue: string): Condition;
+    function value(value: string): Condition;
+    function exactValue(value: string): Condition;
+    function id(value: string): Condition;
+    function exactId(value: string): Condition;
+    function name(value: string): Condition;
+    function exactName(value: string): Condition;
+    function position(index: number): Condition;
+    function positionLast(): Condition;
+    function count(tag: string, count: number): Condition;
+}
diff --git a/node_modules/xpather/built/xpath.d.ts b/node_modules/xpather/built/xpath.d.ts
new file mode 100644
index 0000000..1ac80d0
--- /dev/null
+++ b/node_modules/xpather/built/xpath.d.ts
@@ -0,0 +1,21 @@
+import { Condition } from './condition';
+export declare class Xpath {
+    static readonly root: Xpath;
+    static x(tag: string, ...conditions: Condition[]): Xpath;
+    private readonly xpathString;
+    constructor(xpathString: string, ...conditions: Condition[]);
+    descendant(xpathString: string, ...conditions: Condition[]): Xpath;
+    descendantOrSelf(xpathString: string, ...conditions: Condition[]): Xpath;
+    child(xpathString: string, ...conditions: Condition[]): Xpath;
+    parent(): Xpath;
+    following(xpathString: string, ...conditions: Condition[]): Xpath;
+    next(xpathString: string, ...conditions: Condition[]): Xpath;
+    followingSibling(xpathString: string, ...conditions: Condition[]): Xpath;
+    nextSibling(xpathString: string, ...conditions: Condition[]): Xpath;
+    preceding(xpathString: string, ...conditions: Condition[]): Xpath;
+    previous(xpathString: string, ...conditions: Condition[]): Xpath;
+    precedingSibling(xpathString: string, ...conditions: Condition[]): Xpath;
+    previousSibling(xpathString: string, ...conditions: Condition[]): Xpath;
+    build(): string;
+    toString(): string;
+}
diff --git a/node_modules/xpather/lib/tsconfig.json b/node_modules/xpather/lib/tsconfig.json
index 646ffb4..b2a7028 100644
--- a/node_modules/xpather/lib/tsconfig.json
+++ b/node_modules/xpather/lib/tsconfig.json
@@ -4,7 +4,7 @@
     "module": "commonjs",
     "moduleResolution": "node",
     "sourceMap": true,
-    "declaration": false,
+    "declaration": true,
     "removeComments": false,
     "noImplicitAny": false,
     "experimentalDecorators": true,

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant