Skip to content

Class

+ new Operations(config: Config, dependencyGraph: DependencyGraph, columnSearch: ColumnSearchStrategy, cellContentParser: CellContentParser, parser: ParserWithCaching, stats: Statistics, lazilyTransformingAstService: LazilyTransformingAstService, namedExpressions: NamedExpressions, arraySizePredictor: ArraySizePredictor): Operations

Defined in hyperformula/src/Operations.ts:160

Parameters:

Name Type
config Config
dependencyGraph DependencyGraph
columnSearch ColumnSearchStrategy
cellContentParser CellContentParser
parser ParserWithCaching
stats Statistics
lazilyTransformingAstService LazilyTransformingAstService
namedExpressions NamedExpressions
arraySizePredictor ArraySizePredictor

Returns: Operations

▸ addColumns(cmd: AddColumnsCommand): void

Defined in hyperformula/src/Operations.ts:203

Parameters:

Name Type
cmd AddColumnsCommand

Returns: void


▸ addNamedExpression(expressionName: string, expression: RawCellContent, sheetId?: undefined | number, options?: NamedExpressionOptions): void

Defined in hyperformula/src/Operations.ts:420

Parameters:

Name Type
expressionName string
expression RawCellContent
sheetId? undefined | number
options? NamedExpressionOptions

Returns: void


▸ addPlaceholderSheetWithId(sheetId: number, name: string): void

Defined in hyperformula/src/Operations.ts:253

Adds a placeholder sheet with a specific ID for undo operations. Used to restore previously merged placeholder sheets.

Note: Unlike addSheetWithId, this does NOT call dependencyGraph.addSheet() because placeholders don’t need dirty marking or strategy changes - they only need to exist in the mappings so formulas can reference them again.

Parameters:

Name Type
sheetId number
name string

Returns: void


▸ addRows(cmd: AddRowsCommand): void

Defined in hyperformula/src/Operations.ts:197

Parameters:

Name Type
cmd AddRowsCommand

Returns: void


▸ addSheet(name?: undefined | string): object

Defined in hyperformula/src/Operations.ts:231

Adds a new sheet to the workbook.

Parameters:

Name Type
name? undefined | string

Returns: object

  • sheetId: number

  • sheetName: string


▸ addSheetWithId(sheetId: number, name: string): void

Defined in hyperformula/src/Operations.ts:240

Adds a sheet with a specific ID for redo operations.

Parameters:

Name Type
sheetId number
name string

Returns: void


▸ changeNamedExpressionExpression(expressionName: string, newExpression: RawCellContent, sheetId?: undefined | number, options?: NamedExpressionOptions): [InternalNamedExpression, ClipboardCell]

Defined in hyperformula/src/Operations.ts:433

Parameters:

Name Type
expressionName string
newExpression RawCellContent
sheetId? undefined | number
options? NamedExpressionOptions

Returns: [InternalNamedExpression, ClipboardCell]


▸ clearSheet(sheetId: number): void

Defined in hyperformula/src/Operations.ts:223

Clears the sheet content.

Parameters:

Name Type
sheetId number

Returns: void


▸ ensureItIsPossibleToMoveCells(sourceLeftCorner: SimpleCellAddress, width: number, height: number, destinationLeftCorner: SimpleCellAddress): void

Defined in hyperformula/src/Operations.ts:466

Parameters:

Name Type
sourceLeftCorner SimpleCellAddress
width number
height number
destinationLeftCorner SimpleCellAddress

Returns: void


▸ forceApplyPostponedTransformations(): void

Defined in hyperformula/src/Operations.ts:745

Forces all formula vertices and column index entries to apply pending lazy transformations, bringing them up to the current LazilyTransformingAstService version. Called before undo of move operations and before compaction.

Returns: void


▸ getAndClearContentChanges(): ContentChanges

Defined in hyperformula/src/Operations.ts:734

Returns: ContentChanges


