# WidgetComponentTypeFactory documentation

## TypeScript declaration

### [WidgetComponentTypeFactory](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L81-L81>)

**Kind:** type alias

```
import type { WidgetComponentTypeFactory } from '@siemens/dashboards-ng';
```

```
type WidgetComponentTypeFactory = CommonFactoryFields & (ModuleOptions | StandaloneOptions)
```

### Types Documentation

### [CommonFactoryFields](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L52-L60>)

**Kind:** type alias

```
type CommonFactoryFields = {
  componentName: string;
  editorComponentName?: string;
  /**
   * CSS class that is added to the modal dialog when component editor dialog is shown.
   * Provides the option to change the size if the dialog.
   */
  editorModalClass?: string;
}
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [componentName](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L53-L53>) | `string` |  |
| [editorComponentName](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L54-L54>) (optional) | `string` |  |
| [editorModalClass](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L59-L59>) (optional) | `string` | CSS class that is added to the modal dialog when component editor dialog is shown. Provides the option to change the size if the dialog. |

### [ModuleOptions](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L68-L72>)

**Kind:** type alias

Use when component is not standalone and part of a module

```
type ModuleOptions = WidgetComponentTypeBaseConfig & {
  moduleName: string;
  moduleLoader: (name: string) => Promise<any>;
  componentLoader?: never;
}
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [componentLoader](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L71-L71>) (optional) | `undefined` |  |
| [factoryType](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L63-L63>) (optional) | `"default"` |  |
| [moduleLoader](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L70-L70>) | `(name: string) => Promise<any>` |  |
| [moduleName](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L69-L69>) | `string` |  |

### [StandaloneOptions](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L75-L79>)

**Kind:** type alias

Use when component is standalone

```
type StandaloneOptions = WidgetComponentTypeBaseConfig & {
  componentLoader: <T = unknown>(componentName: string) => Promise<Type<T>>;
  moduleName?: never;
  moduleLoader?: never;
}
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [componentLoader](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L76-L76>) | `<T = unknown>(componentName: string) => Promise<Type<T>>` |  |
| [factoryType](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L63-L63>) (optional) | `"default"` |  |
| [moduleLoader](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L78-L78>) (optional) | `undefined` |  |
| [moduleName](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L77-L77>) (optional) | `undefined` |  |

### [WidgetComponentTypeBaseConfig](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L62-L65>)

**Kind:** type alias

```
type WidgetComponentTypeBaseConfig = {
  factoryType?: 'default';
  [index: string]: any;
}
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [factoryType](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L63-L63>) (optional) | `"default"` |  |

#### Index Signatures

| Name | Type | Description |
| --- | --- | --- |
| [\[index: string\]](<https://github.com/siemens/element/blob/main/projects/dashboards-ng/src/model/widgets.model.ts#L64-L64>) | `any` |  |
