Skip to content
Mog is in active development. The GitHub repo, SDK packages, and community channels are not yet available. Follow for launch updates

ws.view

WorksheetView

Sub-API for worksheet view and display operations.

14 methods

freezeRows

Promise<void>
freezeRows(count: number): Promise<void>;
ParameterTypeRequired
countnumberrequired

Freeze the top N rows. Preserves any existing column freeze. @param count - Number of rows to freeze (0 to unfreeze rows)

freezeColumns

Promise<void>
freezeColumns(count: number): Promise<void>;
ParameterTypeRequired
countnumberrequired

Freeze the left N columns. Preserves any existing row freeze. @param count - Number of columns to freeze (0 to unfreeze columns)

unfreeze

Promise<void>
unfreeze(): Promise<void>;

Remove all frozen panes (both rows and columns).

getFrozenPanes

Promise<{ rows: number; cols: number }>
getFrozenPanes(): Promise<{ rows: number; cols: number }>;

Get the current frozen panes configuration. @returns Object with the number of frozen rows and columns

freezeAt

Promise<void>
freezeAt(range: string): Promise<void>;
ParameterTypeRequired
rangestringrequired

Freeze rows and columns simultaneously using a range reference. The top-left cell of the range becomes the first unfrozen cell. For example, freezeAt("B3") freezes 2 rows and 1 column. @param range - A cell reference (e.g., "B3") indicating the split point

getSplitConfig

Promise<SplitViewportConfig | null>
getSplitConfig(): Promise<SplitViewportConfig | null>;

Get the current split view configuration. @returns The split configuration, or null if the view is not split

setSplitConfig

Promise<void>
setSplitConfig(config: SplitViewportConfig | null): Promise<void>;
ParameterTypeRequired
configSplitViewportConfig | nullrequired

Set or clear the split view configuration. @param config - Split configuration to apply, or null to remove split

setGridlines

Promise<void>
setGridlines(show: boolean): Promise<void>;
ParameterTypeRequired
showbooleanrequired

Show or hide gridlines. @param show - True to show gridlines, false to hide

setHeadings

Promise<void>
setHeadings(show: boolean): Promise<void>;
ParameterTypeRequired
showbooleanrequired

Show or hide row/column headings. @param show - True to show headings, false to hide

getViewOptions

Promise<ViewOptions>
getViewOptions(): Promise<ViewOptions>;

Get the current view options (gridlines, headings). @returns Current view options

getTabColor

Promise<string | null>
getTabColor(): Promise<string | null>;

Get the tab color of this worksheet. @returns The tab color as a hex string, or null if no color is set

setTabColor

Promise<void>
setTabColor(color: string | null): Promise<void>;
ParameterTypeRequired
colorstring | nullrequired

Set or clear the tab color for this worksheet. @param color - Hex color string, or null to clear

getScrollPosition

Promise<ScrollPosition>
getScrollPosition(): Promise<ScrollPosition>;

Get the persistent scroll position (cell-level) for this sheet.

setScrollPosition

Promise<void>
setScrollPosition(topRow: number, leftCol: number): Promise<void>;
ParameterTypeRequired
topRownumberrequired
leftColnumberrequired

Set the persistent scroll position (cell-level) for this sheet.