[JS] Add typescript info - #528
Conversation
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). |
There was a problem hiding this comment.
| 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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Okay, this should be fine now.
Most people with decent TypeScript experience
Exactly not me 😁
|
Thanks for the documentation updates. The preview documentation has now been torn down - reopening this PR will republish it. |
No description provided.