helene
Version:
Real-time Web Apps for Node.js
21 lines (20 loc) • 500 B
TypeScript
import { v4 } from '@lukeed/uuid';
export declare enum PayloadType {
METHOD = "method",
RESULT = "result",
EVENT = "event",
ERROR = "error",
SETUP = "setup",
HEARTBEAT = "heartbeat"
}
export declare namespace Presentation {
const uuid: typeof v4;
type Payload = {
type: PayloadType;
[key: string]: any;
};
function decode<T = Payload>(payload: string | {
data: string;
}): T;
function encode<T = Payload>(payload: T): string;
}