# HyperFormulaNS

Aggregate class for default export

## Other

### ArraySize

▪ **ArraySize**: *[ArraySize](arraysize.md)* = ArraySize

*Defined in [src/index.ts:79](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L79)*

___

### CellError

▪ **CellError**: *[CellError](cellerror.md)* = CellError

*Defined in [src/index.ts:67](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L67)*

___

### CellType

▪ **CellType**: *[CellType](../enums/celltype.md)* = CellType

*Defined in [src/index.ts:68](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L68)*

___

### CellValueDetailedType

▪ **CellValueDetailedType**: *object* = CellValueDetailedType

*Defined in [src/index.ts:70](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L70)*

#### Type declaration:

___

### CellValueType

▪ **CellValueType**: *object* = CellValueType

*Defined in [src/index.ts:69](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L69)*

#### Type declaration:

___

### ConfigValueTooBigError

▪ **ConfigValueTooBigError**: *[ConfigValueTooBigError](configvaluetoobigerror.md)* = ConfigValueTooBigError

*Defined in [src/index.ts:74](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L74)*

___

### ConfigValueTooSmallError

▪ **ConfigValueTooSmallError**: *[ConfigValueTooSmallError](configvaluetoosmallerror.md)* = ConfigValueTooSmallError

*Defined in [src/index.ts:75](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L75)*

___

### DetailedCellError

▪ **DetailedCellError**: *[DetailedCellError](detailedcellerror.md)* = DetailedCellError

*Defined in [src/index.ts:71](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L71)*

___

### EmptyValue

▪ **EmptyValue**: *symbol* = EmptyValue

*Defined in [src/index.ts:81](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L81)*

___

### ErrorType

▪ **ErrorType**: *[ErrorType](../enums/errortype.md)* = ErrorType

*Defined in [src/index.ts:66](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L66)*

___

### EvaluationSuspendedError

▪ **EvaluationSuspendedError**: *[EvaluationSuspendedError](evaluationsuspendederror.md)* = EvaluationSuspendedError

*Defined in [src/index.ts:76](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L76)*

___

### ExpectedOneOfValuesError

▪ **ExpectedOneOfValuesError**: *[ExpectedOneOfValuesError](expectedoneofvalueserror.md)* = ExpectedOneOfValuesError

*Defined in [src/index.ts:77](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L77)*

___

### ExpectedValueOfTypeError

▪ **ExpectedValueOfTypeError**: *[ExpectedValueOfTypeError](expectedvalueoftypeerror.md)* = ExpectedValueOfTypeError

*Defined in [src/index.ts:78](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L78)*

___

### ExportedCellChange

▪ **ExportedCellChange**: *[ExportedCellChange](exportedcellchange.md)* = ExportedCellChange

*Defined in [src/index.ts:72](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L72)*

___

### ExportedNamedExpressionChange

▪ **ExportedNamedExpressionChange**: *[ExportedNamedExpressionChange](exportednamedexpressionchange.md)* = ExportedNamedExpressionChange

*Defined in [src/index.ts:73](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L73)*

___

### FunctionArgumentType

▪ **FunctionArgumentType**: *FunctionArgumentType* = FunctionArgumentType

*Defined in [src/index.ts:83](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L83)*

___

### FunctionPlugin

▪ **FunctionPlugin**: *FunctionPlugin* = FunctionPlugin

*Defined in [src/index.ts:82](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L82)*

___

### FunctionPluginValidationError

▪ **FunctionPluginValidationError**: *[FunctionPluginValidationError](functionpluginvalidationerror.md)* = FunctionPluginValidationError

*Defined in [src/index.ts:84](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L84)*

___

### HyperFormula

▪ **HyperFormula**: *[HyperFormula](hyperformula.md)* = HyperFormula

*Defined in [src/index.ts:65](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L65)*

___

### InvalidAddressError

▪ **InvalidAddressError**: *[InvalidAddressError](invalidaddresserror.md)* = InvalidAddressError

*Defined in [src/index.ts:85](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L85)*

___

### InvalidArgumentsError

▪ **InvalidArgumentsError**: *[InvalidArgumentsError](invalidargumentserror.md)* = InvalidArgumentsError

*Defined in [src/index.ts:86](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L86)*

___

### LanguageAlreadyRegisteredError

▪ **LanguageAlreadyRegisteredError**: *[LanguageAlreadyRegisteredError](languagealreadyregisterederror.md)* = LanguageAlreadyRegisteredError

*Defined in [src/index.ts:88](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L88)*

___

### LanguageNotRegisteredError

▪ **LanguageNotRegisteredError**: *[LanguageNotRegisteredError](languagenotregisterederror.md)* = LanguageNotRegisteredError

*Defined in [src/index.ts:87](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L87)*

___

### MissingTranslationError

▪ **MissingTranslationError**: *[MissingTranslationError](missingtranslationerror.md)* = MissingTranslationError

*Defined in [src/index.ts:89](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L89)*

___

### NamedExpressionDoesNotExistError

▪ **NamedExpressionDoesNotExistError**: *[NamedExpressionDoesNotExistError](namedexpressiondoesnotexisterror.md)* = NamedExpressionDoesNotExistError

*Defined in [src/index.ts:90](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L90)*

___

### NamedExpressionNameIsAlreadyTakenError

▪ **NamedExpressionNameIsAlreadyTakenError**: *[NamedExpressionNameIsAlreadyTakenError](namedexpressionnameisalreadytakenerror.md)* = NamedExpressionNameIsAlreadyTakenError

*Defined in [src/index.ts:91](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L91)*

___

### NamedExpressionNameIsInvalidError

▪ **NamedExpressionNameIsInvalidError**: *[NamedExpressionNameIsInvalidError](namedexpressionnameisinvaliderror.md)* = NamedExpressionNameIsInvalidError

*Defined in [src/index.ts:92](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L92)*

___

### NoOperationToRedoError

▪ **NoOperationToRedoError**: *[NoOperationToRedoError](nooperationtoredoerror.md)* = NoOperationToRedoError

*Defined in [src/index.ts:93](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L93)*

___

### NoOperationToUndoError

▪ **NoOperationToUndoError**: *[NoOperationToUndoError](nooperationtoundoerror.md)* = NoOperationToUndoError

*Defined in [src/index.ts:94](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L94)*

___

### NoRelativeAddressesAllowedError

▪ **NoRelativeAddressesAllowedError**: *[NoRelativeAddressesAllowedError](norelativeaddressesallowederror.md)* = NoRelativeAddressesAllowedError

*Defined in [src/index.ts:95](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L95)*

___

### NoSheetWithIdError

▪ **NoSheetWithIdError**: *[NoSheetWithIdError](nosheetwithiderror.md)* = NoSheetWithIdError

*Defined in [src/index.ts:96](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L96)*

___

### NoSheetWithNameError

▪ **NoSheetWithNameError**: *[NoSheetWithNameError](nosheetwithnameerror.md)* = NoSheetWithNameError

*Defined in [src/index.ts:97](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L97)*

___

### NotAFormulaError

▪ **NotAFormulaError**: *[NotAFormulaError](notaformulaerror.md)* = NotAFormulaError

*Defined in [src/index.ts:98](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L98)*

___

### NothingToPasteError

▪ **NothingToPasteError**: *[NothingToPasteError](nothingtopasteerror.md)* = NothingToPasteError

*Defined in [src/index.ts:99](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L99)*

___

### ProtectedFunctionTranslationError

▪ **ProtectedFunctionTranslationError**: *[ProtectedFunctionTranslationError](protectedfunctiontranslationerror.md)* = ProtectedFunctionTranslationError

*Defined in [src/index.ts:100](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L100)*

___

### SheetNameAlreadyTakenError

▪ **SheetNameAlreadyTakenError**: *[SheetNameAlreadyTakenError](sheetnamealreadytakenerror.md)* = SheetNameAlreadyTakenError

*Defined in [src/index.ts:101](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L101)*

___

### SheetSizeLimitExceededError

▪ **SheetSizeLimitExceededError**: *[SheetSizeLimitExceededError](sheetsizelimitexceedederror.md)* = SheetSizeLimitExceededError

*Defined in [src/index.ts:102](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L102)*

___

### SimpleRangeValue

▪ **SimpleRangeValue**: *[SimpleRangeValue](simplerangevalue.md)* = SimpleRangeValue

*Defined in [src/index.ts:80](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L80)*

___

### SourceLocationHasArrayError

▪ **SourceLocationHasArrayError**: *[SourceLocationHasArrayError](sourcelocationhasarrayerror.md)* = SourceLocationHasArrayError

*Defined in [src/index.ts:103](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L103)*

___

### TargetLocationHasArrayError

▪ **TargetLocationHasArrayError**: *[TargetLocationHasArrayError](targetlocationhasarrayerror.md)* = TargetLocationHasArrayError

*Defined in [src/index.ts:104](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L104)*

___

### UnableToParseError

▪ **UnableToParseError**: *[UnableToParseError](unabletoparseerror.md)* = UnableToParseError

