@nextcloud/files 3.0.0-beta.26 → 3.0.0-beta.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -52,6 +52,11 @@ interface FileActionData {
52
52
  execBatch?: (files: Node[], view: View, dir: string) => Promise<(boolean | null)[]>;
53
53
  /** This action order in the list */
54
54
  order?: number;
55
+ /**
56
+ * This action's parent id in the list.
57
+ * If none found, will be displayed as a top-level action.
58
+ */
59
+ parent?: string;
55
60
  /**
56
61
  * Make this action the default.
57
62
  * If multiple actions are default, the first one
@@ -83,6 +88,7 @@ export declare class FileAction {
83
88
  get exec(): (file: Node, view: View, dir: string) => Promise<boolean | null>;
84
89
  get execBatch(): ((files: Node[], view: View, dir: string) => Promise<(boolean | null)[]>) | undefined;
85
90
  get order(): number | undefined;
91
+ get parent(): string | undefined;
86
92
  get default(): DefaultType | undefined;
87
93
  get inline(): ((file: Node, view: View) => boolean) | undefined;
88
94
  get renderInline(): ((file: Node, view: View) => Promise<HTMLElement | null>) | undefined;
@@ -23,11 +23,15 @@
23
23
  /**
24
24
  * Format a file size in a human-like format. e.g. 42GB
25
25
  *
26
+ * The default for Nextcloud is like Windows using binary sizes but showing decimal units,
27
+ * meaning 1024 bytes will show as 1KB instead of 1KiB or like on Apple 1.02 KB
28
+ *
26
29
  * @param size in bytes
27
30
  * @param skipSmallSizes avoid rendering tiny sizes and return '< 1 KB' instead
28
- * @param binaryPrefixes True if size base 2 (and binary prefixes like `KiB`) should be used
31
+ * @param binaryPrefixes True if size binary prefixes like `KiB` should be used as per IEC 80000-13
32
+ * @param base1000 Set to true to use base 1000 as per SI or used by Apple (default is base 1024 like Linux or Windows)
29
33
  */
30
- export declare function formatFileSize(size: number | string, skipSmallSizes?: boolean, binaryPrefixes?: boolean): string;
34
+ export declare function formatFileSize(size: number | string, skipSmallSizes?: boolean, binaryPrefixes?: boolean, base1000?: boolean): string;
31
35
  /**
32
36
  * Returns a file size in bytes from a humanly readable string
33
37
  * Note: `b` and `B` are both parsed as bytes and not as bit or byte.