[@acaldas/document-model-libs](../README.md) / [Exports](../modules.md) / [BudgetStatement](BudgetStatement.md) / utils

# Namespace: utils

[BudgetStatement](BudgetStatement.md).utils

## Table of contents

### Functions

- [createAccount](BudgetStatement.utils.md#createaccount)
- [createBudgetStatement](BudgetStatement.utils.md#createbudgetstatement)
- [createLineItem](BudgetStatement.utils.md#createlineitem)
- [loadBudgetStatementFromFile](BudgetStatement.utils.md#loadbudgetstatementfromfile)
- [loadBudgetStatementFromInput](BudgetStatement.utils.md#loadbudgetstatementfrominput)
- [saveBudgetStatementToFile](BudgetStatement.utils.md#savebudgetstatementtofile)
- [saveBudgetStatementToFileHandle](BudgetStatement.utils.md#savebudgetstatementtofilehandle)

## Functions

### createAccount

▸ **createAccount**(`input`): [`Account`](BudgetStatement.md#account)

Creates a new Account with default properties and the given input properties.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `input` | [`AccountInput`](BudgetStatement.md#accountinput) | The input properties of the account. |

#### Returns

[`Account`](BudgetStatement.md#account)

The new Account object.

#### Defined in

[src/budget-statement/custom/utils.ts:58](https://github.com/acaldas/document-model-libs/blob/d48c213/src/budget-statement/custom/utils.ts#L58)

___

### createBudgetStatement

▸ **createBudgetStatement**(`initialState?`): [`BudgetStatementDocument`](BudgetStatement.md#budgetstatementdocument)

Creates a new BudgetStatement document with an initial state.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `initialState?` | `Partial`<[`ExtendedState`](Document.md#extendedstate)<`Partial`<`BudgetStatementData`\>\>\> | The initial state of the document. |

#### Returns

[`BudgetStatementDocument`](BudgetStatement.md#budgetstatementdocument)

The new BudgetStatement document.

#### Defined in

[src/budget-statement/custom/utils.ts:29](https://github.com/acaldas/document-model-libs/blob/d48c213/src/budget-statement/custom/utils.ts#L29)

___

### createLineItem

▸ **createLineItem**(`input`): [`LineItem`](BudgetStatement.md#lineitem)

Creates a new LineItem with default properties and the given input properties.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `input` | [`LineItemInput`](BudgetStatement.md#lineiteminput) | The input properties of the line item. |

#### Returns

[`LineItem`](BudgetStatement.md#lineitem)

The new LineItem object.

#### Defined in

[src/budget-statement/custom/utils.ts:69](https://github.com/acaldas/document-model-libs/blob/d48c213/src/budget-statement/custom/utils.ts#L69)

___

### loadBudgetStatementFromFile

▸ **loadBudgetStatementFromFile**(`path`): `Promise`<[`BudgetStatementDocument`](BudgetStatement.md#budgetstatementdocument)\>

Loads the BudgetStatement document from the specified file path.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `path` | `string` | The file path to load the document from. |

#### Returns

`Promise`<[`BudgetStatementDocument`](BudgetStatement.md#budgetstatementdocument)\>

A promise that resolves with the loaded BudgetStatement document.

#### Defined in

[src/budget-statement/custom/utils.ts:102](https://github.com/acaldas/document-model-libs/blob/d48c213/src/budget-statement/custom/utils.ts#L102)

___

### loadBudgetStatementFromInput

▸ **loadBudgetStatementFromInput**(`input`): `Promise`<[`BudgetStatementDocument`](BudgetStatement.md#budgetstatementdocument)\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `input` | [`FileInput`](Document.utils.md#fileinput) |

#### Returns

`Promise`<[`BudgetStatementDocument`](BudgetStatement.md#budgetstatementdocument)\>

#### Defined in

[src/budget-statement/custom/utils.ts:143](https://github.com/acaldas/document-model-libs/blob/d48c213/src/budget-statement/custom/utils.ts#L143)

___

### saveBudgetStatementToFile

▸ **saveBudgetStatementToFile**(`document`, `path`, `name?`): `Promise`<`string`\>

Saves the BudgetStatement document to the specified file path.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `document` | [`BudgetStatementDocument`](BudgetStatement.md#budgetstatementdocument) | The BudgetStatement document to save. |
| `path` | `string` | The file path to save the document to. |
| `name?` | `string` | - |

#### Returns

`Promise`<`string`\>

A promise that resolves with the saved file path.

#### Defined in

[src/budget-statement/custom/utils.ts:89](https://github.com/acaldas/document-model-libs/blob/d48c213/src/budget-statement/custom/utils.ts#L89)

___

### saveBudgetStatementToFileHandle

▸ **saveBudgetStatementToFileHandle**(`document`, `input`): `Promise`<`void`\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `document` | [`BudgetStatementDocument`](BudgetStatement.md#budgetstatementdocument) |
| `input` | `FileSystemFileHandle` |

#### Returns

`Promise`<`void`\>

#### Defined in

[src/budget-statement/custom/utils.ts:182](https://github.com/acaldas/document-model-libs/blob/d48c213/src/budget-statement/custom/utils.ts#L182)
