Files
dealplustech/dealplustech-astro/node_modules/@libsql/hrana-client/lib-esm/ws/client.d.ts
Kunthawat b2e427791b feat: Add complete PDPA compliance pages
- Admin dashboard (/admin/consent-logs) with password auth
- Consent API (/api/consent) with SQLite + IP hashing
- Privacy Policy (Thai) - PDPA Section 36 compliant
- Terms & Conditions (Thai) - 9 standard clauses
- .env.example template with Umami placeholder

All pages preserve current design system.
2026-03-10 21:28:23 +07:00

49 lines
1.8 KiB
TypeScript

/// <reference types="ws" />
import { WebSocket } from "@libsql/isomorphic-ws";
import type { ProtocolVersion, ProtocolEncoding } from "../client.js";
import { Client } from "../client.js";
import { IdAlloc } from "../id_alloc.js";
import { Sql, SqlOwner } from "../sql.js";
import type * as proto from "./proto.js";
import { WsStream } from "./stream.js";
export type Subprotocol = {
version: ProtocolVersion;
encoding: ProtocolEncoding;
};
export declare const subprotocolsV2: Map<string, Subprotocol>;
export declare const subprotocolsV3: Map<string, Subprotocol>;
/** A client for the Hrana protocol over a WebSocket. */
export declare class WsClient extends Client implements SqlOwner {
#private;
/** @private */
_streamIdAlloc: IdAlloc;
/** @private */
_cursorIdAlloc: IdAlloc;
/** @private */
constructor(socket: WebSocket, jwt: string | undefined);
/** Get the protocol version negotiated with the server, possibly waiting until the socket is open. */
getVersion(): Promise<ProtocolVersion>;
/** @private */
_ensureVersion(minVersion: ProtocolVersion, feature: string): void;
/** @private */
_sendRequest(request: proto.Request, callbacks: ResponseCallbacks): void;
/** Open a {@link WsStream}, a stream for executing SQL statements. */
openStream(): WsStream;
/** Cache a SQL text on the server. This requires protocol version 2 or higher. */
storeSql(sql: string): Sql;
/** @private */
_closeSql(sqlId: number): void;
/** Close the client and the WebSocket. */
close(): void;
/** True if the client is closed. */
get closed(): boolean;
}
export interface OpenCallbacks {
openCallback: () => void;
errorCallback: (_: Error) => void;
}
export interface ResponseCallbacks {
responseCallback: (_: proto.Response) => void;
errorCallback: (_: Error) => void;
}