- ✅ Ticket 1.1: Estructura Clean Architecture en backend - ✅ Ticket 1.2: Schemas Zod compartidos - ✅ Ticket 1.3: Refactorización drugs.ts (1362 → 8 archivos modulares) - ✅ Ticket 1.4: Refactorización procedures.ts (3583 → 6 archivos modulares) - ✅ Ticket 1.5: Eliminación de duplicidades (~50 líneas) Cambios principales: - Creada estructura Clean Architecture en backend/src/ - Schemas Zod compartidos en backend/src/shared/schemas/ - Refactorización modular de drugs y procedures - Utilidades genéricas en src/utils/ (filter, validation) - Eliminados scripts obsoletos y documentación antigua - Corregidos errores: QueryClient, import test-error-handling - Build verificado y funcionando correctamente
78 lines
1.9 KiB
TypeScript
78 lines
1.9 KiB
TypeScript
import EventTarget from '../event/EventTarget.js';
|
|
import * as PropertySymbol from '../PropertySymbol.js';
|
|
import Blob from '../file/Blob.js';
|
|
import WS from 'ws';
|
|
/**
|
|
* Represents a WebSocket.
|
|
*
|
|
* Based on:
|
|
* https://github.com/jsdom/jsdom/blob/main/lib/jsdom/living/websockets/WebSocket-impl.js
|
|
*
|
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket
|
|
*/
|
|
export default class WebSocket extends EventTarget {
|
|
#private;
|
|
static readonly CONNECTING: number;
|
|
static readonly OPEN: number;
|
|
static readonly CLOSING: number;
|
|
static readonly CLOSED: number;
|
|
[PropertySymbol.webSocket]: WS | null;
|
|
/**
|
|
*
|
|
* @param url
|
|
* @param protocols
|
|
*/
|
|
constructor(url: string, protocols?: string | string[]);
|
|
/**
|
|
* Returns the ready state.
|
|
*
|
|
* @returns The ready state.
|
|
*/
|
|
get readyState(): number;
|
|
/**
|
|
* Returns the extensions.
|
|
*
|
|
* @returns The extensions.
|
|
*/
|
|
get extensions(): string;
|
|
/**
|
|
* Returns the binary type.
|
|
*
|
|
* @returns The binary type.
|
|
*/
|
|
get binaryType(): 'blob' | 'arraybuffer';
|
|
/**
|
|
* Sets the binary type.
|
|
*
|
|
* @param value The binary type.
|
|
*/
|
|
set binaryType(value: 'blob' | 'arraybuffer');
|
|
/**
|
|
* Returns protocol.
|
|
*/
|
|
get protocol(): string;
|
|
/**
|
|
* Returns the URL.
|
|
*
|
|
* @returns The URL.
|
|
*/
|
|
get url(): string;
|
|
/**
|
|
* Closes the WebSocket.
|
|
*
|
|
* @param [code] Code.
|
|
* @param [reason] Reason.
|
|
*/
|
|
close(code?: number, reason?: string | Buffer<ArrayBufferLike>): void;
|
|
/**
|
|
* Sends data through the WebSocket.
|
|
*
|
|
* @param data Data.
|
|
*/
|
|
send(data: ArrayBuffer | ArrayBufferView | Blob | Buffer | string): void;
|
|
/**
|
|
* Destroys the WebSocket.
|
|
*/
|
|
[PropertySymbol.destroy](): void;
|
|
}
|
|
//# sourceMappingURL=WebSocket.d.ts.map
|