dlovely-websocket
Version:
WebSocket For Dlovely
26 lines (25 loc) • 724 B
TypeScript
import type { SocketControl } from './SocketControl'
import type { SocketApp } from './SocketApp'
export declare class SocketCache<
Control extends SocketApp.Roles,
Name extends SocketApp.StoreNames<Control>,
Val extends SocketApp.Store<Control, Name>,
Key extends keyof Val
> {
readonly name: Name
readonly key: Key
private readonly broadcast
constructor(
name: Name,
init: Val[] | (() => Val[]) | (() => Promise<Val[]>),
key: Key,
control: SocketControl<Control>
)
private readonly _store
get state(): (string | number)[]
get size(): number
get(key: string | number): Val | undefined
add(val: Val): void
set(val: Val): void
del(key: string): void
}