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)| Parameter | Type | Description |
|---|---|---|
nabu | Nabu | n/a |
Static members
static get()
TypeScript
get(nabu: Nabu): Todos| Parameter | Type | Description |
|---|---|---|
nabu | Nabu | n/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: numberdone
TypeScript
done: ListItem[]doneCount
TypeScript
doneCount: numberprogress
TypeScript
progress: numberFraction completed, 0..1 (0 when there are no to-dos).
remaining
TypeScript
remaining: ListItem[]Methods
checkAll()
TypeScript
checkAll(): voidMark every to-do checked, in a single transaction.
goTo()
TypeScript
goTo(item: ListItem): voidMove the cursor to a to-do item.
| Parameter | Type | Description |
|---|---|---|
item | ListItem | n/a |
toggle()
TypeScript
toggle(item: ListItem): void| Parameter | Type | Description |
|---|---|---|
item | ListItem | n/a |
uncheckAll()
TypeScript
uncheckAll(): voidMark every to-do unchecked, in a single transaction.
Source: src/lib/blocks/list/todos.svelte.js:10