import { FileKindType, FileProviderType, FileType, PreviewFormatType, ProviderType } from '../types/files.types'; import { iconNamesType } from './icons'; import { AppType } from '../types/app.types'; import { ComponentFeaturePolicy } from '../types/features.types'; export declare const fileSizeAsString: (size: number, significantDigits?: number) => string; export declare function getExtension(name: string): string; export declare function isAudio(ext: string): boolean; export declare function isImage(ext: string): boolean; export declare function isWebImage(path: string): boolean; export declare function isBitmap(path: string): boolean; export declare function isMetaFile(path: string): boolean; export declare function isVideo(ext: string): boolean; export declare function isMarkdown(ext: string): boolean; export declare function isMarkup(ext: string): boolean; export declare function isCode(ext: string): boolean; export declare function isText(ext: string): boolean; export declare function isOfficeDocument(path: string): boolean; export declare function getIcon(name: string): { icon: iconNamesType; color?: string; }; /** * Returns preview formats that can be rendered directly in the browser * * @param {string} name - Name of the file * @returns PreviewFormatType */ export declare function getWebPreviewFormat(name: string): PreviewFormatType; /** * Whether a file can be opened in the built-in editor and saved back. * * Editability is a pure client decision: the editor (`wy-file-view-text`) is only rendered for the `text`, `code` and * `html` preview formats, and saving uploads a new blob and replaces the file version. The server computes * `preview_format` from the blob, so it already excludes external provider files (Google Drive, OneDrive etc.), which * have no `download_url` to load content from. Keying on `preview_format` instead of `kind` keeps the menu, the preview * and file creation in agreement with what the file view actually renders. * * @param file - The file to check. Temporary files (id < 1) that are still uploading are never editable. * @param app - The app the file belongs to. Needs write access and create or admin permission. * @param features - Feature policy of the component. The `FileEdit` feature must be allowed. * @returns `true` when the file can be opened in edit mode. */ export declare function isFileEditable(file: FileType | undefined, app: AppType | undefined, features: ComponentFeaturePolicy | undefined): boolean; export declare function getProvider(provider: FileProviderType | undefined): ProviderType | ""; export declare function getKind(name: string): FileKindType; export declare function handleSelectFilename(e: Event): void; export declare function getHash(blob?: Blob, algorithm?: AlgorithmIdentifier): Promise; //# sourceMappingURL=files.d.ts.map