# UserChatMessage Type documentation

## TypeScript declaration

### [UserChatMessage](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L40-L49>)

**Kind:** interface

```
import type { UserChatMessage } from '@siemens/element-ng/chat-messages';
```

User chat message for AI chats

See: [SiAiChatComponent](<../../components/SiAiChatComponent/index.html#SiAiChatComponent>) for the AI chat container where this is used

```
interface UserChatMessage extends BaseChatMessage
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [actions](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L48-L48>) (optional) | `MenuItemAction[]` | Actions available for this message |
| [attachments](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L46-L46>) (optional) | `Attachment[]` | Attachments (for user messages) |
| [content](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L44-L44>) | `string` | Message content, should be a string, empty string shows loading state<br><br>Inherited from [BaseChatMessage](<index.html#t:BaseChatMessage>) |
| [loading](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L30-L30>) (optional, inherited) | `boolean \| Signal<boolean>` | Whether the message is currently loading/being generated - can be a boolean or Signal\<boolean\><br><br>Inherited from [BaseChatMessage](<index.html#t:BaseChatMessage>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L42-L42>) | `"user"` | Type of message<br><br>Inherited from [BaseChatMessage](<index.html#t:BaseChatMessage>) |

### Types Documentation

### [Attachment](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-attachment-list.component.ts#L20-L25>)

**Kind:** interface

```
import type { Attachment } from '@siemens/element-ng/chat-messages';
```

Attachment item interface for file attachments in chat messages, used by [SiAttachmentListComponent](<../../components/SiAttachmentListComponent/index.html#SiAttachmentListComponent>) and inside [SiUserMessageComponent](<../../components/SiUserMessageComponent/index.html#SiUserMessageComponent>) as well as [SiChatInputComponent](<../../components/SiChatInputComponent/index.html#SiChatInputComponent>).

See: [SiAttachmentListComponent](<../../components/SiAttachmentListComponent/index.html#SiAttachmentListComponent>) for the attachment list component

See: [SiUserMessageComponent](<../../components/SiUserMessageComponent/index.html#SiUserMessageComponent>) for the user message

See: [SiChatInputComponent](<../../components/SiChatInputComponent/index.html#SiChatInputComponent>) for the chat input component

```
interface Attachment
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [name](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-attachment-list.component.ts#L22-L22>) | `string` | File name |
| [previewTemplate](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/si-attachment-list.component.ts#L24-L24>) (optional) | `TemplateRef<any> \| (() => TemplateRef<any>)` | Optionally show a preview of the attachment by providing a template that is shown in a modal when clicked (optional) |

### [BaseChatMessage](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L24-L31>)

**Kind:** interface

```
import type { BaseChatMessage } from '@siemens/element-ng/chat-messages';
```

Base interface for all chat messages. Messages can be rendered either with content or with a custom template for advanced styling and functionality.

See: [ChatMessage](<../ChatMessage/index.html#t:ChatMessage>) for the chat message type union

See: [UserChatMessage](<index.html#t:UserChatMessage>) for user messages

See: [AiChatMessage](<../AiChatMessage/index.html#t:AiChatMessage>) for AI messages

See: [TemplateChatMessage](<../TemplateChatMessage/index.html#t:TemplateChatMessage>) for template-based messages

```
interface BaseChatMessage
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [content](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L28-L28>) (optional) | `string \| Signal<string>` | Message content - can be a string or a Signal\<string\>, empty string shows loading state |
| [loading](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L30-L30>) (optional) | `boolean \| Signal<boolean>` | Whether the message is currently loading/being generated - can be a boolean or Signal\<boolean\> |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/chat-messages/chat-message.model.ts#L26-L26>) | `"user" \| "ai"` | Type of message |

### [MenuItemAction](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L34-L41>)

**Kind:** interface

```
import type { MenuItemAction } from '@siemens/element-ng/menu';
```

```
interface MenuItemAction extends MenuItemBase
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [action](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L40-L40>) | `string \| ((actionParam: any, source: MenuItemAction) => void)` | Action that called when the item is triggered. A function will be called, a string will be dispatched to the [SiMenuActionService](<../SiMenuActionService/index.html#t:SiMenuActionService>). |
| [badge](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L21-L21>) (optional, inherited) | `string \| number` | Badge that is rendered after the label.<br><br>Inherited from [MenuItemBase](<index.html#t:MenuItemBase>) |
| [badgeColor](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L23-L23>) (optional, inherited) | `string` | Color of the badge (not iconBadge).<br><br>Inherited from [MenuItemBase](<index.html#t:MenuItemBase>) |
| [disabled](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L25-L25>) (optional, inherited) | `boolean` | Whether the menu item id disabled.<br><br>Inherited from [MenuItemBase](<index.html#t:MenuItemBase>) |
| [icon](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L14-L14>) (optional, inherited) | `string` | Optional icon that will be rendered before the label.<br><br>Inherited from [MenuItemBase](<index.html#t:MenuItemBase>) |
| [iconBadge](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L19-L19>) (optional, inherited) | `string \| number \| boolean` | Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered.<br><br>Inherited from [MenuItemBase](<index.html#t:MenuItemBase>) |
| [id](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L10-L10>) (optional, inherited) | `string` | ID that will be attached to the DOM node.<br><br>Inherited from [MenuItemBase](<index.html#t:MenuItemBase>) |
| [label](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L12-L12>) (inherited) | `TranslatableString` | Label that is shown to the user.<br><br>Inherited from [MenuItemBase](<index.html#t:MenuItemBase>) |
| [type](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L35-L35>) | `"action"` |  |

### [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
```

### [MenuItemBase](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L8-L26>)

**Kind:** interface

```
import type { MenuItemBase } from '@siemens/element-ng/menu';
```

```
interface MenuItemBase
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [badge](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L21-L21>) (optional) | `string \| number` | Badge that is rendered after the label. |
| [badgeColor](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L23-L23>) (optional) | `string` | Color of the badge (not iconBadge). |
| [disabled](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L25-L25>) (optional) | `boolean` | Whether the menu item id disabled. |
| [icon](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L14-L14>) (optional) | `string` | Optional icon that will be rendered before the label. |
| [iconBadge](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L19-L19>) (optional) | `string \| number \| boolean` | Badge (always red) that is attached to the icon. If value===true, an empty red dot will be rendered. |
| [id](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L10-L10>) (optional) | `string` | ID that will be attached to the DOM node. |
| [label](<https://github.com/siemens/element/blob/main/projects/element-ng/menu/si-menu-model.ts#L12-L12>) | `TranslatableString` | Label that is shown to the user. |
