Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Nextcloud.d.ts « js - github.com/icewind1991/files_markdown.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 009fc17a1b6904bb762bcbf796583c96f0fe625c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import Thenable = JQuery.Thenable;

interface EscapeOptions {
    escape?: boolean;
}

interface BasePlugin {
    attach: Function;
}

type SidebarPreviewRender = (model, $thumbnailDiv: JQuery, $thumbnailContainer: JQuery, fallback: () => void) => void;

interface SidebarPreviewPlugin extends BasePlugin {
    attach: (manager: {
        addPreviewHandler: (mimetype: string, renderer: SidebarPreviewRender) => void;
    }) => void;
}

declare namespace OCA {
    namespace Files_Texteditor {
        interface TextEditorPreviewPlugin {
            init: () => (void | Thenable<void> | Promise<void>);
            preview: (text: string, $preview: JQuery) => void;
        }

        function registerPreviewPlugin(mimetype: string, plugin: TextEditorPreviewPlugin);

        const file: {
            dir: string,
            edited: boolean,
            mime: string,
            mtime: number,
            name: string,
            size: number | null,
            writeable: boolean
        };
    }

    namespace Files {
        interface FileList {
            _currentDirectory: string
        }

        namespace App {
            const fileList: FileList;
        }
    }
}

interface EscapeOptions {
	escape?: boolean;
}

declare namespace OC {
	namespace Util {
		function humanFileSize(size: number): string;

		function computerFileSize(size: string): number;
	}

	namespace dialogs {
		function info(text: string, title: string, callback: () => void, modal?: boolean): void;

		function confirm(text: string, title: string, callback: (result: boolean) => void, modal?: boolean): void;

		function confirmHtml(text: string, title: string, callback: (result: boolean) => void, modal?: boolean): void;

		function prompt(text: string, title: string, callback: (ok: boolean, result: string) => void, modal?: boolean, name?: string, password?: boolean): void;

		function filepicket(title: string, callback: (result: string | string[]) => void, multiselect?: boolean, mimetypeFilter?: string, modal?: boolean): void;
	}

	interface Plugin<T> {
		name?: string;
		attach: (instance: T, options: any) => void;
		detach?: (instance: T, options: any) => void;
	}

	namespace Plugins {
		function register<T>(scope: string, plugin: OC.Plugin<T>): void;
	}

	namespace Search {
		interface Core {
			setFilter: (app: string, callback: (query: string) => void) => void;
		}
	}

	function generateUrl(url: string, parameters?: { [key: string]: string }, options?: EscapeOptions)

	function linkToOCS(service: string, version: number): string;

	function linkToRemote(path: string): string;

	function linkToRemoteBase(path: string): string;

	function imagePath(app: string, file: string): string;

	function filePath(app: string, type: string, file: string): string;

	const PERMISSION_CREATE = 4;
	const PERMISSION_READ = 1;
	const PERMISSION_UPDATE = 2;
	const PERMISSION_DELETE = 8;
	const PERMISSION_SHARE = 16;
	const PERMISSION_ALL = 31;

	export const requestToken: string;
}

declare function t(app: string, string: string, vars?: { [key: string]: string }, count?: number, options?: EscapeOptions): string;

declare const oc_config: {
	blacklist_files_regex: string;
	enable_avatars: boolean;
	last_password_link: string | null;
	modRewriteWorking: boolean;
	session_keepalive: boolean;
	session_lifetime: boolean;
	"sharing.maxAutocompleteResults": number;
	"sharing.minSearchStringLength": number;
	version: string;
	versionString: string;
};

declare module 'NC' {
	export interface OCSResult<T> {
		ocs: {
			data: T;
			meta: {
				status: 'ok' | 'failure';
				message: string;
				statuscode: number;
				totalitems: number;
				itemsperpage: number;
			}
		}
	}
}