2023-10-24 09:38:56 +00:00
|
|
|
import Router, { type Route } from 'vue-router';
|
2023-10-16 00:19:35 +00:00
|
|
|
import type { ComponentPublicInstance } from 'vue';
|
|
|
|
|
2023-10-13 19:22:15 +00:00
|
|
|
import type PlyrType from 'plyr';
|
|
|
|
import type videojsType from 'video.js';
|
|
|
|
|
2023-10-30 00:30:11 +00:00
|
|
|
import type { IPhoto, TimelineState } from '@typings';
|
2023-10-29 21:10:56 +00:00
|
|
|
import type { constants, initstate } from '@services/utils';
|
|
|
|
import type { translate, translatePlural } from '@services/l10n';
|
2023-10-16 19:42:18 +00:00
|
|
|
import type { GlobalRouteCheckers, routes } from './router';
|
2023-10-13 19:22:15 +00:00
|
|
|
|
|
|
|
// Global exposed variables
|
|
|
|
declare global {
|
|
|
|
var __webpack_nonce__: string;
|
|
|
|
var __webpack_public_path__: string;
|
|
|
|
|
|
|
|
var OC: Nextcloud.Common.OC;
|
|
|
|
var OCP: Nextcloud.Common.OCP;
|
|
|
|
var OCA: {
|
|
|
|
Files?: {
|
|
|
|
Sidebar?: any;
|
|
|
|
App?: any;
|
|
|
|
};
|
|
|
|
Theming?: {
|
|
|
|
name: string;
|
|
|
|
enabledThemes: any[];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-10-30 08:01:27 +00:00
|
|
|
/**
|
|
|
|
* Global Memories object. Initialized in main.ts
|
|
|
|
* Most of this is not available for admin.ts.
|
|
|
|
*/
|
2023-10-13 19:22:15 +00:00
|
|
|
var _m: {
|
|
|
|
mode: 'admin' | 'user';
|
|
|
|
route: Route;
|
2023-10-24 05:12:48 +00:00
|
|
|
router: Router;
|
2023-10-16 19:42:18 +00:00
|
|
|
routes: typeof routes;
|
2023-10-13 19:22:15 +00:00
|
|
|
|
|
|
|
modals: {
|
|
|
|
editMetadata: (photos: IPhoto[], sections?: number[]) => void;
|
|
|
|
updateAlbums: (photos: IPhoto[]) => void;
|
2023-11-14 06:39:12 +00:00
|
|
|
sharePhotos: (photo: IPhoto[]) => void;
|
2023-10-13 19:22:15 +00:00
|
|
|
shareNodeLink: (path: string, immediate?: boolean) => Promise<void>;
|
|
|
|
moveToFolder: (photos: IPhoto[]) => void;
|
|
|
|
moveToFace: (photos: IPhoto[]) => void;
|
2023-11-14 08:40:04 +00:00
|
|
|
albumShare: (user: string, name: string, link?: boolean) => Promise<void>;
|
2023-10-13 19:22:15 +00:00
|
|
|
showSettings: () => void;
|
|
|
|
};
|
|
|
|
|
|
|
|
sidebar: {
|
|
|
|
open: (photo: IPhoto | number, filename?: string, forceNative?: boolean) => void;
|
|
|
|
close: () => void;
|
|
|
|
setTab: (tab: string) => void;
|
2023-10-30 05:13:44 +00:00
|
|
|
invalidateUnless: (fileid: number) => void;
|
2023-10-13 19:22:15 +00:00
|
|
|
getWidth: () => number;
|
|
|
|
};
|
|
|
|
|
|
|
|
viewer: {
|
2023-10-24 05:12:48 +00:00
|
|
|
open: (photo: IPhoto) => void;
|
2023-10-28 09:00:58 +00:00
|
|
|
openDynamic: (anchorPhoto: IPhoto, timeline: TimelineState) => Promise<void>;
|
2023-10-13 19:22:15 +00:00
|
|
|
openStatic(photo: IPhoto, list: IPhoto[], thumbSize?: 256 | 512): Promise<void>;
|
|
|
|
close: () => void;
|
|
|
|
isOpen: boolean;
|
|
|
|
currentPhoto: IPhoto | null;
|
|
|
|
photoswipe?: unknown; // debugging only
|
|
|
|
};
|
|
|
|
|
|
|
|
video: {
|
|
|
|
videojs: typeof videojsType;
|
|
|
|
Plyr: typeof PlyrType;
|
|
|
|
clientId: string;
|
|
|
|
clientIdPersistent: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
window: {
|
|
|
|
innerWidth: number; // cache
|
|
|
|
innerHeight: number; // cache
|
|
|
|
};
|
|
|
|
};
|
2023-10-16 00:19:35 +00:00
|
|
|
|
|
|
|
// Typings for external libraries below
|
|
|
|
type VueRecyclerType = ComponentPublicInstance & {
|
|
|
|
$el: HTMLDivElement;
|
|
|
|
$refs: {
|
|
|
|
wrapper: HTMLDivElement;
|
|
|
|
};
|
|
|
|
scrollToPosition: (position: number) => void;
|
|
|
|
scrollToItem: (index: number) => void;
|
|
|
|
};
|
|
|
|
|
|
|
|
type VueNcPopover = ComponentPublicInstance & {
|
|
|
|
$refs: { popover: { show(): void; hide(): void } };
|
|
|
|
};
|
|
|
|
|
|
|
|
type VueNcSelectTags = ComponentPublicInstance & {
|
|
|
|
availableTags: any[];
|
|
|
|
};
|
|
|
|
|
|
|
|
type VueHTMLComponent = ComponentPublicInstance & {
|
|
|
|
$el: HTMLElement;
|
|
|
|
};
|
2023-10-13 19:22:15 +00:00
|
|
|
}
|
|
|
|
|
2023-10-16 18:15:02 +00:00
|
|
|
// types present on all components (bootstrap.ts, router.ts)
|
2023-10-13 19:22:15 +00:00
|
|
|
declare module 'vue' {
|
2023-10-16 18:08:23 +00:00
|
|
|
interface ComponentCustomProperties extends GlobalRouteCheckers {
|
2023-10-13 19:22:15 +00:00
|
|
|
t: typeof translate;
|
|
|
|
n: typeof translatePlural;
|
|
|
|
|
2023-10-16 18:23:01 +00:00
|
|
|
c: typeof constants;
|
|
|
|
initstate: typeof initstate;
|
2023-10-13 19:22:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export {};
|