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

Nextcloud.d.ts « js - github.com/nextcloud/files_markdown.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 36128f5a463c49025fa845f23125a601bf128266 (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
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;
        }
    }
}

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 filepicker(title: string, callback: (result: string | string[]) => void, multiselect?: boolean, mimetypeFilter?: string, modal?: boolean): void;
    }

    namespace Plugins {
        function register(scope: string, plugin: BasePlugin);
        function register(scope: 'OCA.Files.SidebarPreviewManager', plugin: SidebarPreviewPlugin);
    }

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

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

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

    function linkToRemote(service: string): string;

    function linkToRemoteBase(service: string): string;

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

    function addStyle(app: string, stylesheet: string): void;

    function addScript(app: string, script: string, callback?: Function): JQueryPromise<void>

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

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

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