▸ getClipboardCell(address: SimpleCellAddress): ClipboardCell

Defined in hyperformula/src/Operations.ts:549

Parameters:

Name Type
address SimpleCellAddress

Returns: ClipboardCell


▸ getOldContent(address: SimpleCellAddress): [SimpleCellAddress, ClipboardCell]

Defined in hyperformula/src/Operations.ts:530

Parameters:

Name Type
address SimpleCellAddress

Returns: [SimpleCellAddress, ClipboardCell]


▸ getRangeClipboardCells(range: AbsoluteCellRange): [SimpleCellAddress, ClipboardCell][]

Defined in hyperformula/src/Operations.ts:590

Parameters:

Name Type
range AbsoluteCellRange

Returns: [SimpleCellAddress, ClipboardCell][]


▸ getSheetClipboardCells(sheet: number): ClipboardCell[][]

Defined in hyperformula/src/Operations.ts:574

Parameters:

Name Type
sheet number

Returns: ClipboardCell[][]


▸ moveCells(sourceLeftCorner: SimpleCellAddress, width: number, height: number, destinationLeftCorner: SimpleCellAddress): MoveCellsResult

Defined in hyperformula/src/Operations.ts:343

Parameters:

Name Type
sourceLeftCorner SimpleCellAddress
width number
height number
destinationLeftCorner SimpleCellAddress

Returns: MoveCellsResult


▸ moveColumns(sheet: number, startColumn: number, numberOfColumns: number, targetColumn: number): number

Defined in hyperformula/src/Operations.ts:324

Parameters:

Name Type
sheet number
startColumn number
numberOfColumns number
targetColumn number

Returns: number


▸ moveRows(sheet: number, startRow: number, numberOfRows: number, targetRow: number): number

Defined in hyperformula/src/Operations.ts:305

Parameters:

Name Type
sheet number
startRow number
numberOfRows number
targetRow number

Returns: number


▸ removeColumns(cmd: RemoveColumnsCommand): ColumnsRemoval[]

Defined in hyperformula/src/Operations.ts:209

Parameters:

Name Type
cmd RemoveColumnsCommand

Returns: ColumnsRemoval[]


▸ removeNamedExpression(expressionName: string, sheetId?: undefined | number): [InternalNamedExpression, ClipboardCell]

Defined in hyperformula/src/Operations.ts:447

Parameters:

Name Type
expressionName string
sheetId? undefined | number

Returns: [InternalNamedExpression, ClipboardCell]


▸ removeRows(cmd: RemoveRowsCommand): RowsRemoval[]

Defined in hyperformula/src/Operations.ts:186

Parameters:

Name Type
cmd RemoveRowsCommand

Returns: RowsRemoval[]


▸ removeSheet(sheetId: number): [InternalNamedExpression, ClipboardCell][]

Defined in hyperformula/src/Operations.ts:261

Removes a sheet from the workbook.

Parameters:

Name Type
sheetId number

Returns: [InternalNamedExpression, ClipboardCell][]


▸ removeSheetByName(sheetName: string): [InternalNamedExpression‹›, ClipboardCell][]

Defined in hyperformula/src/Operations.ts:273

Removes a sheet from the workbook by name.

Parameters:

Name Type
sheetName string

Returns: [InternalNamedExpression‹›, ClipboardCell][]


▸ renameSheet(sheetId: number, newName: string): object

Defined in hyperformula/src/Operations.ts:281

Renames a sheet in the workbook.

Parameters:

Name Type
sheetId number
newName string

Returns: object

  • mergedPlaceholderSheetId? : undefined | number

  • previousDisplayName: Maybe‹string›

  • version? : undefined | number


▸ restoreCell(address: SimpleCellAddress, clipboardCell: ClipboardCell): void

Defined in hyperformula/src/Operations.ts:509

Restores a single cell.

Parameters:

Name Type
address SimpleCellAddress
clipboardCell ClipboardCell

Returns: void


