# ArraySizePredictor

## Constructors

### constructor

\+ **new ArraySizePredictor**(`config`: [Config](config.md), `functionRegistry`: FunctionRegistry): *[ArraySizePredictor](arraysizepredictor.md)*

*Defined in [hyperformula/src/ArraySize.ts:45](https://github.com/handsontable/hyperformula/blob/e442fd0/hyperformula/src/ArraySize.ts#L45)*

**Parameters:**

Name | Type |
------ | ------ |
`config` | [Config](config.md) |
`functionRegistry` | FunctionRegistry |

**Returns:** *[ArraySizePredictor](arraysizepredictor.md)*

## Methods

### checkArraySize

▸ **checkArraySize**(`ast`: Ast, `formulaAddress`: [SimpleCellAddress](../interfaces/simplecelladdress.md)): *[ArraySize](arraysize.md)*

*Defined in [hyperformula/src/ArraySize.ts:54](https://github.com/handsontable/hyperformula/blob/e442fd0/hyperformula/src/ArraySize.ts#L54)*

**Parameters:**

Name | Type |
------ | ------ |
`ast` | Ast |
`formulaAddress` | [SimpleCellAddress](../interfaces/simplecelladdress.md) |

**Returns:** *[ArraySize](arraysize.md)*

___

### checkArraySizeForAst

▸ **checkArraySizeForAst**(`ast`: Ast, `state`: InterpreterState): *[ArraySize](arraysize.md)*

*Defined in [hyperformula/src/ArraySize.ts:58](https://github.com/handsontable/hyperformula/blob/e442fd0/hyperformula/src/ArraySize.ts#L58)*

**Parameters:**

Name | Type |
------ | ------ |
`ast` | Ast |
`state` | InterpreterState |

**Returns:** *[ArraySize](arraysize.md)*

___

### isSizeKnownBeforeEvaluation

▸ **isSizeKnownBeforeEvaluation**(`ast`: Ast, `state`: InterpreterState): *boolean*

*Defined in [hyperformula/src/ArraySize.ts:140](https://github.com/handsontable/hyperformula/blob/e442fd0/hyperformula/src/ArraySize.ts#L140)*

Says whether the size predicted for `ast` by [checkArraySizeForAst](arraysizepredictor.md#checkarraysizeforast) is the size of its value, so that a result
area can be reserved from it. It is not when the size is computed from a named expression, which is sized as one cell
while its value can be a range of any size and can be redefined after the formula is placed, or from a function call
whose own size method returns `ArraySize.error()`, such as `SEQUENCE(A1)`, whose result size depends on cell values.
Arguments that do not determine the size of a call, such as the ranges `SUM` adds up, are not checked.

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`ast` | Ast | the AST whose size is predicted |
`state` | InterpreterState | the state its size is predicted in  |

**Returns:** *boolean*