UNPKG

5.3 kBTypeScriptView Raw
1/**
2 * Copyright (c) "Neo4j"
3 * Neo4j Sweden AB [http://neo4j.com]
4 *
5 * This file is part of Neo4j.
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20import {
21 Neo4jError,
22 error,
23 Integer,
24 inSafeRange,
25 int,
26 isInt,
27 toNumber,
28 toString,
29 isPoint,
30 Point,
31 Date,
32 DateTime,
33 Duration,
34 isDate,
35 isDateTime,
36 isDuration,
37 isLocalDateTime,
38 isLocalTime,
39 isTime,
40 LocalDateTime,
41 LocalTime,
42 Time,
43 Node,
44 Path,
45 PathSegment,
46 Relationship,
47 UnboundRelationship,
48 Record,
49 ResultSummary,
50 Notification,
51 NotificationPosition,
52 Plan,
53 ProfiledPlan,
54 ServerInfo,
55 QueryStatistics,
56 Result,
57 ResultObserver,
58 QueryResult,
59 Transaction,
60 Session,
61 ConnectionProvider
62} from 'neo4j-driver-core'
63import {
64 AuthToken,
65 Config,
66 Driver,
67 EncryptionLevel,
68 READ,
69 SessionMode,
70 TrustStrategy,
71 WRITE
72} from './driver'
73import RxSession from './session-rx'
74import RxTransaction from './transaction-rx'
75import RxResult from './result-rx'
76import { Parameters } from './query-runner'
77
78declare const auth: {
79 basic: (username: string, password: string, realm?: string) => AuthToken
80
81 kerberos: (base64EncodedTicket: string) => AuthToken
82
83 custom: (
84 principal: string,
85 credentials: string,
86 realm: string,
87 scheme: string,
88 parameters?: Parameters
89 ) => AuthToken
90}
91
92declare function driver(
93 url: string,
94 authToken?: AuthToken,
95 config?: Config
96): Driver
97
98declare const types: {
99 Node: Node
100 Relationship: Relationship
101 UnboundRelationship: UnboundRelationship
102 PathSegment: PathSegment
103 Path: Path
104 Result: Result
105 ResultSummary: ResultSummary
106 Record: Record
107 Point: typeof Point
108 Duration: typeof Duration
109 LocalTime: typeof LocalTime
110 Time: typeof Time
111 Date: typeof Date
112 LocalDateTime: typeof LocalDateTime
113 DateTime: typeof DateTime
114 Integer: typeof Integer
115 RxSession: RxSession
116 RxTransaction: RxTransaction
117 RxResult: RxResult
118}
119
120declare const session: {
121 READ: typeof READ
122 WRITE: typeof WRITE
123}
124
125declare const integer: {
126 toNumber: typeof toNumber
127 toString: typeof toString
128 inSafeRange: typeof inSafeRange
129}
130
131declare const spatial: {
132 isPoint: typeof isPoint
133}
134
135declare const temporal: {
136 isDuration: typeof isDuration
137 isLocalTime: typeof isLocalTime
138 isTime: typeof isTime
139 isDate: typeof isDate
140 isLocalDateTime: typeof isLocalDateTime
141 isDateTime: typeof isDateTime
142}
143
144/*
145 Both default and non-default exports declare all visible types so that they can be used in client code like this:
146
147 import neo4j from "neo4j-driver";
148 const driver: neo4j.Driver = neo4j.driver("bolt://localhost");
149 const session: neo4j.Session = driver.session();
150 ...
151*/
152
153declare const forExport: {
154 driver: typeof driver
155 int: typeof int
156 isInt: typeof isInt
157 integer: typeof integer
158 auth: typeof auth
159 types: typeof types
160 session: typeof session
161 error: typeof error
162 spatial: typeof spatial
163 temporal: typeof temporal
164 Driver: Driver
165 AuthToken: AuthToken
166 Config: Config
167 EncryptionLevel: EncryptionLevel
168 TrustStrategy: TrustStrategy
169 SessionMode: SessionMode
170 Neo4jError: Neo4jError
171 Node: Node
172 Relationship: Relationship
173 UnboundRelationship: UnboundRelationship
174 PathSegment: PathSegment
175 Path: Path
176 Integer: Integer
177 Record: Record
178 Result: Result
179 QueryResult: QueryResult
180 ResultObserver: ResultObserver
181 ResultSummary: ResultSummary
182 Plan: Plan
183 ProfiledPlan: ProfiledPlan
184 QueryStatistic: QueryStatistics
185 Notification: Notification
186 ServerInfo: ServerInfo
187 NotificationPosition: NotificationPosition
188 Session: Session
189 Transaction: Transaction
190 Point: Point
191 isPoint: typeof isPoint
192 Duration: Duration
193 LocalTime: LocalTime
194 Time: Time
195 Date: Date
196 LocalDateTime: LocalDateTime
197 DateTime: DateTime
198 RxSession: RxSession
199 RxTransaction: RxTransaction
200 RxResult: RxResult
201 ConnectionProvider: ConnectionProvider
202 isDuration: typeof isDuration
203 isLocalTime: typeof isLocalTime
204 isTime: typeof isTime
205 isDate: typeof isDate
206 isLocalDateTime: typeof isLocalDateTime
207 isDateTime: typeof isDateTime
208}
209
210export {
211 driver,
212 int,
213 isInt,
214 integer,
215 auth,
216 types,
217 session,
218 error,
219 spatial,
220 temporal,
221 Driver,
222 AuthToken,
223 Config,
224 EncryptionLevel,
225 TrustStrategy,
226 SessionMode,
227 Neo4jError,
228 Node,
229 Relationship,
230 UnboundRelationship,
231 PathSegment,
232 Path,
233 Integer,
234 Record,
235 Result,
236 QueryResult,
237 ResultObserver,
238 ResultSummary,
239 Plan,
240 ProfiledPlan,
241 QueryStatistics,
242 Notification,
243 ServerInfo,
244 NotificationPosition,
245 Session,
246 Transaction,
247 Point,
248 isPoint,
249 Duration,
250 LocalTime,
251 Time,
252 Date,
253 LocalDateTime,
254 DateTime,
255 RxSession,
256 RxTransaction,
257 RxResult,
258 ConnectionProvider,
259 isDuration,
260 isLocalTime,
261 isTime,
262 isDate,
263 isLocalDateTime,
264 isDateTime
265}
266
267export default forExport