Skip to content

Commit

Permalink
fix(files): dav Node type declaration
Browse files Browse the repository at this point in the history
Signed-off-by: skjnldsv <[email protected]>
  • Loading branch information
skjnldsv committed Dec 10, 2024
1 parent 8d45666 commit da33159
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions apps/files/src/eventbus.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
}
Expand Down
4 changes: 2 additions & 2 deletions apps/files/src/services/Files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
4 changes: 2 additions & 2 deletions apps/files/src/store/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
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'
Expand Down

0 comments on commit da33159

Please sign in to comment.