-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.d.ts
81 lines (80 loc) · 2.73 KB
/
index.d.ts
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
/*!
* Copyright (C) 2017 Glayzzle (BSD3 License)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*/
declare module "grafine" {
export class shard {
constructor(db: graph, id: Number);
id(): Number;
isChanged(): Boolean;
getSize(): Number;
export(): any;
import(data: any): index;
get(uuid: Number): point;
attach(point: point): shard;
remove(point: point): shard;
factory(uuid: Number): point;
factory(uuid: Number, data: any): point;
}
export class index {
constructor(db: graph, id: Number);
id(): Number;
isChanged(): Boolean;
getSize(): Number;
export(): any;
import(data: any): index;
add(key: String, value: String, point: point): index;
add(key: String, value: String, uuid: Number): index;
remove(key: String, value: String, point: point): index;
remove(key: String, value: String, uuid: Number): index;
search(key: String, value: String): Number[];
each(key: String, cb: (value: String, uuid: Number) => void): index;
}
export class point {
uuid: Number;
constructor(db: graph);
export(): any;
import(data: any): point;
delete(): point;
removeAttribute(name: String): point;
removeIndex(name: String): point;
getIndex(name: String): String;
index(name: String, value: String): point;
set(property: String, object: point): point;
add(property: String, object: point): point;
get(property: String): Number[];
first(property: String): Number;
}
class ExportStructure {
hash: Number;
capacity: Number;
uuid: Number;
shards: any[];
indexes: any[];
}
export class graph {
constructor();
constructor(shards: Number);
constructor(shards: Number, capacity: Number);
size(): Number;
uuid(): Number;
shard(uuid: Number): shard;
createShard(id: Number): shard;
getIndex(key:String): index;
readIndex(key: String, cb: (value: String, uuid: Number) => void): graph;
get(uuid: Number): point;
resolve(data: Number): point;
resolve(data: Number[]): point[];
removeIndex(key: String, value: String, point: point): graph;
removeIndex(key: String, value: String, uuid: Number): graph;
createIndex(id: Number): index;
export(): ExportStructure;
import(data: ExportStructure): graph;
create(): point;
create(point: point): point;
search(criteria: any): Number[];
shards(): shard[];
indexes(): index[];
}
}