File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- <!-- Canonical source: AGENTS.md — keep this file in sync -->
21# time-queues — AI Agent Rules
32
43## Project identity
@@ -11,7 +10,7 @@ For detailed usage docs and API references see the [wiki](https://github.com/uho
1110## Setup
1211
1312```bash
14- git clone --recurse-submodules git@ github.com: uhop/time-queues.git
13+ git clone --recurse-submodules https:// github.com/ uhop/time-queues.git
1514cd time-queues
1615npm install
1716```
@@ -23,6 +22,7 @@ npm install
2322- `npm run test:bun` — run with Bun
2423- `npm run test:deno` — run with Deno
2524- `npm run ts-check` — TypeScript type checking (tsc --noEmit)
25+ - `npm run js-check` — JS lint via TypeScript (`tsconfig.check.json`: unused vars / undeclared refs / missing returns / unreachable code)
2626- `npm run ts-test` — run TS typing tests
2727- `npm run lint` — Prettier format check
2828- `npm run lint:fix` — Prettier auto-format
Original file line number Diff line number Diff line change 1- <!-- Canonical source: AGENTS.md — keep this file in sync -->
21# time-queues — AI Agent Rules
32
43## Project identity
@@ -11,7 +10,7 @@ For detailed usage docs and API references see the [wiki](https://github.com/uho
1110## Setup
1211
1312```bash
14- git clone --recurse-submodules git@ github.com: uhop/time-queues.git
13+ git clone --recurse-submodules https:// github.com/ uhop/time-queues.git
1514cd time-queues
1615npm install
1716```
@@ -23,6 +22,7 @@ npm install
2322- `npm run test:bun` — run with Bun
2423- `npm run test:deno` — run with Deno
2524- `npm run ts-check` — TypeScript type checking (tsc --noEmit)
25+ - `npm run js-check` — JS lint via TypeScript (`tsconfig.check.json`: unused vars / undeclared refs / missing returns / unreachable code)
2626- `npm run ts-test` — run TS typing tests
2727- `npm run lint` — Prettier format check
2828- `npm run lint:fix` — Prettier auto-format
Original file line number Diff line number Diff line change 3131 npm ci
3232 npm test
3333 npm run ts-check --if-present
34+ npm run js-check --if-present
Original file line number Diff line number Diff line change 1- <!-- Canonical source: AGENTS.md — keep this file in sync -->
21# time-queues — AI Agent Rules
32
43## Project identity
@@ -11,7 +10,7 @@ For detailed usage docs and API references see the [wiki](https://github.com/uho
1110## Setup
1211
1312```bash
14- git clone --recurse-submodules git@ github.com: uhop/time-queues.git
13+ git clone --recurse-submodules https:// github.com/ uhop/time-queues.git
1514cd time-queues
1615npm install
1716```
@@ -23,6 +22,7 @@ npm install
2322- `npm run test:bun` — run with Bun
2423- `npm run test:deno` — run with Deno
2524- `npm run ts-check` — TypeScript type checking (tsc --noEmit)
25+ - `npm run js-check` — JS lint via TypeScript (`tsconfig.check.json`: unused vars / undeclared refs / missing returns / unreachable code)
2626- `npm run ts-test` — run TS typing tests
2727- `npm run lint` — Prettier format check
2828- `npm run lint:fix` — Prettier auto-format
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ npm install
2222- ` npm run test:bun ` — run with Bun
2323- ` npm run test:deno ` — run with Deno
2424- ` npm run ts-check ` — TypeScript type checking (tsc --noEmit)
25+ - ` npm run js-check ` — JS lint via TypeScript (` tsconfig.check.json ` : unused vars / undeclared refs / missing returns / unreachable code)
2526- ` npm run ts-test ` — run TS typing tests
2627- ` npm run lint ` — Prettier format check
2728- ` npm run lint:fix ` — Prettier auto-format
Original file line number Diff line number Diff line change 1818 "test:seq:bun" : " bun run `tape6-seq --self` --flags FO" ,
1919 "test:seq:deno" : " deno run -A `tape6-seq --self` --flags FO" ,
2020 "ts-check" : " tsc --noEmit" ,
21+ "js-check" : " tsc --project tsconfig.check.json" ,
2122 "ts-test" : " tape6 --flags FO '/ts-tests/test-*.*ts'" ,
2223 "ts-test:bun" : " tape6-bun --flags FO '/ts-tests/test-*.*ts'" ,
2324 "ts-test:deno" : " tape6-deno --flags FO '/ts-tests/test-*.*ts'" ,
Original file line number Diff line number Diff line change 1+ import List from 'list-toolkit/list.js' ;
12import { MicroTask } from './MicroTask.js' ;
23import { MicroTaskQueue } from './MicroTaskQueue.js' ;
34
@@ -11,6 +12,11 @@ export declare class ListQueue extends MicroTaskQueue {
1112 */
1213 paused : boolean ;
1314
15+ /**
16+ * The linked list of pending microtasks.
17+ */
18+ list : List < MicroTask > ;
19+
1420 /**
1521 * The function that stops the queue.
1622 * It is used internally by `pause()` and `resume()`.
Original file line number Diff line number Diff line change 11// @ts -self-types="./ListQueue.d.ts"
22
33import List from 'list-toolkit/list.js' ;
4+ import MicroTask from './MicroTask.js' ;
45import MicroTaskQueue from './MicroTaskQueue.js' ;
56
67export class ListQueue extends MicroTaskQueue {
78 constructor ( paused ) {
89 super ( paused ) ;
910 // AI-NOTE: Using list-toolkit List for O(1) push/pop operations
11+ /** @type {List<MicroTask> } */
1012 this . list = new List ( ) ;
1113 // AI-NOTE: stopQueue holds the stop function returned by startQueue(), or null
1214 this . stopQueue = null ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export class MicroTaskQueue {
1919 this . paused = false ;
2020 return this ;
2121 }
22- enqueue ( fn ) {
22+ enqueue ( fn , ... _args ) {
2323 const task = new MicroTask ( fn ) ;
2424 return task ;
2525 }
Original file line number Diff line number Diff line change @@ -44,7 +44,8 @@ export class PageWatcher extends ListQueue {
4444
4545 // Implemented in ListQueue: dequeue()
4646
47- schedule ( ) {
47+ /** @returns {never } */
48+ schedule ( _fn ) {
4849 throw new Error ( 'Not implemented' ) ;
4950 }
5051
You can’t perform that action at this time.
0 commit comments