|
3 | 3 | * SPDX-License-Identifier: AGPL-3.0-or-later |
4 | 4 | */ |
5 | 5 |
|
6 | | -import type { Folder } from '../node/folder.ts' |
7 | | -import type { Node } from '../node/node.ts' |
| 6 | +import type { IFolder, INode } from '../node/index.ts' |
8 | 7 |
|
9 | 8 | import isSvg from 'is-svg' |
10 | 9 | import { Column } from './column.ts' |
11 | 10 |
|
12 | 11 | export type ContentsWithRoot = { |
13 | | - folder: Folder, |
14 | | - contents: Node[] |
| 12 | + folder: IFolder, |
| 13 | + contents: INode[] |
| 14 | +} |
| 15 | + |
| 16 | +export interface IGetContentsOptions { |
| 17 | + /** |
| 18 | + * Abort signal to be able to cancel the request. |
| 19 | + * |
| 20 | + *@see https://developer.mozilla.org/en-US/docs/Web/API/AbortController |
| 21 | + */ |
| 22 | + signal: AbortSignal |
15 | 23 | } |
16 | 24 |
|
17 | 25 | export interface IView { |
@@ -42,11 +50,11 @@ export interface IView { |
42 | 50 | * This method _must_ also return the current directory |
43 | 51 | * information alongside with its content. |
44 | 52 | * |
45 | | - * Usually a abort signal is provided to be able to |
| 53 | + * An abort signal is provided to be able to |
46 | 54 | * cancel the request if the user change directory |
47 | 55 | * {@see https://developer.mozilla.org/en-US/docs/Web/API/AbortController }. |
48 | 56 | */ |
49 | | - getContents(path: string, options: { signal: AbortSignal }): Promise<ContentsWithRoot> |
| 57 | + getContents(path: string, options: IGetContentsOptions): Promise<ContentsWithRoot> |
50 | 58 |
|
51 | 59 | /** |
52 | 60 | * If set then the view will be hidden from the navigation unless its the active view. |
@@ -95,8 +103,7 @@ export interface IView { |
95 | 103 | /** |
96 | 104 | * Method called to load child views if any |
97 | 105 | */ |
98 | | - // eslint-disable-next-line no-use-before-define |
99 | | - loadChildViews?: (view: View) => Promise<void> |
| 106 | + loadChildViews?: (view: IView) => Promise<void> |
100 | 107 | } |
101 | 108 |
|
102 | 109 | export class View implements IView { |
|
0 commit comments