Skip to content

Commit

Permalink
fix(typings): fix the type of the socket#id attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Jan 2, 2024
1 parent b3f0cab commit f9c16f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class Socket<
public readonly io: Manager<ListenEvents, EmitEvents>;

/**
* A unique identifier for the session.
* A unique identifier for the session. `undefined` when the socket is not connected.
*
* @example
* const socket = io();
Expand All @@ -162,7 +162,7 @@ export class Socket<
* console.log(socket.id); // "G5p5..."
* });
*/
public id: string;
public id: string | undefined;

/**
* The session ID used for connection state recovery, which must not be shared (unlike {@link id}).
Expand Down

0 comments on commit f9c16f2

Please sign in to comment.