UNPKG

1.63 kBTypeScriptView Raw
1/**
2 * ```js
3 * import arangojs, { aql, Database } from "arangojs";
4 * ```
5 *
6 * The "index" module is the default entry point when importing the arangojs
7 * module or using the web build in the browser.
8 *
9 * If you are just getting started, you probably want to use the
10 * {@link arangojs} function, which is also the default export of this module,
11 * or the {@link database.Database} class for which it is a wrapper.
12 *
13 * @packageDocumentation
14 */
15import { Config } from "./connection";
16import { Database } from "./database";
17/**
18 * Creates a new `Database` instance with its own connection pool.
19 *
20 * This is a wrapper function for the {@link database.Database:constructor}.
21 *
22 * @param config - An object with configuration options.
23 *
24 * @example
25 * ```js
26 * const db = arangojs({
27 * url: "http://127.0.0.1:8529",
28 * databaseName: "myDatabase",
29 * auth: { username: "admin", password: "hunter2" },
30 * });
31 * ```
32 */
33export declare function arangojs(config?: Config): Database;
34/**
35 * Creates a new `Database` instance with its own connection pool.
36 *
37 * This is a wrapper function for the {@link database.Database:constructor}.
38 *
39 * @param url - Base URL of the ArangoDB server or list of server URLs.
40 * Equivalent to the `url` option in {@link connection.Config}.
41 *
42 * @example
43 * ```js
44 * const db = arangojs("http://127.0.0.1:8529", "myDatabase");
45 * db.useBasicAuth("admin", "hunter2");
46 * ```
47 */
48export declare function arangojs(url: string | string[], name?: string): Database;
49export default arangojs;
50export { aql } from "./aql";
51export { Database } from "./database";
52//# sourceMappingURL=index.d.ts.map
\No newline at end of file