websocket-ts
Version:
<div> <div align="center"> <img src="https://raw.githubusercontent.com/jjxxs/websocket-ts/gh-pages/websocket-ts-logo.svg" alt="websocket-ts" width="300" height="65" /> </div> <p align="center"> <img src="https://github.com/jjxxs/websocket-ts
19 lines (17 loc) • 453 B
text/typescript
/**
* A WebsocketBuffer is used to store messages temporarily until they can be sent.
*/
export interface WebsocketBuffer<
E = string | ArrayBufferLike | Blob | ArrayBufferView,
> {
/**
* Adds an element to the buffer.
* @param element the element to add
*/
add(element: E): void;
/**
* Reads an element from the buffer.
* @return an element from the buffer or undefined if the buffer is empty
*/
read(): E | undefined;
}