From 8c66f9a41b4b548f0a3c1d2f743c70c4baa8c286 Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Sun, 13 May 2018 22:05:12 +0200 Subject: [PATCH] adding jsdoc to ErrorCodes --- lib/types.d.ts | 18 ++++++++++++++++++ lib/types.js | 18 ++++++++++++++++++ lib/types.js.map | 2 +- package.json | 2 +- src/types.ts | 23 +++++++++++++++++++++++ 5 files changed, 61 insertions(+), 2 deletions(-) diff --git a/lib/types.d.ts b/lib/types.d.ts index 3126c4c..1b022d4 100644 --- a/lib/types.d.ts +++ b/lib/types.d.ts @@ -1,10 +1,28 @@ /// export declare enum ErrorCodes { + /** + * No error + */ NoError = 0, + /** + * Format error - unable to interpret query + */ FormatError = 1, + /** + * Server failure - internal problem + */ ServerFailure = 2, + /** + * Name error - Only for authorative name server, domain name of query does not exist + */ NameError = 3, + /** + * Not implemented - Request not supported + */ NotImplemented = 4, + /** + * Refused - Nameserver refuses request + */ Refused = 5, } export interface MessageHeader { diff --git a/lib/types.js b/lib/types.js index 613ffa9..42b880d 100644 --- a/lib/types.js +++ b/lib/types.js @@ -10,11 +10,29 @@ Object.defineProperty(exports, "__esModule", { value: true }); // * var ErrorCodes; (function (ErrorCodes) { + /** + * No error + */ ErrorCodes[ErrorCodes["NoError"] = 0] = "NoError"; + /** + * Format error - unable to interpret query + */ ErrorCodes[ErrorCodes["FormatError"] = 1] = "FormatError"; + /** + * Server failure - internal problem + */ ErrorCodes[ErrorCodes["ServerFailure"] = 2] = "ServerFailure"; + /** + * Name error - Only for authorative name server, domain name of query does not exist + */ ErrorCodes[ErrorCodes["NameError"] = 3] = "NameError"; + /** + * Not implemented - Request not supported + */ ErrorCodes[ErrorCodes["NotImplemented"] = 4] = "NotImplemented"; + /** + * Refused - Nameserver refuses request + */ ErrorCodes[ErrorCodes["Refused"] = 5] = "Refused"; })(ErrorCodes = exports.ErrorCodes || (exports.ErrorCodes = {})); //# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/lib/types.js.map b/lib/types.js.map index d3c1f30..53770c8 100644 --- a/lib/types.js.map +++ b/lib/types.js.map @@ -1 +1 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;AACA,uBAAuB;AACvB,kDAAkD;AAClD,8CAA8C;AAC9C,kGAAkG;AAClG,0DAA0D;AAC1D,0DAA0D;AAC1D,wCAAwC;AACxC,WAAW;AACX,IAAY,UAOX;AAPD,WAAY,UAAU;IACnB,iDAAW,CAAA;IACX,yDAAW,CAAA;IACX,6DAAa,CAAA;IACb,qDAAS,CAAA;IACT,+DAAc,CAAA;IACd,iDAAO,CAAA;AACV,CAAC,EAPW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAOrB"} \ No newline at end of file +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;AACA,uBAAuB;AACvB,kDAAkD;AAClD,8CAA8C;AAC9C,kGAAkG;AAClG,0DAA0D;AAC1D,0DAA0D;AAC1D,wCAAwC;AACxC,WAAW;AACX,IAAY,UA8BX;AA9BD,WAAY,UAAU;IACnB;;OAEG;IACH,iDAAW,CAAA;IAEX;;OAEG;IACH,yDAAW,CAAA;IAEX;;OAEG;IACH,6DAAa,CAAA;IAEb;;OAEG;IACH,qDAAS,CAAA;IAET;;OAEG;IACH,+DAAc,CAAA;IAEd;;OAEG;IACH,iDAAO,CAAA;AACV,CAAC,EA9BW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QA8BrB"} \ No newline at end of file diff --git a/package.json b/package.json index 4c7184a..b3e3e1e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nodename-core", - "version": "0.1.5", + "version": "0.1.6", "main": "lib/listener.js", "types": "lib/listener.d.ts", "author": "Fabian Stamm ", diff --git a/src/types.ts b/src/types.ts index 3b77193..e0453c6 100644 --- a/src/types.ts +++ b/src/types.ts @@ -8,11 +8,34 @@ // * 6 - 15 Reserved for future usage // * export enum ErrorCodes { + /** + * No error + */ NoError = 0, + + /** + * Format error - unable to interpret query + */ FormatError, + + /** + * Server failure - internal problem + */ ServerFailure, + + /** + * Name error - Only for authorative name server, domain name of query does not exist + */ NameError, + + /** + * Not implemented - Request not supported + */ NotImplemented, + + /** + * Refused - Nameserver refuses request + */ Refused }