import { DavFileInfoResponse } from '@opencloud-eu/web-client/webdav'; import { Audio, GeoCoordinates, Identity, Image, MotionPhoto, Photo, User } from '../../graph/generated'; import { MongoAbility, SubjectRawRule } from '@casl/ability'; import { DAVResultResponseProps, FileStat } from 'webdav'; export type AbilityActions = 'create' | 'create-all' | 'delete' | 'delete-all' | 'read' | 'read-all' | 'set-quota' | 'set-quota-all' | 'update' | 'update-all'; export type AbilitySubjects = 'Account' | 'Announcement' | 'Drive' | 'Favorite' | 'Group' | 'Language' | 'Logo' | 'PublicLink' | 'ReadOnlyPublicLinkPassword' | 'Role' | 'Setting' | 'Share'; export type Ability = MongoAbility<[AbilityActions, AbilitySubjects]>; export type AbilityRule = SubjectRawRule; export interface Resource { id: string; fileId?: string; parentFolderId?: string; storageId?: string; readonly nodeId?: string; name?: string; tags?: string[]; audio?: Audio; location?: GeoCoordinates; image?: Image; photo?: Photo; motionPhoto?: MotionPhoto; path: string; webDavPath?: string; downloadURL?: string; type?: string; thumbnail?: string; processing?: boolean; locked?: boolean; lockOwner?: string; lockTime?: string; mimeType?: string; isFolder?: boolean; mdate?: string; size?: number | string; permissions?: string; starred?: boolean; etag?: string; shareTypes?: number[]; privateLink?: string; owner?: Identity; extension?: string; extraProps?: Record; remoteItemId?: string; remoteItemPath?: string; isInVault?: boolean; hasPreview?(): boolean; canCreate?(): boolean; canUpload?({ user }: { user?: User; }): boolean; canDownload?(): boolean; canShare?(args?: { user?: User; ability?: Ability; }): boolean; canRename?(args?: { user?: User; ability?: Ability; }): boolean; canBeDeleted?(args?: { user?: User; ability?: Ability; }): boolean; canEditTags?(): boolean; canListVersions?(args?: { user?: User; }): boolean; getDomSelector?(): string; isReceivedShare?(): boolean; isShareRoot?(): boolean; isMounted?(): boolean; } export interface FolderResource extends Resource { __folderResource?: any; } export interface FileResource extends Resource { __fileResource?: any; } export interface TrashResource extends Resource { ddate: string; canBeRestored(): boolean; } export interface WebDavResponseTusSupport { extension?: string[]; maxSize?: number; resumable?: string; version?: string[]; } export interface WebDavResponseResource extends Omit { props?: Omit & DavFileInfoResponse; processing?: boolean; tusSupport?: WebDavResponseTusSupport; } export interface SearchResource extends Resource { highlights: string; }