From b2daa0ecc72ffa41317d71a34b0b43fab1be6885 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 13 Feb 2026 15:27:38 -0500 Subject: [PATCH] docs: use typescript fenced codeblocks for GitHub rendering --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3154088..be0556a 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Every task function receives an available `Worker` (or `null` when the pool needs a new worker created) and **must** return an object with the worker to recycle and the result: -```ts +```typescript type WorkerPoolTask = ( worker: Worker | null ) => Promise<{ worker: Worker; result: T }> @@ -38,7 +38,7 @@ type WorkerPoolTask = ( ### ChunkQueue interface (`add` / `onIdle`) -```ts +```typescript import { WorkerPool } from '@fideus-labs/worker-pool' const workerUrl = new URL('./my-worker.js', import.meta.url).href @@ -70,7 +70,7 @@ pool.terminateWorkers() Submit an array of tasks at once with optional progress reporting and cancellation: -```ts +```typescript const pool = new WorkerPool(2) const tasks = inputs.map((input) => createTask(input)) @@ -134,7 +134,7 @@ pnpm add @fideus-labs/fizarrita @fideus-labs/worker-pool zarrita ### Basic usage -```ts +```typescript import { WorkerPool } from '@fideus-labs/worker-pool' import { getWorker, setWorker } from '@fideus-labs/fizarrita' import * as zarr from 'zarrita' @@ -159,7 +159,7 @@ pool.terminateWorkers() Both `getWorker` and `setWorker` support a `useSharedArrayBuffer` option for additional performance: -```ts +```typescript // Read — output allocated on SharedArrayBuffer, workers decode directly // into shared memory (eliminates one transfer + one copy per chunk) const chunk = await getWorker(arr, null, { @@ -205,7 +205,7 @@ descriptive error message. **Vite example:** -```ts +```typescript // vite.config.ts export default defineConfig({ server: {