Skip to main content

Class: ChecklistManager

Defined in: src/sdk/checklist/ChecklistManager.ts:15

A manager for a set of checklists. The manager tracks the state of all actionable items in the checklist set. The manager can respond to requests to change the state of its checklist set made through the event bus via the topics defined in ChecklistControlEvents or through direct calls to methods on the manager itself. When the state of its checklist set changes, the manager will publish data to the appropriate topics defined in ChecklistStateEvents to describe the changes that occurred.

Constructors

Constructor

new ChecklistManager(index, bus, checklistDef): ChecklistManager

Defined in: src/sdk/checklist/ChecklistManager.ts:36

Creates a new instance of ChecklistManager. The new manager is initialized as asleep.

Parameters

ParameterTypeDescription
indexnumberThe index of this manager's checklist set.
busEventBusThe event bus.
checklistDefChecklistSetDefThe definition for this manager's checklist set.

Returns

ChecklistManager

Methods

completeList()

completeList(groupIndex, listIndex): void

Defined in: src/sdk/checklist/ChecklistManager.ts:270

Completes all actionable items in a single checklist. Has no effect if this manager is asleep.

Parameters

ParameterTypeDescription
groupIndexnumberThe index of the checklist group containing the checklist to complete.
listIndexnumberThe index of the checklist to complete within its group.

Returns

void

Throws

Error if this manager has been destroyed.


destroy()

destroy(): void

Defined in: src/sdk/checklist/ChecklistManager.ts:388

Destroys this manager. Once destroyed, the manager will no longer track the state of its checklist set, will no longer respond to commands to change the state, and will no longer respond to state requests.

Returns

void


resetAll()

resetAll(): void

Defined in: src/sdk/checklist/ChecklistManager.ts:169

Resets all checklists in this manager's checklist set. Has no effect if this manager is asleep.

Returns

void

Throws

Error if this manager has been destroyed.


resetGroup()

resetGroup(groupIndex): void

Defined in: src/sdk/checklist/ChecklistManager.ts:201

Resets all checklists in a single checklist group. Has no effect if this manager is asleep.

Parameters

ParameterTypeDescription
groupIndexnumberThe index of the group to reset.

Returns

void

Throws

Error if this manager has been destroyed.


resetList()

resetList(groupIndex, listIndex): void

Defined in: src/sdk/checklist/ChecklistManager.ts:237

Resets all actionable items in a single checklist. Has no effect if this manager is asleep.

Parameters

ParameterTypeDescription
groupIndexnumberThe index of the checklist group containing the checklist to reset.
listIndexnumberThe index of the checklist to reset within its group.

Returns

void

Throws

Error if this manager has been destroyed.


sleep()

sleep(): void

Defined in: src/sdk/checklist/ChecklistManager.ts:149

Puts this manager to sleep. When asleep, this manager will not respond to commands to change the state of its checklist set. Sleeping managers still respond to checklist state requests.

Returns

void

Throws

Error if this manager has been destroyed.


toggleItem()

toggleItem(groupIndex, listIndex, branchIndex, itemIndex, force?): void

Defined in: src/sdk/checklist/ChecklistManager.ts:308

Toggles whether an actionable item is completed. Has no effect if this manager is asleep.

Parameters

ParameterTypeDescription
groupIndexnumberThe index of the checklist group containing the item to toggle.
listIndexnumberThe index of the checklist containing the item to toggle within its group.
branchIndexnumberThe index of the branch containing the item to toggle within its list, or -1 if the item is not contained in a branch.
itemIndexnumberThe index of the item to toggle within its checklist.
force?booleanThe state to force onto the item. If true, then the item will be completed. If false, then the item will be reset. If undefined, then the item will be toggled to the opposite of its current state.

Returns

void

Throws

Error if this manager has been destroyed.


wake()

wake(): void

Defined in: src/sdk/checklist/ChecklistManager.ts:128

Wakes this manager. When awake, this manager will respond to commands to change the state of its checklist set.

Returns

void

Throws

Error if this manager has been destroyed.