@nextcloud/files 3.3.0 → 3.4.0

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.
@@ -0,0 +1,34 @@
1
+ import { Node } from '../files/node';
2
+
3
+ export declare enum FilesSortingMode {
4
+ Name = "basename",
5
+ Modified = "mtime",
6
+ Size = "size"
7
+ }
8
+ export interface FilesSortingOptions {
9
+ /**
10
+ * They key to order the files by
11
+ * @default FilesSortingMode.Name
12
+ */
13
+ sortingMode?: FilesSortingMode;
14
+ /**
15
+ * @default 'asc'
16
+ */
17
+ sortingOrder?: 'asc' | 'desc';
18
+ /**
19
+ * If set to true nodes marked as favorites are ordered on top of all other nodes
20
+ * @default false
21
+ */
22
+ sortFavoritesFirst?: boolean;
23
+ /**
24
+ * If set to true folders are ordered on top of files
25
+ * @default false
26
+ */
27
+ sortFoldersFirst?: boolean;
28
+ }
29
+ /**
30
+ * Sort files and folders according to the sorting options
31
+ * @param nodes Nodes to sort
32
+ * @param options Sorting options
33
+ */
34
+ export declare function sortNodes(nodes: Node[], options?: FilesSortingOptions): Node[];
@@ -0,0 +1,12 @@
1
+ type IdentifierFn<T> = (v: T) => unknown;
2
+ type SortingOrder = 'asc' | 'desc';
3
+ /**
4
+ * Natural order a collection
5
+ * You can define identifiers as callback functions, that get the element and return the value to sort.
6
+ *
7
+ * @param collection The collection to order
8
+ * @param identifiers An array of identifiers to use, by default the identity of the element is used
9
+ * @param orders Array of orders, by default all identifiers are sorted ascening
10
+ */
11
+ export declare function orderBy<T>(collection: readonly T[], identifiers?: IdentifierFn<T>[], orders?: SortingOrder[]): T[];
12
+ export {};
@@ -1,7 +1,7 @@
1
1
  Included dependencies:
2
2
 
3
3
  fast-xml-parser
4
- version: 4.3.6
4
+ version: 4.4.0
5
5
  license: MIT
6
6
 
7
7
  is-svg
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextcloud/files",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "description": "Nextcloud files utils",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -51,13 +51,13 @@
51
51
  },
52
52
  "homepage": "https://github.com/nextcloud-libraries/nextcloud-files",
53
53
  "devDependencies": {
54
- "@codecov/vite-plugin": "^0.0.1-beta.6",
54
+ "@codecov/vite-plugin": "^0.0.1-beta.8",
55
55
  "@nextcloud/eslint-config": "^8.4.1",
56
56
  "@nextcloud/typings": "^1.8.0",
57
57
  "@nextcloud/vite-config": "^2.0.0",
58
58
  "@types/node": "^20.12.12",
59
59
  "@vitest/coverage-istanbul": "^1.6.0",
60
- "fast-xml-parser": "^4.3.6",
60
+ "fast-xml-parser": "^4.4.0",
61
61
  "jsdom": "^24.0.0",
62
62
  "tslib": "^2.6.2",
63
63
  "typedoc": "^0.25.13",
File without changes