You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@annotator.apache.org by ge...@apache.org on 2021/06/05 17:14:14 UTC

[incubator-annotator] 02/02: Declare types for optimal-select dependency

This is an automated email from the ASF dual-hosted git repository.

gerben pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git

commit 08575e97aa3e1a9286f1cf17237fd5fe870a85bf
Author: Gerben <ge...@treora.com>
AuthorDate: Sat Jun 5 18:57:34 2021 +0200

    Declare types for optimal-select dependency
    
    The linter does not seem to pick it up however..
---
 .gitignore                                    | 1 +
 packages/dom/@types/optimal-select/index.d.ts | 9 +++++++++
 packages/dom/tsconfig.json                    | 2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 0fd2b1a..f28d081 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
 *.d.ts
+!/packages/**/@types/**/*.d.ts
 *.d.ts.map
 .nyc_output
 coverage
diff --git a/packages/dom/@types/optimal-select/index.d.ts b/packages/dom/@types/optimal-select/index.d.ts
new file mode 100644
index 0000000..90eb3f4
--- /dev/null
+++ b/packages/dom/@types/optimal-select/index.d.ts
@@ -0,0 +1,9 @@
+// Partial declaration, just to cover the pieces we need.
+declare module 'optimal-select' {
+  export default function optimalSelect(
+    element: Element,
+    options: {
+      root: Node,
+    },
+  ): string;
+}
diff --git a/packages/dom/tsconfig.json b/packages/dom/tsconfig.json
index 02e0fcf..e26d55e 100644
--- a/packages/dom/tsconfig.json
+++ b/packages/dom/tsconfig.json
@@ -1,6 +1,6 @@
 {
   "extends": "../../tsconfig.base.json",
-  "include": ["src"],
+  "include": ["src", "./@types"],
   "compilerOptions": {
     "outDir": "lib",
     "rootDir": "src"