Optional
initialState: ISheetRangeUpdate | SheetJSON | ICellValue[][]Optional
options: ISheetModelOptionsUsed for runtime reflection.
Add a drawing to the container
Optional
options: TypedAddDrawingOptions<DrawingJSON>Add a listener. This is very similar to default javascript listeners except the offer a few additional options and there is no remove listener.
These add listeners return a function that can be called to remove the listener. Additionally they honor transactional boundaries.
Listeners are fired in the order that they are added.
Optional
options: ListenerOptionsAdd an image to the current sheet. This will return an IDrawingImageModel that can be used to manipulate the image or remove it.
This can be either string to a url, a SharedResource or an AddSharedResourceOptions
AddDrawingImageOptions
Add a listener for a specific range.
Optional
options: RangeListenerOptionsBy default insert/remove of headers will alter the range listener. To see the actually bounds use the range in the callback.
If the sheet is cleared this will auto remove the listener.
Given the range extend the cells in a certain direction.
Note - If the range contains merges then the amount must be a 'fill' dimension must a multiple of the initialRange 'fill' dimension.
the direction to fill
Returns a function that provides the ability to see a setter for a given autofill offset. If this is negative then it will return a setter in the opposite of the direction
Adjusts both the column widths and rows heights to fit the content.
Optional
addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]Optional
options: AutoFitOptionsAdjust the columns width to fit the content. If empty then will use an algo to fit 8.43 characters.
Optional
addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]Optional
options: AutoFitOptionsAdjust the row height to fit the content. If empty then will use the normal style height.
Optional
addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]Optional
options: AutoFitOptionsClear the cells.
Optional
addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]A string or CellRangeCoords or an array of either.
ClearType.Content
Free all resources associated with the sheet and mark as read-only.
This is called by workbooks when the workbook is is closed. This is different than delete which removes the sheet from the workbook.
ISheetModel.addListener for closeEvent
Will copy cells into the range from the source ranges or from the CopyCellSource
Optional
options: CopyCellsOptionsReturns a list of items for the given types. If no options is provided then it will return counts for the select range. If there given address is empty then this will return null.
Optional
address: string | CellCoords | Partial<CellRangeCoords>Optional
types: Record<CountCellItemType, number | boolean>The types will be used to filter the results. If a number is provided this will be a max number If a boolean is provided this will be a statement to include/exclude
Some uses cases for this are checking for data to delete a sheet, checking for multiple values for merges, or displaying stats.
Creates a cell that is not including at a coordinate but adopts all rendering. Useful for previewing values such as tooltip. If the coords are passed it will return a disconnect cell update for that value.
a detached ICellModel
This does not add to the sheet but provides a standalone ICellModel.
Return the empty Cell. useful for quick comparisons.
Returns a single value for the found result or null if not found.
Optional
options: FindCellOptionsReturns the next coord in a given direction that has a value within the sheet.
Optional
limit: numberThis will skip cells with styling but no value.
Returns a CellRangeCoords that represents the 'closest' contentful data
Return the active address as a cell coord
Returns the absolute bounds of a given address.
Returns an immutable cell from the specified address. This can be either a CellCoord or a case insensitive 'a1' style string reference. If no address is specified then the current selection is used.
Optional
address: CellCoordsAddresseither a coord or an a1 string
Will never return null.
Returns the minimum bounds that includes all cell data.
include custom headers in sizing.
include cells in hidden headers.
This is guaranteed to always return at least a single cell. This will returns cells that have either styling or a value.
false
false
Returns the column headers managed by the Sheet.
Returns a list of items that can be copied to another sheet or to the clipboard. If null then nothing is returned.
The bottom right populated cell location.
Returns an array of merges that intersect the range coordinates.
Optional
addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]Returns all overflowed cells with the given range. If a null range is provided then all overflowed calls will be returned.
Optional
address: CellRangeCoordsAddressA string or CellRangeCoords.
defaults to false. If overflowed should also return hidden. TODO - This needs to be moved to view since it's dependant on scale
Returns an array of ProtectedRanges.
Optional
_addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]If null then there is no protection
null
Returns a range of cells for the specified range. These allow for interaction with the cells.
If no address is specified then this will use the intersection of the cell bounds and the selection bounds.
Optional
address: CellRangeCoordsAddressReturns the row headers managed by the Sheet.
Returns the minimum bounds that includes all cells selections.
Defaults to null means that there is no customized color
null
Returns an array of Tables are in the range.
Optional
addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]Optional
includeHidden: booleanIf no arguments are provided then this will return all tables in the Sheet.
The view specific properties.
Hides the columns for the given ranges. If no range is provided the the current selection is used
Optional
addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]Optional
options: SetOptionsHides the rows for the given ranges. If no range is provided the the current selection is used
Optional
addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]Optional
options: SetOptionsinsert cells at the range. By default the values will direction in whichever direction the selection shape is smaller. For example a selection with a 5 column by 1 row will direction Down (rows). Note - This will error if direction data will fall outsize of the max sheet size
Optional
addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]A string or CellRangeCoords or an array of either.
Optional
direction: Down | RightOptional
options: SetOptions'based on the selection shape'
Merges all cells within the selection ranges. If the ranges overlap then this operation will throw an exception
list of ranges
the intersection of all ranges applied
to current selection
MergeType.All
Protect a set of ranges.
Optional
_addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]list of ranges
Optional
_rangeProtection: RangeProtectionthe intersection of all ranges applied
to current selection
Simple protection
Begins a transaction but puts it onto a global stack. This will batch all 'transactional' changes until they have all be committed or rolled back.
Optional
description: stringAny changes that are made to this object will be reflected in the local sheet but not committed to the transactional store until the batch is popped.
Remove cells at a range. This is different than clearing cells in that it direction value up or left.
Optional
addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]A string or CellRangeCoords or an array of either.
Optional
direction: Up | LeftOptional
options: SetOptions'based on the selection shape'
Remove any tables within the range.
Optional
addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]Optional
options: ModifyTableSetOptionsReturn drawings that match the search criteria. If no search criteria is provided, all drawings will be returned.
Optional
options: DrawingSearchOptionsSet a single value. This is a convenience method that wraps setCellPairs to provide a simpler interface. For higher performance use
Sets a collection of Cells in a single batch/transaction.
This allows for an array of different values to be set as a single update. This is useful for non-contiguous updates and greatly improves performance over setting individually.
Optional
options: SetCellOptionsSet the protection. This will merge with existing protection.
Pass null to clear all protections.
See the tab color for the sheet.
The color
The tab color is not used by the sheet but rather by the workbook.
Set the view specific properties. This will merge with existing view.
This can not be mull
Returns the current shared resources.
Returns the sheetStyle associated with the sheet.
Sort the given range.
Optional
options: RangeSortOptionsThe sorting of various data types has a default priority of of boolean > string > number and dates are treated as numbers.
Unhides the columns for the given ranges. If no range is provided the the current selection is used
Optional
addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]Optional
options: SetOptionsUnhides the rows for the given ranges. If no range is provided the the current selection is used
Optional
addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]Optional
options: SetOptionsUnMerges all cells within the selection ranges. If the ranges don't contain merges or the ranges overlap then this operation will throw an exception.
Optional
addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]list of ranges
the intersection of all ranges applied
to the current selection
Unprotected all cells within the selection ranges.
Optional
_addresses: CellRangeCoordsAddress | CellRangeCoordsAddress[]list of ranges
Optional
_password: stringthe intersection of all ranges applied
to the current selection
Create a table at the given range. If the range is already a table then it will be updated.
Optional
update: Partial<{ Optional
options: ModifyTableSetOptionsIf no update is passed in then a default table will be create. If a ref is not specified then the range will be used as the ref. If a ref is specified then the rowStart of ref must match the range or an error will occur.
Base implementation of
See
ISheetModel.