UNPKG

sdg

Version:

pomelo ts

35 lines (34 loc) 1.01 kB
/// <reference types="node" /> import { EventEmitter } from 'events'; import Session from './session'; import SessionService from '../sessionService'; import { FRONTEND_ID, IFrontendSessionExport, IObject, ISession, SID, UID } from '../../..'; export declare class FrontendSession extends EventEmitter implements ISession { private readonly session; id: SID; frontendId: FRONTEND_ID; uid: UID; settings: IObject; sessionService: SessionService; constructor(session: Session); on(event: string, listener: (...args: any[]) => void): this; bind(uid: UID): void; unbind(uid: UID): void; push(key: string): Promise<void>; pushAll(): Promise<void>; get(key: string): any; set(key: string, value: any): void; /** * 导出session字段 */ export(): IFrontendSessionExport; /** * 是否在线 */ get isOnline(): boolean; /** * 获取客户端的地址 */ get clientIp(): string; private cloneSession; }