@@ -7,6 +7,8 @@ declare module '@iotum/callbridge-js/dashboard' {
77 export enum Service {
88 /** None */
99 None = "" ,
10+ /** Search */
11+ Search = "Search" ,
1012 /** Team (Chat) */
1113 Team = "Team" ,
1214 /** Drive (Content Library) */
@@ -82,6 +84,9 @@ declare module '@iotum/callbridge-js/dashboard' {
8284 */
8385 invitedHosts ?: number [ ] ;
8486 } ;
87+ /**
88+ * Chat room.
89+ */
8590 export type ChatRoom = {
8691 /** Room path, used for navigation. @see `Dashboard.load` */
8792 path : string ;
@@ -94,6 +99,24 @@ declare module '@iotum/callbridge-js/dashboard' {
9499 picture_url : string ;
95100 } > ;
96101 } ;
102+ /**
103+ * Search options.
104+ */
105+ export type SearchOptions = {
106+ /** The search content type. Default `SearchContentType.Event` */
107+ contentType ?: SearchContentType ;
108+ /** The page number of the search result. Optional, default 1 */
109+ page ?: number ;
110+ /** The sorting order of the search result. Optional, default 'date' */
111+ order ?: 'date' | 'relevance' ;
112+ } ;
113+ /**
114+ * Search content type.
115+ */
116+ export enum SearchContentType {
117+ /** E.g. meeting and call event. */
118+ event = "event"
119+ }
97120 /**
98121 * Callbridge Dashboard.
99122 */
@@ -136,6 +159,29 @@ declare module '@iotum/callbridge-js/dashboard' {
136159 id ?: number ;
137160 options : ScheduleOptions ;
138161 } ;
162+ 'dashboard.SEARCH_START' : {
163+ /** The search query. */
164+ query : string ;
165+ /** The page of the result. */
166+ page : number ;
167+ /** The order of the result. */
168+ order : 'date' | 'relevance' ;
169+ } ;
170+ 'dashboard.SEARCH_RESULT' : {
171+ /** The search query. */
172+ query : string ;
173+ /** The search error. */
174+ error ?: string ;
175+ /** The search result. */
176+ result ?: Array < {
177+ /** The type of the item. */
178+ contentType : SearchContentType ;
179+ /** The id of the item */
180+ id : number ;
181+ /** The result text with <mark> */
182+ highlight : Record < string , Array < string > > ;
183+ } > ;
184+ } ;
139185 /** Meeting widget is ready */
140186 'room.READY' : void ;
141187 /** Meeting widget is unloading */
@@ -156,6 +202,15 @@ declare module '@iotum/callbridge-js/dashboard' {
156202 * Optional, service options.
157203 */
158204 serviceOptions ?: ServiceOptions ) ;
205+ /**
206+ * Search for thing.
207+ * @param query The search query.
208+ * @param options Optional, search options.
209+ * @throws {Error }
210+ * - "Not implemented" when the service is not "Search".
211+ * - "Nothing to search" when the query is empty.
212+ */
213+ search ( query : string , options ?: SearchOptions ) : void ;
159214 /**
160215 * Loads the service.
161216 * @param service the service to load.
@@ -179,7 +234,7 @@ declare module '@iotum/callbridge-js/dashboard' {
179234}
180235declare module '@iotum/callbridge-js/index' {
181236 export { type WidgetOptions } from '@iotum/callbridge-js/widget' ;
182- export { default as Dashboard , Service , LayoutOption , MeetingAction , ScheduleAction , type ServiceOptions , type ChatRoom , } from '@iotum/callbridge-js/dashboard' ;
237+ export { default as Dashboard , Service , LayoutOption , MeetingAction , ScheduleAction , SearchContentType , type ServiceOptions , type ChatRoom , type SearchOptions , } from '@iotum/callbridge-js/dashboard' ;
183238 export { type AudioSettings } from '@iotum/callbridge-js/room' ;
184239 export { default as Meeting , type MeetingOptions } from '@iotum/callbridge-js/meeting' ;
185240 export { default as Livestream , type LivestreamOptions } from '@iotum/callbridge-js/livestream' ;
0 commit comments