toolmark-monorepo / @toolmark/core / ConfirmQueue
Interface: ConfirmQueue
Defined in: packages/core/src/confirm-queue.ts:14
A FIFO of inline confirmation requests. Pass queue.handler as ToolmarkOptions.confirm, render getPending() and answer with approve/reject (spec §7; useConfirmQueue subscribes to it).
Properties
handler
handler: (
req) =>Promise<ConfirmOutcome>
Defined in: packages/core/src/confirm-queue.ts:16
Inline confirm handler: resolves when the request is approved, rejected or aborted.
Parameters
req
Returns
Promise<ConfirmOutcome>
Methods
approve()
approve(
input?):void
Defined in: packages/core/src/confirm-queue.ts:25
Approves the head request.
Parameters
input?
unknown
Optional edited input (re-validated by the registry).
Returns
void
getPending()
getPending():
ConfirmRequest|null
Defined in: packages/core/src/confirm-queue.ts:18
Head of the FIFO, or null when nothing is pending.
Returns
ConfirmRequest | null
reject()
reject(
reason?):void
Defined in: packages/core/src/confirm-queue.ts:30
Rejects the head request.
Parameters
reason?
string
Optional reason passed to the outcome.
Returns
void
subscribe()
subscribe(
fn): () =>void
Defined in: packages/core/src/confirm-queue.ts:20
Subscribes to queue changes; returns an unsubscribe function.
Parameters
fn
() => void
Returns
() => void