Skip to main content

Type Alias: BuiltInCommandId

BuiltInCommandId = "freegantt.collapseAll" | "freegantt.expandAll" | "freegantt.collapseRow" | "freegantt.expandRow" | "freegantt.zoomIn" | "freegantt.zoomOut" | "freegantt.panToToday" | "freegantt.panToStart" | "freegantt.panToEnd" | "freegantt.panRight" | "freegantt.panLeft" | "freegantt.panDown" | "freegantt.panUp" | "freegantt.pageDown" | "freegantt.pageUp" | "freegantt.selectAll" | "freegantt.clearSelection" | "freegantt.selectNextEntry" | "freegantt.selectPreviousEntry" | "freegantt.activateEntry" | "freegantt.moveEntryUp" | "freegantt.moveEntryDown" | "freegantt.indentEntry" | "freegantt.outdentEntry" | "freegantt.deleteSelection" | "freegantt.clearDates" | "freegantt.discardCellEdit" | "freegantt.editFocusedCell" | "freegantt.switchToggle" | "freegantt.undo" | "freegantt.redo" | "freegantt.resizeColumnWider" | "freegantt.resizeColumnNarrower" | "freegantt.moveColumnRight" | "freegantt.moveColumnLeft"

Defined in: api/command.ts:28

Every command id the library itself registers (#236). One place names them, so gantt.commands.run('freegantt.discardCellEdit') autocompletes.

Autocomplete on the way in, a compile error on the way out. run takes the open CommandId, so a plugin's own id stays legal and run('gant.edit') still compiles — a wrong id there throws UnknownCommandError. view/core-commands.ts registers against this closed union instead (#333), so a typo in a registration never compiles.

It is BuiltInCommandId and not CommandId, because a plugin's own id is a command id too (#7's lesson: one name for two concepts stalls a reader). CommandId below is the open one.

The typed registrations close catalog → union. api/command.test.ts closes union → catalog: a Record<BuiltInCommandId, true> names every member, and the test asks the core catalog for the same set, so a member nothing registers fails too.