import type { Transaction } from '@tiptap/pm/state' export function setTaskItemChecked( tr: Transaction, position: number | undefined, checked: boolean ): boolean { if (typeof position !== 'number') return false const taskItem = tr.doc.nodeAt(position) tr.setNodeMarkup(position, undefined, { ...taskItem?.attrs, checked }) return true }