Files
dealplustech/dealplustech-astro/node_modules/@libsql/hrana-client/lib-esm/ws/client.d.ts
Kunthawat Greethong 6402d885f9 Complete Astro migration - PDPA compliant website
- Migrated all pages from Next.js to Astro
- Added PDPA-compliant Privacy Policy (Thai)
- Added PDPA-compliant Terms & Conditions (Thai)
- Added Cookie Policy with disclosure (Thai)
- Implemented cookie consent banner (client-side)
- Integrated Umami Analytics placeholder
- Blog system with 3 posts
- Optimized Docker configuration for production
- Static site build (184KB, 11 pages)
- Ready for Easypanel deployment

Backup: /Users/kunthawatgreethong/Gitea/dealplustech-backup-nextjs-20260309.tar.gz
2026-03-09 18:28:01 +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;
}