11"use strict" ;
22const redis = require ( "redis" ) ,
3+ // @ts -ignore
34 util = require ( "util" ) ,
45 ResultSet = require ( "./resultSet" ) ;
56
@@ -12,9 +13,9 @@ class Graph {
1213 * See: node_redis for more options on createClient
1314 *
1415 * @param {string } graphId the graph id
15- * @param {string | RedisClient } [host] Redis host or node_redis client
16- * @param {string | int } [port] Redis port
17- * @param {ClientOpts } [options] node_redis options
16+ * @param {string | import('redis'). RedisClient } [host] Redis host or node_redis client
17+ * @param {string | number } [port] Redis port (integer)
18+ * @param {Object } [options] node_redis options
1819 */
1920 constructor ( graphId , host , port , options ) {
2021 this . _graphId = graphId ; // Graph ID
@@ -42,7 +43,7 @@ class Graph {
4243 /**
4344 * Auxiliary function to extract string(s) data from procedures such as:
4445 * db.labels, db.propertyKeys and db.relationshipTypes
45- * @param {ResultSet } resultSet - a procedure result set
46+ * @param {import('./resultSet') } resultSet - a procedure result set
4647 * @returns {string[] } strings array.
4748 */
4849 _extractStrings ( resultSet ) {
@@ -55,7 +56,7 @@ class Graph {
5556
5657 /**
5758 * Transforms a parameter value to string.
58- * @param {object } paramValue
59+ * @param {* } paramValue
5960 * @returns {string } the string representation of paramValue.
6061 */
6162 paramToString ( paramValue ) {
@@ -100,7 +101,7 @@ class Graph {
100101 * @async
101102 * @param {string } query Cypher query
102103 * @param {Map } [params] Parameters map
103- * @returns {ResultSet } a promise contains a result set
104+ * @returns {Promise<import('./resultSet')> } a promise contains a result set
104105 */
105106 async query ( query , params ) {
106107 if ( params ) {
@@ -118,7 +119,7 @@ class Graph {
118119 /**
119120 * Deletes the entire graph
120121 * @async
121- * @returns {ResultSet } a promise contains the delete operation running time statistics
122+ * @returns {Promise<import('./resultSet')> } a promise contains the delete operation running time statistics
122123 */
123124 async deleteGraph ( ) {
124125 var res = await this . _sendCommand ( "graph.DELETE" , [ this . _graphId ] ) ;
@@ -135,7 +136,7 @@ class Graph {
135136 * @param {string } procedure Procedure to call
136137 * @param {string[] } [args] Arguments to pass
137138 * @param {string[] } [y] Yield outputs
138- * @returns {ResultSet } a promise contains the procedure result set data
139+ * @returns {Promise<import('./resultSet')> } a promise contains the procedure result set data
139140 */
140141 callProcedure ( procedure , args = new Array ( ) , y = new Array ( ) ) {
141142 let q = "CALL " + procedure + "(" + args . join ( "," ) + ")" + y . join ( " " ) ;
@@ -198,7 +199,7 @@ class Graph {
198199
199200 /**
200201 * Retrieves label by ID.
201- * @param {int } id internal ID of label.
202+ * @param {number } id internal ID of label. (integer)
202203 * @returns {string } String label.
203204 */
204205 getLabel ( id ) {
@@ -208,8 +209,8 @@ class Graph {
208209 /**
209210 * Retrieve all the labels from the graph and returns the wanted label
210211 * @async
211- * @param {int } id internal ID of label.
212- * @returns {string } String label.
212+ * @param {number } id internal ID of label. (integer)
213+ * @returns {Promise< string> } String label.
213214 */
214215 async fetchAndGetLabel ( id ) {
215216 await this . labels ( ) ;
@@ -218,8 +219,8 @@ class Graph {
218219
219220 /**
220221 * Retrieves relationship type by ID.
221- * @param {int } id internal ID of relationship type.
222- * @return String relationship type.
222+ * @param {number } id internal ID of relationship type. (integer)
223+ * @returns { string } relationship type.
223224 */
224225 getRelationship ( id ) {
225226 return this . _relationshipTypes [ id ] ;
@@ -228,8 +229,8 @@ class Graph {
228229 /**
229230 * Retrieves al the relationships types from the graph, and returns the wanted type
230231 * @async
231- * @param {int } id internal ID of relationship type.
232- * @returns {string } String relationship type.
232+ * @param {number } id internal ID of relationship type. (integer)
233+ * @returns {Promise< string> } String relationship type.
233234 */
234235 async fetchAndGetRelationship ( id ) {
235236 await this . relationshipTypes ( ) ;
@@ -238,7 +239,7 @@ class Graph {
238239
239240 /**
240241 * Retrieves property name by ID.
241- * @param {int } id internal ID of property.
242+ * @param {number } id internal ID of property. (integer)
242243 * @returns {string } String property.
243244 */
244245 getProperty ( id ) {
@@ -247,9 +248,9 @@ class Graph {
247248
248249 /**
249250 * Retrieves al the properties from the graph, and returns the wanted property
250- * @async
251- * @param {int } id internal ID of property.
252- * @returns {string } String property.
251+ * @asyncTODO
252+ * @param {number } id internal ID of property. (integer)
253+ * @returns {Promise< string> } String property.
253254 */
254255 async fetchAndGetProperty ( id ) {
255256 await this . propertyKeys ( ) ;
0 commit comments