---
name: advanced-mog-api
description: Full API reference for the mog spreadsheet engine.
---

# Mog Spreadsheet Engine — Full API Reference

`api-reference.json` contains every method signature, docstring, and type definition for the Workbook and Worksheet APIs. The system prompt only shows core methods — this file has the complete set.

## Structure

```
interfaces.Workbook.functions   — 108 methods (39 root + 10 namespaces)
interfaces.Worksheet.functions  — 407 methods (54 root + 30 namespaces)
types                           — 110 type/enum definitions
```

Each method entry:
```json
{
  "signature": "charts.add(config: ChartConfig): Promise<Chart>;",
  "docstring": "Add a chart to the worksheet.",
  "usedTypes": ["ChartConfig", "Chart"]
}
```

Each type entry:
```json
{
  "name": "ChartConfig",
  "definition": "{ type: ChartType; dataRange: string; ... }",
  "docstring": "Configuration for creating a chart."
}
```

## Searching the API

```bash
# Find a method by name
grep -n '"charts.add"' api-reference.json -A 5

# Find all methods in a namespace
grep -n '"pivots\.' api-reference.json | head -40

# Find a type definition
grep -n '"ChartConfig"' api-reference.json -A 10

# Find all config/options types
grep -n '"name": ".*Config\|"name": ".*Options' api-reference.json

# Find enum values
grep -n '"isEnum": true' api-reference.json -B 2 -A 10

# Search docstrings for a keyword
grep -in '"docstring".*pivot' api-reference.json | head -20
```

## Worksheet Namespaces

| Namespace | Methods | Key types |
|-----------|---------|-----------|
| charts | 28 | ChartConfig, ChartType, SeriesConfig, DataLabelConfig, Chart |
| pivots | 29 | PivotTableConfig, PivotTableHandle, PivotTableInfo |
| conditionalFormats | 10 | CFRuleInput, ConditionalFormat, ConditionalFormatUpdate |
| tables | 41 | CreateTableOptions, TableOptions, TableInfo |
| slicers | 12 | SlicerConfig, SlicerInfo, Slicer, SlicerItem, SlicerState |
| filters | 19 | ColumnFilterCriteria, FilterInfo, FilterState, FilterDetailInfo |
| sparklines | 18 | (sparkline config types) |
| validation | 8 | ValidationRule |
| formats | 9 | CellFormat, FormatEntry, NumberFormatType |
| structure | 14 | MergedRegion, RemoveDuplicatesResult, SubtotalConfig |
| layout | 21 | (row/column sizing, auto-fit) |
| view | 14 | ViewOptions, ScrollPosition |
| outline | 14 | OutlineSettings, GroupState |
| protection | 9 | ProtectionConfig, ProtectionOptions |
| print | 14 | PrintSettings, ImageExportOptions |
| comments | 13 | Comment, Note |
| hyperlinks | 3 | (hyperlink CRUD) |
| pictures | 3 | PictureConfig, PictureHandle |
| shapes | 3 | ShapeConfig, ShapeHandle |
| smartArt | 18 | SmartArtConfig |
| objects | 16 | FloatingObjectHandle, FloatingObjectInfo, ObjectPosition |
| bindings | 7 | CreateBindingConfig, SheetDataBindingInfo |
| names | 6 | NamedRangeInfo |
| settings | 7 | SheetSettingsInfo |
| drawings | 3 | DrawingHandle |
| equations | 3 | EquationConfig, EquationHandle |
| formControls | 3 | (form control CRUD) |
| connectors | 2 | ConnectorHandle |
| textBoxes | 3 | TextBoxConfig, TextBoxHandle |
| wordArt | 3 | WordArtConfig, WordArtHandle |

## Workbook Namespaces

| Namespace | Methods | Key types |
|-----------|---------|-----------|
| sheets | 10 | (add, remove, rename, move, copy) |
| history | 9 | UndoHistoryEntry, UndoState |
| names | 12 | NamedRangeInfo, NamedRangeUpdateOptions, CreateNamesFromSelectionOptions |
| scenarios | 6 | ScenarioConfig, Scenario, ApplyScenarioResult |
| slicers | 7 | SlicerConfig, SlicerInfo |
| styles | 5 | TableStyleConfig, TableStyleInfo |
| theme | 4 | (theme operations) |
| viewport | 5 | ViewportBounds, ViewportRegion, ViewportChangeEvent |
| notifications | 9 | (notification system) |
| protection | 2 | (workbook protection) |

## Reference

- Full API: `api-reference.json` (in this directory)
