# SiFormModule Type documentation

## TypeScript declaration

### [SiFormModule](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form.module.ts#L17-L35>)

**Kind:** ng module

```
import { SiFormModule } from '@siemens/element-ng/form';
```

```
ng_module SiFormModule
```

#### Constructor

##### constructor

[Source for constructor](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form.module.ts#L17-L35>)

```
constructor(): SiFormModule
```

**Returns:** [SiFormModule](<index.html#t:SiFormModule>)

#### Methods

##### withConfiguration

[Source for withConfiguration](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form.module.ts#L25-L34>)

**Modifiers:** static

Overrides the default configuration of the form module.

```
withConfiguration({
    validationErrorMapper
  }: { validationErrorMapper: SiFormValidationErrorMapper; }): ModuleWithProviders<SiFormModule>
```

#### Parameters

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [{ validationErrorMapper }](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form.module.ts#L25-L29>) | `{ validationErrorMapper: SiFormValidationErrorMapper; }` |  |  |

**Returns:** [ModuleWithProviders](<https://angular.dev/api/core/ModuleWithProviders>)`<`[SiFormModule](<index.html#t:SiFormModule>)`>`

### Types Documentation

### [SiFormValidationErrorMapper](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L12-L31>)

**Kind:** interface

```
import type { SiFormValidationErrorMapper } from '@siemens/element-ng/form';
```

Interface for form error mapper. It resolves a key to either a translatable string or function which is called with the validation error for its key and should return a translatable string.

```
interface SiFormValidationErrorMapper
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [dateFormat](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L26-L26>) (optional) | `TranslatableString \| ((error: { format: string; }) => TranslatableString)` |  |
| [email](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L15-L15>) (optional) | `TranslatableString \| ((error: { email: boolean; }) => TranslatableString)` |  |
| [max](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L17-L17>) (optional) | `TranslatableString \| ((error: { max: number; actual: number; }) => TranslatableString)` |  |
| [maxDate](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L27-L27>) (optional) | `TranslatableString \| ((error: { max: Date; actual: Date; }) => TranslatableString)` |  |
| [maxLength](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L21-L23>) (optional) | `TranslatableString \| ((error: { requiredLength: number; actualLength: number; }) => TranslatableString)` |  |
| [min](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L16-L16>) (optional) | `TranslatableString \| ((error: { min: number; actual: number; }) => TranslatableString)` |  |
| [minDate](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L28-L28>) (optional) | `TranslatableString \| ((error: { min: Date; actual: Date; }) => TranslatableString)` |  |
| [minLength](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L18-L20>) (optional) | `TranslatableString \| ((error: { requiredLength: number; actualLength: number; }) => TranslatableString)` |  |
| [numberFormat](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L25-L25>) (optional) | `TranslatableString \| ((error: { numberFormat: boolean; }) => TranslatableString)` |  |
| [pattern](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L24-L24>) (optional) | `TranslatableString \| ((error: { pattern: string \| RegExp; }) => TranslatableString)` |  |
| [required](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L13-L13>) (optional) | `TranslatableString \| ((error: { required: boolean; }) => TranslatableString)` |  |
| [requiredTrue](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L14-L14>) (optional) | `TranslatableString \| ((error: { required: boolean; }) => TranslatableString)` |  |

#### Index Signatures

| Name | Type | Description |
| --- | --- | --- |
| [\[key: string\]](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L30-L30>) | `string \| ((error: any) => string) \| undefined` |  |

### [TranslatableString](<https://github.com/siemens/element/blob/main/projects/element-translate-ng/translate-types/global.types.ts#L18-L18>)

**Kind:** type alias

```
import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';
```

Represents a translatable string. This can either be a translation key, e.g. `ACTIONS.EDIT` that will be automatically translated when displayed on the UI or a pre-translated string, e.g. `Edit`. Equivalent to a normal string in usage and functionality.

```
type TranslatableString = string & Translatable
```
