Skip to content

Commit 3a40483

Browse files
committed
docs: Fixed all JSDocs
1 parent 7f99ba3 commit 3a40483

File tree

5 files changed

+14
-29
lines changed

5 files changed

+14
-29
lines changed

src/lib/Structures/Base/SocketHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export class SocketHandler extends Base {
151151
this.disconnect();
152152
break;
153153
}
154-
const message = this._handleMessage(processed);
154+
const message = this._handleMessage(processed as RawMessage);
155155
if (message === null) continue;
156156
this.node.emit('message', message);
157157
}

src/lib/Structures/NodeServer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ export class NodeServer {
129129

130130
/**
131131
* Disconnect the server and rejects all current messages
132-
* @returns {boolean}
133132
*/
134133
public disconnect(): boolean {
135134
if (!this.server) return false;

src/lib/Structures/NodeSocket.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export class NodeSocket extends SocketHandler {
6060

6161
/**
6262
* Disconnect from the socket, this will also reject all messages
63-
* @returns {boolean}
6463
*/
6564
public disconnect(): boolean {
6665
if (!super.disconnect()) return false;

src/lib/Structures/Queue.ts

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ import {
1414
import { readHeader } from '../Util/Header';
1515
import { NodeSocket } from './NodeSocket';
1616
import { Node } from '../Node';
17+
import { Socket } from 'net';
1718

18-
/**
19-
* @extends {Map<string,QueueEntry>}
20-
*/
2119
export class Queue extends Map<string, QueueEntry> {
2220

2321
private nodeSocket!: NodeSocket;
@@ -40,39 +38,22 @@ export class Queue extends Map<string, QueueEntry> {
4038

4139
/**
4240
* The name of the client that manages this instance
43-
* @type {string}
4441
*/
45-
public get name() {
46-
return this.nodeSocket.name;
42+
public get name(): string {
43+
return this.nodeSocket.name!;
4744
}
4845

4946
/**
5047
* The socket contained in the client that manages this instance
51-
* @type {Socket}
5248
*/
53-
public get socket() {
54-
return this.nodeSocket.socket;
49+
public get socket(): Socket {
50+
return this.nodeSocket.socket!;
5551
}
5652

57-
/**
58-
* @typedef {Object} QueueObject
59-
* @property {string} id The id of the message
60-
* @property {boolean} receptive Whether this message is receptive or not
61-
* @property {Buffer} data The data received from the socket
62-
* @private
63-
*/
64-
6553
/**
6654
* Returns a new Iterator object that parses each value for this queue.
67-
* @name @@iterator
68-
* @method
69-
* @instance
70-
* @generator
71-
* @returns {Iterator<QueueObject|symbol>}
72-
* @memberof Queue
7355
*/
74-
75-
public *process(buffer: Buffer) {
56+
public *process(buffer: Buffer): IterableIterator<QueueObject | symbol> {
7657
if (this._rest) {
7758
buffer = Buffer.concat([this._rest, buffer]);
7859
this._rest = null;
@@ -155,3 +136,9 @@ interface QueueEntry {
155136
resolve: (value: any) => void;
156137
reject: (error: Error) => void;
157138
}
139+
140+
interface QueueObject {
141+
id: string;
142+
receptive: boolean;
143+
data: any;
144+
}

src/lib/Util/Transform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function _compressSmallInteger(integer: number) {
5757

5858
/**
5959
* Get the message details
60-
* @param {*} message The message to convert
60+
* @param message The message to convert
6161
* @returns {Array<number | Buffer>}
6262
*/
6363
export function _getMessageDetails(message: any): [number, Buffer] {

0 commit comments

Comments
 (0)