globular-element
Version:
Collection of webcomponent to work with globular
45 lines (44 loc) • 2.23 kB
TypeScript
import { Globular } from "globular-web-client";
import { FileInfo } from "globular-web-client/file/file_pb";
/**
* Format file size from bytes to Gb, Mb or Kb...
* @param {*} f_size
* @returns
*/
export declare function getFileSizeString(f_size: any): string;
export declare function getFileSize(url_: string, callback: (size: number) => void, errorcallback: (err: string) => void): void;
export declare function copyToClipboard(text: string): void;
export declare class FileController {
private static _dirs_;
private static _local_files;
private static _public_dirs_;
private static _shared_dirs_;
static get dirs(): any;
static removeDir(path: string, globule?: Globular): void;
static addDir(dir: FileInfo): void;
static get publicDirs(): any;
static get sharedDirs(): any;
static clearSharedDirs(): void;
static hasLocal(path: string, callback: (exist: boolean, f?: FileInfo) => void): void;
/**
* Retrun the file from a given path.
* @param globule
* @param path
* @param callback
* @param errorCallback
*/
static getFile(globule: Globular, path: string, thumbnailWith: number, thumbnailHeight: number, callback: (f: FileInfo) => void, errorCallback: (err: string) => void): void;
static initLnks(dir: FileInfo, callback: (dir: FileInfo) => void, errorCallback: (err: any) => void): void;
static markAsShare(dir: FileInfo): void;
static markAsPublic(dir: FileInfo): void;
static readDir(path: string, callback: (dir: FileInfo) => void, errorCallback: (err: any) => void, globule?: Globular, force?: boolean, recursive?: boolean): void;
/**
* Static function's
*/
private static _readDir;
static validateDirAccess(dir: FileInfo): boolean;
static fetchText(path: string, globule?: Globular): Promise<unknown>;
static readText(file: FileInfo, callback: (text: Uint8Array | string) => void, errorCallback: (err: any) => void, globule?: Globular, token?: string): void;
static getHiddenFiles(path: string, callback: (files: any) => void, globule?: Globular): void;
static getImage(callback: ([]: any[]) => void, images: any, files: FileInfo[], index: number, globule?: Globular): void;
}