aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/src/types.ts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/src/types.ts')
-rw-r--r--apps/files/src/types.ts82
1 files changed, 54 insertions, 28 deletions
diff --git a/apps/files/src/types.ts b/apps/files/src/types.ts
index d2bfcaed0ee..0096ecc0fdb 100644
--- a/apps/files/src/types.ts
+++ b/apps/files/src/types.ts
@@ -1,35 +1,18 @@
/**
- * @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com>
- *
- * @author John Molakvoæ <skjnldsv@protonmail.com>
- *
- * @license AGPL-3.0-or-later
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
-import type { Folder, Node } from '@nextcloud/files'
+import type { FileAction, Folder, Node, View } from '@nextcloud/files'
import type { Upload } from '@nextcloud/upload'
// Global definitions
export type Service = string
-export type FileId = number
+export type FileSource = string
export type ViewId = string
// Files store
export type FilesStore = {
- [fileid: FileId]: Node
+ [source: FileSource]: Node
}
export type RootsStore = {
@@ -48,7 +31,7 @@ export interface RootOptions {
// Paths store
export type PathConfig = {
- [path: string]: number
+ [path: string]: FileSource
}
export type ServicesState = {
@@ -62,20 +45,33 @@ export type PathsStore = {
export interface PathOptions {
service: Service
path: string
- fileid: FileId
+ source: FileSource
}
// User config store
export interface UserConfig {
- [key: string]: boolean
+ [key: string]: boolean | string | undefined
+
+ crop_image_previews: boolean
+ default_view: 'files' | 'personal'
+ grid_view: boolean
+ show_files_extensions: boolean
+ show_hidden: boolean
+ show_mime_column: boolean
+ sort_favorites_first: boolean
+ sort_folders_first: boolean
+
+ show_dialog_deletion: boolean
+ show_dialog_file_extension: boolean,
}
+
export interface UserConfigStore {
userConfig: UserConfig
}
export interface SelectionStore {
- selected: FileId[]
- lastSelection: FileId[]
+ selected: FileSource[]
+ lastSelection: FileSource[]
lastSelectedIndex: number | null
}
@@ -109,14 +105,44 @@ export interface UploaderStore {
// Drag and drop store
export interface DragAndDropStore {
- dragging: FileId[]
+ dragging: FileSource[]
+}
+
+// Active node store
+export interface ActiveStore {
+ activeAction: FileAction|null
+ activeFolder: Folder|null
+ activeNode: Node|null
+ activeView: View|null
}
+/**
+ * Search scope for the in-files-search
+ */
+export type SearchScope = 'filter'|'globally'
+
export interface TemplateFile {
app: string
label: string
extension: string
iconClass?: string
+ iconSvgInline?: string
mimetypes: string[]
ratio?: number
+ templates?: Record<string, unknown>[]
+}
+
+export type Capabilities = {
+ files: {
+ bigfilechunking: boolean
+ blacklisted_files: string[]
+ forbidden_filename_basenames: string[]
+ forbidden_filename_characters: string[]
+ forbidden_filename_extensions: string[]
+ forbidden_filenames: string[]
+ undelete: boolean
+ version_deletion: boolean
+ version_labeling: boolean
+ versioning: boolean
+ }
}