API / @aionbuilders/nabu

Todos

Class Stability: stable

Document-level reactive registry of all to-do items (checklist list-items). Pure derived view over the block tree — stores nothing in Loro. Lazy: obtain via Todos.get(nabu).

Import

TypeScript
import { Todos } from '@aionbuilders/nabu';

Constructor

TypeScript
new Todos(nabu: Nabu)
Parameters of the constructor
ParameterTypeDescription
nabuNabun/a

Static members

static get()

TypeScript
get(nabu: Nabu): Todos
Parameters of get
ParameterTypeDescription
nabuNabun/a

Properties

all

TypeScript
all: ListItem[]

All to-do items in document order (DFS). A to-do is a list-item whose parent list is a todo list (ListItem.isTodo).

count

TypeScript
count: number

done

TypeScript
done: ListItem[]

doneCount

TypeScript
doneCount: number

progress

TypeScript
progress: number

Fraction completed, 0..1 (0 when there are no to-dos).

remaining

TypeScript
remaining: ListItem[]

Methods

checkAll()

TypeScript
checkAll(): void

Mark every to-do checked, in a single transaction.

goTo()

TypeScript
goTo(item: ListItem): void

Move the cursor to a to-do item.

Parameters of goTo
ParameterTypeDescription
itemListItemn/a

toggle()

TypeScript
toggle(item: ListItem): void
Parameters of toggle
ParameterTypeDescription
itemListItemn/a

uncheckAll()

TypeScript
uncheckAll(): void

Mark every to-do unchecked, in a single transaction.

Source: src/lib/blocks/list/todos.svelte.js:10