Skip to content

Commit 7f9dfa3

Browse files
committed
(typescript) update types
1 parent 2716df8 commit 7f9dfa3

File tree

1 file changed

+41
-37
lines changed

1 file changed

+41
-37
lines changed

types/index.d.ts

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ export interface MessageReactions {
7171
[key: string]: StringNumber[]
7272
}
7373

74+
export interface CustomAction {
75+
name: string
76+
title: string
77+
}
78+
79+
export type CustomActions = CustomAction[]
80+
7481
export interface Slots {
7582
'rooms-header': VNode[]
7683
'room-list-item': VNode[]
@@ -109,51 +116,48 @@ export interface Slots {
109116
[key: string]: VNode[]
110117
}
111118

112-
export interface CustomAction {
113-
name: string
114-
title: string
119+
export interface Props {
120+
'current-user-id': StringNumber
121+
rooms: Rooms
122+
messages: Messages
123+
height?: string
124+
theme?: 'light' | 'dark'
125+
styles?: Record<string, Record<string, string>>
126+
'loading-rooms'?: boolean
127+
'rooms-loaded'?: boolean
128+
'room-id'?: StringNumber
129+
'load-first-room'?: boolean
130+
'room-message'?: string
131+
'messages-loaded'?: boolean
132+
'room-actions'?: CustomActions
133+
'menu-actions'?: CustomActions
134+
'message-actions'?: CustomActions
135+
'show-add-room'?: boolean
136+
'show-send-icon'?: boolean
137+
'show-files'?: boolean
138+
'show-audio'?: boolean
139+
'show-emojis'?: boolean
140+
'show-reaction-emojis'?: boolean
141+
'show-new-messages-divider'?: boolean
142+
'show-footer'?: boolean
143+
'text-messages'?: Record<string, StringNumber>
144+
'text-formatting'?: number
145+
'responsive-breakpoint'?: boolean
146+
'single-room'?: boolean
147+
'accepted-files'?: string
115148
}
116149

117-
export type CustomActions = CustomAction[]
118-
119150
export interface AdvancedChatOptions {
120-
props?: {
121-
height: string
122-
'current-user-id': StringNumber
123-
rooms: Rooms
124-
'loading-rooms': boolean
125-
'rooms-loaded': boolean
126-
'room-id': StringNumber
127-
'load-first-room': boolean
128-
messages: Messages
129-
'room-message': string
130-
'messages-loaded': boolean
131-
'room-actions': CustomActions
132-
'menu-actions': CustomActions
133-
'message-actions': CustomActions
134-
'show-add-room': boolean
135-
'show-send-icon': boolean
136-
'show-files': boolean
137-
'show-audio': boolean
138-
'show-emojis': boolean
139-
'show-reaction-emojis': boolean
140-
'show-new-messages-divider': boolean
141-
'show-footer': boolean
142-
'text-messages': {}
143-
'text-formatting': number
144-
'responsive-breakpoint': boolean
145-
'single-room': boolean
146-
theme: string
147-
'accepted-files': string
148-
styles: { [key: string]: string }
149-
}
150-
151+
props: Props
151152
slots?: Slots
152153
}
153154

154-
export default class VueAdvancedChat extends Vue {
155+
export default class AdvancedChat extends Vue {
155156
rooms: Rooms
156157
messages: Messages
158+
157159
$slots: Slots
160+
$props: Props
161+
158162
static install: PluginFunction<AdvancedChatOptions>
159163
}

0 commit comments

Comments
 (0)