Skip to content

Commit d981b68

Browse files
committed
Revert breaking changes
1 parent 2b36919 commit d981b68

File tree

9 files changed

+88
-93
lines changed

9 files changed

+88
-93
lines changed

CHANGELOG.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,6 @@ This driver uses semantic versioning:
1616

1717
## [Unreleased]
1818

19-
### Removed
20-
21-
- Removed `Dict` type from `connection` module
22-
23-
The `Dict<T>` type was identical to `Record<string, T>` and has been replaced
24-
with this built-in type across arangojs.
25-
26-
### Changed
27-
28-
- Updated TypeScript to version 4
29-
30-
This may result in type signatures that are incompatible with TypeScript 3
31-
being added in future releases (including patch releases).
32-
3319
### Added
3420

3521
- Added `collection.documents` for fetching multiple documents

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"semver": "^7.3.5",
9696
"source-map-support": "^0.5.19",
9797
"typedoc": "^0.20.36",
98-
"typescript": "^4.2.4",
98+
"typescript": "^3.8.3",
9999
"url": "^0.11.0",
100100
"webpack": "^4.46.0",
101101
"webpack-cli": "^4.6.0",

src/aql.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @packageDocumentation
1212
*/
1313
import { ArangoCollection, isArangoCollection } from "./collection";
14+
import { Dict } from "./connection";
1415
import { Graph, isArangoGraph } from "./graph";
1516
import { isArangoView, View } from "./view";
1617

@@ -29,7 +30,7 @@ export interface AqlQuery {
2930
* Names of parameters representing collections are prefixed with an
3031
* at-symbol.
3132
*/
32-
bindVars: Record<string, any>;
33+
bindVars: Dict<any>;
3334
}
3435

3536
/**
@@ -206,7 +207,7 @@ export function aql(
206207
...args: AqlValue[]
207208
): GeneratedAqlQuery {
208209
const strings = [...templateStrings];
209-
const bindVars: Record<string, any> = {};
210+
const bindVars: Dict<any> = {};
210211
const bindValues = [];
211212
let query = strings[0];
212213
for (let i = 0; i < args.length; i++) {

src/collection.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
* @packageDocumentation
1313
*/
14-
import { ArangoResponseMetadata, Params } from "./connection";
14+
import { ArangoResponseMetadata, Dict, Params } from "./connection";
1515
import { ArrayCursor, BatchedArrayCursor } from "./cursor";
1616
import { Database } from "./database";
1717
import {
@@ -1388,7 +1388,7 @@ export interface DocumentCollection<T extends Record<string, unknown> = any>
13881388
): Promise<
13891389
ArangoResponseMetadata &
13901390
CollectionMetadata &
1391-
CollectionProperties & { count: number; figures: Record<string, any> }
1391+
CollectionProperties & { count: number; figures: Dict<any> }
13921392
>;
13931393
/**
13941394
* Retrieves the collection revision ID.
@@ -3441,7 +3441,7 @@ export class Collection<T extends Record<string, unknown> = any>
34413441
CollectionMetadata &
34423442
CollectionProperties & {
34433443
count: number;
3444-
figures: Record<string, any>;
3444+
figures: Dict<any>;
34453445
} & ArangoResponseMetadata
34463446
> {
34473447
return this._db.request({

src/connection.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ import {
3333
const MIME_JSON = /\/(json|javascript)(\W|$)/;
3434
const LEADER_ENDPOINT_HEADER = "x-arango-endpoint";
3535

36+
/**
37+
* Generic type representing an object with values of a given value type.
38+
*
39+
* @param T - Type of the object's property values.
40+
*/
41+
export type Dict<T> = { [key: string]: T };
42+
3643
/**
3744
* Determines the behavior when multiple URLs are used:
3845
*
@@ -53,13 +60,13 @@ export type LoadBalancingStrategy = "NONE" | "ROUND_ROBIN" | "ONE_RANDOM";
5360
*
5461
* Header names should always be lowercase.
5562
*/
56-
export type Headers = Record<string, string>;
63+
export type Headers = Dict<string>;
5764

5865
/**
5966
* An arbitrary object with scalar values representing query string parameters
6067
* and their values.
6168
*/
62-
export type Params = Record<string, any>;
69+
export type Params = Dict<any>;
6370

6471
/**
6572
* Generic properties shared by all ArangoDB HTTP API responses.

src/cursor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* @packageDocumentation
99
*/
1010
import { LinkedList } from "x3-linkedlist";
11+
import { Dict } from "./connection";
1112
import { Database } from "./database";
1213

1314
/**
@@ -32,7 +33,7 @@ export interface CursorExtras {
3233
/**
3334
* Additional statistics about the query execution.
3435
*/
35-
stats?: Record<string, any>;
36+
stats?: Dict<any>;
3637
}
3738

3839
interface BatchView<T = any> {

0 commit comments

Comments
 (0)