Skip to content

Commit c076a3b

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 c076a3b

File tree

2 files changed

+534
-4
lines changed

2 files changed

+534
-4
lines changed

packages/neo4j-driver/src/index.js

+68-4
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,25 @@ 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 RxResult from './result-rx'
71+
6272
const {
6373
util: { ENCRYPTION_ON, ENCRYPTION_OFF, assertString, isEmptyObjectOrNull },
6474
serverAddress: { ServerAddress },
@@ -389,7 +399,34 @@ const forExport = {
389399
session,
390400
error,
391401
spatial,
392-
temporal
402+
temporal,
403+
Driver,
404+
Session,
405+
Transaction,
406+
Result,
407+
RxSession,
408+
RxTransaction,
409+
RxResult,
410+
ResultSummary,
411+
Plan,
412+
ProfiledPlan,
413+
QueryStatistics,
414+
Notification,
415+
ServerInfo,
416+
Record,
417+
Node,
418+
Relationship,
419+
UnboundRelationship,
420+
Path,
421+
PathSegment,
422+
Point,
423+
Integer,
424+
Duration,
425+
LocalTime,
426+
Time,
427+
Date,
428+
LocalDateTime,
429+
DateTime
393430
}
394431

395432
export {
@@ -411,6 +448,33 @@ export {
411448
session,
412449
error,
413450
spatial,
414-
temporal
451+
temporal,
452+
Driver,
453+
Session,
454+
Transaction,
455+
Result,
456+
RxSession,
457+
RxTransaction,
458+
RxResult,
459+
ResultSummary,
460+
Plan,
461+
ProfiledPlan,
462+
QueryStatistics,
463+
Notification,
464+
ServerInfo,
465+
Record,
466+
Node,
467+
Relationship,
468+
UnboundRelationship,
469+
Path,
470+
PathSegment,
471+
Point,
472+
Integer,
473+
Duration,
474+
LocalTime,
475+
Time,
476+
Date,
477+
LocalDateTime,
478+
DateTime
415479
}
416480
export default forExport

0 commit comments

Comments
 (0)