forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocuments.d.ts
More file actions
99 lines (99 loc) · 2.8 KB
/
Copy pathdocuments.d.ts
File metadata and controls
99 lines (99 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/**
* ```ts
* import type { Document, Edge } from "arangojs/documents";
* ```
*
* The "documents" module provides document/edge related types for TypeScript.
*
* @packageDocumentation
*/
/**
* Common ArangoDB metadata properties of a document.
*/
export declare type DocumentMetadata = {
/**
* Key of the document, which uniquely identifies the document within its
* collection.
*/
_key: string;
/**
* Unique ID of the document, which is composed of the collection name
* and the document `_key`.
*/
_id: string;
/**
* Revision of the document data.
*/
_rev: string;
};
/**
* ArangoDB metadata defining the relations of an edge document.
*/
export declare type EdgeMetadata = {
/**
* Unique ID of the document that acts as the edge's start vertex.
*/
_from: string;
/**
* Unique ID of the document that acts as the edge's end vertex.
*/
_to: string;
};
/**
* Type representing an object that can be stored in a collection.
*/
export declare type DocumentData<T extends object = any> = T & Partial<DocumentMetadata> & Partial<EdgeMetadata>;
/**
* Type representing an object that can be stored in an edge collection.
*/
export declare type EdgeData<T extends object = any> = T & Partial<DocumentMetadata> & EdgeMetadata;
/**
* Type representing a document stored in a collection.
*/
export declare type Document<T extends object = any> = T & DocumentMetadata & Partial<EdgeMetadata>;
/**
* Type representing an edge document stored in an edge collection.
*/
export declare type Edge<T extends object = any> = T & DocumentMetadata & EdgeMetadata;
/**
* Type representing patch data for a given object type to represent a payload
* ArangoDB can apply in a document PATCH request (i.e. a partial update).
*
* This differs from `Partial` in that it also applies itself to any nested
* objects recursively.
*/
export declare type Patch<T = object> = {
[K in keyof T]?: T[K] | Patch<T[K]>;
};
/**
* An object with an ArangoDB document `_id` property.
*
* See {@link DocumentMetadata}.
*/
export declare type ObjectWithId = {
[key: string]: any;
_id: string;
};
/**
* An object with an ArangoDB document `_key` property.
*
* See {@link DocumentMetadata}.
*/
export declare type ObjectWithKey = {
[key: string]: any;
_key: string;
};
/**
* A value that can be used to identify a document within a collection in
* arangojs methods, i.e. a partial ArangoDB document or the value of a
* document's `_key` or `_id`.
*
* See {@link DocumentMetadata}.
*/
export declare type DocumentSelector = ObjectWithId | ObjectWithKey | string;
/**
* @internal
* @hidden
*/
export declare function _documentHandle(selector: DocumentSelector, collectionName: string, strict?: boolean): string;
//# sourceMappingURL=documents.d.ts.map