Skip to content

Commit f6445f4

Browse files
committed
Update types
1 parent abf20b2 commit f6445f4

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/types.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ export namespace MessageType {
1313
| DerivedUnsupported
1414
export type DerivedAny = DateHeader | DerivedMessage
1515

16-
export type PartialAny = PartialFile | PartialImage | PartialText
16+
export type PartialAny =
17+
| PartialCustom
18+
| PartialFile
19+
| PartialImage
20+
| PartialText
1721

1822
interface Base {
1923
author: User
@@ -34,7 +38,7 @@ export namespace MessageType {
3438
showStatus: boolean
3539
}
3640

37-
export interface DerivedCustom extends DerivedMessageProps {
41+
export interface DerivedCustom extends DerivedMessageProps, Custom {
3842
type: Custom['type']
3943
}
4044

@@ -50,15 +54,20 @@ export namespace MessageType {
5054
type: Text['type']
5155
}
5256

53-
export interface DerivedUnsupported extends DerivedMessageProps {
57+
export interface DerivedUnsupported extends DerivedMessageProps, Unsupported {
5458
type: Unsupported['type']
5559
}
5660

57-
export interface Custom extends Base {
61+
export interface PartialCustom extends Base {
62+
metadata?: Record<string, any>
63+
}
64+
65+
export interface Custom extends Base, PartialCustom {
5866
type: 'custom'
5967
}
6068

6169
export interface PartialFile {
70+
metadata?: Record<string, any>
6271
mimeType?: string
6372
name: string
6473
size: number
@@ -71,6 +80,7 @@ export namespace MessageType {
7180

7281
export interface PartialImage {
7382
height?: number
83+
metadata?: Record<string, any>
7484
name: string
7585
size: number
7686
uri: string
@@ -82,6 +92,7 @@ export namespace MessageType {
8292
}
8393

8494
export interface PartialText {
95+
metadata?: Record<string, any>
8596
previewData?: PreviewData
8697
text: string
8798
}

0 commit comments

Comments
 (0)