# Types: InboxActions to InboxState (/themes/sdk/reference/inbox/types-1)

```ts
import { … } from '@poltura/theme-sdk/inbox';
```

## `InboxActions` [#inboxactions]

What the shopper can do in the chat.

<TypeTable type={{"open":{"description":"Opens the panel.","type":"() => void","required":true},"close":{"description":"Closes the panel.","type":"() => void","required":true},"toggle":{"description":"Opens the panel when it is closed and closes it when it is open.","type":"() => void","required":true},"send":{"description":"Sends a message in the conversation, with the files picked so far.","type":"(content: string) => Promise<void>","required":true},"attach":{"description":"Picks a file to send with the next message.","type":"(file: File) => Promise<void>","required":true},"removeAttachment":{"description":"Drops a picked file.","type":"(id: string) => void","required":true},"retry":{"description":"Sends a failed message again.","type":"(localId: string) => Promise<void>","required":true},"searchKnowledge":{"description":"Searches the help articles.","type":"(query: string) => Promise<void>","required":true},"openArticle":{"description":"Opens a help article in full.","type":"(id: string) => Promise<void>","required":true},"closeArticle":{"description":"Leaves the open article and returns to the results.","type":"() => void","required":true}}} />

## `InboxAppearance` [#inboxappearance]

How the merchant set the chat up: which corner it sits in, its colour mode and its colours.

<TypeTable type={{"position":{"description":"The side of the screen the launcher and panel sit on.","type":"'right' | 'left'","required":true},"mode":{"description":"Whether the chat follows the page's colour mode or is fixed to light or dark.","type":"'auto' | 'light' | 'dark'","required":true},"colors":{"description":"The colours in light mode.","type":"InboxColors","required":true},"darkColors":{"description":"The colours in dark mode.","type":"InboxColors","required":true}}} />

## `InboxArticle` [#inboxarticle]

A help article opened in full.

<TypeTable type={{"id":{"description":"The article's id.","type":"string","required":true},"title":{"description":"The article's title.","type":"string","required":true},"bodyHtml":{"description":"The article body as sanitised HTML.","type":"string","required":true},"url":{"description":"The article's own page, or null when it has none.","type":"string | null","required":true}}} />

## `InboxAttachment` [#inboxattachment]

A file sent with a message.

<TypeTable type={{"id":{"description":"The file's id.","type":"string","required":true},"filename":{"description":"The file's name as the sender gave it.","type":"string","required":true},"kind":{"description":"What kind of file it is.","type":"InboxAttachmentKind","required":true},"byteSize":{"description":"The file size in bytes.","type":"number","required":true},"downloadUrl":{"description":"Where the file downloads from, or null while it cannot be fetched.","type":"string | null","required":true}}} />

## `InboxAttachmentKind` [#inboxattachmentkind]

What kind of file a message carries.

```ts
type InboxAttachmentKind = 'image' | 'pdf' | 'text'
```

## `InboxAuthorKind` [#inboxauthorkind]

Who wrote a message: the shopper, a team member, the AI assistant or the chat itself.

```ts
type InboxAuthorKind = 'customer' | 'staff' | 'ai' | 'system'
```

## `InboxColors` [#inboxcolors]

The colours of the chat in one colour mode, each a CSS colour or a design token reference such as `var(--card)`.

<TypeTable type={{"accent":{"description":"The launcher, the send button and the shopper's message bubbles.","type":"string","required":true},"accentText":{"description":"The text and icons drawn on the accent colour.","type":"string","required":true},"background":{"description":"The panel background.","type":"string","required":true},"text":{"description":"The panel text.","type":"string","required":true}}} />

## `InboxConnection` [#inboxconnection]

The state of the chat's live connection to the store.

```ts
type InboxConnection = 'connecting' | 'live' | 'reconnecting' | 'offline'
```

## `InboxCopy` [#inboxcopy]

Every text the chat shows, already resolved: the merchant's wording where set, the store language's otherwise.

