Skip to content

Commit bb0a2aa

Browse files
committed
Do not expose all constructors in TS declarations
Node, Relationship, UnboundRelationship, PathSegment, Path and Record should not be exposed in `neo4j.types` constant.
1 parent 7cce621 commit bb0a2aa

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

test/types/index.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,12 @@ const protocolError: string = neo4j.error.PROTOCOL_ERROR;
7979
const error1: neo4j.Neo4jError = new neo4j.Neo4jError("Error message");
8080
const error2: neo4j.Neo4jError = new neo4j.Neo4jError("Error message", "Error code");
8181

82-
const node: neo4j.Node = new neo4j.types.Node(int1, [], {});
83-
const relationship: neo4j.Relationship = new neo4j.types.Relationship(int1, int1, int1, "", {});
84-
const unboundRelationship: neo4j.UnboundRelationship = new neo4j.types.UnboundRelationship(int1, "", {});
85-
const pathSegment: neo4j.PathSegment = new neo4j.types.PathSegment(node, relationship, node);
86-
const path: neo4j.Path = new neo4j.types.Path(node, node, []);
8782
const result: neo4j.Result = readSession.run("");
8883

8984
result.then(value => {
9085
const resultSummary: neo4j.ResultSummary = value.summary;
9186
});
9287

93-
const record: neo4j.Record = new neo4j.types.Record([], [], {});
9488
const point: neo4j.Point = new neo4j.types.Point(int1, 1, 2, 3);
9589
const duration: neo4j.Duration = new neo4j.types.Duration(int1, int1, int1, int1);
9690
const localTime: neo4j.LocalTime = new neo4j.types.LocalTime(int1, int1, int1, int1);

types/v1/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ declare function driver(url: string,
4949
config?: Config): Driver;
5050

5151
declare const types: {
52-
Node: typeof Node;
53-
Relationship: typeof Relationship;
54-
UnboundRelationship: typeof UnboundRelationship;
55-
PathSegment: typeof PathSegment;
56-
Path: typeof Path;
52+
Node: Node;
53+
Relationship: Relationship;
54+
UnboundRelationship: UnboundRelationship;
55+
PathSegment: PathSegment;
56+
Path: Path;
5757
Result: Result;
5858
ResultSummary: ResultSummary;
59-
Record: typeof Record;
59+
Record: Record;
6060
Point: typeof Point;
6161
Duration: typeof Duration;
6262
LocalTime: typeof LocalTime;

0 commit comments

Comments
 (0)