Skip to content

[JS] Add typescript info - #528

Merged
stefano-ottolenghi merged 5 commits into
devfrom
ts
Sep 24, 2026
Merged

stefano-ottolenghi merged 5 commits into
devfrom
ts

Conversation

@stefano-ottolenghi

Copy link
Copy Markdown
Contributor

No description provided.

@MaxAake
MaxAake self-requested a review September 17, 2026 14:28
Comment thread javascript-manual/modules/ROOT/pages/install.adoc Outdated

@MaxAake MaxAake left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝

Comment thread javascript-manual/modules/ROOT/pages/install.adoc Outdated
stefano-ottolenghi and others added 2 commits September 24, 2026 10:05
Co-authored-by: Max Gustafsson <61233757+MaxAake@users.noreply.github.com>
----

[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).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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'll need to explicitly import any types (such as `Rules`, `MappedQueryResult`, etc).

RecordObjectMapping is an object, not a type.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. Is there any indication we can give over what needs to be explicitly imported? I was confused myself with some things working with neo4j. and others not.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything you're using as a type annotation const var: Type = {} you need to explicitly import. whereas "actual" classes and objects will exist on the imported neo4j object at runtime. so const var = new neo4j.Type() will work.

Most people with decent TypeScript experience will have a grasp of this, but it doesn't hurt to do extra clarification in case someone is using the driver for their first TS project.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, this should be fine now.

Most people with decent TypeScript experience

Exactly not me 😁

@neo4j-docops-agent

neo4j-docops-agent commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks for the documentation updates.

The preview documentation has now been torn down - reopening this PR will republish it.

@MaxAake MaxAake left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅

@stefano-ottolenghi
stefano-ottolenghi merged commit 0c9b727 into dev Sep 24, 2026
4 of 5 checks passed
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

Successfully merging this pull request may close these issues.

3 participants