Skip to content

SocketSessionData

@tsed/socketio

Usage

typescript
import { SocketSessionData } from "@tsed/socketio";

See /packages/third-parties/socketio/src/types/class/SocketSessionData.ts.

Overview

ts
class SocketSessionData extends Map<string, unknown> {
    get size(): number;
    static get [Symbol.species](): MapConstructor;
    constructor(data: Record<string, unknown>);
    [Symbol.iterator](): IterableIterator<[string, unknown]>;
    clear(): void;
    delete(key: string): boolean;
    entries(): IterableIterator<[string, unknown]>;
    forEach(callbackfn: (value: unknown, key: string, map: Map<string, unknown>) => void, thisArg?: any): void;
    get(key: string): unknown | undefined;
    has(key: string): boolean;
    keys(): IterableIterator<string>;
    set(key: string, value: unknown): this;
    values(): IterableIterator<unknown>;
}

Description

Represents session data associated with a socket connection, providing a compatibility layer with Ts.ED v7 by wrapping a socket.data which is used to archive recoverability and resiliency to a Map instance.

This class implements the Map<string, unknown> interface and provides methods and properties to manage and manipulate session data.

get size

ts
get size(): number;

static get [Symbol.species]

ts
static get [Symbol.species](): MapConstructor;

[Symbol.iterator]

ts
[Symbol.iterator](): IterableIterator<[string, unknown]>;

clear

ts
clear(): void;

delete

ts
delete(key: string): boolean;

entries

ts
entries(): IterableIterator<[string, unknown]>;

forEach

ts
forEach(callbackfn: (value: unknown, key: string, map: Map<string, unknown>) => void, thisArg?: any): void;

get

ts
get(key: string): unknown | undefined;

has

ts
has(key: string): boolean;

keys

ts
keys(): IterableIterator<string>;

set

ts
set(key: string, value: unknown): this;

values

ts
values(): IterableIterator<unknown>;

Released under the MIT License.