Skip to content

Commit d2a42c6

Browse files
committed
fix(files): Add Sidebar.Tab type in global context
And use proper optional argument syntax for its constructor Signed-off-by: Louis Chmn <[email protected]>
1 parent 1105d4b commit d2a42c6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

apps/files/src/models/Tab.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export default class Tab {
2222
* @param {object} options destructuring object
2323
* @param {string} options.id the unique id of this tab
2424
* @param {string} options.name the translated tab name
25-
* @param {?string} options.icon the icon css class
26-
* @param {?string} options.iconSvg the icon in svg format
25+
* @param {string} [options.icon] the icon css class
26+
* @param {string} [options.iconSvg] the icon in svg format
2727
* @param {Function} options.mount function to mount the tab
2828
* @param {Function} [options.setIsActive] function to forward the active state of the tab
2929
* @param {Function} options.update function to update the tab

window.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
55

6+
import type Tab from './apps/files/src/models/Tab.js'
67
import type RouterService from './apps/files/src/services/RouterService.ts'
78
import type Settings from './apps/files/src/services/Settings.js'
89
import type Sidebar from './apps/files/src/services/Sidebar.js'
@@ -12,6 +13,7 @@ type SidebarAPI = Sidebar & {
1213
close: () => void
1314
setFullScreenMode: (fullScreen: boolean) => void
1415
setShowTagsDefault: (showTagsDefault: boolean) => void
16+
Tab: typeof Tab
1517
}
1618

1719
declare global {

0 commit comments

Comments
 (0)