Skip to content

Export all available types and interfaces #280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 65 additions & 7 deletions types/v1/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@
* limitations under the License.
*/

import {inSafeRange, int, isInt, toNumber, toString} from "./integer";
import Integer, {inSafeRange, int, isInt, toNumber, toString} from "./integer";
import {Node, Path, PathSegment, Relationship, UnboundRelationship} from "./graph-types";
import {Neo4jError, PROTOCOL_ERROR, SERVICE_UNAVAILABLE, SESSION_EXPIRED} from "./error";
import Result from "./result";
import ResultSummary from "./result-summary";
import Result, {Observer, StatementResult} from "./result";
import ResultSummary, {
Notification,
NotificationPosition,
Plan,
ProfiledPlan,
ServerInfo,
StatementStatistic
} from "./result-summary";
import Record from "./record";
import Session from "./session";
import {AuthToken, Config, Driver, READ, WRITE} from "./driver";
import {AuthToken, Config, Driver, EncryptionLevel, READ, SessionMode, TrustStrategy, WRITE} from "./driver";
import Transaction from "./transaction";
import {Parameters} from "./statement-runner";

Expand Down Expand Up @@ -74,19 +81,48 @@ declare const integer: {
inSafeRange: typeof inSafeRange;
};

/*
Both default and non-default exports declare all visible types so that they can be used in client code like this:

import neo4j from "neo4j-driver";
const driver: neo4j.Driver = neo4j.driver("bolt://localhost");
const session: neo4j.Session = driver.session();
...
*/

declare const forExport: {
driver: typeof driver;
int: typeof int;
isInt: typeof isInt;
integer: typeof integer;
Neo4jError: typeof Neo4jError;
auth: typeof auth;
types: typeof types;
session: typeof session;
error: typeof error;
Driver: Driver;
AuthToken: AuthToken;
Config: Config;
EncryptionLevel: EncryptionLevel;
TrustStrategy: TrustStrategy;
SessionMode: SessionMode;
Neo4jError: Neo4jError;
Node: Node;
Relationship: Relationship;
UnboundRelationship: UnboundRelationship;
PathSegment: PathSegment;
Path: Path;
Integer: Integer;
Record: Record;
Result: Result;
StatementResult: StatementResult;
Observer: Observer;
ResultSummary: ResultSummary;
Plan: Plan,
ProfiledPlan: ProfiledPlan,
StatementStatistic: StatementStatistic,
Notification: Notification,
ServerInfo: ServerInfo,
NotificationPosition: NotificationPosition,
Session: Session;
Transaction: Transaction;
};
Expand All @@ -96,14 +132,36 @@ export {
int,
isInt,
integer,
Neo4jError,
auth,
types,
session,
error,
Driver,
AuthToken,
Session,
Config,
EncryptionLevel,
TrustStrategy,
SessionMode,
Neo4jError,
Node,
Relationship,
UnboundRelationship,
PathSegment,
Path,
Integer,
Record,
Result,
StatementResult,
Observer,
ResultSummary,
Plan,
ProfiledPlan,
StatementStatistic,
Notification,
ServerInfo,
NotificationPosition,
Session,
Transaction
}

export default forExport;