- ✅ 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
43 lines
1.5 KiB
TypeScript
43 lines
1.5 KiB
TypeScript
/// <reference types="node" />
|
|
|
|
import type { OutputFormat, Uint8ArrayBuffer } from './array.js';
|
|
|
|
/**
|
|
* Encodes a string to UTF-8 bytes (strict mode)
|
|
* Throws on invalid Unicode (unpaired surrogates)
|
|
* @param str - The string to encode
|
|
* @param format - Output format (default: 'uint8')
|
|
* @returns The encoded bytes
|
|
*/
|
|
export function utf8fromString(str: string, format?: 'uint8'): Uint8ArrayBuffer;
|
|
export function utf8fromString(str: string, format: 'buffer'): Buffer;
|
|
export function utf8fromString(str: string, format?: OutputFormat): Uint8ArrayBuffer | Buffer;
|
|
|
|
/**
|
|
* Encodes a string to UTF-8 bytes (loose mode)
|
|
* Replaces invalid Unicode with replacement character
|
|
* @param str - The string to encode
|
|
* @param format - Output format (default: 'uint8')
|
|
* @returns The encoded bytes
|
|
*/
|
|
export function utf8fromStringLoose(str: string, format?: 'uint8'): Uint8ArrayBuffer;
|
|
export function utf8fromStringLoose(str: string, format: 'buffer'): Buffer;
|
|
export function utf8fromStringLoose(str: string, format?: OutputFormat): Uint8ArrayBuffer | Buffer;
|
|
|
|
/**
|
|
* Decodes UTF-8 bytes to a string (strict mode)
|
|
* Throws on invalid UTF-8 sequences
|
|
* @param arr - The bytes to decode
|
|
* @returns The decoded string
|
|
*/
|
|
export function utf8toString(arr: Uint8ArrayBuffer): string;
|
|
|
|
/**
|
|
* Decodes UTF-8 bytes to a string (loose mode)
|
|
* Replaces invalid sequences with replacement character
|
|
* @param arr - The bytes to decode
|
|
* @returns The decoded string
|
|
*/
|
|
export function utf8toStringLoose(arr: Uint8ArrayBuffer): string;
|
|
|