Files
mail/src/types/composer.ts
T
2026-06-22 22:54:02 -04:00

48 lines
1.1 KiB
TypeScript

import type { ServiceObject } from "@MailManager/models/service"
import type { EntityIdentifier } from "@MailManager/types/common"
import type { MessageAddressInterface } from "@MailManager/types/message"
export enum ComposerMode {
Fresh = 'fresh',
Reply = 'reply',
Forward = 'forward',
}
export interface ComposerDraftAttachment {
identifier: string
composition: string
origin: 'source' | 'upload'
name: string
type: string
size: number
source: EntityIdentifier | null
}
export interface ComposerDraftMessage {
to: MessageAddressInterface[]
cc: MessageAddressInterface[]
bcc: MessageAddressInterface[]
subject: string
body: {
html: string
text: string
}
}
export interface ComposerDraft {
action: ComposerMode
identifier: string
revision: number
sender: ComposerSenderIdentity
source: EntityIdentifier | null
stageStatus: 'local' | 'staged'
stagedAt: Date | null
message: ComposerDraftMessage
attachments: Record<string, ComposerDraftAttachment>
}
export interface ComposerSenderIdentity {
service: ServiceObject
address: string
label: string | null
}