diff --git a/lib/files/file.ts b/lib/files/file.ts index 4c7c3421..ed6c5085 100644 --- a/lib/files/file.ts +++ b/lib/files/file.ts @@ -3,11 +3,11 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ import { FileType } from './fileType' -import { type INode, Node } from './node' +import { Node } from './node' export class File extends Node { - get type(): FileType { + get type(): FileType.File { return FileType.File } @@ -23,6 +23,4 @@ export class File extends Node { /** * Interface of the File class */ -export interface IFile extends INode { - readonly type: FileType.File -} +export type IFile = Pick diff --git a/lib/files/folder.ts b/lib/files/folder.ts index d53250ad..05d0291d 100644 --- a/lib/files/folder.ts +++ b/lib/files/folder.ts @@ -2,9 +2,9 @@ * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ +import type { NodeData } from './nodeData' import { FileType } from './fileType' -import { type INode, Node } from './node' -import { type NodeData } from './nodeData' +import { Node } from './node' export class Folder extends Node { @@ -16,22 +16,22 @@ export class Folder extends Node { }) } - get type(): FileType { + get type(): FileType.Folder { return FileType.Folder } - get extension(): string|null { + get extension(): null { return null } - get mime(): string { + get mime(): 'httpd/unix-directory' { return 'httpd/unix-directory' } /** * Returns a clone of the folder */ - clone(): Node { + clone(): Folder { return new Folder(this.data) } @@ -40,8 +40,4 @@ export class Folder extends Node { /** * Interface of the folder class */ -export interface IFolder extends INode { - readonly type: FileType.Folder - readonly extension: null - readonly mime: 'httpd/unix-directory' -} +export type IFolder = Pick