Skip to content

Commit c364a8b

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

File tree

2 files changed

+577
-4
lines changed

2 files changed

+577
-4
lines changed

packages/neo4j-driver/src/index.js

Lines changed: 73 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,26 @@ import {
5050
UnboundRelationship,
5151
Record,
5252
ResultSummary,
53+
Plan,
54+
ProfiledPlan,
55+
QueryStatistics,
56+
Notification,
57+
ServerInfo,
5358
Result,
54-
ConnectionProvider,
55-
auth
59+
auth,
60+
Session,
61+
Transaction,
5662
} from 'neo4j-driver-core'
5763
import {
5864
DirectConnectionProvider,
5965
RoutingConnectionProvider
6066
} from 'neo4j-driver-bolt-connection'
6167

68+
import RxSession from './session-rx'
69+
import RxTransaction from './transaction-rx'
70+
import RxManagedTransaction from './transaction-managed-rx'
71+
import RxResult from './result-rx'
72+
6273
const {
6374
util: { ENCRYPTION_ON, ENCRYPTION_OFF, assertString, isEmptyObjectOrNull },
6475
serverAddress: { ServerAddress },
@@ -389,7 +400,36 @@ const forExport = {
389400
session,
390401
error,
391402
spatial,
392-
temporal
403+
temporal,
404+
Driver,
405+
Session,
406+
Transaction,
407+
ManagedTransaction,
408+
Result,
409+
RxSession,
410+
RxTransaction,
411+
RxManagedTransaction,
412+
RxResult,
413+
ResultSummary,
414+
Plan,
415+
ProfiledPlan,
416+
QueryStatistics,
417+
Notification,
418+
ServerInfo,
419+
Record,
420+
Node,
421+
Relationship,
422+
UnboundRelationship,
423+
Path,
424+
PathSegment,
425+
Point,
426+
Integer,
427+
Duration,
428+
LocalTime,
429+
Time,
430+
Date,
431+
LocalDateTime,
432+
DateTime
393433
}
394434

395435
export {
@@ -411,6 +451,35 @@ export {
411451
session,
412452
error,
413453
spatial,
414-
temporal
454+
temporal,
455+
Driver,
456+
Session,
457+
Transaction,
458+
ManagedTransaction,
459+
Result,
460+
RxSession,
461+
RxTransaction,
462+
RxManagedTransaction,
463+
RxResult,
464+
ResultSummary,
465+
Plan,
466+
ProfiledPlan,
467+
QueryStatistics,
468+
Notification,
469+
ServerInfo,
470+
Record,
471+
Node,
472+
Relationship,
473+
UnboundRelationship,
474+
Path,
475+
PathSegment,
476+
Point,
477+
Integer,
478+
Duration,
479+
LocalTime,
480+
Time,
481+
Date,
482+
LocalDateTime,
483+
DateTime
415484
}
416485
export default forExport

0 commit comments

Comments
 (0)