socio
Version:
A WebSocket Real-Time Communication (RTC) API framework.
68 lines (67 loc) • 1.83 kB
TypeScript
import type { QueryMarker } from "./types.d.ts";
import type { SocioStringObj } from "./sql-parsing.js";
export declare enum ServerMessageKind {
SUB = 0,
UNSUB = 1,
SQL = 2,
PING = 3,
AUTH = 4,
GET_PERM = 5,
PROP_SUB = 6,
PROP_UNSUB = 7,
PROP_GET = 8,
PROP_SET = 9,
PROP_REG = 10,
SERV = 11,
ADMIN = 12,
RECON = 13,
UP_FILES = 14,
GET_FILES = 15,
IDENTIFY = 16,
DISCOVERY = 17,
RPC = 18,
OK = 19
}
export declare enum ClientMessageKind {
CON = 0,
UPD = 1,
PONG = 2,
AUTH = 3,
GET_PERM = 4,
RES = 5,
PROP_UPD = 6,
PROP_DROP = 7,
CMD = 8,
RECON = 9,
RECV_FILES = 10,
TIMEOUT = 11,
RPC = 12
}
export declare const socio_string_markers_regex: RegExp;
export declare function SocioStringParse(str: string): SocioStringObj;
export declare function SocioMarkerHas(marker: QueryMarker, { parsed, str }: {
parsed?: string[] | null;
str?: string;
}): boolean;
export declare function initLifecycleHooks<T extends Record<string, unknown>>(): T;
export declare function sleep(seconds?: number): Promise<unknown>;
export declare function clamp(x: number, min: number, max: number): number;
export declare function GetAllMethodNamesOf(obj: any): string[];
export declare const perMessageDeflate: {
zlibDeflateOptions: {
chunkSize: number;
memLevel: number;
level: number;
};
zlibInflateOptions: {
chunkSize: number;
};
clientNoContextTakeover: boolean;
serverNoContextTakeover: boolean;
serverMaxWindowBits: number;
concurrencyLimit: number;
threshold: number;
};
export declare function socio_encode(o: any): any;
export declare function socio_decode(buffer: Uint8Array): any;
export declare function FastHash(str: string): number;