▸ restoreClipboardCells(sourceSheetId: number, cells: IterableIterator‹[SimpleCellAddress, ClipboardCell]›): string[]

Defined in hyperformula/src/Operations.ts:493

Parameters:

Name Type
sourceSheetId number
cells IterableIterator‹[SimpleCellAddress, ClipboardCell]›

Returns: string[]


▸ restoreNamedExpression(namedExpression: InternalNamedExpression, content: ClipboardCell, sheetId?: undefined | number): void

Defined in hyperformula/src/Operations.ts:426

Parameters:

Name Type
namedExpression InternalNamedExpression
content ClipboardCell
sheetId? undefined | number

Returns: void


▸ rowEffectivelyNotInSheet(row: number, sheet: number): boolean

Defined in hyperformula/src/Operations.ts:729

Returns true if row number is outside of given sheet.

Parameters:

Name Type Description
row number row number
sheet number sheet ID number

Returns: boolean


▸ setCellContent(address: SimpleCellAddress, newCellContent: RawCellContent): [SimpleCellAddress, ClipboardCell]

Defined in hyperformula/src/Operations.ts:598

Parameters:

Name Type
address SimpleCellAddress
newCellContent RawCellContent

Returns: [SimpleCellAddress, ClipboardCell]


▸ setCellEmpty(address: SimpleCellAddress): void

Defined in hyperformula/src/Operations.ts:695

Sets cell content to an empty value. Creates an EmptyCellVertex and updates the dependency graph and column search index.

Parameters:

Name Type
address SimpleCellAddress

Returns: void


▸ setColumnOrder(sheetId: number, columnMapping: [number, number][]): [SimpleCellAddress, ClipboardCell][]

Defined in hyperformula/src/Operations.ts:399

Parameters:

Name Type
sheetId number
columnMapping [number, number][]

Returns: [SimpleCellAddress, ClipboardCell][]


▸ setFormulaToCell(address: SimpleCellAddress, size: ArraySize, __namedParameters: object): void

Defined in hyperformula/src/Operations.ts:663

Sets cell content to a formula. Creates a ScalarFormulaVertex and updates the dependency graph and column search index.

Parameters:

▪ address: SimpleCellAddress

▪ size: ArraySize

▪ __namedParameters: object

Name Type
ast Ast
dependencies RelativeDependency[]
hasStructuralChangeFunction boolean
hasVolatileFunction boolean

Returns: void


▸ setFormulaToCellFromCache(formulaHash: string, address: SimpleCellAddress): void

Defined in hyperformula/src/Operations.ts:709

Parameters:

Name Type
formulaHash string
address SimpleCellAddress

Returns: void


▸ setParsingErrorToCell(rawInput: string, errors: ParsingError[], address: SimpleCellAddress): void

Defined in hyperformula/src/Operations.ts:648

Sets cell content to an instance of parsing error. Creates a ParsingErrorVertex and updates the dependency graph and column search index.

Parameters:

Name Type
rawInput string
errors ParsingError[]
address SimpleCellAddress

Returns: void


▸ setRowOrder(sheetId: number, rowMapping: [number, number][]): [SimpleCellAddress, ClipboardCell][]

Defined in hyperformula/src/Operations.ts:378

Parameters:

Name Type
sheetId number
rowMapping [number, number][]

Returns: [SimpleCellAddress, ClipboardCell][]


▸ setSheetContent(sheetId: number, newSheetContent: RawCellContent[][]): void

Defined in hyperformula/src/Operations.ts:634

Parameters:

Name Type
sheetId number
newSheetContent RawCellContent[][]

Returns: void


▸ setValueToCell(value: RawAndParsedValue, address: SimpleCellAddress): void

Defined in hyperformula/src/Operations.ts:681

Sets cell content to a value. Creates a ValueCellVertex and updates the dependency graph and column search index.

Parameters:

Name Type
value RawAndParsedValue
address SimpleCellAddress

Returns: void