<TypeTable type={{"launcherLabel":{"description":"The launcher button's accessible label.","type":"string","required":true},"title":{"description":"The panel heading.","type":"string","required":true},"greeting":{"description":"The welcome line shown above an empty conversation.","type":"string","required":true},"offlineMessage":{"description":"What the panel says when no one is online.","type":"string","required":true},"close":{"description":"The close button's accessible label.","type":"string","required":true},"send":{"description":"The send button's label.","type":"string","required":true},"placeholder":{"description":"The message field's placeholder.","type":"string","required":true},"attach":{"description":"The attach button's accessible label.","type":"string","required":true},"removeAttachment":{"description":"The label of the button that drops a picked file.","type":"string","required":true},"reconnecting":{"description":"What the status line says while the chat reconnects.","type":"string","required":true},"sending":{"description":"The delivery label of a message being sent.","type":"string","required":true},"sent":{"description":"The delivery label of a message that reached the store.","type":"string","required":true},"delivered":{"description":"The delivery label of a message that reached the team.","type":"string","required":true},"read":{"description":"The delivery label of a message the team has read.","type":"string","required":true},"failed":{"description":"The delivery label of a message that failed.","type":"string","required":true},"rateLimited":{"description":"The delivery label of a message refused for being sent too fast, when the store words it.","type":"string","required":false},"retry":{"description":"The label of the button that sends a failed message again.","type":"string","required":true},"typing":{"description":"What the chat says while the other side is typing.","type":"string","required":true},"aiDisclosure":{"description":"The note that marks a reply as written by the AI assistant.","type":"string","required":true},"unread":{"description":"The launcher badge's accessible label for unread messages.","type":"(count: number) => string","required":true},"helpTitle":{"description":"The help search heading.","type":"string","required":true},"helpPlaceholder":{"description":"The help search field's placeholder.","type":"string","required":true},"helpEmpty":{"description":"What the help search says when nothing matches.","type":"string","required":true},"helpBack":{"description":"The label of the button that returns from an article to the results.","type":"string","required":true},"helpStillNeedHelp":{"description":"The line that leads from the help articles to the conversation.","type":"string","required":true}}} />

## `InboxDelivery` [#inboxdelivery]

How far a message the shopper sent has got.

```ts
type InboxDelivery = 'sending' | 'sent' | 'delivered' | 'read' | 'failed'
```

## `InboxKnowledge` [#inboxknowledge]

The help search inside the chat: whether it exists, what was asked, what was found and the article open now.

<TypeTable type={{"enabled":{"description":"Whether the store offers help articles in the chat.","type":"boolean","required":true},"query":{"description":"The text last searched for.","type":"string","required":true},"results":{"description":"The articles found.","type":"InboxKnowledgeItem[]","required":true},"loading":{"description":"Whether a search or an article is loading.","type":"boolean","required":true},"article":{"description":"The article opened in full, or null while the results show.","type":"InboxArticle | null","required":true}}} />

## `InboxKnowledgeItem` [#inboxknowledgeitem]

A help article found by a search, before it is opened.

<TypeTable type={{"id":{"description":"The article's id.","type":"string","required":true},"title":{"description":"The article's title.","type":"string","required":true},"excerpt":{"description":"A short extract of the article.","type":"string","required":true},"url":{"description":"The article's own page, or null when it has none.","type":"string | null","required":true},"categoryTitle":{"description":"The title of the category the article is in, or null.","type":"string | null","required":true}}} />

## `InboxMessage` [#inboxmessage]

A message in the conversation.

<TypeTable type={{"rateLimited":{"description":"Whether sending failed because the shopper wrote too fast.","type":"boolean","required":false},"id":{"description":"The message's id.","type":"string","required":true},"localId":{"description":"The id the browser gave a message the shopper sent, or null for a message from the team.","type":"string | null","required":true},"author":{"description":"Who wrote the message.","type":"{ kind: InboxAuthorKind; name: string | null; }","required":true},"content":{"description":"The message text.","type":"string","required":true},"attachments":{"description":"The files sent with the message.","type":"InboxAttachment[]","required":true},"delivery":{"description":"How far the message has got; meaningful for the shopper's own messages.","type":"InboxDelivery","required":true},"aiGenerated":{"description":"Whether AI wrote the text, also when a team member sent an AI suggestion.","type":"boolean","required":false},"createdAt":{"description":"When the message was written, as an ISO 8601 date and time.","type":"string","required":true}}} />

## `InboxPendingAttachment` [#inboxpendingattachment]

A file the shopper has picked and not sent yet.

<TypeTable type={{"id":{"description":"The file's id.","type":"string","required":true},"filename":{"description":"The file's name.","type":"string","required":true},"kind":{"description":"What kind of file it is.","type":"InboxAttachmentKind","required":true},"state":{"description":"Whether it is still uploading, ready to send or failed to upload.","type":"'uploading' | 'ready' | 'failed'","required":true}}} />

## `InboxState` [#inboxstate]

The chat's view and the actions the shopper can take.

<TypeTable type={{"view":{"description":"What the chat shows right now.","type":"InboxView","required":true},"actions":{"description":"What the shopper can do.","type":"InboxActions","required":true}}} />