*Defined in [src/index.ts:105](https://github.com/handsontable/hyperformula/blob/b8542ec/src/index.ts#L105)*

___

## Static Properties

### buildDate

▪ **buildDate**: *string* = process.env.HT_BUILD_DATE as string

*Defined in [src/HyperFormula.ts:105](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L105)*

Latest build date.

___

### languages

▪ **languages**: *Record‹string, RawTranslationPackage›*

*Defined in [src/HyperFormula.ts:121](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L121)*

When using the UMD build, this property contains all available languages to use with the [registerLanguage](#registerlanguage) method.

For more information, see the [Localizing functions](/docs/guide/localizing-functions.md) guide.

___

### releaseDate

▪ **releaseDate**: *string* = process.env.HT_RELEASE_DATE as string

*Defined in [src/HyperFormula.ts:112](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L112)*

A release date.

___

### version

▪ **version**: *string* = process.env.HT_VERSION as string

*Defined in [src/HyperFormula.ts:98](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L98)*

Version of the HyperFormula.

## Static Accessors

### defaultConfig

• **get defaultConfig**(): *[ConfigParams](../interfaces/configparams.md)*

*Defined in [src/HyperFormula.ts:160](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L160)*

Returns all of HyperFormula's default [configuration options](/docs/guide/configuration-options.md).

**`example`** 
```js
// returns all default configuration options
const defaultConfig = HyperFormula.defaultConfig;
```

**`category`** Static Accessors

**Returns:** *[ConfigParams](../interfaces/configparams.md)*

## Factories

### buildEmpty

▸ **buildEmpty**(`configInput`: Partial‹[ConfigParams](../interfaces/configparams.md)›, `namedExpressions`: [SerializedNamedExpression](../interfaces/serializednamedexpression.md)[]): *[HyperFormula](hyperformula.md)*

*Defined in [src/HyperFormula.ts:353](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L353)*

Builds an empty engine instance.
Can be configured with the optional parameter that represents a [ConfigParams](../interfaces/configparams.md).
If not specified the engine will be built with the default configuration.

**`example`** 
```js
const namedExpressions = [
 {
   name: 'theUltimateQuestionOfLife',
   expression: '=42',
 },
];

// build with no initial data and with optional config parameter maxColumns
const hfInstance = HyperFormula.buildEmpty({ maxColumns: 1000 }, namedExpressions);
```

**Parameters:**

Name | Type | Default | Description |
------ | ------ | ------ | ------ |
`configInput` | Partial‹[ConfigParams](../interfaces/configparams.md)› | {} | engine configuration |
`namedExpressions` | [SerializedNamedExpression](../interfaces/serializednamedexpression.md)[] | [] | starting named expressions  |

**Returns:** *[HyperFormula](hyperformula.md)*

___

### buildFromArray

▸ **buildFromArray**(`sheet`: [Sheet](../globals.md#sheet), `configInput`: Partial‹[ConfigParams](../interfaces/configparams.md)›, `namedExpressions`: [SerializedNamedExpression](../interfaces/serializednamedexpression.md)[]): *[HyperFormula](hyperformula.md)*

*Defined in [src/HyperFormula.ts:279](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L279)*

Builds the engine for a sheet from a two-dimensional array representation.
The engine is created with a single sheet.
Can be configured with the optional second parameter that represents a [ConfigParams](../interfaces/configparams.md).
If not specified, the engine will be built with the default configuration.

**`throws`** [SheetSizeLimitExceededError](hyperformulans.md#static-sheetsizelimitexceedederror) when sheet size exceeds the limits

**`throws`** [InvalidArgumentsError](hyperformulans.md#static-invalidargumentserror) when sheet is not an array of arrays

**`throws`** [FunctionPluginValidationError](hyperformulans.md#static-functionpluginvalidationerror) when plugin class definition is not consistent with metadata

**`example`** 
```js
// data represented as an array
const sheetData = [
 ['0', '=SUM(1, 2, 3)', '52'],
 ['=SUM(A1:C1)', '', '=A1'],
 ['2', '=SUM(A1:C1)', '=theUltimateQuestionOfLife'],
];

const namedExpressions = [
 {
   name: 'theUltimateQuestionOfLife',
   expression: '=42',
 },
];

// method with optional config parameter maxColumns
const hfInstance = HyperFormula.buildFromArray(sheetData, { maxColumns: 1000 }, namedExpressions);
```

**Parameters:**

Name | Type | Default | Description |
------ | ------ | ------ | ------ |
`sheet` | [Sheet](../globals.md#sheet) | - | two-dimensional array representation of sheet |
`configInput` | Partial‹[ConfigParams](../interfaces/configparams.md)› | {} | engine configuration |
`namedExpressions` | [SerializedNamedExpression](../interfaces/serializednamedexpression.md)[] | [] | starting named expressions  |

**Returns:** *[HyperFormula](hyperformula.md)*

___

### buildFromSheets

▸ **buildFromSheets**(`sheets`: [Sheets](../globals.md#sheets), `configInput`: Partial‹[ConfigParams](../interfaces/configparams.md)›, `namedExpressions`: [SerializedNamedExpression](../interfaces/serializednamedexpression.md)[]): *[HyperFormula](hyperformula.md)*

*Defined in [src/HyperFormula.ts:326](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L326)*

Builds the engine from an object containing multiple sheets with names.
The engine is created with one or more sheets.
Can be configured with the optional second parameter that represents a [ConfigParams](../interfaces/configparams.md).
If not specified the engine will be built with the default configuration.

**`throws`** [SheetSizeLimitExceededError](hyperformulans.md#static-sheetsizelimitexceedederror) when sheet size exceeds the limits

**`throws`** [InvalidArgumentsError](hyperformulans.md#static-invalidargumentserror) when any sheet is not an array of arrays

**`throws`** [FunctionPluginValidationError](hyperformulans.md#static-functionpluginvalidationerror) when plugin class definition is not consistent with metadata

**`example`** 
```js
// data represented as an object with sheets: Sheet1 and Sheet2
const sheetData = {
 'Sheet1': [
   ['1', '', '=Sheet2!$A1'],
   ['', '2', '=SUM(1, 2, 3)'],
   ['=Sheet2!$A2', '2', ''],
  ],
 'Sheet2': [
   ['', '4', '=Sheet1!$B1'],
   ['', '8', '=SUM(9, 3, 3)'],
   ['=Sheet1!$B1', '2', '=theUltimateQuestionOfLife'],
  ],
};

const namedExpressions = [
 {
   name: 'theUltimateQuestionOfLife',
   expression: '=42',
 },
];

// method with optional config parameter useColumnIndex
const hfInstance = HyperFormula.buildFromSheets(sheetData, { useColumnIndex: true }, namedExpressions);
```

**Parameters:**

Name | Type | Default | Description |
------ | ------ | ------ | ------ |
`sheets` | [Sheets](../globals.md#sheets) | - | object with sheets definition |
`configInput` | Partial‹[ConfigParams](../interfaces/configparams.md)› | {} | engine configuration |
`namedExpressions` | [SerializedNamedExpression](../interfaces/serializednamedexpression.md)[] | [] | starting named expressions  |

**Returns:** *[HyperFormula](hyperformula.md)*

___

## Instance

### destroy 

▸ **destroy**(): *void*

*Defined in [src/HyperFormula.ts:4846](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4846)*

Destroys instance of HyperFormula.

**`example`** 
```js
// destroys the instance
hfInstance.destroy();
```

**Returns:** *void*

___

### getConfig 

▸ **getConfig**(): *[ConfigParams](../interfaces/configparams.md)*

*Defined in [src/HyperFormula.ts:1278](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1278)*

Returns current configuration of the engine instance.

For more information, see the [Configuration options guide](/docs/guide/configuration-options.md).

**`example`** 
```js
// should return all config metadata including default and those which were added
const hfConfig = hfInstance.getConfig();
```

**Returns:** *[ConfigParams](../interfaces/configparams.md)*

___

### rebuildAndRecalculate 

▸ **rebuildAndRecalculate**(): *void*

*Defined in [src/HyperFormula.ts:1292](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1292)*

Rebuilds the HyperFormula instance preserving the current sheets data.

**`example`** 
```js
hfInstance.rebuildAndRecalculate();
```

**Returns:** *void*

___

### updateConfig 

▸ **updateConfig**(`newParams`: Partial‹[ConfigParams](../interfaces/configparams.md)›): *void*

*Defined in [src/HyperFormula.ts:1255](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1255)*

Updates the config with given new metadata. It is an expensive operation, as it might trigger rebuilding the engine and recalculation of all formulas.

For more information, see the [Configuration options guide](/docs/guide/configuration-options.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) when some parameters of config are of wrong type (e.g., currencySymbol)

**`throws`** [ConfigValueEmpty](configvalueempty.md) when some parameters of config are of invalid value (e.g., currencySymbol)

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1', '2'],
]);

// add a config param, for example maxColumns,
// you can check the configuration with getConfig method
hfInstance.updateConfig({ maxColumns: 1000 });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`newParams` | Partial‹[ConfigParams](../interfaces/configparams.md)› | configuration options to be updated or added  |

**Returns:** *void*

___

## Sheets

### addSheet 

▸ **addSheet**(`sheetName?`: undefined | string): *string*

*Defined in [src/HyperFormula.ts:2869](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2869)*

Adds a new sheet to the HyperFormula instance. Returns given or autogenerated name of a new sheet.

Note that this method may trigger dependency graph recalculation.

**`fires`** [sheetAdded](../interfaces/listeners.md#sheetadded) after the sheet was added

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [SheetNameAlreadyTakenError](hyperformulans.md#static-sheetnamealreadytakenerror) when sheet with a given name already exists

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
 MySheet1: [ ['1'] ],
 MySheet2: [ ['10'] ],
});

// should return 'MySheet3'
const nameProvided = hfInstance.addSheet('MySheet3');

// should return autogenerated 'Sheet4'
// because no name was provided and 3 other ones already exist
const generatedName = hfInstance.addSheet();
```

**Parameters:**

Name | Type |
------ | ------ |
`sheetName?` | undefined &#124; string |

**Returns:** *string*

___

### clearSheet 

▸ **clearSheet**(`sheetId`: number): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:3017](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3017)*

Clears the sheet content. Double-checks if the sheet exists.

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
 MySheet1: [ ['=SUM(MySheet2!A1:A2)'] ],
 MySheet2: [ ['10'] ],
});

// should return a list of cells which values changed after the operation,
// their absolute addresses and new values, in this example it will return:
// [{
//   address: { sheet: 0, col: 0, row: 0 },
//   newValue: 0,
// }]
const changes = hfInstance.clearSheet(0);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID.  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### countSheets 

▸ **countSheets**(): *number*

*Defined in [src/HyperFormula.ts:3706](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3706)*

Returns the number of existing sheets.

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1', '2'],
]);

// should return the number of sheets which is '1'
const sheetsCount = hfInstance.countSheets();
```

**Returns:** *number*

___

### doesSheetExist 

▸ **doesSheetExist**(`sheetName`: string): *boolean*

*Defined in [src/HyperFormula.ts:3425](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3425)*

Returns `true` whether sheet with a given name exists. The method accepts sheet name to be checked.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
  MySheet1: [ ['1'] ],
  MySheet2: [ ['10'] ],
});

// should return 'true' since 'MySheet1' exists
const sheetExist = hfInstance.doesSheetExist('MySheet1');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetName` | string | name of the sheet, case-insensitive.  |

**Returns:** *boolean*

___

### getAllSheetsDimensions 

▸ **getAllSheetsDimensions**(): *Record‹string, [SheetDimensions](../globals.md#sheetdimensions)›*

*Defined in [src/HyperFormula.ts:1131](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1131)*

Returns a map containing dimensions of all sheets for the engine instance represented as a key-value pairs where keys are sheet IDs and dimensions are returned as numbers, width and height respectively.

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
  Sheet1: [
   ['1', '2', '=Sheet2!$A1'],
  ],
  Sheet2: [
   ['3'],
   ['4'],
  ],
});

// should return the dimensions of all sheets:
// { Sheet1: { width: 3, height: 1 }, Sheet2: { width: 1, height: 2 } }
const allSheetsDimensions = hfInstance.getAllSheetsDimensions();
```

**Returns:** *Record‹string, [SheetDimensions](../globals.md#sheetdimensions)›*

___

### getAllSheetsFormulas 

▸ **getAllSheetsFormulas**(): *Record‹string, (string | undefined)[][]›*

*Defined in [src/HyperFormula.ts:1202](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1202)*

Returns formulas of all sheets in a form of an object which property keys are strings and values are 2D arrays of strings or possibly `undefined` when the call does not contain a formula.

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1', '2', '=A1+10'],
]);

// should return only formulas: { Sheet1: [ [ undefined, undefined, '=A1+10' ] ] }
const allSheetsFormulas = hfInstance.getAllSheetsFormulas();
```

**Returns:** *Record‹string, (string | undefined)[][]›*

___

### getAllSheetsSerialized 

▸ **getAllSheetsSerialized**(): *Record‹string, [RawCellContent](../globals.md#rawcellcontent)[][]›*

*Defined in [src/HyperFormula.ts:1227](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1227)*

Returns formulas or values of all sheets in a form of an object which property keys are strings and values are 2D arrays of [RawCellContent](../globals.md#rawcellcontent).

Each non-formula cell is serialized to the exact value it was set with, preserving its type.
For example, a cell set with the string `'1'` is serialized as the string `'1'`, while a cell set with the number `1` is serialized as the number `1`.

**`throws`** [EvaluationSuspendedError](hyperformulans.md#static-evaluationsuspendederror) when the evaluation is suspended

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1', 2, '=A1+10'],
]);

// should return all sheets serialized content: { Sheet1: [ [ '1', 2, '=A1+10' ] ] }
// note: the string '1' stays a string and the number 2 stays a number
const allSheetsSerialized = hfInstance.getAllSheetsSerialized();
```

**Returns:** *Record‹string, [RawCellContent](../globals.md#rawcellcontent)[][]›*

___

### getAllSheetsValues 

▸ **getAllSheetsValues**(): *Record‹string, [CellValue](../globals.md#cellvalue)[][]›*

*Defined in [src/HyperFormula.ts:1183](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1183)*

Returns values of all sheets in a form of an object which property keys are strings and values are 2D arrays of [CellValue](../globals.md#cellvalue).

**`throws`** [EvaluationSuspendedError](hyperformulans.md#static-evaluationsuspendederror) when the evaluation is suspended

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1', '=A1+10', '3'],
]);

// should return all sheets values: { Sheet1: [ [ 1, 11, 3 ] ] }
const allSheetsValues = hfInstance.getAllSheetsValues();
```

**Returns:** *Record‹string, [CellValue](../globals.md#cellvalue)[][]›*

___

### getSheetDimensions 

▸ **getSheetDimensions**(`sheetId`: number): *[SheetDimensions](../globals.md#sheetdimensions)*

*Defined in [src/HyperFormula.ts:1158](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1158)*

Returns dimensions of a specified sheet.
The sheet dimensions is represented with numbers: width and height.

Note: Due to the memory optimizations, some of the empty bottom rows and rightmost columns are not counted to the dimensions.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
   ['1', '2', '=Sheet2!$A1'],
]);

// should return provided sheet's dimensions: { width: 3, height: 1 }
const sheetDimensions = hfInstance.getSheetDimensions(0);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID number  |

**Returns:** *[SheetDimensions](../globals.md#sheetdimensions)*

___

### getSheetFormulas 

▸ **getSheetFormulas**(`sheetId`: number): *(string | undefined)[][]*

*Defined in [src/HyperFormula.ts:1068](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1068)*

Returns an array with normalized formula strings from [Sheet](../globals.md#sheet) or `undefined` for a cells that have no value.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['0', '=SUM(1, 2, 3)', '=A1'],
 ['1', '=TEXT(A2, "0.0%")', '=C1'],
 ['2', '=SUM(A1:C1)', '=C1'],
]);

// should return all formulas of a sheet:
// [
//  [undefined, '=SUM(1, 2, 3)', '=A1'],
//  [undefined, '=TEXT(A2, "0.0%")', '=C1'],
//  [undefined, '=SUM(A1:C1)', '=C1'],
// ];
const sheetFormulas = hfInstance.getSheetFormulas(0);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID number  |

**Returns:** *(string | undefined)[][]*

___

### getSheetId 

▸ **getSheetId**(`sheetName`: string): *number | undefined*

*Defined in [src/HyperFormula.ts:3400](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3400)*

Returns a unique sheet ID assigned to the sheet with a given name or `undefined` if the sheet does not exist.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
  MySheet1: [ ['1'] ],
  MySheet2: [ ['10'] ],
});

// should return '0' because 'MySheet1' is of ID '0'
const sheetID = hfInstance.getSheetId('MySheet1');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetName` | string | name of the sheet, for which we want to retrieve ID, case-insensitive.  |

**Returns:** *number | undefined*

___

### getSheetName 

▸ **getSheetName**(`sheetId`: number): *string | undefined*

*Defined in [src/HyperFormula.ts:3354](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3354)*

Returns a unique sheet name assigned to the sheet of a given ID or `undefined` if the there is no sheet with a given ID.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
 MySheet1: [ ['1'] ],
 MySheet2: [ ['10'] ],
});

// should return 'MySheet2' as this sheet is the second one
const sheetName = hfInstance.getSheetName(1);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | ID of the sheet, for which we want to retrieve name  |

**Returns:** *string | undefined*

___

### getSheetNames 

▸ **getSheetNames**(): *string[]*

*Defined in [src/HyperFormula.ts:3376](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3376)*

List all sheet names.
Returns an array of sheet names as strings.

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
 MySheet1: [ ['1'] ],
 MySheet2: [ ['10'] ],
});

// should return all sheets names: ['MySheet1', 'MySheet2']
const sheetNames = hfInstance.getSheetNames();
```

**Returns:** *string[]*

___

### getSheetSerialized 

▸ **getSheetSerialized**(`sheetId`: number): *[RawCellContent](../globals.md#rawcellcontent)[][]*

*Defined in [src/HyperFormula.ts:1101](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1101)*

Returns an array of arrays of [RawCellContent](../globals.md#rawcellcontent) with serialized content of cells from [Sheet](../globals.md#sheet), either a cell formula or an explicit value.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [EvaluationSuspendedError](hyperformulans.md#static-evaluationsuspendederror) when the evaluation is suspended

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['0', '=SUM(1, 2, 3)', '=A1'],
 ['1', '=TEXT(A2, "0.0%")', '=C1'],
 ['2', '=SUM(A1:C1)', '=C1'],
]);

// should return:
// [
//  ['0', '=SUM(1, 2, 3)', '=A1'],
//  ['1', '=TEXT(A2, "0.0%")', '=C1'],
//  ['2', '=SUM(A1:C1)', '=C1'],
// ];
const serializedContent = hfInstance.getSheetSerialized(0);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID number  |

**Returns:** *[RawCellContent](../globals.md#rawcellcontent)[][]*

___

### getSheetValues 

▸ **getSheetValues**(`sheetId`: number): *[CellValue](../globals.md#cellvalue)[][]*

*Defined in [src/HyperFormula.ts:1035](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1035)*

Returns an array of arrays of [CellValue](../globals.md#cellvalue) with values of all cells from [Sheet](../globals.md#sheet).
Applies rounding and post-processing.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [EvaluationSuspendedError](hyperformulans.md#static-evaluationsuspendederror) when the evaluation is suspended

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['0', '=SUM(1, 2, 3)', '=A1'],
 ['1', '=TEXT(A2, "0.0%")', '=C1'],
 ['2', '=SUM(A1:C1)', '=C1'],
]);

// should return all values of a sheet: [[0, 6, 0], [1, '1.0%', 0], [2, 6, 0]]
const sheetValues = hfInstance.getSheetValues(0);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID number  |

**Returns:** *[CellValue](../globals.md#cellvalue)[][]*

___

### isItPossibleToAddSheet 

▸ **isItPossibleToAddSheet**(`sheetName`: string): *boolean*

*Defined in [src/HyperFormula.ts:2830](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2830)*

Returns information whether it is possible to add a sheet to the engine.
Checks against particular rules to ascertain that addSheet can be called.
If returns `true`, doing [addSheet](hyperformulans.md#addsheet) operation won't throw any errors, and it is possible to add sheet with provided name.
Returns `false` if the chosen name is already used.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
  MySheet1: [ ['1'] ],
  MySheet2: [ ['10'] ],
});

// should return 'false' because 'MySheet2' already exists
const isAddable = hfInstance.isItPossibleToAddSheet('MySheet2');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetName` | string | sheet name, case-insensitive  |

**Returns:** *boolean*

___

### isItPossibleToClearSheet 

▸ **isItPossibleToClearSheet**(`sheetId`: number): *boolean*

*Defined in [src/HyperFormula.ts:2975](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2975)*

Returns information whether it is possible to clear a specified sheet.
If returns `true`, doing [clearSheet](hyperformulans.md#clearsheet) operation won't throw any errors, provided sheet exists and its content can be cleared.
Returns `false` otherwise

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
 MySheet1: [ ['1'] ],
 MySheet2: [ ['10'] ],
});

// should return 'true' because 'MySheet2' exists and can be cleared
const isClearable = hfInstance.isItPossibleToClearSheet(1);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID.  |

**Returns:** *boolean*

___

### isItPossibleToRemoveSheet 

▸ **isItPossibleToRemoveSheet**(`sheetId`: number): *boolean*

*Defined in [src/HyperFormula.ts:2901](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2901)*

Returns information whether it is possible to remove sheet for the engine.
Returns `true` if the provided sheet exists, and therefore it can be removed, doing [removeSheet](hyperformulans.md#removesheet) operation won't throw any errors.
Returns `false` otherwise

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
 MySheet1: [ ['1'] ],
 MySheet2: [ ['10'] ],
});

// should return 'true' because sheet with ID 1 exists and is removable
const isRemovable = hfInstance.isItPossibleToRemoveSheet(1);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID.  |

**Returns:** *boolean*

___

### isItPossibleToRenameSheet 

▸ **isItPossibleToRenameSheet**(`sheetId`: number, `newName`: string): *boolean*

*Defined in [src/HyperFormula.ts:3733](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3733)*

Returns information whether it is possible to rename sheet.
Returns `true` if the sheet with provided id exists and new name is available
Returns `false` if sheet cannot be renamed

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
  MySheet1: [ ['1'] ],
  MySheet2: [ ['10'] ],
});

// returns true
hfInstance.isItPossibleToRenameSheet(0, 'MySheet0');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | a sheet number |
`newName` | string | a name of the sheet to be given  |

**Returns:** *boolean*

___

### isItPossibleToReplaceSheetContent 

▸ **isItPossibleToReplaceSheetContent**(`sheetId`: number, `values`: [RawCellContent](../globals.md#rawcellcontent)[][]): *boolean*

*Defined in [src/HyperFormula.ts:3047](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3047)*

Returns information whether it is possible to replace the sheet content.
If returns `true`, doing [setSheetContent](hyperformulans.md#setsheetcontent) operation won't throw any errors, the provided sheet exists and then its content can be replaced.
Returns `false` otherwise

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
 MySheet1: [ ['1'] ],
 MySheet2: [ ['10'] ],
});

// should return 'true' because sheet of ID 0 exists
// and the provided content can be placed in this sheet
const isReplaceable = hfInstance.isItPossibleToReplaceSheetContent(0, [['50'], ['60']]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID. |
`values` | [RawCellContent](../globals.md#rawcellcontent)[][] | array of new values  |

**Returns:** *boolean*

___

### removeSheet 

▸ **removeSheet**(`sheetId`: number): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:2944](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2944)*

Removes a sheet

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [sheetRemoved](../interfaces/listeners.md#sheetremoved) after the sheet was removed

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
 MySheet1: [ ['=SUM(MySheet2!A1:A2)'] ],
 MySheet2: [ ['10'] ],
});

// should return a list of cells which values changed after the operation,
// their absolute addresses and new values, in this example it will return:
// [{
//   address: { sheet: 0, col: 0, row: 0 },
//   newValue: { error: [CellError], value: '#REF!' },
// }]
const changes = hfInstance.removeSheet(1);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID.  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### renameSheet 

▸ **renameSheet**(`sheetId`: number, `newName`: string): *void*

*Defined in [src/HyperFormula.ts:3771](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3771)*

Renames a specified sheet.

Note that this method may trigger dependency graph recalculation.

**`fires`** [sheetRenamed](../interfaces/listeners.md#sheetrenamed) after the sheet was renamed

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [SheetNameAlreadyTakenError](hyperformulans.md#static-sheetnamealreadytakenerror) when the provided sheet name already exists

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
  MySheet1: [ ['1'] ],
  MySheet2: [ ['10'] ],
});

// renames the sheet 'MySheet1'
hfInstance.renameSheet(0, 'MySheet0');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | a sheet ID |
`newName` | string | a name of the sheet to be given, if is the same as the old one the method does nothing  |

**Returns:** *void*

___

### setSheetContent 

▸ **setSheetContent**(`sheetId`: number, `values`: [RawCellContent](../globals.md#rawcellcontent)[][]): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:3084](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3084)*

Replaces the sheet content with new values.

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [InvalidArgumentsError](hyperformulans.md#static-invalidargumentserror) when values argument is not an array of arrays

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
 MySheet1: [ ['1'] ],
 MySheet2: [ ['10'] ],
});

// should return a list of cells which values changed after the operation,
// their absolute addresses and new values
const changes = hfInstance.setSheetContent(0, [['50'], ['60']]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID. |
`values` | [RawCellContent](../globals.md#rawcellcontent)[][] | array of new values  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

## Ranges

### getFillRangeData 

▸ **getFillRangeData**(`source`: [SimpleCellRange](../interfaces/simplecellrange.md), `target`: [SimpleCellRange](../interfaces/simplecellrange.md), `offsetsFromTarget`: boolean): *[RawCellContent](../globals.md#rawcellcontent)[][]*

*Defined in [src/HyperFormula.ts:2786](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2786)*

Returns values to fill target range using source range, with properly extending the range using wrap-around heuristic.

**`throws`** [EvaluationSuspendedError](hyperformulans.md#static-evaluationsuspendederror) when the evaluation is suspended

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if source or target are of wrong type

**`throws`** [SheetsNotEqual](sheetsnotequal.md) if range provided has distinct sheet numbers for start and end

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([[1, '=A1'], ['=$A$1', '2']]);

// should return [['2', '=$A$1', '2'], ['=A3', 1, '=C3'], ['2', '=$A$1', '2']]
hfInstance.getFillRangeData( {start: {sheet: 0, row: 0, col: 0}, end: {sheet: 0, row: 1, col: 1}},
{start: {sheet: 0, row: 1, col: 1}, end: {sheet: 0, row: 3, col: 3}});
```

**Parameters:**

Name | Type | Default | Description |
------ | ------ | ------ | ------ |
`source` | [SimpleCellRange](../interfaces/simplecellrange.md) | - | of data |
`target` | [SimpleCellRange](../interfaces/simplecellrange.md) | - | range where data is intended to be put |
`offsetsFromTarget` | boolean | false | if true, offsets are computed from target corner, otherwise from source corner  |

**Returns:** *[RawCellContent](../globals.md#rawcellcontent)[][]*

___

### getRangeFormulas 

▸ **getRangeFormulas**(`source`: [SimpleCellRange](../interfaces/simplecellrange.md)): *(string | undefined)[][]*

*Defined in [src/HyperFormula.ts:2713](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2713)*

Returns cell formulas in given range.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if source is of wrong type

**`throws`** [SheetsNotEqual](sheetsnotequal.md) if range provided has distinct sheet numbers for start and end

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['=SUM(1, 2)', '2', '10'],
 ['5', '6', '7'],
 ['40', '30', '20'],
]);

// returns cell formulas of a given range only:
// [ [ '=SUM(1, 2)', undefined ], [ undefined, undefined ] ]
const rangeFormulas = hfInstance.getRangeFormulas({ start: { sheet: 0, col: 0, row: 0 }, end: { sheet: 0, col: 1, row: 1 } });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`source` | [SimpleCellRange](../interfaces/simplecellrange.md) | rectangular range  |

**Returns:** *(string | undefined)[][]*

___

### getRangeSerialized 

▸ **getRangeSerialized**(`source`: [SimpleCellRange](../interfaces/simplecellrange.md)): *[RawCellContent](../globals.md#rawcellcontent)[][]*

*Defined in [src/HyperFormula.ts:2752](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2752)*

Returns serialized cells in given range.

Each non-formula cell is serialized to the exact value it was set with, preserving its type
(e.g., a cell set with the string `'2'` is serialized as the string `'2'`, while a cell set with the number `2` is serialized as the number `2`).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if source is of wrong type

**`throws`** [SheetsNotEqual](sheetsnotequal.md) if range provided has distinct sheet numbers for start and end

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['=SUM(1, 2)', 2, 10],
 [5, 6, 7],
 [40, 30, 20],
]);

// should return serialized cell content for the given range:
// [ [ '=SUM(1, 2)', 2 ], [ 5, 6 ] ]
const rangeSerialized = hfInstance.getRangeSerialized({ start: { sheet: 0, col: 0, row: 0 }, end: { sheet: 0, col: 1, row: 1 } });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`source` | [SimpleCellRange](../interfaces/simplecellrange.md) | rectangular range  |

**Returns:** *[RawCellContent](../globals.md#rawcellcontent)[][]*

___

### getRangeValues 

▸ **getRangeValues**(`source`: [SimpleCellRange](../interfaces/simplecellrange.md)): *[CellValue](../globals.md#cellvalue)[][]*

*Defined in [src/HyperFormula.ts:2677](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2677)*

Returns the cell content of a given range in a [CellValue](../globals.md#cellvalue)[][] format.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if source is of wrong type

**`throws`** [SheetsNotEqual](sheetsnotequal.md) if range provided has distinct sheet numbers for start and end

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['=SUM(1, 2)', '2', '10'],
 ['5', '6', '7'],
 ['40', '30', '20'],
]);

// returns calculated cells content: [ [ 3, 2 ], [ 5, 6 ] ]
const rangeValues = hfInstance.getRangeValues({ start: { sheet: 0, col: 0, row: 0 }, end: { sheet: 0, col: 1, row: 1 } });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`source` | [SimpleCellRange](../interfaces/simplecellrange.md) | rectangular range  |

**Returns:** *[CellValue](../globals.md#cellvalue)[][]*

___

## Rows

### addRows 

▸ **addRows**(`sheetId`: number, ...`indexes`: [ColumnRowIndex](../globals.md#columnrowindex)[]): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:1924](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1924)*

Adds multiple rows into a specified position in a given sheet.
Does nothing if rows are outside effective sheet size.

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [SheetSizeLimitExceededError](hyperformulans.md#static-sheetsizelimitexceedederror) when performing this operation would result in sheet size limits exceeding

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1'],
 ['2'],
]);

// should return a list of cells which values changed after the operation,
// their absolute addresses and new values
const changes = hfInstance.addRows(0, [0, 1]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID in which rows will be added |
`...indexes` | [ColumnRowIndex](../globals.md#columnrowindex)[] | non-contiguous indexes with format [row, amount], where row is a row number above which the rows will be added  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### isItPossibleToAddRows 

▸ **isItPossibleToAddRows**(`sheetId`: number, ...`indexes`: [ColumnRowIndex](../globals.md#columnrowindex)[]): *boolean*

*Defined in [src/HyperFormula.ts:1882](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1882)*

Returns information whether it is possible to add rows into a specified position in a given sheet.
Checks against particular rules to ascertain that addRows can be called.
If returns `true`, doing [addRows](hyperformulans.md#addrows) operation won't throw any errors.
Returns `false` if adding rows would exceed the sheet size limit or given arguments are invalid.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1', '2', '3'],
]);

// should return 'true' for this example,
// it is possible to add one row in the second row of sheet 0
const isAddable = hfInstance.isItPossibleToAddRows(0, [1, 1]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID in which rows will be added |
`...indexes` | [ColumnRowIndex](../globals.md#columnrowindex)[] | non-contiguous indexes with format [row, amount], where row is a row number above which the rows will be added  |

**Returns:** *boolean*

___

### isItPossibleToMoveRows 

▸ **isItPossibleToMoveRows**(`sheetId`: number, `startRow`: number, `numberOfRows`: number, `targetRow`: number): *boolean*

*Defined in [src/HyperFormula.ts:2279](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2279)*

Returns information whether it is possible to move a particular number of rows to a specified position in a given sheet.
Checks against particular rules to ascertain that moveRows can be called.
If returns `true`, doing [moveRows](hyperformulans.md#moverows) operation won't throw any errors.
Returns `false` if the operation might be disrupted and causes side effects by the fact that there is an array inside the selected rows, the target location includes an array or the provided address is invalid.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1'],
 ['2'],
]);

// should return 'true' for this example
// it is possible to move one row from row 0 into row 2
const isMovable = hfInstance.isItPossibleToMoveRows(0, 0, 1, 2);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | a sheet number in which the operation will be performed |
`startRow` | number | number of the first row to move |
`numberOfRows` | number | number of rows to move |
`targetRow` | number | row number before which rows will be moved  |

**Returns:** *boolean*

___

### isItPossibleToRemoveRows 

▸ **isItPossibleToRemoveRows**(`sheetId`: number, ...`indexes`: [ColumnRowIndex](../globals.md#columnrowindex)[]): *boolean*

*Defined in [src/HyperFormula.ts:1955](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1955)*

Returns information whether it is possible to remove rows from a specified position in a given sheet.
Checks against particular rules to ascertain that removeRows can be called.
If returns `true`, doing [removeRows](hyperformulans.md#removerows) operation won't throw any errors.
Returns `false` if given arguments are invalid.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1'],
 ['2'],
]);

// should return 'true' for this example
// it is possible to remove one row from row 1 of sheet 0
const isRemovable = hfInstance.isItPossibleToRemoveRows(0, [1, 1]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID from which rows will be removed |
`...indexes` | [ColumnRowIndex](../globals.md#columnrowindex)[] | non-contiguous indexes with format: [row, amount]  |

**Returns:** *boolean*

___

### isItPossibleToSetRowOrder 

▸ **isItPossibleToSetRowOrder**(`sheetId`: number, `newRowOrder`: number[]): *boolean*

*Defined in [src/HyperFormula.ts:1677](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1677)*

Checks if it is possible to reorder rows of a sheet according to a permutation.

Parameter `newRowOrder` should have the form `[ newPositionForRow0, newPositionForRow1, newPositionForRow2, ... ]`,
i.e. the value at index `i` is the new position for the row that is currently at index `i`.
See [setRowOrder](hyperformulans.md#setroworder) for details.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['A'],
 ['B'],
 ['C']
]);

// returns true
hfInstance.isItPossibleToSetRowOrder(0, [1, 2, 0]);

// returns false (array length must match the number of rows)
hfInstance.isItPossibleToSetRowOrder(0, [2]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | ID of a sheet to operate on |
`newRowOrder` | number[] | permutation of rows  |

**Returns:** *boolean*

___

### isItPossibleToSwapRowIndexes 

▸ **isItPossibleToSwapRowIndexes**(`sheetId`: number, `rowMapping`: [number, number][]): *boolean*

*Defined in [src/HyperFormula.ts:1590](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1590)*

Checks if it is possible to reorder rows of a sheet according to a source-target mapping.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 [1],
 [2],
 [4, 5],
]);

// returns true
const isSwappable = hfInstance.isItPossibleToSwapRowIndexes(0, [[0, 2], [2, 0]]);

// returns false
const isSwappable = hfInstance.isItPossibleToSwapRowIndexes(0, [[0, 1]]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | ID of a sheet to operate on |
`rowMapping` | [number, number][] | array mapping original positions to final positions of rows  |

**Returns:** *boolean*

___

### moveRows 

▸ **moveRows**(`sheetId`: number, `startRow`: number, `numberOfRows`: number, `targetRow`: number): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:2326](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2326)*

Moves a particular number of rows to a specified position in a given sheet.

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [InvalidArgumentsError](hyperformulans.md#static-invalidargumentserror) when the given arguments are invalid

**`throws`** [SourceLocationHasArrayError](hyperformulans.md#static-sourcelocationhasarrayerror) when the source location has array inside - array cannot be moved

**`throws`** [TargetLocationHasArrayError](hyperformulans.md#static-targetlocationhasarrayerror) when the target location has array inside - cells cannot be replaced by the array

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1'],
 ['2'],
]);

// should return a list of cells which values changed after the operation,
// their absolute addresses and new values
const changes = hfInstance.moveRows(0, 0, 1, 2);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | a sheet number in which the operation will be performed |
`startRow` | number | number of the first row to move |
`numberOfRows` | number | number of rows to move |
`targetRow` | number | row number before which rows will be moved  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### removeRows 

▸ **removeRows**(`sheetId`: number, ...`indexes`: [ColumnRowIndex](../globals.md#columnrowindex)[]): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:1996](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1996)*

Removes multiple rows from a specified position in a given sheet.
Does nothing if rows are outside the effective sheet size.

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [InvalidArgumentsError](hyperformulans.md#static-invalidargumentserror) when the given arguments are invalid

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1'],
 ['2'],
]);

// should return: [{ sheet: 0, col: 1, row: 2, value: null }] for this example
const changes = hfInstance.removeRows(0, [1, 1]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID from which rows will be removed |
`...indexes` | [ColumnRowIndex](../globals.md#columnrowindex)[] | non-contiguous indexes with format: [row, amount]  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### setRowOrder 

▸ **setRowOrder**(`sheetId`: number, `newRowOrder`: number[]): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:1642](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1642)*

Reorders rows of a sheet according to a permutation of 0-based indexes.

Parameter `newRowOrder` should have the form `[ newPositionForRow0, newPositionForRow1, newPositionForRow2, ... ]`.
In other words, the value at index `i` is the new position for the row that is currently at index `i`.
Note that this is the opposite of `[ previousPositionForRow0, previousPositionForRow1, ... ]`.

This method might be used to [sort the rows of a sheet](../../guide/sorting-data.md).

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note: This method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [InvalidArgumentsError](hyperformulans.md#static-invalidargumentserror) when rowMapping does not define correct row permutation for some subset of rows of the given sheet

**`throws`** [SourceLocationHasArrayError](hyperformulans.md#static-sourcelocationhasarrayerror) when the selected position has array inside

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['A'],
 ['B'],
 ['C']
]);

// Move 'A' to index 1, 'B' to index 2, and 'C' to index 0.
const newRowOrder = [1, 2, 0]; // [ newPosForA, newPosForB, newPosForC ]

const changes = hfInstance.setRowOrder(0, newRowOrder);

// Sheet after this operation: [['C'], ['A'], ['B']]
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | ID of a sheet to operate on |
`newRowOrder` | number[] | permutation of rows; array length must match the number of rows returned by [getSheetDimensions()](#getsheetdimensions)  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### swapRowIndexes 

▸ **swapRowIndexes**(`sheetId`: number, `rowMapping`: [number, number][]): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:1559](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1559)*

Reorders rows of a sheet according to a source-target mapping.

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [InvalidArgumentsError](hyperformulans.md#static-invalidargumentserror) when rowMapping does not define correct row permutation for some subset of rows of the given sheet

**`throws`** [SourceLocationHasArrayError](hyperformulans.md#static-sourcelocationhasarrayerror) when the selected position has array inside

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 [1],
 [2],
 [4, 5],
]);

// should set swap rows 0 and 2 in place, returns:
// [{
//   address: { sheet: 0, col: 0, row: 2 },
//   newValue: 1,
// },
// {
//   address: { sheet: 0, col: 1, row: 2 },
//   newValue: null,
// },
// {
//   address: { sheet: 0, col: 0, row: 0 },
//   newValue: 4,
// },
// {
//   address: { sheet: 0, col: 1, row: 0 },
//   newValue: 5,
// }]
const changes = hfInstance.swapRowIndexes(0, [[0, 2], [2, 0]]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | ID of a sheet to operate on |
`rowMapping` | [number, number][] | array mapping original positions to final positions of rows  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

## Columns

### addColumns 

▸ **addColumns**(`sheetId`: number, ...`indexes`: [ColumnRowIndex](../globals.md#columnrowindex)[]): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:2072](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2072)*

Adds multiple columns into a specified position in a given sheet.
Does nothing if the columns are outside the effective sheet size.

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [InvalidArgumentsError](hyperformulans.md#static-invalidargumentserror) when the given arguments are invalid

**`throws`** [SheetSizeLimitExceededError](hyperformulans.md#static-sheetsizelimitexceedederror) when performing this operation would result in sheet size limits exceeding

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['=RAND()', '42'],
]);

// should return a list of cells which values changed after the operation,
// their absolute addresses and new values, for this example:
// [{
//   address: { sheet: 0, col: 1, row: 0 },
//   newValue: 0.92754862796338,
// }]
const changes = hfInstance.addColumns(0, [0, 1]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID in which columns will be added |
`...indexes` | [ColumnRowIndex](../globals.md#columnrowindex)[] | non-contiguous indexes with format: [column, amount], where column is a column number from which new columns will be added  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### isItPossibleToAddColumns 

▸ **isItPossibleToAddColumns**(`sheetId`: number, ...`indexes`: [ColumnRowIndex](../globals.md#columnrowindex)[]): *boolean*

*Defined in [src/HyperFormula.ts:2026](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2026)*

Returns information whether it is possible to add columns into a specified position in a given sheet.
Checks against particular rules to ascertain that addColumns can be called.
If returns `true`, doing [addColumns](hyperformulans.md#addcolumns) operation won't throw any errors.
Returns `false` if adding columns would exceed the sheet size limit or given arguments are invalid.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1', '2'],
]);

// should return 'true' for this example,
// it is possible to add 1 column in sheet 0, at column 1
const isAddable = hfInstance.isItPossibleToAddColumns(0, [1, 1]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID in which columns will be added |
`...indexes` | [ColumnRowIndex](../globals.md#columnrowindex)[] | non-contiguous indexes with format: [column, amount], where column is a column number from which new columns will be added  |

**Returns:** *boolean*

___

### isItPossibleToMoveColumns 

▸ **isItPossibleToMoveColumns**(`sheetId`: number, `startColumn`: number, `numberOfColumns`: number, `targetColumn`: number): *boolean*

*Defined in [src/HyperFormula.ts:2361](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2361)*

Returns information whether it is possible to move a particular number of columns to a specified position in a given sheet.
Checks against particular rules to ascertain that moveColumns can be called.
If returns `true`, doing [moveColumns](hyperformulans.md#movecolumns) operation won't throw any errors.
Returns `false` if the operation might be disrupted and causes side effects by the fact that there is an array inside the selected columns, the target location includes an array or the provided address is invalid.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1', '2'],
]);

// should return 'true' for this example
// it is possible to move one column from column 1 into column 2 of sheet 0
const isMovable = hfInstance.isItPossibleToMoveColumns(0, 1, 1, 2);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | a sheet number in which the operation will be performed |
`startColumn` | number | number of the first column to move |
`numberOfColumns` | number | number of columns to move |
`targetColumn` | number | column number before which columns will be moved  |

**Returns:** *boolean*

___

### isItPossibleToRemoveColumns 

▸ **isItPossibleToRemoveColumns**(`sheetId`: number, ...`indexes`: [ColumnRowIndex](../globals.md#columnrowindex)[]): *boolean*

*Defined in [src/HyperFormula.ts:2102](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2102)*

Returns information whether it is possible to remove columns from a specified position in a given sheet.
Checks against particular rules to ascertain that removeColumns can be called.
If returns `true`, doing [removeColumns](hyperformulans.md#removecolumns) operation won't throw any errors.
Returns `false` if given arguments are invalid.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1', '2'],
]);

// should return 'true' for this example
// it is possible to remove one column, in place of the second column of sheet 0
const isRemovable = hfInstance.isItPossibleToRemoveColumns(0, [1, 1]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID from which columns will be removed |
`...indexes` | [ColumnRowIndex](../globals.md#columnrowindex)[] | non-contiguous indexes with format [column, amount]  |

**Returns:** *boolean*

___

### isItPossibleToSetColumnOrder 

▸ **isItPossibleToSetColumnOrder**(`sheetId`: number, `newColumnOrder`: number[]): *boolean*

*Defined in [src/HyperFormula.ts:1846](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1846)*

Checks if it is possible to reorder columns of a sheet according to a permutation.

Parameter `newColumnOrder` should have the form `[ newPositionForColumn0, newPositionForColumn1, newPositionForColumn2, ... ]`,
i.e. the value at index `i` is the new position for the column that is currently at index `i`.
See [setColumnOrder](hyperformulans.md#setcolumnorder) for details.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['A', 'B', 'C']
]);

// returns true
hfInstance.isItPossibleToSetColumnOrder(0, [1, 2, 0]);

// returns false (array length must match the number of columns)
hfInstance.isItPossibleToSetColumnOrder(0, [1]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | ID of a sheet to operate on |
`newColumnOrder` | number[] | permutation of columns  |

**Returns:** *boolean*

___

### isItPossibleToSwapColumnIndexes 

▸ **isItPossibleToSwapColumnIndexes**(`sheetId`: number, `columnMapping`: [number, number][]): *boolean*

*Defined in [src/HyperFormula.ts:1763](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1763)*

Checks if it is possible to reorder columns of a sheet according to a source-target mapping.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 [1, 2, 4],
 [5]
]);

// returns true
hfInstance.isItPossibleToSwapColumnIndexes(0, [[0, 2], [2, 0]]);

// returns false
hfInstance.isItPossibleToSwapColumnIndexes(0, [[0, 1]]);
```

**Parameters:**

Name | Type |
------ | ------ |
`sheetId` | number |
`columnMapping` | [number, number][] |

**Returns:** *boolean*

___

### moveColumns 

▸ **moveColumns**(`sheetId`: number, `startColumn`: number, `numberOfColumns`: number, `targetColumn`: number): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:2414](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2414)*

Moves a particular number of columns to a specified position in a given sheet.

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [InvalidArgumentsError](hyperformulans.md#static-invalidargumentserror) when the given arguments are invalid

**`throws`** [SourceLocationHasArrayError](hyperformulans.md#static-sourcelocationhasarrayerror) when the source location has array inside - array cannot be moved

**`throws`** [TargetLocationHasArrayError](hyperformulans.md#static-targetlocationhasarrayerror) when the target location has array inside - cells cannot be replaced by the array

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1', '2', '3', '=RAND()', '=SUM(A1:C1)'],
]);

// should return a list of cells which values changed after the operation,
// their absolute addresses and new values, for this example:
// [{
//   address: { sheet: 0, col: 1, row: 0 },
//   newValue: 0.16210054671639,
//  }, {
//   address: { sheet: 0, col: 4, row: 0 },
//   newValue: 6.16210054671639,
// }]
const changes = hfInstance.moveColumns(0, 1, 1, 2);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | a sheet number in which the operation will be performed |
`startColumn` | number | number of the first column to move |
`numberOfColumns` | number | number of columns to move |
`targetColumn` | number | column number before which columns will be moved  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### removeColumns 

▸ **removeColumns**(`sheetId`: number, ...`indexes`: [ColumnRowIndex](../globals.md#columnrowindex)[]): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:2147](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2147)*

Removes multiple columns from a specified position in a given sheet.
Does nothing if columns are outside the effective sheet size.

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [InvalidArgumentsError](hyperformulans.md#static-invalidargumentserror) when the given arguments are invalid

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['0', '=SUM(1, 2, 3)', '=A1'],
]);

// should return a list of cells which values changed after the operation,
// their absolute addresses and new values, in this example it will return:
// [{
//   address: { sheet: 0, col: 1, row: 0 },
//   newValue: { error: [CellError], value: '#REF!' },
// }]
const changes = hfInstance.removeColumns(0, [0, 1]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | sheet ID from which columns will be removed |
`...indexes` | [ColumnRowIndex](../globals.md#columnrowindex)[] | non-contiguous indexes with format: [column, amount]  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### setColumnOrder 

▸ **setColumnOrder**(`sheetId`: number, `newColumnOrder`: number[]): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:1813](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1813)*

Reorders columns of a sheet according to a permutation of 0-based indexes.

Parameter `newColumnOrder` should have the form `[ newPositionForColumn0, newPositionForColumn1, newPositionForColumn2, ... ]`.
In other words, the value at index `i` is the new position for the column that is currently at index `i`.
Note that this is the opposite of `[ previousPositionForColumn0, previousPositionForColumn1, ... ]`.

This method might be used to [sort the columns of a sheet](../../guide/sorting-data.md).

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note: This method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [InvalidArgumentsError](hyperformulans.md#static-invalidargumentserror) when columnMapping does not define correct column permutation for some subset of columns of the given sheet

**`throws`** [SourceLocationHasArrayError](hyperformulans.md#static-sourcelocationhasarrayerror) when the selected position has array inside

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
  ['A', 'B', 'C']
]);

// Move 'A' to index 1, 'B' to index 2, and 'C' to index 0.
const newColumnOrder = [1, 2, 0]; // [ newPosForA, newPosForB, newPosForC ]

const changes = hfInstance.setColumnOrder(0, newColumnOrder);

// Sheet after this operation: [['C', 'A', 'B']]
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | ID of a sheet to operate on |
`newColumnOrder` | number[] | permutation of columns; array length must match the number of columns returned by [getSheetDimensions()](#getsheetdimensions)  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### swapColumnIndexes 

▸ **swapColumnIndexes**(`sheetId`: number, `columnMapping`: [number, number][]): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:1735](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1735)*

Reorders columns of a sheet according to a source-target mapping.

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [InvalidArgumentsError](hyperformulans.md#static-invalidargumentserror) when columnMapping does not define correct column permutation for some subset of columns of the given sheet

**`throws`** [SourceLocationHasArrayError](hyperformulans.md#static-sourcelocationhasarrayerror) when the selected position has array inside

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 [1, 2, 4],
 [5]
]);

// should set swap columns 0 and 2 in place, returns:
// [{
//   address: { sheet: 0, col: 2, row: 0 },
//   newValue: 1,
// },
// {
//   address: { sheet: 0, col: 2, row: 1 },
//   newValue: 5,
// },
// {
//   address: { sheet: 0, col: 0, row: 0 },
//   newValue: 4,
// },
// {
//   address: { sheet: 0, col: 0, row: 1 },
//   newValue: null,
// }]
const changes = hfInstance.swapColumnIndexes(0, [[0, 2], [2, 0]]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`sheetId` | number | ID of a sheet to operate on |
`columnMapping` | [number, number][] | array mapping original positions to final positions of columns  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

## Cells

### doesCellHaveFormula 

▸ **doesCellHaveFormula**(`cellAddress`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *boolean*

*Defined in [src/HyperFormula.ts:3517](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3517)*

Returns `true` if the specified cell contains a formula.
The method accepts cell coordinates as object with column, row and sheet numbers.

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if cellAddress is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['=SUM(A2:A3)', '2'],
]);

// should return 'true' since the A1 cell contains a formula
const A1Formula = hfInstance.doesCellHaveFormula({ sheet: 0, col: 0, row: 0 });

// should return 'false' since the B1 cell does not contain a formula
const B1NoFormula = hfInstance.doesCellHaveFormula({ sheet: 0, col: 1, row: 0 });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`cellAddress` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | cell coordinates  |

**Returns:** *boolean*

___

### doesCellHaveSimpleValue 

▸ **doesCellHaveSimpleValue**(`cellAddress`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *boolean*

*Defined in [src/HyperFormula.ts:3486](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3486)*

Returns `true` if the specified cell contains a simple value.
The method accepts cell coordinates as object with column, row and sheet numbers.

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if cellAddress is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['=SUM(A2:A3)', '2'],
]);

// should return 'true' since the selected cell contains a simple value
const isA1Simple = hfInstance.doesCellHaveSimpleValue({ sheet: 0, col: 0, row: 0 });

// should return 'false' since the selected cell does not contain a simple value
const isB1Simple = hfInstance.doesCellHaveSimpleValue({ sheet: 0, col: 1, row: 0 });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`cellAddress` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | cell coordinates  |

**Returns:** *boolean*

___

### getCellFormula 

▸ **getCellFormula**(`cellAddress`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *string | undefined*

*Defined in [src/HyperFormula.ts:941](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L941)*

Returns a normalized formula string from the cell of a given address or `undefined` for an address that does not exist and empty values.

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) when cellAddress is of incorrect type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['=SUM(1, 2, 3)', '0'],
]);

// should return a normalized A1 cell formula: '=SUM(1, 2, 3)'
const A1Formula = hfInstance.getCellFormula({ sheet: 0, col: 0, row: 0 });

// should return a normalized B1 cell formula: 'undefined'
const B1Formula = hfInstance.getCellFormula({ sheet: 0, col: 1, row: 0 });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`cellAddress` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | cell coordinates  |

**Returns:** *string | undefined*

___

### getCellHyperlink 

▸ **getCellHyperlink**(`cellAddress`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *string | undefined*

*Defined in [src/HyperFormula.ts:971](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L971)*

Returns the `HYPERLINK` url for a cell of a given address or `undefined` for an address that does not exist or a cell that is not `HYPERLINK`

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) when cellAddress is of incorrect type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['=HYPERLINK("https://hyperformula.handsontable.com/", "HyperFormula")', '0'],
]);

// should return url of 'HYPERLINK': https://hyperformula.handsontable.com/
const A1Hyperlink = hfInstance.getCellHyperlink({ sheet: 0, col: 0, row: 0 });

// should return 'undefined' for a cell that is not 'HYPERLINK'
const B1Hyperlink = hfInstance.getCellHyperlink({ sheet: 0, col: 1, row: 0 });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`cellAddress` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | cell coordinates  |

**Returns:** *string | undefined*

___

### getCellSerialized 

▸ **getCellSerialized**(`cellAddress`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *[RawCellContent](../globals.md#rawcellcontent)*

*Defined in [src/HyperFormula.ts:1003](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1003)*

Returns [RawCellContent](../globals.md#rawcellcontent) with a serialized content of the cell of a given address: either a cell formula, an explicit value, or an error.

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [EvaluationSuspendedError](hyperformulans.md#static-evaluationsuspendederror) when the evaluation is suspended

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) when cellAddress is of incorrect type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['=SUM(1, 2, 3)', '0'],
]);

// should return serialized content of A1 cell: '=SUM(1, 2, 3)'
const cellA1Serialized = hfInstance.getCellSerialized({ sheet: 0, col: 0, row: 0 });

// should return serialized content of B1 cell: '0'
const cellB1Serialized = hfInstance.getCellSerialized({ sheet: 0, col: 1, row: 0 });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`cellAddress` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | cell coordinates  |

**Returns:** *[RawCellContent](../globals.md#rawcellcontent)*

___

### getCellType 

▸ **getCellType**(`cellAddress`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *[CellType](hyperformulans.md#static-celltype)*

*Defined in [src/HyperFormula.ts:3454](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3454)*

Returns the type of a cell at a given address.
The method accepts cell coordinates as object with column, row and sheet numbers.

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if cellAddress is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['=SUM(A2:A3)', '2'],
]);

// should return 'FORMULA', the cell of given coordinates is of this type
const cellA1Type = hfInstance.getCellType({ sheet: 0, col: 0, row: 0 });

// should return 'VALUE', the cell of given coordinates is of this type
const cellB1Type = hfInstance.getCellType({ sheet: 0, col: 1, row: 0 });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`cellAddress` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | cell coordinates  |

**Returns:** *[CellType](hyperformulans.md#static-celltype)*

___

### getCellValue 

▸ **getCellValue**(`cellAddress`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *[CellValue](../globals.md#cellvalue)*

*Defined in [src/HyperFormula.ts:910](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L910)*

Returns the cell value of a given address.
Applies rounding and post-processing.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) when cellAddress is of incorrect type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [EvaluationSuspendedError](hyperformulans.md#static-evaluationsuspendederror) when the evaluation is suspended

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['=SUM(1, 2, 3)', '2'],
]);

// get value of A1 cell, should be '6'
const A1Value = hfInstance.getCellValue({ sheet: 0, col: 0, row: 0 });

// get value of B1 cell, should be '2'
const B1Value = hfInstance.getCellValue({ sheet: 0, col: 1, row: 0 });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`cellAddress` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | cell coordinates  |

**Returns:** *[CellValue](../globals.md#cellvalue)*

___

### getCellValueDetailedType 

▸ **getCellValueDetailedType**(`cellAddress`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *[CellValueDetailedType](hyperformulans.md#static-cellvaluedetailedtype)*

*Defined in [src/HyperFormula.ts:3648](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3648)*

Returns detailed type of the cell value of a given address.
The method accepts cell coordinates as object with column, row and sheet numbers.

For more information, see the [Types of values guide](/docs/guide/types-of-values.md).

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [EvaluationSuspendedError](hyperformulans.md#static-evaluationsuspendederror) when the evaluation is suspended

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if cellAddress is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1%', '1$'],
]);

// should return 'NUMBER_PERCENT', cell value type of provided coordinates is a number with a format inference percent.
const cellType = hfInstance.getCellValueDetailedType({ sheet: 0, col: 0, row: 0 });

// should return 'NUMBER_CURRENCY', cell value type of provided coordinates is a number with a format inference currency.
const cellType = hfInstance.getCellValueDetailedType({ sheet: 0, col: 1, row: 0 });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`cellAddress` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | cell coordinates  |

**Returns:** *[CellValueDetailedType](hyperformulans.md#static-cellvaluedetailedtype)*

___

### getCellValueFormat 

▸ **getCellValueFormat**(`cellAddress`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *FormatInfo*

*Defined in [src/HyperFormula.ts:3682](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3682)*

Returns auxiliary format information of the cell value of a given address.
The method accepts cell coordinates as object with column, row and sheet numbers.

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [EvaluationSuspendedError](hyperformulans.md#static-evaluationsuspendederror) when the evaluation is suspended

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if cellAddress is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1$', '1'],
]);

// should return '$', cell value type of provided coordinates is a number with a format inference currency, parsed as using '$' as currency.
const cellFormat = hfInstance.getCellValueFormat({ sheet: 0, col: 0, row: 0 });

// should return undefined, cell value type of provided coordinates is a number with no format information.
const cellFormat = hfInstance.getCellValueFormat({ sheet: 0, col: 1, row: 0 });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`cellAddress` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | cell coordinates  |

**Returns:** *FormatInfo*

___

### getCellValueType 

▸ **getCellValueType**(`cellAddress`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *[CellValueType](hyperformulans.md#static-cellvaluetype)*

*Defined in [src/HyperFormula.ts:3612](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3612)*

Returns type of the cell value of a given address.
The method accepts cell coordinates as object with column, row and sheet numbers.

For more information, see the [Types of values guide](/docs/guide/types-of-values.md).

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [EvaluationSuspendedError](hyperformulans.md#static-evaluationsuspendederror) when the evaluation is suspended

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if cellAddress is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['=SUM(1, 2, 3)', '2'],
]);

// should return 'NUMBER', cell value type of provided coordinates is a number
const cellValue = hfInstance.getCellValueType({ sheet: 0, col: 1, row: 0 });

// should return 'NUMBER', cell value type of provided coordinates is a number
const cellValue = hfInstance.getCellValueType({ sheet: 0, col: 0, row: 0 });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`cellAddress` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | cell coordinates  |

**Returns:** *[CellValueType](hyperformulans.md#static-cellvaluetype)*

___

### isCellEmpty 

▸ **isCellEmpty**(`cellAddress`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *boolean*

*Defined in [src/HyperFormula.ts:3549](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3549)*

Returns`true` if the specified cell is empty.
The method accepts cell coordinates as object with column, row and sheet numbers.

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if cellAddress is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
  [null, '1'],
]);

// should return 'true', cell of provided coordinates is empty
const isEmpty = hfInstance.isCellEmpty({ sheet: 0, col: 0, row: 0 });

// should return 'false', cell of provided coordinates is not empty
const isNotEmpty = hfInstance.isCellEmpty({ sheet: 0, col: 1, row: 0 });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`cellAddress` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | cell coordinates  |

**Returns:** *boolean*

___

### isCellPartOfArray 

▸ **isCellPartOfArray**(`cellAddress`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *boolean*

*Defined in [src/HyperFormula.ts:3577](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3577)*

Returns `true` if a given cell is a part of an array.
The method accepts cell coordinates as object with column, row and sheet numbers.

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if cellAddress is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
   ['{=TRANSPOSE(B1:B1)}'],
]);

// should return 'true', cell of provided coordinates is a part of an array
const isPartOfArray = hfInstance.isCellPartOfArray({ sheet: 0, col: 0, row: 0 });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`cellAddress` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | cell coordinates  |

**Returns:** *boolean*

___

### isItPossibleToMoveCells 

▸ **isItPossibleToMoveCells**(`source`: [SimpleCellRange](../interfaces/simplecellrange.md), `destinationLeftCorner`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *boolean*

*Defined in [src/HyperFormula.ts:2183](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2183)*

Returns information whether it is possible to move cells to a specified position in a given sheet.
Checks against particular rules to ascertain that moveCells can be called.
If returns `true`, doing [moveCells](hyperformulans.md#movecells) operation won't throw any errors.
Returns `false` if the operation might be disrupted and causes side effects by the fact that there is an array inside the selected columns, the target location includes an array or the provided address is invalid.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if destinationLeftCorner, source, or any of basic type arguments are of wrong type

**`throws`** [SheetsNotEqual](sheetsnotequal.md) if range provided has distinct sheet numbers for start and end

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1', '2'],
]);

// choose the coordinates and assign them to variables
const source = { sheet: 0, col: 1, row: 0 };
const destination = { sheet: 0, col: 3, row: 0 };

// should return 'true' for this example
// it is possible to move a block of width 1 and height 1
// from the corner: column 1 and row 0 of sheet 0
// into destination corner: column 3, row 0 of sheet 0
const isMovable = hfInstance.isItPossibleToMoveCells({ start: source, end: source }, destination);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`source` | [SimpleCellRange](../interfaces/simplecellrange.md) | range for a moved block |
`destinationLeftCorner` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | upper left address of the target cell block  |

**Returns:** *boolean*

___

### isItPossibleToSetCellContents 

▸ **isItPossibleToSetCellContents**(`address`: [SimpleCellAddress](../interfaces/simplecelladdress.md) | [SimpleCellRange](../interfaces/simplecellrange.md)): *boolean*

*Defined in [src/HyperFormula.ts:1454](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1454)*

Returns information whether it is possible to change the content in a rectangular area bounded by the box.
If returns `true`, doing [setCellContents](hyperformulans.md#setcellcontents) operation won't throw any errors.
Returns `false` if the address is invalid or the sheet does not exist.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [SheetsNotEqual](sheetsnotequal.md) if range provided has distinct sheet numbers for start and end

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1', '2'],
]);

// top left corner
const address1 = { col: 0, row: 0, sheet: 0 };
// bottom right corner
const address2 = { col: 1, row: 0, sheet: 0 };

// should return 'true' for this example, it is possible to set content of
// width 2, height 1 in the first row and column of sheet 0
const isSettable = hfInstance.isItPossibleToSetCellContents({ start: address1, end: address2 });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`address` | [SimpleCellAddress](../interfaces/simplecelladdress.md) &#124; [SimpleCellRange](../interfaces/simplecellrange.md) | single cell or block of cells to check  |

**Returns:** *boolean*

___

### moveCells 

▸ **moveCells**(`source`: [SimpleCellRange](../interfaces/simplecellrange.md), `destinationLeftCorner`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:2240](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2240)*

Moves the content of a cell block from source to the target location.

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if destinationLeftCorner or source are of wrong type

**`throws`** [InvalidArgumentsError](hyperformulans.md#static-invalidargumentserror) when the given arguments are invalid

**`throws`** [SheetSizeLimitExceededError](hyperformulans.md#static-sheetsizelimitexceedederror) when performing this operation would result in sheet size limits exceeding

**`throws`** [SourceLocationHasArrayError](hyperformulans.md#static-sourcelocationhasarrayerror) when the source location has array inside - array cannot be moved

**`throws`** [TargetLocationHasArrayError](hyperformulans.md#static-targetlocationhasarrayerror) when the target location has array inside - cells cannot be replaced by the array

**`throws`** [SheetsNotEqual](sheetsnotequal.md) if range provided has distinct sheet numbers for start and end

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['=RAND()', '42'],
]);

// choose the coordinates and assign them to variables
const source = { sheet: 0, col: 1, row: 0 };
const destination = { sheet: 0, col: 3, row: 0 };

// should return a list of cells which values changed after the operation,
// their absolute addresses and new values, for this example:
// [{
//   address: { sheet: 0, col: 0, row: 0 },
//   newValue: 0.93524248002062,
// }]
const changes = hfInstance.moveCells({ start: source, end: source }, destination);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`source` | [SimpleCellRange](../interfaces/simplecellrange.md) | range for a moved block |
`destinationLeftCorner` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | upper left address of the target cell block  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### setCellContents 

▸ **setCellContents**(`topLeftCornerAddress`: [SimpleCellAddress](../interfaces/simplecelladdress.md), `cellContents`: [RawCellContent](../globals.md#rawcellcontent)[][] | [RawCellContent](../globals.md#rawcellcontent)): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:1507](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1507)*

Sets the content for a block of cells of a given coordinates.

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [InvalidArgumentsError](hyperformulans.md#static-invalidargumentserror) when the value is not an array of arrays or a raw cell value

**`throws`** [SheetSizeLimitExceededError](hyperformulans.md#static-sheetsizelimitexceedederror) when performing this operation would result in sheet size limits exceeding

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if topLeftCornerAddress argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1', '2', '=A1'],
]);

// should set the content, returns:
// [{
//   address: { sheet: 0, col: 3, row: 0 },
//   newValue: 2,
// }]
const changes = hfInstance.setCellContents({ col: 3, row: 0, sheet: 0 }, [['=B1']]);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`topLeftCornerAddress` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | top left corner of block of cells |
`cellContents` | [RawCellContent](../globals.md#rawcellcontent)[][] &#124; [RawCellContent](../globals.md#rawcellcontent) | array with content  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

## Named Expressions

### addNamedExpression 

▸ **addNamedExpression**(`expressionName`: string, `expression`: [RawCellContent](../globals.md#rawcellcontent), `scope?`: undefined | number, `options?`: [NamedExpressionOptions](../globals.md#namedexpressionoptions)): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:4002](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4002)*

Adds a specified named expression.

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [namedExpressionAdded](../interfaces/listeners.md#namedexpressionadded) always, unless [batch](hyperformulans.md#batch) mode is used

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NamedExpressionNameIsAlreadyTakenError](hyperformulans.md#static-namedexpressionnameisalreadytakenerror) when the named-expression name is not available.

**`throws`** [NamedExpressionNameIsInvalidError](hyperformulans.md#static-namedexpressionnameisinvaliderror) when the named-expression name is not valid

**`throws`** [NoRelativeAddressesAllowedError](hyperformulans.md#static-norelativeaddressesallowederror) when the named-expression formula contains relative references

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) if no sheet with given sheetId exists

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['42'],
]);

// add own expression, scope limited to 'Sheet1' (sheetId=0), the method should return a list of cells which values
// changed after the operation, their absolute addresses and new values
// for this example:
// [{
//   name: 'prettyName',
//   newValue: 142,
// }]
const changes = hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100', 0);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`expressionName` | string | a name of the expression to be added |
`expression` | [RawCellContent](../globals.md#rawcellcontent) | the expression |
`scope?` | undefined &#124; number | scope definition, `sheetId` for local scope or `undefined` for global scope |
`options?` | [NamedExpressionOptions](../globals.md#namedexpressionoptions) | additional metadata related to named expression  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### changeNamedExpression 

▸ **changeNamedExpression**(`expressionName`: string, `newExpression`: [RawCellContent](../globals.md#rawcellcontent), `scope?`: undefined | number, `options?`: [NamedExpressionOptions](../globals.md#namedexpressionoptions)): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:4224](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4224)*

Changes a given named expression to a specified formula.

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NamedExpressionDoesNotExistError](hyperformulans.md#static-namedexpressiondoesnotexisterror) when the given expression does not exist.

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) if no sheet with given sheetId exists

**`throws`** [[ArrayFormulasNotSupportedError]] when the named expression formula is an array formula

**`throws`** [NoRelativeAddressesAllowedError](hyperformulans.md#static-norelativeaddressesallowederror) when the named expression formula contains relative references

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['42'],
]);

// add a named expression, scope limited to 'Sheet1' (sheetId=0)
hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100', 0);

// change the named expression
const changes = hfInstance.changeNamedExpression('prettyName', '=Sheet1!$A$1+200');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`expressionName` | string | an expression name, case-insensitive. |
`newExpression` | [RawCellContent](../globals.md#rawcellcontent) | a new expression |
`scope?` | undefined &#124; number | scope definition, `sheetId` for local scope or `undefined` for global scope |
`options?` | [NamedExpressionOptions](../globals.md#namedexpressionoptions) | additional metadata related to named expression  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### getAllNamedExpressionsSerialized 

▸ **getAllNamedExpressionsSerialized**(): *[SerializedNamedExpression](../interfaces/serializednamedexpression.md)[]*

*Defined in [src/HyperFormula.ts:4392](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4392)*

Returns all named expressions serialized.

For more information, see the [Named expressions guide](/docs/guide/named-expressions.md).

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['42'],
 ['50'],
 ['60'],
]);

// add two named expressions and one scoped
hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100');
hfInstance.addNamedExpression('anotherPrettyName', '=Sheet1!$A$2+100');
hfInstance.addNamedExpression('prettyName3', '=Sheet1!$A$3+100', 0);

// get all expressions serialized
// should return:
// [
// {name: 'prettyName', expression: '=Sheet1!$A$1+100', options: undefined, scope: undefined},
// {name: 'anotherPrettyName', expression: '=Sheet1!$A$2+100', options: undefined, scope: undefined},
// {name: 'alsoPrettyName', expression: '=Sheet1!$A$3+100', options: undefined, scope: 0}
// ]
const allExpressions = hfInstance.getAllNamedExpressionsSerialized();
```

**Returns:** *[SerializedNamedExpression](../interfaces/serializednamedexpression.md)[]*

___

### getNamedExpression 

▸ **getNamedExpression**(`expressionName`: string, `scope?`: undefined | number): *[NamedExpression](../interfaces/namedexpression.md) | undefined*

*Defined in [src/HyperFormula.ts:4127](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4127)*

Returns a named expression, or `undefined` for a named expression that does not exist or does not hold a formula.

For more information, see the [Named expressions guide](/docs/guide/named-expressions.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) if no sheet with given sheetId exists

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['42'],
]);

// add a named expression in 'Sheet1' (sheetId=0)
hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100', 0);

// returns a named expression that corresponds to the passed name from 'Sheet1' (sheetId=0)
// for this example, returns:
// {name: 'prettyName', expression: '=Sheet1!$A$1+100', options: undefined, scope: 0}
const myFormula = hfInstance.getNamedExpression('prettyName', 0);

// for a named expression that doesn't exist, returns 'undefined':
const myFormulaTwo = hfInstance.getNamedExpression('uglyName', 0);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`expressionName` | string | expression name, case-insensitive. |
`scope?` | undefined &#124; number | scope definition, `sheetId` for local scope or `undefined` for global scope  |

**Returns:** *[NamedExpression](../interfaces/namedexpression.md) | undefined*

___

### getNamedExpressionFormula 

▸ **getNamedExpressionFormula**(`expressionName`: string, `scope?`: undefined | number): *string | undefined*

*Defined in [src/HyperFormula.ts:4082](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4082)*

Returns a normalized formula string for given named expression, or `undefined` for a named expression that does not exist or does not hold a formula.

For more information, see the [Named expressions guide](/docs/guide/named-expressions.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) if no sheet with given sheetId exists

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['42'],
]);

// add a named expression in 'Sheet1' (sheetId=0)
hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100', 0);

// returns a normalized formula string corresponding to the passed name from 'Sheet1' (sheetId=0),
// '=Sheet1!A1+100' for this example
const myFormula = hfInstance.getNamedExpressionFormula('prettyName', 0);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`expressionName` | string | expression name, case-insensitive. |
`scope?` | undefined &#124; number | scope definition, `sheetId` for local scope or `undefined` for global scope  |

**Returns:** *string | undefined*

___

### getNamedExpressionValue 

▸ **getNamedExpressionValue**(`expressionName`: string, `scope?`: undefined | number): *[CellValue](../globals.md#cellvalue) | undefined*

*Defined in [src/HyperFormula.ts:4040](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4040)*

Gets specified named expression value.
Returns a [CellValue](../globals.md#cellvalue) or undefined if the given named expression does not exist.

For more information, see the [Named expressions guide](/docs/guide/named-expressions.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) if no sheet with given sheetId exists

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['42'],
]);

// add a named expression, only 'Sheet1' (sheetId=0) considered as it is the scope
hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100', 'Sheet1');

// returns the calculated value of a passed named expression, '142' for this example
const myFormula = hfInstance.getNamedExpressionValue('prettyName', 'Sheet1');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`expressionName` | string | expression name, case-insensitive. |
`scope?` | undefined &#124; number | scope definition, `sheetId` for local scope or `undefined` for global scope  |

**Returns:** *[CellValue](../globals.md#cellvalue) | undefined*

___

### isItPossibleToAddNamedExpression 

▸ **isItPossibleToAddNamedExpression**(`expressionName`: string, `expression`: [RawCellContent](../globals.md#rawcellcontent), `scope?`: undefined | number): *boolean*

*Defined in [src/HyperFormula.ts:3950](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3950)*

Returns information whether it is possible to add named expression into a specific scope.
Checks against particular rules to ascertain that addNamedExpression can be called.
If returns `true`, doing [addNamedExpression](hyperformulans.md#addnamedexpression) operation won't throw any errors.
Returns `false` if the operation might be disrupted.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['42'],
]);

// should return 'true' for this example,
// it is possible to add named expression to global scope
const isAddable = hfInstance.isItPossibleToAddNamedExpression('prettyName', '=Sheet1!$A$1+100');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`expressionName` | string | a name of the expression to be added |
`expression` | [RawCellContent](../globals.md#rawcellcontent) | the expression |
`scope?` | undefined &#124; number | scope definition, `sheetId` for local scope or `undefined` for global scope  |

**Returns:** *boolean*

___

### isItPossibleToChangeNamedExpression 

▸ **isItPossibleToChangeNamedExpression**(`expressionName`: string, `newExpression`: [RawCellContent](../globals.md#rawcellcontent), `scope?`: undefined | number): *boolean*

*Defined in [src/HyperFormula.ts:4176](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4176)*

Returns information whether it is possible to change named expression in a specific scope.
Checks against particular rules to ascertain that changeNamedExpression can be called.
If returns `true`, doing [changeNamedExpression](hyperformulans.md#changenamedexpression) operation won't throw any errors.
Returns `false` if the operation might be disrupted.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['42'],
]);

// add a named expression
hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100');

// should return 'true' for this example,
// it is possible to change named expression
const isAddable = hfInstance.isItPossibleToChangeNamedExpression('prettyName', '=Sheet1!$A$1+100');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`expressionName` | string | an expression name, case-insensitive. |
`newExpression` | [RawCellContent](../globals.md#rawcellcontent) | a new expression |
`scope?` | undefined &#124; number | scope definition, `sheetId` for local scope or `undefined` for global scope  |

**Returns:** *boolean*

___

### isItPossibleToRemoveNamedExpression 

▸ **isItPossibleToRemoveNamedExpression**(`expressionName`: string, `scope?`: undefined | number): *boolean*

*Defined in [src/HyperFormula.ts:4260](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4260)*

Returns information whether it is possible to remove named expression from a specific scope.
Checks against particular rules to ascertain that removeNamedExpression can be called.
If returns `true`, doing [removeNamedExpression](hyperformulans.md#removenamedexpression) operation won't throw any errors.
Returns `false` if the operation might be disrupted.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['42'],
]);

// add a named expression
hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100');

// should return 'true' for this example,
// it is possible to change named expression
const isAddable = hfInstance.isItPossibleToRemoveNamedExpression('prettyName');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`expressionName` | string | an expression name, case-insensitive. |
`scope?` | undefined &#124; number | scope definition, `sheetId` for local scope or `undefined` for global scope  |

**Returns:** *boolean*

___

### listNamedExpressions 

▸ **listNamedExpressions**(`scope?`: undefined | number): *string[]*

*Defined in [src/HyperFormula.ts:4354](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4354)*

Lists named expressions.
- If scope parameter is provided, returns an array of expression names defined for this scope.
- If scope parameter is undefined, returns an array of global expression names.

For more information, see the [Named expressions guide](/docs/guide/named-expressions.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) if no sheet with given sheetId exists

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['42'],
 ['50'],
 ['60'],
]);

// add two named expressions and one scoped
hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100');
hfInstance.addNamedExpression('anotherPrettyName', '=Sheet1!$A$2+100');
hfInstance.addNamedExpression('alsoPrettyName', '=Sheet1!$A$3+100', 0);

// list the expressions, should return: ['prettyName', 'anotherPrettyName'] for this example
const listOfExpressions = hfInstance.listNamedExpressions();

 // list the expressions, should return: ['alsoPrettyName'] for this example
const listOfExpressions = hfInstance.listNamedExpressions(0);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`scope?` | undefined &#124; number | scope of the named expressions, `sheetId` for local scope or `undefined` for global scope  |

**Returns:** *string[]*

___

### removeNamedExpression 

▸ **removeNamedExpression**(`expressionName`: string, `scope?`: undefined | number): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:4305](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4305)*

Removes a named expression.

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [namedExpressionRemoved](../interfaces/listeners.md#namedexpressionremoved) after the expression was removed

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NamedExpressionDoesNotExistError](hyperformulans.md#static-namedexpressiondoesnotexisterror) when the given expression does not exist.

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) if no sheet with given sheetId exists

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['42'],
]);

// add a named expression
hfInstance.addNamedExpression('prettyName', '=Sheet1!$A$1+100', 0);

// remove the named expression
const changes = hfInstance.removeNamedExpression('prettyName', 0);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`expressionName` | string | expression name, case-insensitive. |
`scope?` | undefined &#124; number | scope definition, `sheetId` for local scope or `undefined` for global scope  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

## Helpers

### calculateFormula 

▸ **calculateFormula**(`formulaString`: string, `sheetId`: number): *[CellValue](../globals.md#cellvalue) | [CellValue](../globals.md#cellvalue)[][]*

*Defined in [src/HyperFormula.ts:4457](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4457)*

Calculates fire-and-forget formula, returns the calculated value.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type arguments is of wrong type.

**`throws`** [NotAFormulaError](hyperformulans.md#static-notaformulaerror) when the provided string is not a valid formula (i.e., doesn't start with `=`).

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the provided `sheetID` doesn't exist.

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
 Sheet1: [['58']],
 Sheet2: [['1', '2', '3'], ['4', '5', '6']]
});

// returns the calculated formula's value
// for this example, returns `68`
const calculatedFormula = hfInstance.calculateFormula('=A1+10', 0);

// for this example, returns [['11', '12', '13'], ['14', '15', '16']]
const calculatedFormula = hfInstance.calculateFormula('=A1:B3+10', 1);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`formulaString` | string | A formula in a proper format, starting with `=`. |
`sheetId` | number | The ID of a sheet in context of which the formula gets evaluated.  |

**Returns:** *[CellValue](../globals.md#cellvalue) | [CellValue](../globals.md#cellvalue)[][]*

___

### getAvailableFunctions 

▸ **getAvailableFunctions**(): *FunctionListEntry[]*

*Defined in [src/HyperFormula.ts:4622](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4622)*

Returns metadata of all functions available in this instance for a function picker, with names translated
according to the language set in this instance's configuration. Each entry contains the translated name, the
language-independent canonical name, the category, and a short description. Entries are sorted alphabetically by
their localized name, using the collation rules of the host environment, so the exact order of names that differ
only by case or diacritics may vary between hosts.

The list reflects this instance's own registry: the built-in functions and any custom (user-registered)
functions, plus their aliases. An alias is listed under its own id, borrowing its target's category and
description, with the target id exposed as `aliasOf`. Custom functions ship no catalogue entry, so their
`category` is `'Custom'` and they carry no `shortDescription`.

A function with no translation entry for the configured language is omitted: the interpreter refuses to evaluate
an untranslated id, so listing it would advertise a function that cannot be called — in practice, a custom
plugin registered without translations for that language. A translation set to an empty string is not a missing
entry: it falls back to the canonical id, so the function stays listed under its canonical name.

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();

// get the list of available functions, translated for the configured language
const functions = hfInstance.getAvailableFunctions();
```

**Returns:** *FunctionListEntry[]*

___

### getCellDependents 

▸ **getCellDependents**(`address`: [SimpleCellAddress](../interfaces/simplecelladdress.md) | [SimpleCellRange](../interfaces/simplecellrange.md)): *([SimpleCellRange](../interfaces/simplecellrange.md) | [SimpleCellAddress](../interfaces/simplecelladdress.md))[]*

*Defined in [src/HyperFormula.ts:3281](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3281)*

Returns all the out-neighbors in the [dependency graph](../../guide/dependency-graph.md) for a given cell address or range. Including:
- All cells with formulas that contain the given cell address or range
- Some of the ranges that contain the given cell address or range

The exact result depends on the optimizations applied by the HyperFormula to the dependency graph, some of which are described in the section ["Optimizations for large ranges"](../../guide/dependency-graph.md#optimizations-for-large-ranges).

The returned array includes also named expression dependents. They are represented as cell references with sheet ID `-1`.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if address is not [SimpleCellAddress](../interfaces/simplecelladdress.md) or [SimpleCellRange](../interfaces/simplecellrange.md)

**`throws`** [SheetsNotEqual](sheetsnotequal.md) if range provided has distinct sheet numbers for start and end

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray( [ ['1', '=A1', '=A1+B1'] ] );

hfInstance.getCellDependents({ sheet: 0, col: 0, row: 0});
// returns [{ sheet: 0, col: 1, row: 0}, { sheet: 0, col: 2, row: 0}]
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`address` | [SimpleCellAddress](../interfaces/simplecelladdress.md) &#124; [SimpleCellRange](../interfaces/simplecellrange.md) | object representation of an absolute address or range of addresses  |

**Returns:** *([SimpleCellRange](../interfaces/simplecellrange.md) | [SimpleCellAddress](../interfaces/simplecelladdress.md))[]*

___

### getCellPrecedents 

▸ **getCellPrecedents**(`address`: [SimpleCellAddress](../interfaces/simplecelladdress.md) | [SimpleCellRange](../interfaces/simplecellrange.md)): *([SimpleCellRange](../interfaces/simplecellrange.md) | [SimpleCellAddress](../interfaces/simplecelladdress.md))[]*

*Defined in [src/HyperFormula.ts:3319](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3319)*

Returns all the in-neighbors in the [dependency graph](../../guide/dependency-graph.md) for a given cell address or range. In particular:
- If the argument is a single cell, `getCellPrecedents()` returns all cells and ranges contained in that cell's formula.
- If the argument is a range of cells, `getCellPrecedents()` returns some of the cell addresses and smaller ranges contained in that range (but not all of them). The exact result depends on the optimizations applied by the HyperFormula to the dependency graph, some of which are described in the section ["Optimizations for large ranges"](../../guide/dependency-graph.md#optimizations-for-large-ranges).

The returned array includes also named expression precedents. They are represented as cell references with sheet ID `-1`.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if address is of wrong type

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray( [ ['1', '=A1', '=A1+B1'] ] );

hfInstance.getCellPrecedents({ sheet: 0, col: 2, row: 0});
// returns [{ sheet: 0, col: 0, row: 0}, { sheet: 0, col: 1, row: 0}]
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`address` | [SimpleCellAddress](../interfaces/simplecelladdress.md) &#124; [SimpleCellRange](../interfaces/simplecellrange.md) | object representation of an absolute address or range of addresses  |

**Returns:** *([SimpleCellRange](../interfaces/simplecellrange.md) | [SimpleCellAddress](../interfaces/simplecelladdress.md))[]*

___

### getFunctionDetails 

▸ **getFunctionDetails**(`canonicalName`: string): *FunctionDetails | undefined*

*Defined in [src/HyperFormula.ts:4666](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4666)*

Returns the full metadata of a single function registered in this instance, with names translated according to
the language set in this instance's configuration: the parameter list (with per-parameter optionality), the
number of trailing parameters that repeat (`repeatLastArgs`), the category, a short description, and the
documentation link (`documentationUrl`) and usage examples (`examples`) — every built-in authors both.
Resolves both built-in and custom (user-registered) functions, as well as aliases. An alias reports its
target's metadata (including examples, which spell the target's name) under the alias id, with the target id
exposed as `aliasOf`. Returns `undefined` when the function id is unknown, not registered in this instance, or
has no translation entry for the configured language (an untranslated id cannot be evaluated, so it is not
described either, which keeps this method consistent with [getAvailableFunctions](hyperformulans.md#getavailablefunctions)).
For a custom function, `category` is `'Custom'`, there is no `shortDescription`, `documentationUrl` or
`examples`, and parameters are reported positionally (`Arg1`, `Arg2`, ...).

`canonicalName` is matched exactly, in two ways worth knowing:
- It is **case-sensitive**, unlike formula syntax. `'SUMIF'` resolves; `'sumif'` and `'SumIf'` return
  `undefined`, even though `=sumif(...)` evaluates.
- It must be the **canonical (English) id, never a localized name**. `localizedName` is output only: under
  `plPL` this method reports `localizedName: 'SUMA.JEŻELI'` for `'SUMIF'`, but passing `'SUMA.JEŻELI'` back in
  returns `undefined`. To look up an entry from [getAvailableFunctions](hyperformulans.md#getavailablefunctions), pass its `canonicalName`.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();

// get the details of the SUMIF function, translated for the configured language
const details = hfInstance.getFunctionDetails('SUMIF');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`canonicalName` | string | the language-independent function id, e.g. `'SUMIF'`  |

**Returns:** *FunctionDetails | undefined*

___

### getNamedExpressionsFromFormula 

▸ **getNamedExpressionsFromFormula**(`formulaString`: string): *string[]*

*Defined in [src/HyperFormula.ts:4488](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4488)*

Return a list of named expressions used by a formula.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type arguments is of wrong type.

**`throws`** [NotAFormulaError](hyperformulans.md#static-notaformulaerror) when the provided string is not a valid formula (i.e., doesn't start with `=`).

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();

// returns a list of named expressions used by a formula
// for this example, returns ['foo', 'bar']
const namedExpressions = hfInstance.getNamedExpressionsFromFormula('=foo+bar*2');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`formulaString` | string | A formula in a proper format, starting with `=`.  |

**Returns:** *string[]*

___

### normalizeFormula 

▸ **normalizeFormula**(`formulaString`: string): *string*

*Defined in [src/HyperFormula.ts:4421](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4421)*

Parses and then unparses a formula.
Returns a normalized formula (e.g., restores the original capitalization of sheet names, function names, cell addresses, and named expressions).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [NotAFormulaError](hyperformulans.md#static-notaformulaerror) when the provided string is not a valid formula, i.e., does not start with "="

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['42'],
 ['50'],
]);

// returns '=Sheet1!$A$1+10'
const normalizedFormula = hfInstance.normalizeFormula('=SHEET1!$A$1+10');

// returns '=3*$A$1'
const normalizedFormula = hfInstance.normalizeFormula('=3*$a$1');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`formulaString` | string | a formula in a proper format - it must start with "="  |

**Returns:** *string*

___

### numberToDate 

▸ **numberToDate**(`inputNumber`: number): *[DateTime](../globals.md#datetime)*

*Defined in [src/HyperFormula.ts:4720](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4720)*

Interprets number as a date.

For more information, see the [Date and time handling guide](/docs/guide/date-and-time-handling.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();

// pass the number of days since nullDate
// the method should return formatted date, for this example:
// {year: 2020, month: 1, day: 15}
const dateFromNumber = hfInstance.numberToDate(43845);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`inputNumber` | number | number of days since nullDate, should be non-negative, fractions are ignored.  |

**Returns:** *[DateTime](../globals.md#datetime)*

___

### numberToDateTime 

▸ **numberToDateTime**(`inputNumber`: number): *[DateTime](../globals.md#datetime)*

*Defined in [src/HyperFormula.ts:4694](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4694)*

Interprets number as a date + time.

For more information, see the [Date and time handling guide](/docs/guide/date-and-time-handling.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();

// pass the number of days since nullDate
// the method should return formatted date and time, for this example:
// {year: 2020, month: 1, day: 15, hours: 2, minutes: 24, seconds: 0}
const dateTimeFromNumber = hfInstance.numberToDateTime(43845.1);

```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`inputNumber` | number | number of days since nullDate, should be non-negative, fractions are interpreted as hours/minutes/seconds.  |

**Returns:** *[DateTime](../globals.md#datetime)*

___

### numberToTime 

▸ **numberToTime**(`inputNumber`: number): *[DateTime](../globals.md#datetime)*

*Defined in [src/HyperFormula.ts:4745](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4745)*

Interprets number as a time (hours/minutes/seconds).

For more information, see the [Date and time handling guide](/docs/guide/date-and-time-handling.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();

// pass a number to be interpreted as a time
// should return {hours: 26, minutes: 24} for this example
const timeFromNumber = hfInstance.numberToTime(1.1);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`inputNumber` | number | time in 24h units.  |

**Returns:** *[DateTime](../globals.md#datetime)*

___

### simpleCellAddressFromString 

▸ **simpleCellAddressFromString**(`cellAddress`: string, `contextSheetId`: number): *[SimpleCellAddress](../interfaces/simplecelladdress.md) | undefined*

*Defined in [src/HyperFormula.ts:3122](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3122)*

Computes the simple (absolute) address of a cell address, based on its string representation.
- If a sheet name is present in the string representation but is not present in the engine, returns `undefined`.
- If no sheet name is present in the string representation, uses `contextSheetId` as a sheet id in the returned address.

For more information, see the [Cell references guide](/docs/guide/cell-references.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();
hfInstance.addSheet('Sheet0'); //sheetId = 0

// returns { sheet: 42, col: 0, row: 0 }
const simpleCellAddress = hfInstance.simpleCellAddressFromString('A1', 42);

// returns { sheet: 0, col: 0, row: 5 }
const simpleCellAddress = hfInstance.simpleCellAddressFromString('Sheet0!A6', 42);

// returns { sheet: 0, col: 0, row: 5 }
const simpleCellAddress = hfInstance.simpleCellAddressFromString('Sheet0!$A$6', 42);

// returns 'undefined', as there's no 'Sheet 2' in the HyperFormula instance
const simpleCellAddress = hfInstance.simpleCellAddressFromString('Sheet2!A6', 42);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`cellAddress` | string | string representation of cell address in A1 notation |
`contextSheetId` | number | sheet id used to construct the simple address in case of missing sheet name in `cellAddress` argument  |

**Returns:** *[SimpleCellAddress](../interfaces/simplecelladdress.md) | undefined*

___

### simpleCellAddressToString 

▸ **simpleCellAddressToString**(`cellAddress`: [SimpleCellAddress](../interfaces/simplecelladdress.md), `optionsOrContextSheetId`: object | number): *undefined | string*

*Defined in [src/HyperFormula.ts:3191](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3191)*

Computes string representation of an absolute address in A1 notation. If `cellAddress.sheet` is not present in the engine, returns `undefined`.

For more information, see the [Cell references guide](/docs/guide/cell-references.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if its arguments are of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();
hfInstance.addSheet('Sheet0'); //sheetId = 0
const addr = { sheet: 0, col: 1, row: 1 };

// should return 'B2'
const A1Notation = hfInstance.simpleCellAddressToString(addr);

// should return 'B2'
const A1Notation = hfInstance.simpleCellAddressToString(addr, { includeSheetName: false });

// should return 'Sheet0!B2'
const A1Notation = hfInstance.simpleCellAddressToString(addr, { includeSheetName: true });

// should return 'B2' as context sheet id is the same as addr.sheet
const A1Notation = hfInstance.simpleCellAddressToString(addr, 0);

// should return 'Sheet0!B2' as context sheet id is different from addr.sheet
const A1Notation = hfInstance.simpleCellAddressToString(addr, 42);
```

**Parameters:**

Name | Type | Default | Description |
------ | ------ | ------ | ------ |
`cellAddress` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | - | object representation of an absolute address |
`optionsOrContextSheetId` | object &#124; number | {} | options object or number used as context sheet id to construct the string address (see examples)  |

**Returns:** *undefined | string*

___

### simpleCellRangeFromString 

▸ **simpleCellRangeFromString**(`cellRange`: string, `contextSheetId`: number): *[SimpleCellRange](../interfaces/simplecellrange.md) | undefined*

*Defined in [src/HyperFormula.ts:3151](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3151)*

Computes simple (absolute) address of a cell range based on its string representation.
If sheet name is present in string representation but not present in the engine, returns `undefined`.

For more information, see the [Cell references guide](/docs/guide/cell-references.md).

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();
hfInstance.addSheet('Sheet0'); //sheetId = 0

// should return { start: { sheet: 0, col: 0, row: 0 }, end: { sheet: 0, col: 1, row: 0 } }
const simpleCellAddress = hfInstance.simpleCellRangeFromString('A1:A2', 0);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`cellRange` | string | string representation of cell range in A1 notation |
`contextSheetId` | number | sheet id used to construct the simple address in case of missing sheet name in `cellRange` argument  |

**Returns:** *[SimpleCellRange](../interfaces/simplecellrange.md) | undefined*

___

### simpleCellRangeToString 

▸ **simpleCellRangeToString**(`cellRange`: [SimpleCellRange](../interfaces/simplecellrange.md), `optionsOrContextSheetId`: object | number): *string | undefined*

*Defined in [src/HyperFormula.ts:3244](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3244)*

Computes string representation of an absolute range in A1 notation.
Returns `undefined` if:
- `cellRange` is not a valid range,
- `cellRange.start.sheet` and `cellRange.start.end` are different,
- `cellRange.start.sheet` is not present in the engine,
- `cellRange.start.end` is not present in the engine.

Note: This method is useful only for cell ranges; does not work with column ranges and row ranges.

For more information, see the [Cell references guide](/docs/guide/cell-references.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if its arguments are of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();
hfInstance.addSheet('Sheet0'); //sheetId = 0
const range = { start: { sheet: 0, col: 1, row: 1 }, end: { sheet: 0, col: 2, row: 1 } };

// should return 'B2:C2'
const A1Notation = hfInstance.simpleCellRangeToString(range);

// should return 'B2:C2'
const A1Notation = hfInstance.simpleCellRangeToString(range, { includeSheetName: false });

// should return 'Sheet0!B2:C2'
const A1Notation = hfInstance.simpleCellRangeToString(range, { includeSheetName: true });

// should return 'B2:C2' as context sheet id is the same as range.start.sheet and range.end.sheet
const A1Notation = hfInstance.simpleCellRangeToString(range, 0);

// should return 'Sheet0!B2:C2' as context sheet id is different from range.start.sheet and range.end.sheet
const A1Notation = hfInstance.simpleCellRangeToString(range, 42);
```

**Parameters:**

Name | Type | Default | Description |
------ | ------ | ------ | ------ |
`cellRange` | [SimpleCellRange](../interfaces/simplecellrange.md) | - | object representation of an absolute range |
`optionsOrContextSheetId` | object &#124; number | {} | options object or number used as context sheet id to construct the string address (see examples)  |

**Returns:** *string | undefined*

___

### validateFormula 

▸ **validateFormula**(`formulaString`: string): *boolean*

*Defined in [src/HyperFormula.ts:4522](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4522)*

Validates the formula.
If the provided string starts with "=" and is a parsable formula, the method returns `true`.
The validation is purely grammatical: the method doesn't verify if the formula can be calculated or not.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
// checks if the given string is a valid formula, should return 'true' for this example
const isFormula = hfInstance.validateFormula('=SUM(1, 2)');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`formulaString` | string | a formula in a proper format - it must start with "="  |

**Returns:** *boolean*

___

## Clipboard

### clearClipboard 

▸ **clearClipboard**(): *void*

*Defined in [src/HyperFormula.ts:2592](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2592)*

Clears the clipboard content.

**`example`** 
```js
// clears the clipboard, isClipboardEmpty() should return true if called afterwards
hfInstance.clearClipboard();
```

The usage of the internal clipboard is described thoroughly in the [Clipboard Operations guide](../../guide/clipboard-operations.md).

**Returns:** *void*

___

### copy 

▸ **copy**(`source`: [SimpleCellRange](../interfaces/simplecellrange.md)): *[CellValue](../globals.md#cellvalue)[][]*

*Defined in [src/HyperFormula.ts:2452](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2452)*

Stores a copy of the cell block in internal clipboard for the further paste.
Returns the copied values for use in external clipboard.

For more information, see the [Clipboard Operations guide](/docs/guide/clipboard-operations.md).

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if source is of wrong type

**`throws`** [SheetsNotEqual](sheetsnotequal.md) if range provided has distinct sheet numbers for start and end

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
  ['1', '2'],
]);

// it copies [ [ 2 ] ]
const clipboardContent = hfInstance.copy({
  start: { sheet: 0, col: 1, row: 0 },
  end: { sheet: 0, col: 1, row: 0 },
});
```

The usage of the internal clipboard is described thoroughly in the [Clipboard Operations guide](../../guide/clipboard-operations.md).

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`source` | [SimpleCellRange](../interfaces/simplecellrange.md) | rectangle range to copy  |

**Returns:** *[CellValue](../globals.md#cellvalue)[][]*

___

### cut 

▸ **cut**(`source`: [SimpleCellRange](../interfaces/simplecellrange.md)): *[CellValue](../globals.md#cellvalue)[][]*

*Defined in [src/HyperFormula.ts:2492](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2492)*

Stores information of the cell block in internal clipboard for further paste.
Calling [paste](hyperformulans.md#paste) right after this method is equivalent to call [moveCells](hyperformulans.md#movecells).
Almost any CRUD operation called after this method will abort the cut operation.
Returns the cut values for use in external clipboard.

For more information, see the [Clipboard Operations guide](/docs/guide/clipboard-operations.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if source is of wrong type

**`throws`** [SheetsNotEqual](sheetsnotequal.md) if range provided has distinct sheet numbers for start and end

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
  ['1', '2'],
]);

// returns the values that were cut: [ [ 1 ] ]
const clipboardContent = hfInstance.cut({
  start: { sheet: 0, col: 0, row: 0 },
  end: { sheet: 0, col: 0, row: 0 },
});
```

The usage of the internal clipboard is described thoroughly in the [Clipboard Operations guide](../../guide/clipboard-operations.md).

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`source` | [SimpleCellRange](../interfaces/simplecellrange.md) | rectangle range to cut  |

**Returns:** *[CellValue](../globals.md#cellvalue)[][]*

___

### isClipboardEmpty 

▸ **isClipboardEmpty**(): *boolean*

*Defined in [src/HyperFormula.ts:2575](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2575)*

Returns information whether there is something in the clipboard.

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1', '2'],
]);

// copy desired content
const clipboardContent = hfInstance.copy({
  start: { sheet: 0, col: 1, row: 0 },
  end: { sheet: 0, col: 1, row: 0 },
});

// returns 'false', there is content in the clipboard
const isClipboardEmpty = hfInstance.isClipboardEmpty();
```

The usage of the internal clipboard is described thoroughly in the [Clipboard Operations guide](../../guide/clipboard-operations.md).

**Returns:** *boolean*

___

### paste 

▸ **paste**(`targetLeftCorner`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:2543](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2543)*

When called after [copy](hyperformulans.md#copy) it pastes copied values and formulas into a cell block.
When called after [cut](hyperformulans.md#cut) it performs [moveCells](hyperformulans.md#movecells) operation into the cell block.
Does nothing if the clipboard is empty.

For more information, see the [Clipboard Operations guide](/docs/guide/clipboard-operations.md).

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [NoSheetWithIdError](hyperformulans.md#static-nosheetwithiderror) when the given sheet ID does not exist

**`throws`** [EvaluationSuspendedError](hyperformulans.md#static-evaluationsuspendederror) when the evaluation is suspended

**`throws`** [SheetSizeLimitExceededError](hyperformulans.md#static-sheetsizelimitexceedederror) when performing this operation would result in sheet size limits exceeding

**`throws`** [NothingToPasteError](hyperformulans.md#static-nothingtopasteerror) when clipboard is empty

**`throws`** [TargetLocationHasArrayError](hyperformulans.md#static-targetlocationhasarrayerror) when the selected target area has array inside

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if targetLeftCorner is of wrong type

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
  ['1', '2'],
]);

// [ [ 2 ] ] was copied
const clipboardContent = hfInstance.copy({
  start: { sheet: 0, col: 1, row: 0 },
  end: { sheet: 0, col: 1, row: 0 },
});

// returns a list of modified cells: their absolute addresses and new values
const changes = hfInstance.paste({ sheet: 0, col: 1, row: 0 });
```

The usage of the internal clipboard is described thoroughly in the [Clipboard Operations guide](../../guide/clipboard-operations.md).

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`targetLeftCorner` | [SimpleCellAddress](../interfaces/simplecelladdress.md) | upper left address of the target cell block  |

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

## Undo and Redo

### clearRedoStack 

▸ **clearRedoStack**(): *void*

*Defined in [src/HyperFormula.ts:2622](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2622)*

Clears the redo stack in undoRedo history.

For more information, see the [Undo-Redo guide](/docs/guide/undo-redo.md).

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
  ['1', '2', '3'],
]);

// do an operation, for example remove columns
hfInstance.removeColumns(0, [0, 1]);

// undo the operation
hfInstance.undo();

// redo the operation
hfInstance.redo();

// clear the redo stack
hfInstance.clearRedoStack();
```

**Returns:** *void*

___

### clearUndoStack 

▸ **clearUndoStack**(): *void*

*Defined in [src/HyperFormula.ts:2649](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L2649)*

Clears the undo stack in undoRedo history.

For more information, see the [Undo-Redo guide](/docs/guide/undo-redo.md).

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
  ['1', '2', '3'],
]);

// do an operation, for example remove columns
hfInstance.removeColumns(0, [0, 1]);

// undo the operation
hfInstance.undo();

// clear the undo stack
hfInstance.clearUndoStack();
```

**Returns:** *void*

___

### isThereSomethingToRedo 

▸ **isThereSomethingToRedo**(): *boolean*

*Defined in [src/HyperFormula.ts:1422](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1422)*

Checks if there is at least one operation that can be re-done.

For more information, see the [Undo-Redo guide](/docs/guide/undo-redo.md).

**`example`** 
```js
hfInstance.undo();

// when there is an action to redo, this returns 'true'
const isSomethingToRedo = hfInstance.isThereSomethingToRedo();
```

**Returns:** *boolean*

___

### isThereSomethingToUndo 

▸ **isThereSomethingToUndo**(): *boolean*

*Defined in [src/HyperFormula.ts:1403](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1403)*

Checks if there is at least one operation that can be undone.

For more information, see the [Undo-Redo guide](/docs/guide/undo-redo.md).

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1'],
 ['2'],
 ['3'],
]);

// perform CRUD operation, for example remove the second row
hfInstance.removeRows(0, [1, 1]);

// should return 'true', it is possible to undo last operation
// which is removing rows in this example
const isSomethingToUndo = hfInstance.isThereSomethingToUndo();
```

**Returns:** *boolean*

___

### redo 

▸ **redo**(): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:1375](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1375)*

Re-do recently undone operation.

For more information, see the [Undo-Redo guide](/docs/guide/undo-redo.md).

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [NoOperationToRedoError](hyperformulans.md#static-nooperationtoredoerror) when there is no operation running that can be re-done

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1'],
 ['2'],
 ['3'],
]);

// perform CRUD operation, for example remove the second row
hfInstance.removeRows(0, [1, 1]);

// undo the operation, it should return previous values: [['1'], ['2'], ['3']]
hfInstance.undo();

// do a redo, it should return the values after removing the second row: [['1'], ['3']]
const changes = hfInstance.redo();
```

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### undo 

▸ **undo**(): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:1337](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L1337)*

Undo the previous operation.

For more information, see the [Undo-Redo guide](/docs/guide/undo-redo.md).

Returns [an array of cells whose values changed as a result of this operation](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`throws`** [NoOperationToUndoError](hyperformulans.md#static-nooperationtoundoerror) when there is no operation running that can be undone

**`example`** 
```js
const hfInstance = HyperFormula.buildFromArray([
 ['1', '2'],
 ['3', ''],
]);

// perform CRUD operation, for example remove the second row
hfInstance.removeRows(0, [1, 1]);

// undo the operation, it should return the changes
const changes = hfInstance.undo();
```

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

## Batch

### batch 

▸ **batch**(`batchOperations`: function): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:3812](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3812)*

Runs the provided callback as a single [batch operation](../../guide/batch-operations.md) and returns the changed cells.

Returns [an array of cells whose values changed as a result of all batched operations](/docs/guide/basic-operations.md#changes-array).

Note that this method may trigger dependency graph recalculation.

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`fires`** [evaluationSuspended](../interfaces/listeners.md#evaluationsuspended) always

**`fires`** [evaluationResumed](../interfaces/listeners.md#evaluationresumed) after the recomputation of necessary values

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
 MySheet1: [ ['1'] ],
 MySheet2: [ ['10'] ],
});

// multiple operations in a single callback will trigger evaluation only once
// and only one set of changes is returned as a combined result of all
// the operations that were triggered within the callback
const changes = hfInstance.batch(() => {
 hfInstance.setCellContents({ col: 3, row: 0, sheet: 0 }, [['=B1']]);
 hfInstance.setCellContents({ col: 4, row: 0, sheet: 0 }, [['=A1']]);
});
```

**Parameters:**

▪ **batchOperations**: *function*

a function with operations to be performed

▸ (): *void*

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### isEvaluationSuspended 

▸ **isEvaluationSuspended**(): *boolean*

*Defined in [src/HyperFormula.ts:3921](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3921)*

Checks if the dependency graph recalculation process is [suspended](../../guide/batch-operations.md) or not.

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();

// suspend the evaluation
hfInstance.suspendEvaluation();

// between suspendEvaluation() and resumeEvaluation()
// or inside batch() callback it will return 'true', otherwise 'false'
const isEvaluationSuspended = hfInstance.isEvaluationSuspended();

const changes = hfInstance.resumeEvaluation();
```

**Returns:** *boolean*

___

### resumeEvaluation 

▸ **resumeEvaluation**(): *[ExportedChange](../globals.md#exportedchange)[]*

*Defined in [src/HyperFormula.ts:3895](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3895)*

Resumes the dependency graph recalculation that was [suspended](../../guide/batch-operations.md) with [suspendEvaluation](hyperformulans.md#suspendevaluation).
It also triggers the recalculation and returns [an array of cells whose values changed as a result of all batched operations](/docs/guide/basic-operations.md#changes-array).

**`fires`** [valuesUpdated](../interfaces/listeners.md#valuesupdated) if recalculation was triggered by this change

**`fires`** [evaluationResumed](../interfaces/listeners.md#evaluationresumed) after the recomputation of necessary values

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
 MySheet1: [ ['1'] ],
 MySheet2: [ ['10'] ],
});

// similar to batch() but operations are not within a callback,
// one method suspends the recalculation
// the second will resume calculations and return the changes

// first, suspend the evaluation
hfInstance.suspendEvaluation();

// perform operations
hfInstance.setCellContents({ col: 3, row: 0, sheet: 0 }, [['=B1']]);
hfInstance.setSheetContent(1, [['50'], ['60']]);

// resume the evaluation
const changes = hfInstance.resumeEvaluation();
```

**Returns:** *[ExportedChange](../globals.md#exportedchange)[]*

___

### suspendEvaluation 

▸ **suspendEvaluation**(): *void*

*Defined in [src/HyperFormula.ts:3859](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L3859)*

Suspends the dependency graph recalculation to start a [batch operation](../../guide/batch-operations.md).
It allows optimizing the performance.
With this method, multiple CRUD operations can be done without triggering recalculation after every operation.
Suspending evaluation should result in an overall faster calculation compared to recalculating after each operation separately.
To resume the evaluation use [resumeEvaluation](hyperformulans.md#resumeevaluation).

**`fires`** [evaluationSuspended](../interfaces/listeners.md#evaluationsuspended) always

**`example`** 
```js
const hfInstance = HyperFormula.buildFromSheets({
 MySheet1: [ ['1'] ],
 MySheet2: [ ['10'] ],
});

// similar to batch() but operations are not within a callback,
// one method suspends the recalculation
// the second will resume calculations and return the changes

// suspend the evaluation with this method
hfInstance.suspendEvaluation();

// perform operations
hfInstance.setCellContents({ col: 3, row: 0, sheet: 0 }, [['=B1']]);
hfInstance.setSheetContent(1, [['50'], ['60']]);

// use resumeEvaluation to resume
const changes = hfInstance.resumeEvaluation();
```

**Returns:** *void*

___

## Events

### off 

▸ **off**‹**Event**›(`event`: Event, `listener`: Listeners[Event]): *void*

*Defined in [src/HyperFormula.ts:4831](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4831)*

Unsubscribes from an event or from all events.
For the list of all available events, see [Listeners](../interfaces/listeners.md).

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();

// define a simple function to be called upon emitting an event
const handler = ( ) => { console.log('baz') }

// subscribe to a 'sheetAdded', pass the handler
hfInstance.on('sheetAdded', handler);

// add a sheet to trigger an event,
// console should print 'baz' each time a sheet is added
hfInstance.addSheet('FooBar');

// unsubscribe from a 'sheetAdded'
hfInstance.off('sheetAdded', handler);

// add a sheet, the console should not print anything
hfInstance.addSheet('FooBaz');
```

**Type parameters:**

▪ **Event**: *keyof Listeners*

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`event` | Event | the name of the event to subscribe to |
`listener` | Listeners[Event] | to be called when event is emitted  |

**Returns:** *void*

___

### on 

▸ **on**‹**Event**›(`event`: Event, `listener`: Listeners[Event]): *void*

*Defined in [src/HyperFormula.ts:4771](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4771)*

Subscribes to an event.
For the list of all available events, see [Listeners](../interfaces/listeners.md).

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();

// subscribe to a 'sheetAdded', pass a simple handler
hfInstance.on('sheetAdded', ( ) => { console.log('foo') });

// add a sheet to trigger an event,
// console should print 'foo' after each time sheet is added in this example
hfInstance.addSheet('FooBar');
```

**Type parameters:**

▪ **Event**: *keyof Listeners*

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`event` | Event | the name of the event to subscribe to |
`listener` | Listeners[Event] | to be called when event is emitted  |

**Returns:** *void*

___

### once 

▸ **once**‹**Event**›(`event`: Event, `listener`: Listeners[Event]): *void*

*Defined in [src/HyperFormula.ts:4797](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4797)*

Subscribes to an event once.
For the list of all available events, see [Listeners](../interfaces/listeners.md).

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();

// subscribe to a 'sheetAdded', pass a simple handler
hfInstance.once('sheetAdded', ( ) => { console.log('foo') });

// call addSheet twice,
// console should print 'foo' only once when the sheet is added in this example
hfInstance.addSheet('FooBar');
hfInstance.addSheet('FooBaz');
```

**Type parameters:**

▪ **Event**: *keyof Listeners*

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`event` | Event | the name of the event to subscribe to |
`listener` | Listeners[Event] | to be called when event is emitted  |

**Returns:** *void*

___

## Custom Functions

### getAllFunctionPlugins 

▸ **getAllFunctionPlugins**(): *FunctionPluginDefinition[]*

*Defined in [src/HyperFormula.ts:4591](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4591)*

Returns classes of all plugins registered in this instance of HyperFormula

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();

// return classes of all plugins registered, assign to a variable
const allNames = hfInstance.getAllFunctionPlugins();
```

**Returns:** *FunctionPluginDefinition[]*

___

### getFunctionPlugin 

▸ **getFunctionPlugin**(`functionId`: string): *FunctionPluginDefinition | undefined*

*Defined in [src/HyperFormula.ts:4573](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4573)*

Returns class of a plugin used by function with given id

For more information, see the [Custom functions guide](/docs/guide/custom-functions.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
// import your own plugin
import { MyExamplePlugin } from './file_with_your_plugin';

const hfInstance = HyperFormula.buildEmpty();

// register a plugin
HyperFormula.registerFunctionPlugin(MyExamplePlugin);

// get the plugin
const myPlugin = hfInstance.getFunctionPlugin('EXAMPLE');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`functionId` | string | id of a function, e.g., 'SUMIF'  |

**Returns:** *FunctionPluginDefinition | undefined*

___

### getRegisteredFunctionNames 

▸ **getRegisteredFunctionNames**(): *string[]*

*Defined in [src/HyperFormula.ts:4543](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L4543)*

Returns translated names of all functions registered in this instance of HyperFormula
according to the language set in the configuration

**`example`** 
```js
const hfInstance = HyperFormula.buildEmpty();

// return translated names of all functions, assign to a variable
const allNames = hfInstance.getRegisteredFunctionNames();
```

**Returns:** *string[]*

___

## Static Methods

### getAllFunctionPlugins

▸ **getAllFunctionPlugins**(): *FunctionPluginDefinition[]*

*Defined in [src/HyperFormula.ts:652](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L652)*

Returns classes of all plugins registered in HyperFormula.

**`example`** 
```js
// return classes of all plugins
const allClasses = HyperFormula.getAllFunctionPlugins();
```

**Returns:** *FunctionPluginDefinition[]*

___

### getAvailableFunctions

▸ **getAvailableFunctions**(`code`: string): *FunctionListEntry[]*

*Defined in [src/HyperFormula.ts:688](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L688)*

Returns metadata of all functions available for a given language, as a short list suitable for a function
picker. Each entry contains the translated name, the language-independent canonical name, the category, and a
short description. Entries are sorted alphabetically by their localized name, using the collation rules of the
host environment, so the exact order of names that differ only by case or diacritics may vary between hosts.

The list reflects the global registry: the built-in functions and every custom function registered with
[registerFunctionPlugin](hyperformulans.md#static-registerfunctionplugin) or [registerFunction](hyperformulans.md#static-registerfunction), plus their aliases. An alias is listed under its own id,
borrowing its target's category and description, with the target id exposed as `aliasOf`. Custom functions
ship no catalogue entry, so they are listed with `category: 'Custom'` and no `shortDescription` — with one
exception: the catalogue is keyed by function id, so a custom plugin registered *over* a built-in id inherits
that id's entry and is listed with the built-in's category and description. Use the instance method
[getAvailableFunctions](hyperformulans.md#getavailablefunctions) for one engine's own registry, which differs from the global one when the instance
was built with the `functionPlugins` configuration option.

A function with no translation entry for `code` is omitted: the interpreter refuses to evaluate an untranslated
id, so listing it would advertise a function that cannot be called. A translation set to an empty string is not
a missing entry — it falls back to the canonical id, so the function stays listed under its canonical name.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [LanguageNotRegisteredError](hyperformulans.md#static-languagenotregisterederror) when the given language is not registered

**`example`** 
```js
// get the list of available functions, translated for enGB
const functions = HyperFormula.getAvailableFunctions('enGB');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`code` | string | language code, e.g. `'enGB'`  |

**Returns:** *FunctionListEntry[]*

___

### getFunctionDetails

▸ **getFunctionDetails**(`canonicalName`: string, `code`: string): *FunctionDetails | undefined*

*Defined in [src/HyperFormula.ts:736](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L736)*

Returns the full metadata of a single function for a given language: the parameter list (with per-parameter
optionality), the number of trailing parameters that repeat (`repeatLastArgs`), the category, a short
description, and the documentation link (`documentationUrl`) and usage examples (`examples`) — every built-in
authors both. Returns `undefined` when the function id is unknown, not registered, or has no translation entry
for `code` (an untranslated id cannot be evaluated, so it is not described either, which keeps this method
consistent with [getAvailableFunctions](hyperformulans.md#getavailablefunctions)).

The static method resolves everything in the global registry: the built-in functions, their aliases, and the
custom (user-registered) ones. An alias reports its target's metadata (including examples, which spell the
target's name) under the alias id, with the target id exposed as `aliasOf`. A custom function has no catalogue
entry, so it reports `category: 'Custom'`, no `shortDescription`, `documentationUrl` or `examples`, and
positional parameter names (`Arg1`, `Arg2`, ...). A custom plugin registered over a built-in id is the
exception: the catalogue is keyed by function id, so it reports that built-in's authored metadata alongside
the parameter list of the implementation actually registered. Use the instance method
[getFunctionDetails](hyperformulans.md#getfunctiondetails) for one engine's own registry, which differs from the global one when the instance was
built with the `functionPlugins` configuration option.

`canonicalName` is matched exactly, in two ways worth knowing:
- It is **case-sensitive**, unlike formula syntax. `'SUMIF'` resolves; `'sumif'` and `'SumIf'` return
  `undefined`, even though `=sumif(...)` evaluates.
- It must be the **canonical (English) id, never a localized name**. `localizedName` is output only:
  `getFunctionDetails('SUMIF', 'plPL')` reports `localizedName: 'SUMA.JEŻELI'`, but passing `'SUMA.JEŻELI'` back
  in returns `undefined`. To look up an entry from [getAvailableFunctions](hyperformulans.md#getavailablefunctions), pass its `canonicalName`.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [LanguageNotRegisteredError](hyperformulans.md#static-languagenotregisterederror) when the given language is not registered

**`example`** 
```js
// get the details of the SUMIF function, translated for enGB
const details = HyperFormula.getFunctionDetails('SUMIF', 'enGB');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`canonicalName` | string | the language-independent function id, e.g. `'SUMIF'` |
`code` | string | language code, e.g. `'enGB'`  |

**Returns:** *FunctionDetails | undefined*

___

### getFunctionPlugin

▸ **getFunctionPlugin**(`functionId`: string): *FunctionPluginDefinition | undefined*

*Defined in [src/HyperFormula.ts:636](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L636)*

Returns class of a plugin used by function with given id

For more information, see the [Custom functions guide](/docs/guide/custom-functions.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
// import your own plugin
import { MyExamplePlugin } from './file_with_your_plugin';

// register a plugin
HyperFormula.registerFunctionPlugin(MyExamplePlugin);

// return the class of a given plugin
const myFunctionClass = HyperFormula.getFunctionPlugin('EXAMPLE');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`functionId` | string | id of a function, e.g., 'SUMIF'  |

**Returns:** *FunctionPluginDefinition | undefined*

___

### getLanguage

▸ **getLanguage**(`languageCode`: string): *TranslationPackage*

*Defined in [src/HyperFormula.ts:375](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L375)*

Returns registered language from its code string.

For more information, see the [Localizing functions guide](/docs/guide/localizing-functions.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [LanguageNotRegisteredError](hyperformulans.md#static-languagenotregisterederror) when trying to retrieve not registered language

**`example`** 
```js
// return registered language
const language = HyperFormula.getLanguage('enGB');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`languageCode` | string | code string of the translation package  |

**Returns:** *TranslationPackage*

___

### getRegisteredFunctionNames

▸ **getRegisteredFunctionNames**(`code`: string): *string[]*

*Defined in [src/HyperFormula.ts:606](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L606)*

Returns translated names of all registered functions for a given language

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
// return a list of function names registered for enGB
const allNames = HyperFormula.getRegisteredFunctionNames('enGB');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`code` | string | language code  |

**Returns:** *string[]*

___

### getRegisteredLanguagesCodes

▸ **getRegisteredLanguagesCodes**(): *string[]*

*Defined in [src/HyperFormula.ts:456](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L456)*

Returns all registered languages codes.

**`example`** 
```js
// should return all registered language codes: ['enGB', 'plPL']
const registeredLanguages = HyperFormula.getRegisteredLanguagesCodes();
```

**Returns:** *string[]*

___

### registerFunction

▸ **registerFunction**(`functionId`: string, `plugin`: FunctionPluginDefinition, `translations?`: FunctionTranslationsPackage): *void*

*Defined in [src/HyperFormula.ts:540](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L540)*

Registers a function with a given id if such exists in a plugin.

For more information, see the [Custom functions guide](/docs/guide/custom-functions.md).

Note: This method does not affect the existing HyperFormula instances.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [FunctionPluginValidationError](hyperformulans.md#static-functionpluginvalidationerror) when function with a given id does not exist in plugin or plugin class definition is not consistent with metadata

**`throws`** [ProtectedFunctionTranslationError](hyperformulans.md#static-protectedfunctiontranslationerror) when trying to register translation for protected function

**`example`** 
```js
// import your own plugin
import { MyExamplePlugin } from './file_with_your_plugin';

// register a function
HyperFormula.registerFunction('EXAMPLE', MyExamplePlugin);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`functionId` | string | function id, e.g., 'SUMIF' |
`plugin` | FunctionPluginDefinition | plugin class |
`translations?` | FunctionTranslationsPackage | translations for the function name  |

**Returns:** *void*

___

### registerFunctionPlugin

▸ **registerFunctionPlugin**(`plugin`: FunctionPluginDefinition, `translations?`: FunctionTranslationsPackage): *void*

*Defined in [src/HyperFormula.ts:486](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L486)*

Registers all functions in a given plugin with optional translations.

For more information, see the [Custom functions guide](/docs/guide/custom-functions.md).

Note: FunctionPlugins must be registered prior to the creation of HyperFormula instances in which they are used.
HyperFormula instances created prior to the registration of a FunctionPlugin are unable to access the FunctionPlugin.
Registering a FunctionPlugin with [[custom-functions]] requires the translations parameter.

**`throws`** [FunctionPluginValidationError](hyperformulans.md#static-functionpluginvalidationerror) when plugin class definition is not consistent with metadata

**`throws`** [ProtectedFunctionTranslationError](hyperformulans.md#static-protectedfunctiontranslationerror) when trying to register translation for protected function

**`example`** 
```js
// import your own plugin
import { MyExamplePlugin } from './file_with_your_plugin';

// register the plugin
HyperFormula.registerFunctionPlugin(MyExamplePlugin);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`plugin` | FunctionPluginDefinition | plugin class |
`translations?` | FunctionTranslationsPackage | optional package of function names translations  |

**Returns:** *void*

___

### registerLanguage

▸ **registerLanguage**(`languageCode`: string, `languagePackage`: RawTranslationPackage): *void*

*Defined in [src/HyperFormula.ts:406](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L406)*

Registers language under given code string.

For more information, see the [Localizing functions guide](/docs/guide/localizing-functions.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [ProtectedFunctionTranslationError](hyperformulans.md#static-protectedfunctiontranslationerror) when trying to register translation for protected function

**`throws`** [LanguageAlreadyRegisteredError](hyperformulans.md#static-languagealreadyregisterederror) when given language is already registered

**`example`** 
```js
// return registered language
HyperFormula.registerLanguage('enUS', enUS);
const engine = HyperFormula.buildEmpty({language: 'enUS'});
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`languageCode` | string | code string of the translation package |
`languagePackage` | RawTranslationPackage | translation package to be registered  |

**Returns:** *void*

___

### unregisterAllFunctions

▸ **unregisterAllFunctions**(): *void*

*Defined in [src/HyperFormula.ts:587](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L587)*

Clears function registry.

Note: This method does not affect the existing HyperFormula instances.

**`example`** 
```js
HyperFormula.unregisterAllFunctions();
```

**Returns:** *void*

___

### unregisterFunction

▸ **unregisterFunction**(`functionId`: string): *void*

*Defined in [src/HyperFormula.ts:570](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L570)*

Unregisters a function with a given id.

For more information, see the [Custom functions guide](/docs/guide/custom-functions.md).

Note: This method does not affect the existing HyperFormula instances.

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`example`** 
```js
// import your own plugin
import { MyExamplePlugin } from './file_with_your_plugin';

// register a function
HyperFormula.registerFunction('EXAMPLE', MyExamplePlugin);

// unregister a function
HyperFormula.unregisterFunction('EXAMPLE');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`functionId` | string | function id, e.g., 'SUMIF'  |

**Returns:** *void*

___

### unregisterFunctionPlugin

▸ **unregisterFunctionPlugin**(`plugin`: FunctionPluginDefinition): *void*

*Defined in [src/HyperFormula.ts:510](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L510)*

Unregisters all functions defined in given plugin.

For more information, see the [Custom functions guide](/docs/guide/custom-functions.md).

Note: This method does not affect the existing HyperFormula instances.

**`example`** 
```js
// get the class of a plugin
const registeredPluginClass = HyperFormula.getFunctionPlugin('EXAMPLE');

// unregister all functions defined in a plugin of ID 'EXAMPLE'
HyperFormula.unregisterFunctionPlugin(registeredPluginClass);
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`plugin` | FunctionPluginDefinition | plugin class  |

**Returns:** *void*

___

### unregisterLanguage

▸ **unregisterLanguage**(`languageCode`: string): *void*

*Defined in [src/HyperFormula.ts:436](https://github.com/handsontable/hyperformula/blob/b8542ec/src/HyperFormula.ts#L436)*

Unregisters language that is registered under given code string.

For more information, see the [Localizing functions guide](/docs/guide/localizing-functions.md).

**`throws`** [ExpectedValueOfTypeError](hyperformulans.md#static-expectedvalueoftypeerror) if any of its basic type argument is of wrong type

**`throws`** [LanguageNotRegisteredError](hyperformulans.md#static-languagenotregisterederror) when given language is not registered

**`example`** 
```js
// register the language for the instance
HyperFormula.registerLanguage('plPL', plPL);

// unregister plPL
HyperFormula.unregisterLanguage('plPL');
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`languageCode` | string | code string of the translation package  |

**Returns:** *void*