File tree Expand file tree Collapse file tree 2 files changed +19
-23
lines changed Expand file tree Collapse file tree 2 files changed +19
-23
lines changed Original file line number Diff line number Diff line change 11// @ts -self-types="../type/version.d.ts"
22
33import { Uint16 } from "./dep.ts" ;
4+ import { Enum } from "./enum.js" ;
45
56/**
67 * Version class representing different protocol versions.
@@ -68,6 +69,3 @@ export class Version extends Enum {
6869
6970}
7071
71-
72-
73- // npx -p typescript tsc ./src/version.js --declaration --allowJs --emitDeclarationOnly --lib ESNext --outDir ./dist
Original file line number Diff line number Diff line change @@ -9,56 +9,54 @@ import { Enum } from "../src/enum.js";
99export class Version extends Enum {
1010 /**
1111 * SSL 3.0 version with value 0x0300
12- * @type {Version }
1312 */
1413 static SSL30 : Version ;
14+
1515 /**
1616 * TLS 1.0 version with value 0x0301
17- * @type {Version }
1817 */
1918 static TLS10 : Version ;
19+
2020 /**
2121 * TLS 1.1 version with value 0x0302
22- * @type {Version }
2322 */
2423 static TLS11 : Version ;
24+
2525 /**
2626 * TLS 1.2 version with value 0x0303
27- * @type {Version }
2827 */
2928 static TLS12 : Version ;
29+
3030 /**
3131 * TLS 1.3 version with value 0x0304
32- * @type {Version }
3332 */
3433 static TLS13 : Version ;
34+
3535 /**
36- * Legacy version representing TLS 1.2 with value 0x0303
37- * @type {Version }
36+ * Legacy version representing TLS 1.2
3837 */
3938 static legacy : Version ;
39+
4040 /**
4141 * Parses a 2-byte Uint8Array to determine the corresponding Version instance.
42- *
43- * @static
44- * @param {Uint8Array } octet - The 2-byte array representing a version value.
45- * @returns {Version } The matching Version instance.
46- * @throws {Error } If the version type in octet is unknown.
42+ * @param octet - The 2-byte array representing a version value.
43+ * @returns The matching Version instance.
44+ * @throws Error if the version type in octet is unknown.
4745 */
4846 static from ( octet : Uint8Array ) : Version ;
47+
4948 /**
5049 * Gets the bit size of the version (16 bits).
51- *
52- * @returns {number } The bit size of the version.
5350 */
5451 get bit ( ) : number ;
55- get Uint16 ( ) : Uint16 ;
56- get byte ( ) : Uint16 ;
52+
5753 /**
58- * Returns the byte length
59- * @returns {number } The byte length, which is always 2.
54+ * Gets the byte length of the version (2 bytes).
6055 */
6156 get length ( ) : number ;
62-
63- }
6457
58+ /**
59+ * Gets the version as a Uint16 instance.
60+ */
61+ get byte ( ) : Uint16 ;
62+ }
You can’t perform that action at this time.
0 commit comments