Skip to content

Commit bc6cc8f

Browse files
authored
Export types constructors in the neo4j-driver (#928)
The lack of constructor export was avoiding type checkins using `instanceof`. The exported constructors are already present in `index.d.ts`
1 parent fe66d06 commit bc6cc8f

File tree

2 files changed

+578
-3
lines changed

2 files changed

+578
-3
lines changed

packages/neo4j-driver/src/index.js

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,27 @@ import {
5151
UnboundRelationship,
5252
Record,
5353
ResultSummary,
54+
Plan,
55+
ProfiledPlan,
56+
QueryStatistics,
57+
Notification,
58+
ServerInfo,
5459
Result,
55-
auth
60+
auth,
61+
Session,
62+
Transaction,
63+
ManagedTransaction
5664
} from 'neo4j-driver-core'
5765
import {
5866
DirectConnectionProvider,
5967
RoutingConnectionProvider
6068
} from 'neo4j-driver-bolt-connection'
6169

70+
import RxSession from './session-rx'
71+
import RxTransaction from './transaction-rx'
72+
import RxManagedTransaction from './transaction-managed-rx'
73+
import RxResult from './result-rx'
74+
6275
const {
6376
util: { ENCRYPTION_ON, assertString, isEmptyObjectOrNull },
6477
serverAddress: { ServerAddress },
@@ -390,7 +403,36 @@ const forExport = {
390403
session,
391404
error,
392405
spatial,
393-
temporal
406+
temporal,
407+
Driver,
408+
Session,
409+
Transaction,
410+
ManagedTransaction,
411+
Result,
412+
RxSession,
413+
RxTransaction,
414+
RxManagedTransaction,
415+
RxResult,
416+
ResultSummary,
417+
Plan,
418+
ProfiledPlan,
419+
QueryStatistics,
420+
Notification,
421+
ServerInfo,
422+
Record,
423+
Node,
424+
Relationship,
425+
UnboundRelationship,
426+
Path,
427+
PathSegment,
428+
Point,
429+
Integer,
430+
Duration,
431+
LocalTime,
432+
Time,
433+
Date,
434+
LocalDateTime,
435+
DateTime
394436
}
395437

396438
export {
@@ -413,6 +455,35 @@ export {
413455
session,
414456
error,
415457
spatial,
416-
temporal
458+
temporal,
459+
Driver,
460+
Session,
461+
Transaction,
462+
ManagedTransaction,
463+
Result,
464+
RxSession,
465+
RxTransaction,
466+
RxManagedTransaction,
467+
RxResult,
468+
ResultSummary,
469+
Plan,
470+
ProfiledPlan,
471+
QueryStatistics,
472+
Notification,
473+
ServerInfo,
474+
Record,
475+
Node,
476+
Relationship,
477+
UnboundRelationship,
478+
Path,
479+
PathSegment,
480+
Point,
481+
Integer,
482+
Duration,
483+
LocalTime,
484+
Time,
485+
Date,
486+
LocalDateTime,
487+
DateTime
417488
}
418489
export default forExport

0 commit comments

Comments
 (0)