From 5861bd474481281ee5545b3422bb961aa01d1752 Mon Sep 17 00:00:00 2001 From: Stefano Ottolenghi Date: Thu, 17 Sep 2026 11:33:12 +0200 Subject: [PATCH 1/5] add ts info --- .../modules/ROOT/pages/install.adoc | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/javascript-manual/modules/ROOT/pages/install.adoc b/javascript-manual/modules/ROOT/pages/install.adoc index 3caa5c58..6b5b3b24 100644 --- a/javascript-manual/modules/ROOT/pages/install.adoc +++ b/javascript-manual/modules/ROOT/pages/install.adoc @@ -25,7 +25,12 @@ You can install it with `npm i neo4j-driver-lite`. == Include the driver -Unless you are going to xref:browser-websockets.adoc[use the driver within a web browser], you use the JavaScript driver in a Node.js or TypeScript application. +Unless you are going to xref:browser-websockets.adoc[use the driver within a web browser], you use the driver in a Node.js or TypeScript application. + +[.tabbed-example] +===== +[.include-with-javascript] +====== To include the driver in your application, use `require`: [source, javascript] @@ -33,6 +38,39 @@ To include the driver in your application, use `require`: const neo4j = require('neo4j-driver') ---- +====== +[.include-with-typescript] +====== +To include the driver in your application, use `import`: + +[source, javascript] +---- +import neo4j, {Node} from 'neo4j-driver' +---- + +[IMPORTANT] +Import `Node` explicitly to avoid conflicts with the native `Node` type. + +You can provide the list of libraries the driver needs via the `tsconfig.json` file (or exclude the interpreter check with `"skipLibCheck": true`), and then run your application with `tsc`. + +.tsconfig.json sample file +[source, json] +---- +{ + "compilerOptions": { + "lib": ["ES6", "dom", "es2020.bigint", "esnext.asynciterable", "esnext.disposable"] + }, + "include": ["neo4j-main.ts"] +} +---- + +[TIP] +The minimum supported version is TypeScript 5.2. + + +====== +===== + include::{common-partial}/install.adoc[tag=get-an-instance] From e796a3423384a5044cb023ceed6514ff82ef8ff3 Mon Sep 17 00:00:00 2001 From: Stefano Date: Mon, 21 Sep 2026 16:20:26 +0200 Subject: [PATCH 2/5] Change lang --- javascript-manual/modules/ROOT/pages/install.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript-manual/modules/ROOT/pages/install.adoc b/javascript-manual/modules/ROOT/pages/install.adoc index 6b5b3b24..3c6f15a2 100644 --- a/javascript-manual/modules/ROOT/pages/install.adoc +++ b/javascript-manual/modules/ROOT/pages/install.adoc @@ -43,7 +43,7 @@ const neo4j = require('neo4j-driver') ====== To include the driver in your application, use `import`: -[source, javascript] +[source, typescript] ---- import neo4j, {Node} from 'neo4j-driver' ---- From b81b8281900ccaa5e55689e621a93ccf6dc3d6ce Mon Sep 17 00:00:00 2001 From: Stefano Date: Thu, 24 Sep 2026 10:05:22 +0200 Subject: [PATCH 3/5] Update javascript-manual/modules/ROOT/pages/install.adoc Co-authored-by: Max Gustafsson <61233757+MaxAake@users.noreply.github.com> --- javascript-manual/modules/ROOT/pages/install.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript-manual/modules/ROOT/pages/install.adoc b/javascript-manual/modules/ROOT/pages/install.adoc index 3c6f15a2..ca048672 100644 --- a/javascript-manual/modules/ROOT/pages/install.adoc +++ b/javascript-manual/modules/ROOT/pages/install.adoc @@ -51,7 +51,7 @@ import neo4j, {Node} from 'neo4j-driver' [IMPORTANT] Import `Node` explicitly to avoid conflicts with the native `Node` type. -You can provide the list of libraries the driver needs via the `tsconfig.json` file (or exclude the interpreter check with `"skipLibCheck": true`), and then run your application with `tsc`. +You can provide the list of libraries the driver needs via the `tsconfig.json` file (or exclude the interpreter check with `"skipLibCheck": true`), and then compile your code with `tsc` or run with an execution engine. .tsconfig.json sample file [source, json] From c33c4bda42bdce503b836781b09cf60786d8a34e Mon Sep 17 00:00:00 2001 From: Stefano Ottolenghi Date: Thu, 24 Sep 2026 10:04:22 +0200 Subject: [PATCH 4/5] types info --- javascript-manual/modules/ROOT/pages/install.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript-manual/modules/ROOT/pages/install.adoc b/javascript-manual/modules/ROOT/pages/install.adoc index ca048672..2cb527bc 100644 --- a/javascript-manual/modules/ROOT/pages/install.adoc +++ b/javascript-manual/modules/ROOT/pages/install.adoc @@ -49,7 +49,7 @@ import neo4j, {Node} from 'neo4j-driver' ---- [IMPORTANT] -Import `Node` explicitly to avoid conflicts with the native `Node` type. +Import `Node` explicitly to avoid conflicts with the native `Node` type. The driver also doesn't declare a namespace, so you'll need to explicitly import any types (such as `Rules`, `MappedQueryResult`, `RecordObjectMapping`, etc). You can provide the list of libraries the driver needs via the `tsconfig.json` file (or exclude the interpreter check with `"skipLibCheck": true`), and then compile your code with `tsc` or run with an execution engine. From a147aa9e69b125349c63b3bb38ca223f3c3cafff Mon Sep 17 00:00:00 2001 From: Stefano Ottolenghi Date: Thu, 24 Sep 2026 10:33:53 +0200 Subject: [PATCH 5/5] clarify --- javascript-manual/modules/ROOT/pages/install.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript-manual/modules/ROOT/pages/install.adoc b/javascript-manual/modules/ROOT/pages/install.adoc index 2cb527bc..4697984c 100644 --- a/javascript-manual/modules/ROOT/pages/install.adoc +++ b/javascript-manual/modules/ROOT/pages/install.adoc @@ -49,7 +49,7 @@ import neo4j, {Node} from 'neo4j-driver' ---- [IMPORTANT] -Import `Node` explicitly to avoid conflicts with the native `Node` type. The driver also doesn't declare a namespace, so you'll need to explicitly import any types (such as `Rules`, `MappedQueryResult`, `RecordObjectMapping`, etc). +Import `Node` explicitly to avoid conflicts with the native `Node` type. The driver also doesn't declare a namespace, so you need to explicitly import any symbol you want to use as a type annotation. You can provide the list of libraries the driver needs via the `tsconfig.json` file (or exclude the interpreter check with `"skipLibCheck": true`), and then compile your code with `tsc` or run with an execution engine.