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

# Namespace: utils

[BudgetStatement](BudgetStatement.md).utils

## 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:60](https://github.com/acaldas/document-model-libs/blob/8be7e70/src/budget-statement/custom/utils.ts#L60)

___

### createBudgetStatement

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

Creates a new BudgetStatement document with an initial state.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `initialState?` | `Partial`<`Omit`<[`BudgetStatementDocument`](BudgetStatement.md#budgetstatementdocument), ``"data"``\> & { `data`: `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:28](https://github.com/acaldas/document-model-libs/blob/8be7e70/src/budget-statement/custom/utils.ts#L28)

___

### 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:71](https://github.com/acaldas/document-model-libs/blob/8be7e70/src/budget-statement/custom/utils.ts#L71)

___

### 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:104](https://github.com/acaldas/document-model-libs/blob/8be7e70/src/budget-statement/custom/utils.ts#L104)

___

### loadBudgetStatementFromInput

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

#### Parameters

| Name | Type |
| :------ | :------ |
| `input` | `FileInput` |

#### Returns

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

#### Defined in

[src/budget-statement/custom/utils.ts:141](https://github.com/acaldas/document-model-libs/blob/8be7e70/src/budget-statement/custom/utils.ts#L141)

___

### 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:91](https://github.com/acaldas/document-model-libs/blob/8be7e70/src/budget-statement/custom/utils.ts#L91)

___

### 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:177](https://github.com/acaldas/document-model-libs/blob/8be7e70/src/budget-statement/custom/utils.ts#L177)
