-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhkgraph.d.ts
89 lines (89 loc) · 2.66 KB
/
hkgraph.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
82
83
84
85
86
87
88
89
/**
* Copyright (c) 2016-present, IBM Research
* Licensed under The MIT License [see LICENSE for details]
*/
export = HKGraph;
declare class HKGraph {
nodes: {};
virtualNodes: {};
contexts: {};
virtualContexts: {};
links: {};
virtualLinks: {};
connectors: {};
refs: {};
trails: {};
actions: {};
bindsMap: {};
linkMap: {};
virtualLinkMap: {};
refMap: {};
orphans: {};
contextMap: {};
virtualContextMap: {};
relationless: {};
generateId: typeof generateId;
hasId(id: any): boolean;
/**
* Update an entity
* @param {object} entity an entity with an id and ALL updated properties (including intrinsecs properties)
* @returns {object} the new entity
*/
setEntity(entity: object): object;
/**
* Add a new entity to the graph
* @param {object} entity The entity object to be added.
* @returns {object} The entity added, if the input object does not have an id, the returned will have.
*/
addEntity(entity: object): object;
/**
* Add a new entities to the graph
* @param {object} entities The entities object to be added.
*/
addEntities(entities: object): void;
/**
* @param {string} id the id of entity to be removed
* @returns {object} the removed entity
*/
removeEntity(id: string): object;
hasBind(connectorId: any, bind: any): boolean;
getReferences(id: any): any[];
hasReference(id: any, parent: any): boolean;
getReference(id: any, parent: any): any;
getChildren(contextId: any): any;
getNeighbors(entityId: any): HKEntity[];
getLinks(entityId: any): {};
getAllConnectors(): any;
/**
* Returns an entity in this graph having `id`.
*
* @param {string} id ID of requested entity. Null if requested entity is the null context.
*
* @returns {HKEntity | null} Returns the entity of `id`, or `null` if `id` not found in this graph object.
*
*/
getEntity(id: string): HKEntity | null;
/**
* Returns HK entities in this graph indexed by id.
*
* @returns {Object.<string,HKEntity>}
*
*/
getEntities(): {
[x: string]: HKEntity;
};
serialize(): string;
deserialize(str: any): HKGraph;
}
declare namespace HKGraph {
const NODE_TYPE: "node";
const VIRTUAL_NODE_TYPE: "virtualnode";
const CONTEXT_TYPE: "context";
const VIRTUAL_CONTEXT_TYPE: "virtualcontext";
const LINK_TYPE: "link";
const VIRTUAL_LINK_TYPE: "virtuallink";
const CONNECTOR_TYPE: "connector";
const INTERFACE: "interface";
}
declare function generateId(model: any, length: any): any;
import HKEntity = require("./hkentity");