@@ -38,6 +38,15 @@ export interface IEditorService extends Component<IEditor> {
38
38
originValue ?: string
39
39
) => void
40
40
) ;
41
+ onMoveTab (
42
+ callback : ( updateTabs : IEditorTab < any > [ ] , groupId ?: number ) => void
43
+ ) ;
44
+ onSelectTab ( callback : ( tabId : string , groupId ?: number ) => void ) ;
45
+ onCloseAll ( callback : ( groupId ?: number ) => void ) ;
46
+ onCloseTab ( callback : ( tabId : string , groupId ?: number ) => void ) ;
47
+ onCloseOthers ( callback : ( tabItem : IEditorTab , groupId ?: number ) => void ) ;
48
+ onCloseToLeft ( callback : ( tabItem : IEditorTab , groupId ?: number ) => void ) ;
49
+ onCloseToRight ( callback : ( tabItem : IEditorTab , groupId ?: number ) => void ) ;
41
50
/**
42
51
* Set active group and tab
43
52
* @param groupId Target group ID
@@ -298,4 +307,40 @@ export class EditorService
298
307
) {
299
308
this . subscribe ( EditorEvent . OnUpdateTab , callback ) ;
300
309
}
310
+
311
+ public onMoveTab (
312
+ callback : ( updateTabs : IEditorTab < any > [ ] , groupId ?: number ) => void
313
+ ) {
314
+ this . subscribe ( EditorEvent . OnMoveTab , callback ) ;
315
+ }
316
+
317
+ public onSelectTab ( callback : ( tabId : string , groupId ?: number ) => void ) {
318
+ this . subscribe ( EditorEvent . OnSelectTab , callback ) ;
319
+ }
320
+
321
+ public onCloseAll ( callback : ( groupId ?: number ) => void ) {
322
+ this . subscribe ( EditorEvent . OnCloseAll , callback ) ;
323
+ }
324
+
325
+ public onCloseTab ( callback : ( tabId : string , groupId ?: number ) => void ) {
326
+ this . subscribe ( EditorEvent . OnCloseTab , callback ) ;
327
+ }
328
+
329
+ public onCloseOthers (
330
+ callback : ( tabItem : IEditorTab , groupId ?: number ) => void
331
+ ) {
332
+ this . subscribe ( EditorEvent . OnCloseOthers , callback ) ;
333
+ }
334
+
335
+ public onCloseToLeft (
336
+ callback : ( tabItem : IEditorTab , groupId ?: number ) => void
337
+ ) {
338
+ this . subscribe ( EditorEvent . OnCloseToLeft , callback ) ;
339
+ }
340
+
341
+ public onCloseToRight (
342
+ callback : ( tabItem : IEditorTab , groupId ?: number ) => void
343
+ ) {
344
+ this . subscribe ( EditorEvent . OnCloseToRight , callback ) ;
345
+ }
301
346
}
0 commit comments