From da33159f1e1154a71eec0b0fcc9583116df07b61 Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Tue, 10 Dec 2024 14:37:44 +0100 Subject: [PATCH] fix(files): dav Node type declaration Signed-off-by: skjnldsv --- apps/files/src/eventbus.d.ts | 1 + apps/files/src/services/Files.ts | 4 ++-- apps/files/src/store/paths.ts | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/files/src/eventbus.d.ts b/apps/files/src/eventbus.d.ts index 42e2622cc32c3..e9b877230f673 100644 --- a/apps/files/src/eventbus.d.ts +++ b/apps/files/src/eventbus.d.ts @@ -9,6 +9,7 @@ declare module '@nextcloud/event-bus' { 'files:node:deleted': Node 'files:node:renamed': Node 'files:node:updated': Node + 'files:node:moved': { node: Node, oldSource: string } 'nextcloud:unified-search.search': { query: string } } } diff --git a/apps/files/src/services/Files.ts b/apps/files/src/services/Files.ts index b4a7c37f7f482..0c55eea15ca24 100644 --- a/apps/files/src/services/Files.ts +++ b/apps/files/src/services/Files.ts @@ -23,14 +23,14 @@ import type { ContentsWithRoot } from '@nextcloud/files' import type { FileStat, ResponseDataDetailed } from 'webdav' import { CancelablePromise } from 'cancelable-promise' -import { File, Folder, davGetClient, davGetDefaultPropfind, davResultToNode, davRootPath } from '@nextcloud/files' +import { type Node, File, Folder, davGetClient, davGetDefaultPropfind, davResultToNode, davRootPath } from '@nextcloud/files' import logger from '../logger' /** * Slim wrapper over `@nextcloud/files` `davResultToNode` to allow using the function with `Array.map` * @param node The node returned by the webdav library */ -export const resultToNode = (node: FileStat): File | Folder => { +export const resultToNode = (node: FileStat): Node => { return davResultToNode(node) } diff --git a/apps/files/src/store/paths.ts b/apps/files/src/store/paths.ts index ecca91532f33e..45824112880f0 100644 --- a/apps/files/src/store/paths.ts +++ b/apps/files/src/store/paths.ts @@ -19,10 +19,10 @@ * along with this program. If not, see . * */ -import type { FileSource, PathsStore, PathOptions, ServicesState, Service } from '../types' +import type { FileSource, PathOptions, ServicesState, Service } from '../types' import { defineStore } from 'pinia' import { dirname } from '@nextcloud/paths' -import { File, FileType, Folder, Node, getNavigation } from '@nextcloud/files' +import { type Node, File, FileType, Folder, getNavigation } from '@nextcloud/files' import { subscribe } from '@nextcloud/event-bus' import Vue from 'vue' import logger from '../logger'