Closed
Description
I'm using this driver in a typescript-node project and came across this issue where TS prevents me from using the Point because the type is missing a signature for new
.
Cannot use 'new' with an expression whose type lacks a call or construct signature.
It's like it doesn't understand that it is a class. I solved the type issue, although hacky, by extending the Point type myself:
import { v1 as neo4j } from 'neo4j-driver';
import { Point as PointT } from 'neo4j-driver/types/v1/spatial-types';
const Point = neo4j.types.Point as PointT & {
new (srid: number, x: number, y: number, z?: number): PointT;
};
This works and I'm now able to create Points. However, if I try to replicate the fix into spatial-types.d.ts
with new(srid: T, x: number, y: number, z?: number): Point;
it does not work. Would love to figure out how this can be fixed for everyone.
Metadata
Metadata
Assignees
Labels
No labels