/** * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later */ /** * Format a file size in a human-like format. e.g. 42GB * * The default for Nextcloud is like Windows using binary sizes but showing decimal units, * meaning 1024 bytes will show as 1KB instead of 1KiB or like on Apple 1.02 KB * * @param size in bytes * @param skipSmallSizes avoid rendering tiny sizes and return '< 1 KB' instead * @param binaryPrefixes True if size binary prefixes like `KiB` should be used as per IEC 80000-13 * @param base1000 Set to true to use base 1000 as per SI or used by Apple (default is base 1024 like Linux or Windows) */ export declare function formatFileSize(size: number | string, skipSmallSizes?: boolean, binaryPrefixes?: boolean, base1000?: boolean): string; /** * Returns a file size in bytes from a humanly readable string * Note: `b` and `B` are both parsed as bytes and not as bit or byte. * * @param value file size in human-readable format * @param forceBinary for backwards compatibility this allows values to be base 2 (so 2KB means 2048 bytes instead of 2000 bytes) * @return or null if string could not be parsed */ export declare function parseFileSize(value: string, forceBinary?: boolean): number | null;